diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 390df0c3ed..0634fd4732 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -3,15 +3,30 @@ /types/abs/ @AyaMorisawa /types/absolute/ @AyaMorisawa /types/acc-wizard/ @cyrilschumacher +/types/accept-language-parser/ @kampfgnom /types/accepts/ @bomret /types/accounting/ @gerich-home @chrisleck /types/ace/ @Diullei /types/acl/ @tkQubo /types/acorn/ @RReverser @e-cloud /types/actioncable/ @zhu1230 +/types/activex-access/ @zspitz /types/activex-adodb/ @zspitz +/types/activex-dao/ @zspitz +/types/activex-excel/ @zspitz +/types/activex-infopath/ @zspitz +/types/activex-libreoffice/ @zspitz +/types/activex-msforms/ @zspitz +/types/activex-mshtml/ @zspitz +/types/activex-msxml2/ @zspitz +/types/activex-office/ @zspitz +/types/activex-outlook/ @zspitz +/types/activex-powerpoint/ @zspitz /types/activex-scripting/ @zspitz +/types/activex-stdole/ @zspitz +/types/activex-vbide/ @zspitz /types/activex-wia/ @zspitz +/types/activex-word/ @zspitz /types/adal/ @mmaitre314 /types/adm-zip/ @jvilk @abner /types/adone/ @s0m3on3 @maxveres @@ -22,14 +37,14 @@ /types/alexa-sdk/ @petebeegle @hoo29 @pascalwhoop @blforce /types/alexa-voice-service/ @dolanmiu /types/algebra.js/ @CaselIT -/types/algoliasearch/ @cbaptiste +/types/algoliasearch/ @cbaptiste @haroenv @aherve /types/alt/ @Shearerbeard -/types/amazon-product-api/ @MattiLehtinen +/types/amazon-product-api/ @MattiLehtinen @alien35 /types/amcharts/ @aleksey-bykov /types/amplify/ @joeriks /types/amplify-deferred/ @joeriks @laurentiustamate94 /types/amplitude-js/ @Asido -/types/amqp/ @seikho +/types/amqp/ @seikho @jonnysparkplugs /types/amqp-rpc/ @wokim /types/amqplib/ @mnahkies @abreits @nfantone /types/analytics-node/ @fongandrew @@ -50,6 +65,7 @@ /types/angular-es/ @mbutsykin /types/angular-feature-flags/ @borislavjivkov /types/angular-file-saver/ @deenairn +/types/angular-file-upload/ @cyrilgandon /types/angular-formly/ @scatcher /types/angular-fullscreen/ @julienpa /types/angular-gettext/ @AkosLukacs @@ -62,7 +78,7 @@ /types/angular-idle/ @mthamil /types/angular-jwt/ @rerezz /types/angular-load/ @david-gang -/types/angular-loading-bar/ @stephenlautier +/types/angular-loading-bar/ @stephenlautier @tyronedougherty /types/angular-local-storage/ @kenfdev @dona278 /types/angular-localforage/ @reppners /types/angular-locker/ @nkovacic @@ -84,14 +100,14 @@ /types/angular-signalr-hub/ @AdamSantaniello /types/angular-spinner/ @Biegal /types/angular-storage/ @mdekrey -/types/angular-strap/ @samherrmann +/types/angular-strap/ @samherrmann @mkannwischer /types/angular-toastr/ @nkovacic @trodi /types/angular-toasty/ @muenchdo /types/angular-tooltips/ @leonard-thieu /types/angular-touchspin/ @nkovacic /types/angular-translate/ @michelsalib /types/angular-ui-bootstrap/ @xt0rted @ry8806 -/types/angular-ui-router/ @michelsalib @matiishyn +/types/angular-ui-router/ @michelsalib @matiishyn @mikehaas763 /types/angular-ui-scroll/ @marknadig /types/angular-ui-sortable/ @thgreasi /types/angular-ui-tree/ @CalvinFernandez @@ -116,6 +132,7 @@ /types/aphrodite/ @asvetliakov /types/api-error-handler/ @tkrotoff /types/apigee-access/ @CasperSkydt +/types/apollo-codegen/ @bradleyayers /types/app-root-path/ @shantmarouti /types/appframework/ @kyo-ago /types/appletvjs/ @brainded @@ -129,7 +146,7 @@ /types/archiver/ @dolanmiu @crevil /types/archy/ @vvakame /types/are-we-there-yet/ @brianloveswords -/types/argparse/ @arcticwaters +/types/argparse/ @arcticwaters @tlaziuk /types/argv/ @hookclaw /types/array-find-index/ @samverschueren /types/array-foreach/ @skysteve @@ -148,13 +165,18 @@ /types/assertsharp/ @brunolm /types/assets-webpack-plugin/ @kryops /types/async/ @borisyankov @kern0 @Penryn @fenying @pascalmartin +/types/async-cache/ @BendingBender /types/async-lock/ @elisee /types/async-polling/ @Goldsmith42 /types/async.nexttick/ @pyrho /types/asyncblock/ @horiuchi -/types/atmosphere/ @toedter -/types/atom/ @vvakame -/types/atom-keymap/ @enlight +/types/atmosphere/ @toedter @Mory1879 +/types/atmosphere.js/ @toedter @Mory1879 +/types/atom/v0/ @vvakame @smhxx +/types/atom/ @GlenCFL +/types/atom-keymap/v5/ @enlight +/types/atom-keymap/ @GlenCFL +/types/atom-mocha-test-runner/ @GlenCFL /types/atpl/ @soywiz /types/audiosprite/ @Perlmint /types/aurelia-knockout/ @code-chris @@ -172,11 +194,12 @@ /types/autoprefixer/ @odnamrataizem /types/autosize/ @kingdango @keika299 @NeekSandhu /types/awesomplete/ @webbiesdk @bmdixon @tbekolay -/types/aws-iot-device-sdk/ @niik -/types/aws-lambda/ @skarum @tobyhede @buggy @y13i @wwwy3y3 +/types/aws-iot-device-sdk/ @niik @mlamp +/types/aws-lambda/ @skarum @tobyhede @buggy @y13i @wwwy3y3 @OrthoDex /types/aws-serverless-express/ @threesquared @jcaffey @mattmeye /types/aws4/ @ajcrites /types/axel/ @ruslan-molodyko +/types/axios-mock-adapter/ @tkryskiewicz /types/azure/ @AndrewGaspar @antiveeranna @SomaticIT /types/azure-mobile-services-client/ @dmorosinotto /types/azure-sb/ @Azure @@ -184,12 +207,14 @@ /types/babel-code-frame/ @mohsen1 /types/babel-core/ @yortus @marvinhagemeister /types/babel-generator/ @yortus @johnnyestilles +/types/babel-plugin-react-pug/ @jpap /types/babel-plugin-syntax-jsx/ @marvinhagemeister /types/babel-template/ @yortus @marvinhagemeister /types/babel-traverse/ @yortus @marvinhagemeister /types/babel-types/ @yortus @baxtersa @marvinhagemeister /types/babelify/ @TeamworkGuy2 @marvinhagemeister /types/babylon/ @yortus @marvinhagemeister +/types/babylon-walk/ @czbuchi /types/babyparse/ @cdiddy77 /types/backbone/ @borisyankov @nvivo /types/backbone-associations/ @craigbrett17 @@ -202,6 +227,7 @@ /types/backbone.radio/ @alphaleonis /types/backgrid/ @jlujan /types/backlog-js/ @vvatanabe +/types/backoff/ @BendingBender /types/baconjs/ @alexander-matsievsky @gekkio /types/bagpipes/ @micmro /types/barcode/ @pvomhoff @@ -218,11 +244,11 @@ /types/bcryptjs/ @RafaelKr /types/bem-cn/ @selkinvitaly /types/better-curry/ @pocesar -/types/better-sqlite3/ @Morfent +/types/better-sqlite3/ @Morfent @matrumz /types/bezier-easing/ @ptlis /types/bezier-js/ @danmarshall /types/bgiframe/ @sumegizoltan -/types/big.js/ @nycdotnet +/types/big.js/ @nycdotnet @googol /types/bigi/ @mhegazy /types/bigint/ @Evgenus /types/bignum/ @Patman64 @@ -242,6 +268,7 @@ /types/blessed/ @brynbellomy /types/blissfuljs/ @fskorzec /types/blob-stream/ @erichillah +/types/blob-to-buffer/ @nrlquaker /types/blob-util/ @WorldMaker /types/blocks/ @ksmigiel /types/bloomfilter/ @slawiko @@ -272,15 +299,17 @@ /types/bootstrap-treeview/ @jbtronics /types/bootstrap-validator/ @BradyLiles /types/bootstrap.paginator/ @derikwhittaker -/types/bootstrap.timepicker/ @derikwhittaker +/types/bootstrap.timepicker/ @derikwhittaker @heatherbooker /types/bootstrap.v3.datetimepicker/v3/ @bayitajesi /types/bootstrap.v3.datetimepicker/ @katonap +/types/botvs/ @acrazing /types/bounce.js/ @cherrry /types/bowser/ @pocesar /types/box2d/ @jbaldwin /types/brace-expansion/ @BendingBender /types/braintree-web/ @chlela /types/breeze/ @borisyankov +/types/bricks.js/ @kondi /types/brorand/ @chrootsu /types/browser-bunyan/ @PaulLockwood @kryops /types/browser-fingerprint/ @LKay @@ -302,6 +331,7 @@ /types/bunnymq/ @cyrilschumacher /types/bunyan/ @amikhalev /types/bunyan-blackhole/ @olivr70 +/types/bunyan-bugsnag/ @pasieronen /types/bunyan-config/ @cyrilschumacher /types/bunyan-prettystream/ @jasonswearingen @enlight /types/bunyan-winston-adapter/ @stevehipwell @@ -325,6 +355,7 @@ /types/canvas-gauges/ @Mikhus /types/canvasjs/ @brutalimp /types/capitalize/ @frederickfogerty +/types/card-validator/ @ChanceM /types/cash/ @akvlko /types/casperjs/ @jedmao /types/cassandra-driver/ @Svjard @@ -334,12 +365,13 @@ /types/chai/v2/ @Bartvds @AGBrown /types/chai/ @jedmao @Bartvds @AGBrown @olivr70 @mwistrand @joshuakgoldberg @shaunluttin /types/chai-arrays/ @clementprevot -/types/chai-as-promised/ @jt000 @Kuniwak @leonard-thieu +/types/chai-as-promised/ @jt000 @Kuniwak @leonard-thieu @lazerwalker @mattbishop /types/chai-datetime/ @cliffburger /types/chai-dom/ @mattlewis92 /types/chai-enzyme/ @asvetliakov /types/chai-fuzzy/ @Bartvds /types/chai-http/ @Nemo157 @G1itcher @CaselIT +/types/chai-jest-snapshot/ @mattvperry /types/chai-jquery/ @kazimanzurrashid /types/chai-json-schema/ @ulrichheiniger /types/chai-oequal/ @mizunashi-mana @@ -351,16 +383,18 @@ /types/chance/ @cbowdon /types/change-emitter/ @iskandersierra /types/charm/ @Xananax -/types/chart.js/ @anuti @FabienLavocat @KentarouTakeda @larrybahr -/types/chartist/ @mtgibbs @psimonski +/types/chart.js/ @anuti @FabienLavocat @KentarouTakeda @larrybahr @mernen @josefpaij +/types/chartist/ @mtgibbs @psimonski @clottman /types/chartjs/ @Steve-Fenton @FanaHOVA /types/chayns/ @HenningKuehl /types/check-sum/ @BendingBender /types/checkstyle-formatter/ @mhegazy /types/checksum/ @rogierschouten /types/cheerio/ @blittle @wmaurer @umarniz -/types/chokidar/ @reppners @felixfbecker +/types/chmodr/ @BendingBender +/types/chokidar/ @reppners @felixfbecker @bayssmekanique /types/chosen-js/ @borisyankov @denisname +/types/chownr/ @BendingBender /types/chroma-js/v0/ @invliD /types/chroma-js/ @invliD @mpacholec /types/chrome/ @matthewkimber @otiai10 @couven92 @rreverser @sreimer15 @@ -373,6 +407,7 @@ /types/clean-css/ @tkrotoff /types/clean-stack/ @BendingBender /types/clear-require/ @dan-j +/types/cleave.js/ @clentfort /types/cli/ @kayahr /types/cli-color/ @ChaosinaCan /types/cli-table2/ @mgroenhoff @@ -382,9 +417,11 @@ /types/clipboard-js/ @markwongsk /types/clipboardy/ @BendingBender /types/clndr/ @jasperjn +/types/clockpicker/ @jfcere /types/closure-compiler/ @mprobst /types/cloud-env/ @Morfent /types/cloudflare-apps/ @MartynasZilinskas +/types/cls-hooked/ @aleung /types/co-body/ @geoffreak /types/co-views/ @devlee @geoffreak /types/code/ @prashaantt @@ -411,7 +448,7 @@ /types/commander/ @alan-agius4 @mdezem @vvakame /types/commangular/ @hiraash /types/comment-json/ @Jason3S -/types/common-tags/ @zuzusik +/types/common-tags/ @zuzusik @tzupengwang /types/commonmark/ @nicojs @leonard-thieu /types/compare-version/ @jpevarnek /types/complex/ @AyaMorisawa @@ -425,7 +462,7 @@ /types/conf/v0/ @SamVerschueren /types/conf/ @SamVerschueren @BendingBender /types/confidence/ @jppellerin -/types/config/ @RWander +/types/config/ @RWander @forrestbice @jndonald3 /types/configstore/ @ArcticLight /types/confit/ @ethanresnick /types/connect/ @SomaticIT @@ -435,6 +472,7 @@ /types/connect-livereload/ @SomaticIT /types/connect-modrewrite/ @tinganho /types/connect-mongo/ @Syati +/types/connect-pg-simple/ @pasieronen /types/connect-redis/ @xstoudi @morcerf /types/connect-slashes/ @samherrmann /types/connect-timeout/ @cyrilschumacher @@ -447,6 +485,7 @@ /types/contextjs/ @kernhanda /types/continuation-local-storage/ @rath @heycalmdown @aboveyou00 /types/convert-hrtime/ @BendingBender +/types/convert-layout/ @xeningem /types/convert-source-map/ @AndrewGaspar @mgroenhoff @TeamworkGuy2 /types/convict/ @Nemo157 @vesse @elyscape /types/cookie/ @pine613 @@ -463,7 +502,9 @@ /types/cordova-plugin-background-mode/ @Lordnoname /types/cordova-plugin-badge/ @timbru31 /types/cordova-plugin-ble-central/ @gjunge +/types/cordova-plugin-canvascamera/ @lordazzi /types/cordova-plugin-device-name/ @larrybahr +/types/cordova-plugin-file-opener2/ @cyrilgandon /types/cordova-plugin-ibeacon/ @Ritzlgrmft /types/cordova-plugin-insomnia/ @Ritzlgrmft /types/cordova-plugin-keyboard/ @danmana @@ -485,6 +526,8 @@ /types/cote/ @makepost /types/couchbase/ @maouida /types/countdown/ @gjuchault +/types/counterpart/ @santiagodoldan +/types/countries-and-timezones/ @zero51 /types/country-list/ @iRoachie /types/country-select-js/ @humrochagf /types/cp-file/ @BendingBender @@ -492,13 +535,14 @@ /types/cradle/ @panuhorsmalahti /types/crc/ @YuJianrong /types/create-error/ @tkrotoff +/types/create-react-class/ @jgoz /types/createjs/ @evilangelist @gyohk /types/createjs-lib/ @evilangelist @gyohk /types/credential/ @phuvo /types/credit-card-type/ @LKay /types/cron/ @horiuchi /types/cropperjs/ @stepancar -/types/croppie/ @connor4312 +/types/croppie/ @connor4312 @dklmuc /types/crossfilter/ @schmuli @iebaker /types/crossroads/ @diullei /types/cryptiles/ @awendland @@ -514,16 +558,18 @@ /types/csurf/ @horiuchi /types/csv-parse/ @davidm77 @obi-jan-kenobi /types/csv-stringify/ @rogierschouten @arjenvanderende +/types/csvrow/ @codeanimal /types/csvtojson/ @EricByers @wcarson /types/cucumber/v1/ @abraaoalves @jan-molak @isoung @BendingBender /types/cucumber/ @abraaoalves @jan-molak @isoung @BendingBender -/types/currency-formatter/ @mhegazy +/types/currency-formatter/ @mhegazy @davidmpaz /types/custom-error-generator/ @thmiceli /types/cwise/ @taoqf /types/cwise-compiler/ @taoqf /types/cwise-parser/ @taoqf /types/cybozulabs-md5/ @pine613 -/types/cypress/ @ghengeveld @mikewoudenberg +/types/cypress/ @ghengeveld @mikewoudenberg @rvanmarkus +/types/cytoscape/ @phreed @wy193777 /types/d3/v3/ @gustavderdrache @borisyankov /types/d3/ @tomwanzek @gustavderdrache @borisyankov /types/d3-array/ @gustavderdrache @borisyankov @tomwanzek @@ -553,7 +599,7 @@ /types/d3-request/ @Ledragon @gustavderdrache @borisyankov @tomwanzek /types/d3-sankey/ @tomwanzek @gustavderdrache /types/d3-scale/ @tomwanzek @gustavderdrache @borisyankov -/types/d3-scale-chromatic/ @Ledragon @gustavderdrache @borisyankov +/types/d3-scale-chromatic/ @Ledragon @gustavderdrache @borisyankov @henriquefm /types/d3-selection/ @tomwanzek @gustavderdrache @borisyankov /types/d3-selection-multi/ @gustavderdrache @borisyankov /types/d3-shape/ @tomwanzek @gustavderdrache @borisyankov @@ -568,8 +614,9 @@ /types/d3.slider/ @lk-chen /types/d3kit/ @morphatic /types/d3pie/ @mc-petry -/types/dagre/ @qinfchen +/types/dagre/ @qinfchen @Frankrike @vilterp /types/dagre-d3/ @markwongsk +/types/dagre-layout/ @qinfchen @Frankrike @vilterp /types/dargs/ @BendingBender /types/dat-gui/ @gyohk @sonic3d @rroylance /types/data-driven/ @mrhen @@ -579,6 +626,7 @@ /types/datatables.net-fixedheader/ @szechyjs /types/datatables.net-rowreorder/ @baywet /types/datatables.net-select/ @szechyjs +/types/date-arithmetic/ @HeeL /types/date.format.js/ @balrob /types/dateformat/ @aicest /types/datejs/ @rupertavery @@ -594,6 +642,7 @@ /types/decamelize/ @samverschueren /types/decay/ @enaeseth /types/decimal.js/ @musicist288 +/types/decompress/ @plantain-00 /types/decorum/ @dflor003 /types/dedent/ @douglasduteil /types/deep-assign/ @souldreamer @@ -601,8 +650,9 @@ /types/deep-equal/ @remojansen @janslow /types/deep-extend/ @rhysd /types/deep-freeze/ @Bartvds @aluanhaddad +/types/deep-freeze-es6/ @mattbishop /types/deep-freeze-strict/ @mhegazy -/types/deepmerge/ @marvinscharle +/types/deepmerge/ @marvinscharle @syy1125 /types/defaults/ @IbtihelCHNAB /types/define-lazy-prop/ @BendingBender /types/defined/ @BendingBender @@ -613,7 +663,7 @@ /types/delay/ @BendingBender /types/denodeify/ @joaomoreno /types/deoxxa-content-type/ @pine613 -/types/depd/ @danny8002 +/types/depd/ @danny8002 @BendingBender /types/deployjava/ @cyrilschumacher /types/destroy/ @BendingBender /types/destroy-on-hwm/ @BendingBender @@ -638,11 +688,12 @@ /types/discontinuous-range/ @OiCMudkips /types/disposable-email-domains/ @geoffreak /types/doccookies/ @jonegerton -/types/dockerode/ @seikho @nlaplante @isac322 +/types/dockerode/ @seikho @nlaplante @isac322 @lazarusx @meisenzahl /types/docopt/ @giggio /types/doctrine/ @rictic /types/documentdb/ @NoelAbrahams @brettferdosi @ctstone @yifanwu /types/documentdb-server/ @lith-light-g +/types/documentdb-session/ @DanielRosenwasser /types/dojo/ @vansimke /types/dom-inputevent/ @diagramatics /types/dom4/ @adidahiya @giladgray @@ -656,14 +707,15 @@ /types/dot-prop/v2/ @samverschueren /types/dot-prop/ @samverschueren @BendingBender /types/dotdotdot/ @milanjaros -/types/dotenv/v2/ @borekb @enaeseth +/types/dotenv/v2/ @jussikinnula @borekb @enaeseth /types/dotenv/ @jussikinnula @borekb @enaeseth /types/dotenv-safe/ @krenor /types/dottie/ @domarmstrong /types/doublearray/ @mzsm /types/doubleclick-gpt/ @johngeorgewright /types/downloadjs/ @cwmoo740 -/types/draft-js/ @dmitryrogozhny @eelco @ghotiphud @schwers @michael-yx-wu @willisplummer +/types/draft-js/ @dmitryrogozhny @eelco @ghotiphud @schwers @michael-yx-wu @willisplummer @smvilar +/types/drag-timetable/ @chinkan /types/draggabilly/ @jaydubu /types/dragster/ @zskovacs /types/dragula/ @pwelter34 @abruzzihraig @@ -671,12 +723,17 @@ /types/dropkickjs/ @VorobeY1326 /types/dropzone/v4/ @nvivo @outring @renuo @Hikariii /types/dropzone/ @nvivo @outring @renuo @Hikariii @tedbcsgpro +/types/dts-generator/ @mtraynham /types/duplexer2/ @Goldsmith42 /types/duplexer3/ @BendingBender +/types/duplexify/ @strax +/types/duplicate-package-checker-webpack-plugin/ @mtraynham /types/durandal/ @BlueSpire /types/dustjs-linkedin/ @mdezem /types/dw-bxslider-4/ @namerci -/types/dwt/ @yushulx +/types/dwt/v12/ @yushulx +/types/dwt/ @yushulx @jbh +/types/dygraphs/ @danvk /types/dymo-label-framework/ @thijskuipers /types/dynatable/ @francoismassart /types/each/ @misak113 @@ -696,6 +753,8 @@ /types/egg/ @sheperdwind /types/egg-mock/ @sheperdwind /types/egg.js/ @ToastHawaii +/types/egjs__axes/ @naver +/types/egjs__component/ @naver /types/ej.web.all/ @syncfusion /types/ejs-locals/ @jt000 /types/ejson/ @shantanubhadoria @@ -703,7 +762,8 @@ /types/electron-config/ @mrfunkycold @unindented /types/electron-debug/ @unindented /types/electron-devtools-installer/ @gamesmaxed -/types/electron-json-storage/ @stpettersens +/types/electron-is-dev/ @trodi +/types/electron-json-storage/ @stpettersens @nrlquaker /types/electron-notifications/ @djpereira /types/electron-notify/ @djpereira /types/electron-packager/ @SomaticIT @cortopy @@ -711,6 +771,7 @@ /types/electron-settings/ @icopp /types/electron-store/ @unindented /types/electron-window-state/ @rhysd +/types/electron-winstaller/ @shiftkey /types/element-ready/ @BendingBender /types/element-resize-event/ @rogierschouten @plgregoire /types/elm/ @thSoft @@ -718,11 +779,13 @@ /types/email-templates/ @cyrilschumacher @gurisko /types/email-validator/ @paullessing /types/ember/v1/ @jedmao -/types/ember/ @jedmao @bttf +/types/ember/ @jedmao @bttf @dwickern @chriskrycho @theroncross +/types/ember-testing-helpers/ @chriskrycho /types/emissary/ @vvakame /types/emojione/ @dbrgn /types/empower/ @vvakame /types/emscripten/ @zakki @periklis +/types/end-of-stream/ @strax /types/engine.io/ @KentarouTakeda /types/engine.io-client/ @KentarouTakeda /types/enhanced-resolve/ @e-cloud @onigoetz @@ -731,6 +794,8 @@ /types/env-to-object/ @MugeSo /types/envify/ @tkQubo /types/enzyme/ @MarianPalkus @NoHomey @jwbay @huhuanming @MartynasZilinskas @thovden +/types/enzyme-adapter-react-15/ @tkrotoff +/types/enzyme-adapter-react-16/ @tkrotoff /types/enzyme-to-json/ @joscha /types/eonasdan-bootstrap-datetimepicker/ @ToastHawaii /types/epiceditor/ @borisyankov @@ -748,7 +813,8 @@ /types/escape-string-regexp/ @kruncher /types/escodegen/ @simondel /types/eslint-plugin-prettier/ @ikatyang -/types/esprima/ @teppeis @RReverser +/types/esprima/v2/ @teppeis @RReverser +/types/esprima/ @teppeis @RReverser @peter-scott /types/esprima-walk/ @tswaters /types/esri-leaflet/ @strajuser /types/esri-leaflet-geocoder/ @BendingBender @@ -759,7 +825,8 @@ /types/eureka-js-client/ @Schnillz /types/evaporate/ @kookster @chrisrhoden /types/event-emitter/ @LKay -/types/event-kit/ @enlight +/types/event-kit/v1/ @enlight +/types/event-kit/ @GlenCFL /types/event-loop-lag/ @rogierschouten /types/event-stream/ @flcdrg /types/event-to-promise/ @flying-sheep @@ -777,17 +844,19 @@ /types/express-brute/ @cyrilschumacher /types/express-brute-memcached/ @cyrilschumacher /types/express-brute-mongo/ @cyrilschumacher +/types/express-brute-redis/ @scottharwell /types/express-debug/ @federicobond /types/express-domain-middleware/ @hookclaw /types/express-enforces-ssl/ @kevinstubbs /types/express-fileupload/ @Naktibalda /types/express-flash-2/ @mathsalmi /types/express-formidable/ @tdolsen -/types/express-graphql/ @isman-usoh @nitintutlani +/types/express-graphql/ @isman-usoh @nitintutlani @hubel /types/express-handlebars/ @stpettersens @yhaskell /types/express-jwt/ @wokim @kacepe @Sl1MBoy /types/express-less/ @xieyubo /types/express-minify/ @borislavjivkov +/types/express-mongo-sanitize/ @ericbyers /types/express-mung/ @cyrilschumacher /types/express-myconnection/ @Cellule /types/express-mysql-session/ @Akim95 @@ -822,6 +891,7 @@ /types/farbtastic/ @EnableSoftware /types/fast-diff/ @djrenren /types/fast-levenshtein/ @mizunashi-mana +/types/fast-list/ @BendingBender /types/fast-stats/ @rogierschouten /types/fastclick/ @shinnn /types/favico.js/ @drowse314-dev-ymat @@ -829,6 +899,7 @@ /types/fbemitter/ @kmxz /types/featherlight/ @xStrom /types/fecha/ @9y5 +/types/feedme/ @codeanimal /types/fetch-jsonp/ @tkrotoff /types/fetch-mock/ @asvetliakov @tamird @merrywhether @chrissinclair /types/fetch.io/ @newraina @@ -840,6 +911,7 @@ /types/file-exists/ @BendingBender /types/file-saver/ @cyrilschumacher @DaIgeb /types/file-type/ @tcaesvk @BendingBender +/types/file-url/ @coderslagoon /types/filenamify/ @rokt33r /types/filesize/ @GiedriusGrabauskas /types/fill-pdf/ @westy92 @@ -855,12 +927,12 @@ /types/firebird/ @karak /types/firefox/ @vvakame /types/firmata/ @troywweber7 -/types/first-mate/ @enlight +/types/first-mate/v4/ @enlight +/types/first-mate/ @GlenCFL /types/fixed-data-table/ @pepaar @stephenjelfs /types/flat/ @chrootsu -/types/flatpickr/v2/ @UnwrittenFun -/types/flatpickr/ @UnwrittenFun @rowellx68 @wagich /types/flexslider/ @diullei +/types/flickity/ @clmcgrath @wagich /types/flight/ @jonathanhedren /types/flightplan/ @borislavjivkov /types/flipsnap/ @kubosho @gsino @mayuki @@ -868,7 +940,7 @@ /types/flowjs/ @ryan10132 /types/fluent-ffmpeg/ @tcaesvk @DingWeizhe /types/flux/ @stkb @GiedriusGrabauskas -/types/flux-standard-action/ @tkqubo +/types/flux-standard-action/ @tkqubo @zimme /types/fluxxor/ @mrk21 /types/fm-websync/ @markusmauch /types/fontfaceobserver/ @RandScullard @@ -888,24 +960,26 @@ /types/freedom/ @jpevarnek /types/freeport/ @atd-schubert /types/fresh/ @BendingBender +/types/friendly-errors-webpack-plugin/ @bahlo /types/frisby/ @johnny4753 /types/from/ @Bartvds /types/from2/ @BendingBender /types/fromjs/ @glenndierckx /types/fromnow/ @marinewater /types/fs-ext/ @OguzhanE -/types/fs-extra/ @alan-agius4 @midknight41 @shiftkey +/types/fs-extra/ @alan-agius4 @midknight41 @shiftkey @mees- /types/fs-extra-promise/ @midknight41 @jasonswearingen @HiromiShikata /types/fs-extra-promise-es6/ @midknight41 @jasonswearingen @geoffreak @HiromiShikata /types/fs-finder/ @misak113 /types/fs-mock/ @rogierschouten /types/fs-promise/ @tarruda +/types/fs-readdir-recursive/ @pscanf /types/fsevents/ @BendingBender /types/ftdomdelegate/ @dotnetnerd /types/ftp/ @rogierschouten /types/ftpd/ @rogierschouten /types/fullcalendar/v1/ @nestalk @hasellcamargo -/types/fullcalendar/ @nestalk @hasellcamargo @panic175 +/types/fullcalendar/ @nestalk @hasellcamargo @panic175 @hmil /types/fullname/ @kayahr /types/fuse/ @smrq /types/fusioncharts/ @rohitkr @shivarajkv @@ -920,6 +994,131 @@ /types/gapi.analytics/ @gatsbimantico /types/gapi.auth2/ @flawless2011 /types/gapi.calendar/ @tkrotoff +/types/gapi.client/ @Bolisov +/types/gapi.client.acceleratedmobilepageurl/ @Bolisov +/types/gapi.client.adexchangebuyer/ @Bolisov +/types/gapi.client.adexchangebuyer2/ @Bolisov +/types/gapi.client.adexchangeseller/ @Bolisov +/types/gapi.client.adexperiencereport/ @Bolisov +/types/gapi.client.admin/ @Bolisov +/types/gapi.client.adsense/ @Bolisov +/types/gapi.client.adsensehost/ @Bolisov +/types/gapi.client.analytics/ @Bolisov +/types/gapi.client.analyticsreporting/ @Bolisov +/types/gapi.client.androiddeviceprovisioning/ @Bolisov +/types/gapi.client.androidenterprise/ @Bolisov +/types/gapi.client.androidmanagement/ @Bolisov +/types/gapi.client.androidpublisher/ @Bolisov +/types/gapi.client.appengine/ @Bolisov +/types/gapi.client.appsactivity/ @Bolisov +/types/gapi.client.appstate/ @Bolisov +/types/gapi.client.bigquery/ @Bolisov +/types/gapi.client.bigquerydatatransfer/ @Bolisov +/types/gapi.client.blogger/ @Bolisov +/types/gapi.client.books/ @Bolisov +/types/gapi.client.calendar/ @Bolisov +/types/gapi.client.civicinfo/ @Bolisov +/types/gapi.client.classroom/ @Bolisov +/types/gapi.client.cloudbilling/ @Bolisov +/types/gapi.client.cloudbuild/ @Bolisov +/types/gapi.client.clouddebugger/ @Bolisov +/types/gapi.client.clouderrorreporting/ @Bolisov +/types/gapi.client.cloudfunctions/ @Bolisov +/types/gapi.client.cloudiot/ @Bolisov +/types/gapi.client.cloudkms/ @Bolisov +/types/gapi.client.cloudmonitoring/ @Bolisov +/types/gapi.client.cloudresourcemanager/ @Bolisov +/types/gapi.client.cloudtasks/ @Bolisov +/types/gapi.client.cloudtrace/ @Bolisov +/types/gapi.client.clouduseraccounts/ @Bolisov +/types/gapi.client.compute/ @Bolisov +/types/gapi.client.consumersurveys/ @Bolisov +/types/gapi.client.container/ @Bolisov +/types/gapi.client.content/ @Bolisov +/types/gapi.client.customsearch/ @Bolisov +/types/gapi.client.dataflow/ @Bolisov +/types/gapi.client.dataproc/ @Bolisov +/types/gapi.client.datastore/ @Bolisov +/types/gapi.client.deploymentmanager/ @Bolisov +/types/gapi.client.dfareporting/ @Bolisov +/types/gapi.client.discovery/ @Bolisov +/types/gapi.client.dlp/ @Bolisov +/types/gapi.client.dns/ @Bolisov +/types/gapi.client.doubleclickbidmanager/ @Bolisov +/types/gapi.client.doubleclicksearch/ @Bolisov +/types/gapi.client.drive/ @Bolisov +/types/gapi.client.firebasedynamiclinks/ @Bolisov +/types/gapi.client.firebaseremoteconfig/ @Bolisov +/types/gapi.client.firebaserules/ @Bolisov +/types/gapi.client.firestore/ @Bolisov +/types/gapi.client.fitness/ @Bolisov +/types/gapi.client.fusiontables/ @Bolisov +/types/gapi.client.games/ @Bolisov +/types/gapi.client.gamesconfiguration/ @Bolisov +/types/gapi.client.gamesmanagement/ @Bolisov +/types/gapi.client.genomics/ @Bolisov +/types/gapi.client.gmail/ @Bolisov +/types/gapi.client.groupsmigration/ @Bolisov +/types/gapi.client.groupssettings/ @Bolisov +/types/gapi.client.iam/ @Bolisov +/types/gapi.client.identitytoolkit/ @Bolisov +/types/gapi.client.kgsearch/ @Bolisov +/types/gapi.client.language/ @Bolisov +/types/gapi.client.licensing/ @Bolisov +/types/gapi.client.logging/ @Bolisov +/types/gapi.client.manufacturers/ @Bolisov +/types/gapi.client.mirror/ @Bolisov +/types/gapi.client.ml/ @Bolisov +/types/gapi.client.monitoring/ @Bolisov +/types/gapi.client.oauth2/ @Bolisov +/types/gapi.client.oslogin/ @Bolisov +/types/gapi.client.pagespeedonline/ @Bolisov +/types/gapi.client.partners/ @Bolisov +/types/gapi.client.people/ @Bolisov +/types/gapi.client.playcustomapp/ @Bolisov +/types/gapi.client.playmoviespartner/ @Bolisov +/types/gapi.client.plus/ @Bolisov +/types/gapi.client.plusdomains/ @Bolisov +/types/gapi.client.prediction/ @Bolisov +/types/gapi.client.proximitybeacon/ @Bolisov +/types/gapi.client.pubsub/ @Bolisov +/types/gapi.client.qpxexpress/ @Bolisov +/types/gapi.client.reseller/ @Bolisov +/types/gapi.client.resourceviews/ @Bolisov +/types/gapi.client.runtimeconfig/ @Bolisov +/types/gapi.client.safebrowsing/ @Bolisov +/types/gapi.client.script/ @Bolisov +/types/gapi.client.searchconsole/ @Bolisov +/types/gapi.client.servicecontrol/ @Bolisov +/types/gapi.client.servicemanagement/ @Bolisov +/types/gapi.client.serviceuser/ @Bolisov +/types/gapi.client.sheets/ @Bolisov +/types/gapi.client.siteverification/ @Bolisov +/types/gapi.client.slides/ @Bolisov +/types/gapi.client.sourcerepo/ @Bolisov +/types/gapi.client.spanner/ @Bolisov +/types/gapi.client.spectrum/ @Bolisov +/types/gapi.client.speech/ @Bolisov +/types/gapi.client.sqladmin/ @Bolisov +/types/gapi.client.storage/ @Bolisov +/types/gapi.client.storagetransfer/ @Bolisov +/types/gapi.client.streetviewpublish/ @Bolisov +/types/gapi.client.surveys/ @Bolisov +/types/gapi.client.tagmanager/ @Bolisov +/types/gapi.client.taskqueue/ @Bolisov +/types/gapi.client.tasks/ @Bolisov +/types/gapi.client.testing/ @Bolisov +/types/gapi.client.toolresults/ @Bolisov +/types/gapi.client.translate/ @Bolisov +/types/gapi.client.urlshortener/ @Bolisov +/types/gapi.client.vault/ @Bolisov +/types/gapi.client.videointelligence/ @Bolisov +/types/gapi.client.vision/ @Bolisov +/types/gapi.client.webfonts/ @Bolisov +/types/gapi.client.webmasters/ @Bolisov +/types/gapi.client.youtube/ @Bolisov +/types/gapi.client.youtubeanalytics/ @Bolisov +/types/gapi.client.youtubereporting/ @Bolisov /types/gapi.drive/ @baxtersa /types/gapi.pagespeedonline/ @sgtfrankieboy /types/gapi.people/ @tkrotoff @@ -929,6 +1128,7 @@ /types/gapi.youtube/ @sgtfrankieboy /types/gapi.youtubeanalytics/ @sgtfrankieboy /types/gaussian/ @scttcper +/types/gen-readlines/ @CodeAnimal /types/generic-functions/ @stpettersens /types/generic-pool/ @jerray /types/gently/ @bonnici @@ -949,7 +1149,7 @@ /types/git/ @vvakame /types/git-config/ @stpettersens /types/git-remote-origin-url/ @janslow -/types/gl-matrix/ @mattijskneppers @tatchx +/types/gl-matrix/ @mattijskneppers @tatchx @nbabanov @auzmartist /types/gldatepicker/ @qcz /types/glidejs/ @milanjaros /types/glob/ @vvakame @voy @@ -959,12 +1159,13 @@ /types/global-tunnel-ng/ @BendingBender /types/globalize/ @gcastre @afromogli /types/globalize-compiler/ @iclanton -/types/globby/ @douglasduteil +/types/globby/ @douglasduteil @ikatyang /types/globule/ @durad -/types/gm/ @ChaosinaCan +/types/gm/ @ChaosinaCan @maartenvanvliet /types/go/ @NorthwoodsSoftware /types/google-adwords-scripts/ @jafaircl /types/google-apps-script/ @motemen +/types/google-cloud__datastore/ @beaulac /types/google-cloud__storage/ @blove @nbperry /types/google-earth/ @icholy /types/google-images/ @dolanmiu @@ -976,20 +1177,22 @@ /types/google.fonts/ @danmarshall /types/google.geolocation/ @vbortone /types/google.picker/ @grapswiz -/types/google.visualization/ @danludwig @gmoore-sjcorg @danmana @mlcheng @IvanBisultanov +/types/google.visualization/ @danludwig @gmoore-sjcorg @danmana @mlcheng @IvanBisultanov @glebm /types/googlemaps/ @cgwrench @nertzy @xaolas @mrmcnerd @martincostello /types/googlemaps.infobubble/ @Dashue /types/got/ @BendingBender @LinusU -/types/graceful-fs/ @Bartvds +/types/graceful-fs/v2/ @Bartvds +/types/graceful-fs/ @Bartvds @BendingBender /types/graham_scan/ @hberntsen /types/graphene-pk11/ @microshine /types/graphite-udp/ @EricByers -/types/graphql/ @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet +/types/graphql/ @TonyPythoneer @calebmer @intellix @firede @kepennar @freiksenet @IvanGoncharov @DxCx /types/graphql-date/ @enaeseth /types/graphql-relay/ @arvitaly @nitintutlani @Grelinfo /types/graphql-type-json/ @schfkt /types/graphviz/ @mhfrantz /types/gravatar/ @denis-sokolov +/types/gravatar-url/ @ivangabriele /types/greasemonkey/ @kotas /types/grecaptcha/ @DethAriel /types/gregorian-calendar/ @cwalv @@ -1058,6 +1261,7 @@ /types/gulp-useref/ @tkrotoff /types/gulp-util/ @jedmao /types/gulp-watch/ @tkrotoff +/types/gulp-zip/ @dudeofawesome /types/gzip-size/ @plantain-00 /types/h2o2/ @jasonswearingen @AJamesPhillips /types/halfred/ @dherges @@ -1093,9 +1297,13 @@ /types/helmet/ @cyrilschumacher @EvanHahn @bluehatbrit /types/heredatalens/ @denyo /types/heremaps/ @Josh-ES @denyo +/types/heroku-logger/ @kylevogt +/types/hexo-bunyan/ @segayuu +/types/hexo-fs/ @segayuu +/types/hexo-log/ @segayuu /types/highcharts/ @damianog @baltie @AlbertOzimek @hanssens /types/highcharts-ng/ @scatcher -/types/highland/ @Bartvds @hgwood @iwllyu +/types/highland/ @Bartvds @hgwood @iwllyu @alvis /types/highlight.js/ @nikeee @sourrust /types/hiredis/ @titan /types/history/v2/ @sergey-buturlakin @ngbrown @@ -1107,8 +1315,8 @@ /types/hoek/ @prashaantt /types/homeworks/ @KennethanCeyer /types/hooker/ @misak113 -/types/hopscotch/ @pimterry -/types/howler/ @xperiments @tdukart +/types/hopscotch/ @pimterry @Aurimas1 +/types/howler/ @xperiments @tdukart @alien35 @nicholashza /types/hpp/ @kryops /types/html-entities/ @xstoudi /types/html-minifier/ @tkrotoff @@ -1118,7 +1326,7 @@ /types/html-webpack-template/ @bumbleblym /types/html2canvas/ @rwhepburn @tan9 /types/htmlbars-inline-precompile/ @chriskrycho -/types/htmlparser2/ @staticfunction +/types/htmlparser2/ @staticfunction @LinusU /types/htmltojsx/ @basarat /types/http-assert/ @jkeylu /types/http-aws-es/ @marcogrcr @@ -1126,6 +1334,7 @@ /types/http-errors/ @tkrotoff @BendingBender /types/http-proxy/ @SomaticIT /types/http-proxy-middleware/ @zebMcCorkle @BendingBender +/types/http-server/ @plantain-00 /types/http-status/ @misak113 /types/http-status-codes/ @JoshMcCullough /types/http-string-parser/ @pine613 @@ -1187,6 +1396,7 @@ /types/insight/ @vvakame /types/integer/ @Morfent /types/interact.js/ @dduugg @adidahiya @thasner +/types/intercom-web/ @fongandrew @salbahra /types/intercomjs/ @spencerwi /types/internal-ip/ @BendingBender /types/intl/ @RagibHasin @@ -1234,7 +1444,13 @@ /types/isomorphic-fetch/ @toddlucas /types/isotope-layout/ @avidenic /types/istanbul/ @tkrotoff +/types/istanbul-lib-coverage/ @jason0x43 +/types/istanbul-lib-hook/ @jason0x43 +/types/istanbul-lib-instrument/ @jason0x43 +/types/istanbul-lib-report/ @jason0x43 +/types/istanbul-lib-source-maps/ @jason0x43 /types/istanbul-middleware/ @hookclaw +/types/istanbul-reports/ @jason0x43 /types/ityped/ @DanielRosenwasser /types/ix.js/ @Igorbek /types/jade/ @panuhorsmalahti @@ -1265,8 +1481,13 @@ /types/jdataview/ @RReverser /types/jdenticon/ @mtr /types/jest/v16/ @NoHomey @jwbay -/types/jest/ @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang +/types/jest/ @NoHomey @jwbay @asvetliakov @alexjoverm @epicallan @ikatyang @wsmd +/types/jest-diff/ @myabc +/types/jest-docblock/ @ikatyang +/types/jest-get-type/ @myabc +/types/jest-matcher-utils/ @myabc /types/jest-matchers/ @joscha +/types/jest-validate/ @ikatyang /types/jfs/ @tlaziuk /types/jimp/ @Jack-Works /types/jjv/ @Nemo157 @@ -1275,9 +1496,10 @@ /types/jodata/ @cgwrench /types/johnny-five/ @nakakura /types/joi/v6/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW -/types/joi/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt +/types/joi/ @Bartvds @laurence-myers @cglantschnig @DavidBR-SW @GaelMagnan @ralekna @schfkt @rokoroku /types/joigoose/ @boothwhack /types/jointjs/ @areel @DavidDurman @DenEwout @CaselIT @ChrisMoran +/types/jpeg-js/ @DanielRosenwasser /types/jpm/ @github-account-because-they-want-it /types/jqgrid/ @lokeshpeta /types/jqrangeslider/ @qcz @@ -1326,6 +1548,7 @@ /types/jquery.dynatree/ @fdecampredon /types/jquery.elang/ @sumegizoltan /types/jquery.fancytree/ @alphaleonis @abedi-ir +/types/jquery.filtertable/ @totpero /types/jquery.finger/ @maxackley /types/jquery.flagstrap/ @felipedgarcia /types/jquery.fullscreen/ @piraveen @@ -1379,9 +1602,7 @@ /types/js-beautify/ @JoshuaKGoldberg @hansrwindhoff /types/js-clipper/ @omni360 /types/js-combinatorics/ @outring -/types/js-cookie/ @theodorejb -/types/js-data/v1/ @reppners -/types/js-data/ @reppners +/types/js-cookie/ @theodorejb @BendingBender /types/js-data-angular/ @reppners /types/js-data-http/ @reppners /types/js-fixtures/ @kazimanzurrashid @@ -1409,14 +1630,16 @@ /types/json-merge-patch/ @senyaarseniy /types/json-patch/ @vvakame /types/json-pointer/ @Bartvds -/types/json-rpc-ws/ @npenin +/types/json-rpc-ws/ @npenin @mlamp /types/json-schema/ @bcherny /types/json-socket/ @svi3c /types/json-stable-stringify/ @mhfrantz /types/json-stringify-safe/ @BendingBender /types/json2md/ @MartynasZilinskas +/types/jsonata/ @nick121212 /types/jsoneditor/ @alejo90 /types/jsoneditoronline/ @vbortone +/types/jsonfile/ @dbowring /types/jsonminify/ @no23reason /types/jsonnet/ @hookclaw /types/jsonp/ @surenkov @@ -1426,6 +1649,7 @@ /types/jsonwebtoken/ @SomaticIT @danielheim /types/jspdf/ @amberjs /types/jsplumb/ @shearnie +/types/jsqrcode/ @lordazzi /types/jsrender/ @zakki /types/jsrp/ @harryshipton /types/jss/ @Ptival @@ -1438,14 +1662,15 @@ /types/jsuri/ @coldacid @flqw /types/jsurl/ @agorshkov23 /types/jsx-chai/ @nupplaphil -/types/jszip/ @mzeiher +/types/jszip/ @mzeiher @forabi /types/jug/ @yevt /types/jui/ @easylogic /types/jui-core/ @easylogic /types/jui-grid/ @easylogic /types/jweixin/ @taoqf -/types/jwplayer/ @martinduparc +/types/jwplayer/ @martinduparc @kutomer /types/jwt-client/ @timoteoponce +/types/jwt-decode/v1/ @QuatroDevOfficial /types/jwt-decode/ @GiedriusGrabauskas @madsmadsen /types/jwt-simple/ @kenfdev @GaelMagnan /types/kafka-node/ @dansitu @bkim54 @sfrooster @amiram @@ -1455,10 +1680,11 @@ /types/karma-coverage/ @tkrotoff /types/karma-fixture/ @evictor /types/karma-jasmine/ @michelsalib +/types/karma-webpack/ @mtraynham /types/katex/ @mrand01 /types/kcors/ @Xstoudi @izayoiko /types/kdbush/ @DenisCarriere -/types/kefir/ @AyaMorisawa +/types/kefir/ @AyaMorisawa @HitoriSensei /types/kendo-ui/ @telerik /types/keyboardjs/ @vbortone @piranha771 /types/keycloak-js/ @eppsilon @@ -1472,6 +1698,7 @@ /types/klaw/ @mceachen /types/klaw-sync/ @shiftkey /types/knex/ @tkQubo @baronfel +/types/knex-postgis/ @vesse /types/knockback/ @borisyankov /types/knockout/ @EnableSoftware @BenjaminEckardt /types/knockout-amd-helpers/ @DavidSichau @@ -1498,17 +1725,20 @@ /types/koa-compose/ @jkeylu /types/koa-compress/ @hellopao /types/koa-favicon/ @hellopao -/types/koa-generic-session/ @nsimmons +/types/koa-generic-session/ @nsimmons @Ragg- /types/koa-hbs/ @jcbmln @mudkipme /types/koa-helmet/ @me /types/koa-json/ @brooklyndev /types/koa-json-error/ @mudkipme /types/koa-jwt/ @brunokrebs /types/koa-logger/ @geoffreak +/types/koa-logger-winston/ @stevehipwell /types/koa-morgan/ @vesse /types/koa-mount/ @amirsaber /types/koa-passport/ @horiuchi +/types/koa-pino-logger/ @khell /types/koa-pug/ @Xstoudi +/types/koa-range/ @strax /types/koa-redis/ @nsimmons /types/koa-route/ @migstopheles /types/koa-router/ @hellopao @schfkt @@ -1518,15 +1748,17 @@ /types/koa-static/ @hellopao /types/koa-views/ @brooklyndev /types/koa-websocket/ @me +/types/koa2-cors/ @xialeistudio +/types/koa__cors/ @Xstoudi @izayoiko @stevehipwell /types/kolite/ @borisyankov /types/konami.js/ @mareek /types/kramed/ @tonicblue /types/kss/ @giladgray /types/kue/ @drudge @amiram @pc-jedi -/types/kuromoji/ @mzsm +/types/kurento-utils/ @nenadalm +/types/kuromoji/ @mzsm @kgtkr /types/lab/ @prashaantt /types/ladda/ @dflor003 @leemicw -/types/lambda-phi/ @elitechance /types/later/ @jasond-s /types/latinize/ @GiedriusGrabauskas /types/launchpad/ @rictic @@ -1538,13 +1770,16 @@ /types/leaflet/ @alejo90 /types/leaflet-areaselect/ @awallat /types/leaflet-curve/ @onikiienko -/types/leaflet-draw/ @matt-guest @reblace +/types/leaflet-draw/ @matt-guest @reblace @YunS-Stacy /types/leaflet-editable/ @dalie /types/leaflet-fullscreen/ @DenisCarriere +/types/leaflet-geocoder-mapzen/ @leezu +/types/leaflet-gpx/ @soucekv /types/leaflet-imageoverlay-rotated/ @tkleinke /types/leaflet-label/ @Nemo157 /types/leaflet-polylinedecorator/ @soucekv /types/leaflet-providers/ @BendingBender +/types/leaflet-rotatedmarker/ @robert-prib-polestar /types/leaflet.awesome-markers/v0/ @Odrin @sebek64 /types/leaflet.awesome-markers/ @sebek64 /types/leaflet.fullscreen/ @wcomartin @@ -1577,15 +1812,17 @@ /types/loader-runner/ @e-cloud /types/loader-utils/ @Perlmint /types/lobibox/ @itboy87 +/types/local-dynamo/ @Sicilica /types/localforage-cordovasqlitedriver/ @thgreasi /types/localized-countries/ @coderslagoon +/types/localizejs-library/ @salbahra /types/locate-path/ @me /types/lockfile/v0/ @Bartvds /types/lockfile/ @Bartvds @BendingBender /types/lockr/ @droritos /types/locutus/ @hookclaw /types/lodash/v3/ @bczengel @chrootsu -/types/lodash/ @bczengel @chrootsu @stepancar @ericanderson @aj-r @ailrun +/types/lodash/ @bczengel @chrootsu @stepancar @ericanderson @aj-r @ailrun @e-cloud /types/lodash-es/ @stephenlautier /types/lodash-webpack-plugin/ @bumbleblym /types/lodash.add/ @bczengel @chrootsu @stepancar @@ -1613,6 +1850,7 @@ /types/lodash.clonewith/ @bczengel @chrootsu @stepancar /types/lodash.compact/ @bczengel @chrootsu @stepancar /types/lodash.concat/ @bczengel @chrootsu @stepancar +/types/lodash.cond/ @bczengel @chrootsu @stepancar /types/lodash.constant/ @bczengel @chrootsu @stepancar /types/lodash.countby/ @bczengel @chrootsu @stepancar /types/lodash.create/ @bczengel @chrootsu @stepancar @@ -1627,6 +1865,7 @@ /types/lodash.difference/ @bczengel @chrootsu @stepancar /types/lodash.differenceby/ @bczengel @chrootsu @stepancar /types/lodash.differencewith/ @bczengel @chrootsu @stepancar +/types/lodash.divide/ @bczengel @chrootsu @stepancar /types/lodash.drop/ @bczengel @chrootsu @stepancar /types/lodash.dropright/ @bczengel @chrootsu @stepancar /types/lodash.droprightwhile/ @bczengel @chrootsu @stepancar @@ -1646,6 +1885,8 @@ /types/lodash.findlastkey/ @bczengel @chrootsu @stepancar /types/lodash.first/ @bczengel @chrootsu @stepancar /types/lodash.flatmap/ @bczengel @chrootsu @stepancar +/types/lodash.flatmapdeep/ @bczengel @chrootsu @stepancar +/types/lodash.flatmapdepth/ @bczengel @chrootsu @stepancar /types/lodash.flatten/ @bczengel @chrootsu @stepancar /types/lodash.flattendeep/ @bczengel @chrootsu @stepancar /types/lodash.flattendepth/ @bczengel @chrootsu @stepancar @@ -1773,6 +2014,7 @@ /types/lodash.pull/ @bczengel @chrootsu @stepancar /types/lodash.pullall/ @bczengel @chrootsu @stepancar /types/lodash.pullallby/ @bczengel @chrootsu @stepancar +/types/lodash.pullallwith/ @bczengel @chrootsu @stepancar /types/lodash.pullat/ @bczengel @chrootsu @stepancar /types/lodash.random/ @bczengel @chrootsu @stepancar /types/lodash.range/ @bczengel @chrootsu @stepancar @@ -1822,6 +2064,7 @@ /types/lodash.throttle/ @bczengel @chrootsu @stepancar /types/lodash.times/ @bczengel @chrootsu @stepancar /types/lodash.toarray/ @bczengel @chrootsu @stepancar +/types/lodash.tofinite/ @bczengel @chrootsu @stepancar /types/lodash.tointeger/ @bczengel @chrootsu @stepancar /types/lodash.tolength/ @bczengel @chrootsu @stepancar /types/lodash.tolower/ @bczengel @chrootsu @stepancar @@ -1851,6 +2094,7 @@ /types/lodash.unzip/ @bczengel @chrootsu @stepancar /types/lodash.unzipwith/ @bczengel @chrootsu @stepancar /types/lodash.update/ @bczengel @chrootsu @stepancar +/types/lodash.updatewith/ @bczengel @chrootsu @stepancar /types/lodash.uppercase/ @bczengel @chrootsu @stepancar /types/lodash.upperfirst/ @bczengel @chrootsu @stepancar /types/lodash.values/ @bczengel @chrootsu @stepancar @@ -1868,16 +2112,15 @@ /types/log-symbols/ @BendingBender /types/log-update/ @BendingBender /types/log4javascript/ @Ritzlgrmft -/types/log4js/ @armorik83 /types/logat/ @krvikash35 /types/logg/ @blittle /types/loggly/ @rmartone @geoffreak -/types/loglevel/ @Pro @flqw @szmeti +/types/loglevel/ @Pro @szmeti @screendriver /types/logrotate-stream/ @rogierschouten /types/lokijs/ @TeamworkGuy2 /types/lolex/ @Nemo157 @joshuakgoldberg /types/long/ @peterkooijmans -/types/loopback/ @kattsushi +/types/loopback/ @kattsushi @enko @sequoia @drmikecrowe /types/loopback-boot/ @kattsushi /types/lorem-ipsum/ @durad /types/lory.js/ @kubosho @milkisevil @@ -1885,11 +2128,13 @@ /types/lovefield/ @freshp86 /types/lowdb/ @typicode /types/lowlight/ @NoHomey -/types/lru-cache/ @Bartvds +/types/lozad/ @plantain-00 +/types/lru-cache/ @Bartvds @BendingBender /types/lscache/ @Chris-Martinezz /types/ltx/ @PJakcson /types/luaparse/ @stpettersens -/types/lunr/ @sebastian-lenz +/types/lunr/v0/ @sebastian-lenz +/types/lunr/ @seantanly /types/lwip/ @AyaMorisawa /types/lz-string/ @M0ns1gn0r /types/magic-number/ @stpettersens @@ -1905,7 +2150,7 @@ /types/mandrill-api/ @pocesar /types/map-obj/ @BendingBender /types/mapbox/ @anahkiasen -/types/mapbox-gl/ @dobrud +/types/mapbox-gl/ @dobrud @patrickr /types/mapbox__shelf-pack/ @Perlmint /types/mapsjs/ @davismj /types/mariasql/ @bennett000 @@ -1914,7 +2159,7 @@ /types/markdown-it-container/ @hronex /types/marked/ @worr @BendingBender /types/marker-animate-unobtrusive/ @viskin -/types/markerclustererplus/ @enanox +/types/markerclustererplus/ @enanox @mxl /types/markitup/ @drillbits /types/maskedinput/ @lokeshpeta /types/masonry-layout/ @m-a-wilson @warriorrocker @@ -1931,12 +2176,13 @@ /types/mcustomscrollbar/ @flurg /types/md5/ @arcdev1 @jprogrammer /types/mdns/ @reppners +/types/mdurl/ @rokt33r /types/media-typer/ @BendingBender /types/medium-editor/ @keika299 /types/mem/ @SamVerschueren /types/memcached/ @KentarouTakeda /types/memoizee/ @juanpicado -/types/memory-cache/ @jedigo +/types/memory-cache/ @jedigo @thieman /types/memory-fs/ @e-cloud /types/memwatch-next/ @cyrilschumacher /types/meow/ @KnisterPeter @@ -1959,6 +2205,7 @@ /types/methods/ @cprecioso /types/metismenu/ @onokumus @denisname /types/metric-suffix/ @davidm77 +/types/mfiles/ @avonwyss /types/micro/ @kaoDev /types/microgears/ @marcusdb /types/micromatch/ @glen-84 @@ -1966,16 +2213,17 @@ /types/microsoft-ajax/ @pjmagee /types/microsoft-live-connect/ @jvilk /types/microsoft-sdk-soap/ @markusmauch -/types/microsoftteams/ @OfficeDev +/types/microsoftteams/ @WrathOfZombies @jayongg @ydogandjiev /types/microtime/ @vincekovacs /types/milkcocoa/ @odangosan -/types/mime/ @jedigo +/types/mime/ @jedigo @dhritzkiv /types/mime-db/ @AJamesPhillips /types/mime-types/ @Perlmint /types/mimos/ @AJamesPhillips /types/mina/ @lhk @mattanja @kant2002 /types/minimatch/ @vvakame @shantmarouti /types/minimist/ @Bartvds @Necroskillz @kamranayub +/types/minimist-options/ @ikatyang /types/minipass/ @BendingBender /types/mithril/ @spacejack @andraaspar @isiahmeadows /types/mithril-global/ @spacejack @isiahmeadows @@ -2000,7 +2248,7 @@ /types/moment-range/ @Burgov @wilgert @franjuan @MartynasZilinskas /types/moment-round/ @jacobbaskin /types/moment-timezone/ @michelsalib -/types/mongodb/ @CaselIT @alanmarcell @kikar +/types/mongodb/ @CaselIT @alanmarcell @kikar @bitjson @dante-101 /types/mongoose/ @simonxca @horiuchi @sindrenm @lukasz-zak /types/mongoose-auto-increment/ @AyaMorisawa /types/mongoose-deep-populate/ @AyaMorisawa @@ -2009,18 +2257,18 @@ /types/mongoose-promise/ @simonxca /types/mongoose-seeder/ @Crevil /types/mongoose-sequence/ @linusbrolin -/types/mongoose-simple-random/ @me +/types/mongoose-simple-random/ @rsxdalv /types/mongoose-unique-validator/ @stevehipwell /types/monk/ @wzr1337 /types/moo/ @deltaidea -/types/morgan/ @staticfunction +/types/moonjs/ @DanielRosenwasser +/types/morgan/ @staticfunction @pscanf /types/morris.js/ @mareek @sindilevich /types/mousetrap/ @qcz /types/move-concurrently/ @mgroenhoff /types/moviedb/ @basarat @0x6368656174 /types/moxios/ @itoasuka /types/mpromise/ @sgkim126 -/types/mqtt/ @PekkaPLeppanen /types/mri/ @shiftkey @j-f1 /types/ms/ @danny8002 /types/msgpack-lite/ @endel @efokschaner @@ -2032,7 +2280,7 @@ /types/multer/ @jt000 @DavidBR-SW @mxl @hyunseob /types/multer-gridfs-storage/v1/ @devconcept /types/multer-gridfs-storage/ @devconcept -/types/multer-s3/ @tcaesvk +/types/multer-s3/ @tcaesvk @galtalmor /types/multi-typeof/ @mhegazy /types/multimatch/ @stephenlautier /types/multiparty/ @kenfdev @@ -2041,14 +2289,16 @@ /types/murmurhash3js/ @dlee-nvisia /types/musicmetadata/ @Xstoudi /types/mustache/ @markashleybell +/types/mv/ @nenadalm /types/mysql/ @wjohnsto @kacepe /types/mz/ @ThomasHickman /types/n3/ @phreed -/types/nano/ @timjacobi +/types/nano/ @timjacobi @vincekovacs /types/nanoajax/ @nathancahill /types/nanomsg/ @titan /types/nanoscroller/ @zihark17 /types/nanp/ @karn +/types/nats-hemera/ @vforv /types/natsort/ @mgroenhoff /types/natural/ @dmoonfire /types/natural-sort/ @a-morales @@ -2059,14 +2309,16 @@ /types/nconf/ @jedigo @jmthibault /types/ncp/ @bartvds /types/ndarray/ @pawsong @taoqf -/types/nearley/ @deltaidea -/types/nedb/ @reppners +/types/nearley/ @deltaidea @BendingBender +/types/nedb/ @reppners @anthonynichols /types/nedb-logger/ @thisboyiscrazy /types/needle/v0/ @bigsan -/types/needle/ @bigsan @nikeee +/types/needle/v1/ @bigsan @nikeee +/types/needle/ @bigsan @nikeee @sindilevich /types/negotiator/ @BendingBender /types/neo4j/ @cyrilschumacher /types/nes/ @NoHomey +/types/net-keepalive/ @hertzg /types/netmask/ @mhfrantz /types/nexpect/ @vvakame /types/next/ @dru89 @@ -2092,12 +2344,13 @@ /types/ngtoaster/ @btesser /types/ngwysiwyg/ @patrick-mackay /types/nightmare/ @horiuchi @samyang-au -/types/noble/ @swook @wind-rider @shantanubhadoria @lukel99 @bioball +/types/nightwatch/ @rkavalap @schlesiger +/types/noble/ @swook @wind-rider @shantanubhadoria @lukel99 @bioball @keton /types/nock/ @bonnici @horiuchi /types/nodal/ @charrondev -/types/node/v6/ @WilcoBakker -/types/node/v7/ @parambirs @RobDesideri @tellnes @WilcoBakker @Tyriar -/types/node/ @parambirs @RobDesideri @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @Tyriar @DeividasBakanas +/types/node/v6/ @WilcoBakker @inlined +/types/node/v7/ @parambirs @RobDesideri @tellnes @WilcoBakker +/types/node/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis /types/node-7z/ @erkie /types/node-array-ext/ @Beng89 /types/node-cache/ @chrootsu @dthunell @@ -2112,10 +2365,11 @@ /types/node-fibers/ @caryhaynie /types/node-forge/ @westy92 @flynetworks @a-k-g /types/node-gcm/ @horiuchi +/types/node-geocoder/ @rosek86 /types/node-getopt/ @kcauchy /types/node-hid/ @mhegazy @ert78gb /types/node-hue-api/ @fjmorel -/types/node-int64/ @x3cion +/types/node-int64/ @x3cion @kevin-greene-ck /types/node-ipc/ @arvitaly /types/node-jsfl-runner/ @mrand01 /types/node-json-db/ @kuzn-ilya @@ -2125,6 +2379,7 @@ /types/node-polyglot/ @timjk /types/node-powershell/ @rodrigoff /types/node-ral/ @ssddi456 +/types/node-red/ @andersea /types/node-rsa/ @alitaheri /types/node-schedule/ @cyrilschumacher @flowpl /types/node-slack/ @tkQubo @@ -2132,7 +2387,7 @@ /types/node-sprite-generator/ @Perlmint /types/node-static/ @Morfent /types/node-statsd/ @alexturek @convoyinc -/types/node-telegram-bot-api/ @ammuench @agadar +/types/node-telegram-bot-api/ @ammuench @agadar @Dabolus /types/node-uuid/ @jeffmay /types/node-validator/ @kengorab /types/node-vault/ @YuJianrong @@ -2140,10 +2395,11 @@ /types/node-wit/ @julienduf /types/node-xmpp-client/ @PJakcson /types/node-xmpp-core/ @PJakcson -/types/node-zookeeper-client/ @plantain-00 +/types/node-zookeeper-client/ @plantain-00 @jessezhang91 /types/node_redis/ @borisyankov /types/nodegit/ @dolanmiu -/types/nodemailer/ @rogierschouten +/types/nodemailer/v3/ @rogierschouten +/types/nodemailer/ @rogierschouten @dex4er /types/nodemailer-direct-transport/ @rogierschouten /types/nodemailer-mailgun-transport/ @otociulis /types/nodemailer-pickup-transport/ @psnider @@ -2186,6 +2442,7 @@ /types/object-assign/ @chbrown /types/object-diff/ @rogierschouten /types/object-hash/ @misak113 +/types/object-map/ @wolfgang42 /types/object-path/ @pocesar /types/object-refs/ @3fd /types/oblo-util/ @Oblosys @@ -2202,6 +2459,7 @@ /types/on-headers/ @jjeffery @BendingBender /types/once/ @denis-sokolov @BendingBender /types/onetime/ @BendingBender +/types/oniguruma/ @smhxx /types/onoff/ @marcel-ernst /types/open/ @Bartvds /types/opener/ @tikurahul @@ -2209,7 +2467,7 @@ /types/openjscad/ @danmarshall /types/openlayers/v2/ @bolhovsky /types/openlayers/v3/ @osechet @matthiasdailey-ccri -/types/openlayers/ @osechet @ganlhi +/types/openlayers/ @osechet @wb14123 @ailrun @mylen /types/openstack-wrapper/ @sanjaymadane /types/opentok/ @westy92 @CatGuardian /types/opentype.js/ @danmarshall @@ -2230,6 +2488,8 @@ /types/os-tmpdir/ @mhegazy /types/osmosis/ @jurajkocan /types/osmtogeojson/ @tkqubo +/types/osrm/ @DenisCarriere +/types/owl.carousel/ @igorissen /types/owlcarousel/ @dpiatkowski /types/p-all/ @BendingBender /types/p-any/ @BendingBender @@ -2266,10 +2526,10 @@ /types/pad/ @mhegazy /types/paho-mqtt/ @amikhalev /types/pako/ @cappellin @calebegg -/types/papaparse/ @torpedro @rainshen49 +/types/papaparse/ @torpedro @rainshen49 @jfloff /types/paper/ @clark-stevenson /types/paralleljs/ @jbaldwin -/types/parse/ @dpoetzsch @jaeggerr +/types/parse/ @dpoetzsch @jaeggerr @flavionegrao /types/parse-git-config/ @leonard-thieu /types/parse-glob/ @glen-84 /types/parse-link-header/ @zelein @@ -2292,9 +2552,9 @@ /types/passport-google-oauth2/ @bluehatbrit /types/passport-http/ @krizalys /types/passport-http-bearer/ @isman-usoh -/types/passport-jwt/ @mugeso @alsiola /types/passport-local/ @SomaticIT /types/passport-local-mongoose/ @linusbrolin +/types/passport-oauth2/ @pasieronen /types/passport-oauth2-client-password/ @akaNightmare /types/passport-saml/ @cjbarth /types/passport-steam/ @kzay @@ -2308,7 +2568,8 @@ /types/path-is-absolute/ @mhegazy /types/pathfinding/ @BNedry /types/pathjs/ @lokeshpeta -/types/pathwatcher/ @vvakame +/types/pathwatcher/v0/ @vvakame +/types/pathwatcher/ @GlenCFL /types/pause/ @BendingBender /types/payment/ @apare /types/paypal-cordova-plugin/ @Justin-Credible @@ -2318,13 +2579,18 @@ /types/pdfkit/ @erichillah /types/pdfobject/ @nielsboogaard /types/pebblekitjs/ @makotokw +/types/peer-dial/ @RealTYPICAL /types/peerjs/ @nakakura /types/pegjs/ @vvakame @SrTobi @siegebell /types/pem/ @tony19 @DethAriel /types/perfect-scrollbar/ @aicest @CarbonAtom /types/persona/ @Nycto /types/pet-finder-api/ @me +/types/pg/v6/ @pspeter3 +/types/pg/ @pspeter3 /types/pg-connection-string/ @bradleyayers +/types/pg-ears/ @bradleyayers +/types/pg-escape/ @khell /types/pg-pool/ @aleung /types/pg-query-stream/ @asmarques /types/pg-types/ @waratuman @@ -2346,9 +2612,11 @@ /types/pi-spi/ @marcel-ernst /types/pick-weight/ @rsxdalv /types/pickadate/ @theodorejb @leonard-thieu +/types/picturefill/ @alaz /types/pidusage/ @cyrilschumacher -/types/pify/ @samverschueren +/types/pify/ @samverschueren @mad-mike /types/pigpio/ @manerfan +/types/pikaday/ @MidnightDesign @wake42 /types/pikaday-time/ @Sayan751 /types/pinkyswear/ @chances /types/pino/v3/ @psnider @@ -2365,6 +2633,7 @@ /types/plupload/ @patrickbussmann /types/pluralize/ @ukyo /types/png-async/ @kanreisa +/types/pngjs/ @jason0x43 /types/podcast/ @nikeee /types/podium/ @AJamesPhillips /types/point-in-polygon/ @dyst5422 @kogai @@ -2373,7 +2642,6 @@ /types/polymer/ @lgrignon @laco0416 /types/polymer-ts/ @lgrignon /types/popcorn/ @grapswiz -/types/popper.js/ @joscha @seckardt @marcfallows /types/portscanner/ @douglasduteil /types/postal/ @lokeshpeta @myitcv /types/postmark/ @benbayard @@ -2394,7 +2662,7 @@ /types/pouchdb-mapreduce/ @spaulg @geppy @fredgalvao /types/pouchdb-node/ @spaulg @geppy @fredgalvao /types/pouchdb-replication/ @trubit -/types/pouchdb-upsert/ @keithdmoore @hotforfeature +/types/pouchdb-upsert/ @keithdmoore @hotforfeature @apolkingg8 /types/power-assert/ @vvakame /types/power-assert-formatter/ @vvakame /types/precise/ @codeanimal @@ -2403,6 +2671,7 @@ /types/prelude-ls/ @AyaMorisawa /types/prettier/ @ikatyang /types/pretty-bytes/ @plantain-00 +/types/pretty-format/ @ikatyang /types/pretty-ms/ @BendingBender /types/printf/ @AluisioASG /types/priorityqueuejs/ @geoffreak @@ -2439,6 +2708,7 @@ /types/prosemirror-schema-basic/ @bradleyayers @davidka /types/prosemirror-schema-list/ @bradleyayers @davidka /types/prosemirror-state/ @bradleyayers @davidka +/types/prosemirror-tables/ @superchu @eshvedai /types/prosemirror-transform/ @bradleyayers @davidka /types/prosemirror-view/ @bradleyayers @davidka /types/protobufjs/ @panuhorsmalahti @@ -2453,6 +2723,7 @@ /types/pug/ @TonyPythoneer @19majkel94 /types/pulltorefreshjs/ @DanielRosenwasser /types/pump/ @tlaziuk +/types/puppeteer/ @marvinhagemeister @cdeutsch /types/pure-render-decorator/ @seansfkelley /types/purl/ @danfma /types/pusher-js/ @tkqubo @@ -2483,7 +2754,7 @@ /types/rabbit.js/ @wokim /types/radium/ @alexgorbatchev @nupplaphil @asvetliakov @mihe /types/radius/ @codeanimal -/types/ramda/ @donnut @mdekrey @LiamGoodacre @mrdziuban @sbking @afharo @teves-castro @1M0reBug @hojberg +/types/ramda/ @donnut @mdekrey @LiamGoodacre @mrdziuban @sbking @afharo @teves-castro @1M0reBug @hojberg @charlespwd /types/random-js/ @pistacchio /types/random-seed/ @endel /types/random-string/ @stpettersens @@ -2501,15 +2772,19 @@ /types/rc-slider/ @mantasmarcinkus @mattoni /types/rc-tree/ @johnnyreilly /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 @richseviora /types/react-app/ @prakarshpandey -/types/react-autosuggest/ @nicolas-schmitt @pjo256 @robessog @tbayne +/types/react-aria-menubutton/ @forabi @crohlfs +/types/react-autosuggest/ @nicolas-schmitt @pjo256 @robessog @tbayne @cdeutsch +/types/react-beautiful-dnd/ @varHarrie /types/react-body-classname/ @mhegazy -/types/react-bootstrap/ @walkerburgin @vsiao @danilojrr @Batbold-Gansukh @octatone @chengsieuly @katbusch +/types/react-bootstrap/ @walkerburgin @vsiao @danilojrr @Batbold-Gansukh @octatone @chengsieuly @mretolaza @katbusch @vitosamson @LKay @aaronbeall /types/react-bootstrap-date-picker/ @LKay @ssi-hu-antal-bodnar /types/react-bootstrap-daterangepicker/ @ianks -/types/react-bootstrap-table/ @flaub @alelode +/types/react-bootstrap-table/ @flaub @alelode @UJosue10 /types/react-breadcrumbs/ @KostyaEsmukov /types/react-burger-menu/ @radziksh /types/react-calendar-timeline/ @radziksh @@ -2525,15 +2800,18 @@ /types/react-data-grid/v1/ @SupernaviX /types/react-data-grid/ @SupernaviX @KieranPeat @martinnov92 /types/react-datagrid/ @stephenjelfs -/types/react-datepicker/ @radziksh @andrewBalekha @smrq @Rogach +/types/react-datepicker/ @radziksh @andrewBalekha @smrq @Rogach @royxue /types/react-daterange-picker/ @uncovertruth @MartynasZilinskas /types/react-dates/ @Artur-A /types/react-daum-postcode/ @Sa-ryong /types/react-dnd-html5-backend/ @oizie /types/react-document-title/ @cleverguy25 +/types/react-dom/v15/ @MartynasZilinskas /types/react-dom/ @MartynasZilinskas +/types/react-dom-factories/ @jgoz /types/react-dropzone/v2/ @matdube @LynxEyes @goblindegook @benbayard -/types/react-dropzone/ @matdube @LynxEyes @goblindegook @benbayard @LKay +/types/react-dropzone/v3/ @matdube @LynxEyes @goblindegook @benbayard @LKay +/types/react-dropzone/ @matdube @LynxEyes @goblindegook @benbayard @LKay @codeaid /types/react-easy-chart/ @danzel /types/react-event-listener/ @asvetliakov /types/react-fa/ @flaub @patsissons @LKay @@ -2546,10 +2824,12 @@ /types/react-flexr/ @pushplay /types/react-flip-move/ @jmhain /types/react-fontawesome/ @timurrustamov @dublicator @vincaslt @gavingregory +/types/react-form/ @cameron-mcateer +/types/react-foundation/ @danielearwicker /types/react-ga/ @telshin /types/react-geosuggest/ @brmenchl /types/react-gravatar/ @invliD -/types/react-grid-layout/ @abirkholz @alitaheri @ZheyangSong +/types/react-grid-layout/ @abirkholz @alitaheri @ZheyangSong @andrewhathaway /types/react-hamburger-menu/ @grzesie2k /types/react-helmet/v4/ @evanbb @isman-usoh /types/react-helmet/ @evanbb @isman-usoh @lith-light-g @sammkj @yuit @@ -2560,7 +2840,7 @@ /types/react-i18next/v1/ @KostyaEsmukov /types/react-i18next/ @GiedriusGrabauskas /types/react-icon-base/ @apare @LKay -/types/react-icons/ @apare +/types/react-icons/ @apare @johnnyreilly @LKay /types/react-imageloader/ @stephenjelfs /types/react-infinite/ @rhysd /types/react-infinite-scroller/ @Lapanti @psrebniak @@ -2571,15 +2851,17 @@ /types/react-intl-redux/ @LKay /types/react-is-deprecated/ @seansfkelley /types/react-joyride/ @DanielRosenwasser @bendxn +/types/react-json/ @spielc /types/react-json-pretty/ @LKay /types/react-json-tree/ @gnestor -/types/react-jsonschema-form/ @iamdanfox @sirreal +/types/react-jsonschema-form/ @iamdanfox @sirreal @iplus26 /types/react-lazyload/ @m0a /types/react-leaflet/ @danzel @davschne @yuit /types/react-list/ @buptyyf /types/react-loadable/ @Kovensky @odensc /types/react-loader/ @artfuldev /types/react-maskedinput/ @LKay @lavoaster @CarlosBonetti +/types/react-mce/ @morphologue /types/react-mdl/ @bradzacher /types/react-measure/ @asvetliakov @marcfallows /types/react-mixin/ @tkqubo @@ -2587,32 +2869,40 @@ /types/react-monaco-editor/ @jnetterf /types/react-motion/ @stepancar @asvetliakov /types/react-motion-slider/ @asvetliakov -/types/react-native/ @alloy @gyzerok @huhuanming @iRoachie @timwangdev @kamal +/types/react-native/ @alloy @huhuanming @iRoachie @timwangdev @kamal /types/react-native-collapsible/ @iRoachie /types/react-native-communications/ @huhuanming /types/react-native-datepicker/ @jacobbaskin +/types/react-native-doc-viewer/ @iRoachie /types/react-native-drawer/ @jnbt /types/react-native-drawer-layout/ @jmfirth -/types/react-native-elements/ @iRoachie +/types/react-native-elements/ @iRoachie @ifiokjr /types/react-native-fbsdk/ @ifiokjr /types/react-native-fetch-blob/ @MNBuyskih /types/react-native-fs/ @pocesar /types/react-native-goby/ @MessageDream /types/react-native-google-analytics-bridge/ @huhuanming @nbperry +/types/react-native-google-signin/ @j-fro /types/react-native-keep-awake/ @huhuanming +/types/react-native-linear-gradient/ @j-fro /types/react-native-material-design-searchbar/ @iRoachie +/types/react-native-material-kit/ @iRoachie /types/react-native-material-ui/ @iRoachie +/types/react-native-modal/ @ifiokjr /types/react-native-modalbox/ @iRoachie /types/react-native-orientation/ @MoLow +/types/react-native-safari-view/ @mrand01 /types/react-native-scrollable-tab-view/ @CaiHuan /types/react-native-sensor-manager/ @SahinVardar /types/react-native-snap-carousel/ @jnbt /types/react-native-sortable-list/ @sivolobov /types/react-native-svg-uri/ @iRoachie /types/react-native-swiper/ @CaiHuan @huhuanming @mhcgrq +/types/react-native-tab-navigator/ @iRoachie +/types/react-native-tab-view/ @kaoDev /types/react-native-touch-id/ @huhuanming /types/react-native-vector-icons/ @iRoachie @timwangdev -/types/react-native-video/ @huhuanming +/types/react-native-video/ @huhuanming @abrahambotros /types/react-navigation/ @huhuanming @mhcgrq @fangpenlin @abrahambotros @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev /types/react-notification-system/ @GiedriusGrabauskas @DeividasBakanas @LKay @sztobar /types/react-notification-system-redux/ @LKay @@ -2624,13 +2914,13 @@ /types/react-portal/ @shuntksh /types/react-props-decorators/ @tkqubo /types/react-recaptcha/ @mhegazy -/types/react-redux/ @tkqubo @seansfkelley @thasner @kenzierocks @clayne11 @tansongyang +/types/react-redux/ @tkqubo @thasner @kenzierocks @clayne11 @tansongyang @nicholasboll @mdibyo /types/react-redux-i18n/ @clementdevos /types/react-redux-toastr/ @Smiche @artyomsv @kulmajaba /types/react-relay/ @graphcool /types/react-responsive/ @asvetliakov /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 +/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 /types/react-router-bootstrap/ @vlesierse @LKay @olmobrutall /types/react-router-config/ @lith-light-g @@ -2641,67 +2931,77 @@ /types/react-router-redux/ @huy-nguyen @8398a7 /types/react-scroll/ @sudoplz @GiedriusGrabauskas /types/react-scrollbar/ @stephenjelfs -/types/react-select/ @Hesquibet @giladgray @iebaker @skirsdeda @vujevits @devrelm @MartynasZilinskas +/types/react-select/ @Hesquibet @giladgray @iebaker @skirsdeda @vujevits @devrelm @MartynasZilinskas @onatm @ninjaferret @tehbi4 /types/react-side-effect/ @remojansen /types/react-sidebar/ @jeroenvervaeke /types/react-slick/ @andrewBalekha @GiedriusGrabauskas /types/react-smooth-scrollbar/ @asvetliakov /types/react-sortable-hoc/ @NoHomey @charlesrey -/types/react-sortable-tree/ @wouterhardeman +/types/react-sortable-tree/ @wouterhardeman @jzoric /types/react-spinkit/v1/ @tkqubo @mleko @pelotom /types/react-spinkit/ @tkqubo @mleko @pelotom @zzanol /types/react-split-pane/ @rcchen /types/react-sticky/ @curtisw0 +/types/react-stripe-elements/ @dan-j /types/react-svg-pan-zoom/ @huy-nguyen /types/react-swf/ @stepancar /types/react-swipe/ @DeividasBakanas /types/react-swipeable/ @GiedriusGrabauskas @mctep /types/react-swipeable-views/ @mxl @DeividasBakanas /types/react-syntax-highlighter/ @NoHomey +/types/react-table/ @royxue @psakalo /types/react-tabs/ @danez /types/react-tag-input/ @Ogglas @jankarres /types/react-tagcloud/ @wassname /types/react-tap-event-plugin/ @mxl -/types/react-test-renderer/ @arvitaly @lochbrunner @lochbrunner @johnnyreilly +/types/react-test-renderer/v15/ @arvitaly @lochbrunner @lochbrunner @johnnyreilly +/types/react-test-renderer/ @arvitaly @lochbrunner @johnnyreilly @jgoz /types/react-tether/ @ryprice /types/react-textarea-autosize/ @asvetliakov @zry656565 /types/react-toggle/v2/ @LKay /types/react-toggle/ @LKay /types/react-tooltip/ @DeividasBakanas /types/react-touch/ @grzesie2k +/types/react-tracking/ @alloy /types/react-transition-group/v1/ @LKay /types/react-transition-group/ @LKay +/types/react-treeview/ @janslow +/types/react-truncate/ @mattvperry /types/react-user-tour/ @ccancellieri /types/react-virtual-keyboard/ @bsurai -/types/react-virtualized/ @kaoDev @guntherjh @wasd171 +/types/react-virtualized/ @kaoDev @guntherjh @wasd171 @szabolcsx /types/react-virtualized-select/ @seansfkelley /types/react-weui/ @tairan /types/react-widgets/ @rogierschouten @sanyatuning @frodehansen2 +/types/react-youtube/ @kgtkr /types/reactable/ @spielc /types/reactcss/ @chrisgervang @LKay -/types/reactstrap/ @alihammad @mfal @danilobjr +/types/reactstrap/ @alihammad @mfal @danilobjr @fabiopaiva /types/read/ @timjk +/types/read-chunk/ @crispybee /types/read-package-tree/ @mgroenhoff +/types/read-pkg-up/ @dudeofawesome /types/readdir-stream/ @Bartvds /types/readline-sync/ @jonestristand -/types/realm/ @Akim95 /types/reapop/ @Barrokgl /types/recaptcha/ @brentj73 /types/recase/ @18steps -/types/recharts/ @mthmulders @rapmue +/types/recharts/ @mthmulders @rapmue @royxue /types/recompose/ @iskandersierra @mrapogee @clayne11 /types/reconnectingwebsocket/ @nguarracino -/types/recursive-readdir/ @elisee +/types/recursive-readdir/v1/ @elisee +/types/recursive-readdir/ @elisee @MicahZoltu /types/redis/ @soywiz @CodeAnimal @MugeSo /types/redis-mock/ @BendingBender /types/redis-rate-limiter/ @westy92 /types/redis-scripto/ @westy92 /types/redlock/v2/ @chrootsu /types/redlock/ @chrootsu @BendingBender +/types/redom/ @RauliL /types/reduce-reducers/ @huy-nguyen /types/redux-action/ @newraina /types/redux-action-utils/ @tkqubo -/types/redux-actions/ @jaysoo @alexgorbatchev +/types/redux-actions/ @jaysoo @alexgorbatchev @alechill /types/redux-auth-wrapper/v1/ @LKay /types/redux-auth-wrapper/ @LKay /types/redux-batched-subscribe/ @mDibyo @@ -2712,16 +3012,17 @@ /types/redux-devtools-log-monitor/ @mc-petry /types/redux-doghouse/ @BendingBender /types/redux-first-router/ @Valbrand @viggyfresh +/types/redux-first-router-link/ @janb87 /types/redux-form/v4/ @aikoven /types/redux-form/v6/ @carsonf @aikoven @LKay @bancek -/types/redux-form/ @carsonf @aikoven @LKay @bancek +/types/redux-form/ @carsonf @aikoven @LKay @bancek @alsiola /types/redux-immutable/ @oizie @sebald @gavingregory /types/redux-immutable-state-invariant/ @remojansen @highflying /types/redux-infinite-scroll/ @silkyfray /types/redux-localstorage/ @LKay /types/redux-localstorage-debounce/ @LKay /types/redux-localstorage-filter/ @LKay -/types/redux-logger/ @arusakov +/types/redux-logger/ @arusakov @kgroat /types/redux-mock-store/ @MarianPalkus /types/redux-optimistic-ui/ @asvetliakov /types/redux-pack/ @tansongyang @@ -2731,7 +3032,9 @@ /types/redux-promise-middleware/ @ianks /types/redux-recycle/ @LKay /types/redux-router/ @stepancar +/types/redux-saga-routines/ @LKay /types/redux-storage/ @asvetliakov +/types/redux-storage-engine-jsurl/ @screendriver /types/redux-ui/ @andyshuxin /types/ref/ @loyd /types/ref-array/ @loyd @@ -2744,11 +3047,12 @@ /types/remote-redux-devtools/ @ColinEberhardt @unindented /types/remove-markdown/ @RagibHasin /types/replace-ext/ @DeividasBakanas -/types/request/ @soywiz @bonnici @Bartvds @joeskeen @ccurrens +/types/request/ @soywiz @bonnici @Bartvds @joeskeen @ccurrens @lookfirst /types/request-ip/ @mrhen /types/request-promise/ @cglantschnig @joeskeen @AyaMorisawa /types/request-promise-native/ @gustavohenke -/types/requestretry/ @EricByers +/types/requestretry/ @EricByers @trainerbill +/types/require-dir/ @weekens /types/require-directory/ @Igmat /types/require-from-string/ @ikatyang /types/requirejs/ @jbaldwin @@ -2762,10 +3066,12 @@ /types/restful.js/ @tkqubo /types/restify/v4/ @blittle @stevehipwell /types/restify/ @blittle @stevehipwell +/types/restify-cookies/ @weekens /types/restify-cors-middleware/ @dthunell /types/restify-errors/ @stevehipwell /types/restify-plugins/ @KostyaTretyak /types/restler/ @cyrilschumacher +/types/restling/ @loghorn /types/resumablejs/ @DanielMcAssey /types/rethinkdb/ @alexgorbatchev /types/retry/ @krenor @@ -2784,14 +3090,13 @@ /types/riotcontrol/ @chrootsu /types/riotjs/ @vvakame /types/rison/ @impworks -/types/rivets/ @TrevorDev +/types/rivets/ @TrevorDev @matjanos /types/rollup/ @flying-sheep /types/ronomon__crypto-async/ @BendingBender -/types/rosie/ @abner +/types/rosie/ @abner @subvertallchris /types/roslib/ @Pro @skycoop /types/rot-js/ @atiaxi /types/route-parser/ @ianks @bobbuehler -/types/router5/ @sandersky /types/routie/ @Adilson /types/royalslider/ @csrakowski /types/rpio/ @DominikPalo @@ -2800,7 +3105,7 @@ /types/rsmq/ @MugeSo /types/rsmq-worker/ @MugeSo /types/rss/ @secondwtq -/types/rsvp/ @Taytay @mkohlmyr @theroncross @chriskrycho +/types/rsvp/ @chriskrycho /types/rsync/ @philippstucki /types/rtree/ @oefirouz /types/run-sequence/ @k-kagurazaka @@ -2835,7 +3140,7 @@ /types/sandboxed-module/ @svi3c /types/sane/ @BendingBender /types/sanitize-filename/ @Nemo157 -/types/sanitize-html/ @rogierschouten @afshin +/types/sanitize-html/ @rogierschouten @afshin @BehindTheMath /types/sap__xsenv/ @mad-mike /types/sass-graph/ @marvinhagemeister /types/sat/ @omni360 @@ -2881,29 +3186,34 @@ /types/semantic-ui-visibility/ @leonard-thieu /types/semaphore/ @mhfrantz /types/semver/ @Bartvds @BendingBender @LucianBuzzo +/types/semver-compare/ @vincekovacs /types/semver-diff/ @chrismbarr /types/sencha_touch/ @brian428 /types/send/ @MikeJerred /types/seneca/ @psnider /types/sequelize/v3/ @samuelneff @codeanimal @drinchev @morpheusxaut @torhal -/types/sequelize/ @samuelneff @codeanimal @drinchev @babolivier @kukoo1 @morpheusxaut +/types/sequelize/ @samuelneff @codeanimal @drinchev @babolivier @kukoo1 @oktapodia @morpheusxaut /types/sequelize-fixtures/ @cschwarz +/types/sequencify/ @npenin /types/sequester/ @Strate /types/serialize-javascript/ @lith-light-g /types/serialport/ @codefoster /types/serve-favicon/ @urossmolnik /types/serve-index/ @tkrotoff /types/serve-static/ @urossmolnik +/types/server-destroy/ @gyszalai /types/session-file-store/ @blendsdk /types/set-cookie-parser/ @nickp10 /types/sha1/ @arcdev1 /types/shallowequal/ @seansfkelley /types/shapefile/ @DenisCarriere /types/sharedworker/ @nakakura -/types/sharepoint/ @baywet +/types/sharepoint/ @gandjustas @andrei-markeev @baywet @teroarvola /types/sharp/ @lith-light-g +/types/sharp-timer/v0/ @afractal /types/sharp-timer/ @afractal /types/sheetify/ @toddself +/types/shell-escape/ @nenadalm /types/shell-quote/ @jason0x43 /types/shelljs/ @nikeee @voy /types/shipit/ @cyrilschumacher @@ -2917,9 +3227,11 @@ /types/siema/ @Irmiz /types/siesta/ @bquarmby /types/sigmajs/ @qinfchen +/types/sigmund/ @BendingBender /types/signalr/ @borisyankov @keesey @GiedriusGrabauskas +/types/signalr-no-jquery/ @gjoshevski /types/signals/ @diullei -/types/signature_pad/ @AbubakerB +/types/signature_pad/ @AbubakerB @jrmihalick /types/simple-assign/ @NoHomey /types/simple-cw-node/ @vvakame /types/simple-mock/ @leonyu @@ -2961,14 +3273,15 @@ /types/smooth-scrollbar/ @asvetliakov /types/smoothie/ @mikehhawley /types/smoothscroll-polyfill/ @kryops -/types/smtp-server/ @markisme +/types/smtp-server/ @markisme @Taisiias /types/smtpapi/ @a-morales /types/snapsvg/ @lhk @mattanja @kant2002 /types/snazzy-info-window/ @milosd92 /types/snekfetch/ @DarkerTV /types/snoowrap/ @vitosamson +/types/snowboy/ @dolanmiu /types/soap/ @aleung @cagefox -/types/socket.io/ @progre @divillysausages @florentpoujol @KentarouTakeda +/types/socket.io/ @progre @divillysausages @florentpoujol @KentarouTakeda @gigi /types/socket.io-client/ @progre @divillysausages @florentpoujol /types/socket.io-redis/ @nupplaphil /types/socket.io.users/ @kataras @@ -2978,6 +3291,7 @@ /types/sockjs-client/ @vladev @arusakov @BendingBender /types/solution-center-communicator/ @dami-gg /types/sortablejs/ @Maw-Fox +/types/soundmanager2/ @elton2048 /types/source-list-map/ @e-cloud /types/source-map/ @MortenHoustonLudvigsen @rbuckton /types/source-map-support/ @Bartvds @jason0x43 @@ -2986,6 +3300,7 @@ /types/sparkly/ @BendingBender /types/sparkpost/v1/ @geoffreak /types/sparkpost/ @geoffreak @bondz +/types/sparqljs/ @AlexeyMz /types/spatialite/ @atd-schubert /types/spdy/ @tony19 /types/speakeasy/ @legendecas @mrOlorin @@ -2994,17 +3309,20 @@ /types/spectrum/ @M-Zuber /types/spin.js/ @borisyankov @theodorejb /types/split/ @marcinporebski +/types/split.js/ @icholy /types/split2/ @mugeso /types/spotify-api/ @skovmand -/types/sprintf/ @soywiz +/types/sprintf/ @soywiz @BendingBender +/types/sprintf-js/ @jasonswearingen @BendingBender /types/sql.js/ @Hozuki /types/sqlite3/ @nmalaguti @dpyro /types/sqlstring/ @marvinhagemeister /types/squirejs/ @bradleyayers /types/srp/ @Patman64 /types/ss-utils/ @mythz +/types/ssh-key-decrypt/ @BendingBender /types/ssh2/ @tkQubo @rbuckton -/types/ssh2-sftp-client/ @igrayson +/types/ssh2-sftp-client/ @igrayson @ascariandrea /types/ssh2-streams/ @rbuckton /types/sshpk/ @mabels /types/stack-mapper/ @rogierschouten @@ -3021,9 +3339,12 @@ /types/statuses/ @tkrotoff @BendingBender /types/steam/ @kant2002 /types/steed/ @Paul-Isache +/types/stemmer/ @will-ockmore /types/stompjs/ @jimic -/types/storejs/ @vbortone +/types/stoppable/ @EricByers +/types/storejs/ @vbortone @harry0000 /types/storybook__addon-actions/ @joscha +/types/storybook__addon-info/ @mkornblum /types/storybook__addon-knobs/ @joscha @martynaskadisa /types/storybook__addon-links/ @joscha /types/storybook__addon-notes/ @joscha @@ -3046,20 +3367,22 @@ /types/strip-ansi/ @mhegazy /types/strip-bom/ @mhegazy /types/strip-json-comments/ @dmoonfire +/types/stripe/ @wjohnsto @codeanimal @sampsonjoliver @LinusU /types/stripe-checkout/ @cgwrench -/types/stripe-node/ @wjohnsto @codeanimal /types/stripe-v2/ @ejsmith @amritk @adamcmiel @jleider @galuszkak /types/stripe-v3/ @ejsmith @amritk @adamcmiel @jleider @galuszkak /types/striptags/ @ccitro /types/strong-cluster-control/ @shuntksh /types/strophe/ @DavidKDeutsch /types/stylelint/ @alan-agius4 +/types/stylelint-webpack-plugin/ @bahlo /types/stylus/ @SomaticIT /types/subsume/ @BendingBender /types/succinct/ @EnableSoftware /types/sudo-block/ @BendingBender /types/suitescript/ @darrenhillconsulting /types/sumo-logger/ @forabi +/types/superagent/v2/ @varju @NicoZelaya @mxl /types/superagent/ @NicoZelaya @mxl @paplorinc /types/superagent-no-cache/ @mxl /types/superagent-prefix/ @mxl @@ -3072,10 +3395,11 @@ /types/svg-pan-zoom/v2/ @Promact /types/svg-pan-zoom/ @Yimiprod /types/svg-sprite/ @tkqubo -/types/svg2png/ @hansrwindhoff +/types/svg2png/ @hansrwindhoff @sccgithub /types/svg4everybody/ @BendingBender /types/svgjs.draggable/ @LiFeleSs /types/svgjs.resize/ @jkevingutierrez +/types/svgo/ @bradleyayers /types/swag/ @shiwano /types/swagger-express-middleware/ @alexandreroba /types/swagger-express-mw/ @micmro @@ -3101,12 +3425,14 @@ /types/sylvester/ @StephaneAlie /types/synaptic/ @ToastHawaii @austincummings /types/systeminformation/ @PixelcrabAT -/types/systemjs/ @ludohenin @NathanWalker @GiedriusGrabauskas +/types/systemjs/ @ludohenin @NathanWalker @GiedriusGrabauskas @aluanhaddad /types/table/ @evanshortiss +/types/tabris-plugin-firebase/ @eclipsesource /types/tabtab/ @vojtechhabarta +/types/tabulator/ @euginio /types/tapable/ @e-cloud /types/tape/ @Bartvds @sodatea @DennisSchwartz -/types/tar/ @SomaticIT +/types/tar/ @SomaticIT @connor4312 /types/tedious/ @rogierschouten @cjthompson /types/tedious-connection-pool/ @sandorfr /types/telebot/ @mariotsi @@ -3119,10 +3445,11 @@ /types/tether/ @adidahiya /types/tether-drop/ @adidahiya /types/tether-shepherd/ @mtgibbs -/types/text-buffer/ @vvakame +/types/text-buffer/v0/ @vvakame +/types/text-buffer/ @GlenCFL /types/text-encoding/ @pine613 /types/three/ @gyohk @florentpoujol @SereznoKot @omni360 @ivoisbelongtous @piranha771 @qszhusightp @nakakura @s093294 @Pro @efokschaner -/types/thrift/ @kamek-pf +/types/thrift/ @kamek-pf @kevin-greene-ck @jessezhang91 /types/throng/ @cyrilschumacher /types/throttle/ @BendingBender /types/through/ @AndrewGaspar @@ -3145,37 +3472,39 @@ /types/title/ @fa7ad /types/tldjs/ @geoffreak /types/tmp/ @optical @Perlmint +/types/to-camel-case/ @j-f1 /types/to-markdown/ @SuperPaintman /types/to-title-case-gouch/ @stpettersens /types/toastr/ @borisyankov +/types/tocktimer/ @evanshortiss /types/tooltipster/ @stephenlautier /types/topojson/ @ricardo-mello @chenzhutian /types/torrent-stream/ @xstoudi /types/touch/ @mizunashi-mana @BendingBender /types/touch-events/ @kevinb7 -/types/tough-cookie/ @leonard-thieu +/types/tough-cookie/ @leonard-thieu @LiJinyao /types/traceback/ @misak113 /types/tracking/ @pimterry -/types/transducers-js/ @colinkahn @dphilipson +/types/transducers-js/ @colinkahn @dphilipson @NaridaL /types/transducers.js/ @dphilipson /types/traverse/ @newclear /types/traverson/ @marcinporebski /types/trayballoon/ @korve +/types/tress/ @sindilevich /types/trim/ @skysteve /types/trunk8/ @niemyjski /types/tspromise/ @soywiz /types/tunnel/ @BendingBender -/types/turf/v2/ @gcroteau -/types/turf/ @gcroteau @DenisCarriere /types/tus-js-client/ @kevhiggins /types/tv4/ @Bartvds @psnider -/types/tween.js/ @Amos47 @sunetos @jzarnikov +/types/tween.js/ @Amos47 @sunetos @jzarnikov @alexburner /types/tweenjs/ @evilangelist /types/tweezer.js/ @praxxis /types/twig/ @soywiz @enko /types/twilio/ @nickiannone @ashleybrener /types/twit/ @Volox /types/twitter/ @chitoku-k +/types/twitter-stream-channels/ @adrianbardan /types/twix/ @j3ko /types/type-check/ @hansrwindhoff /types/type-detect/ @Bartvds @@ -3203,9 +3532,10 @@ /types/undertaker/ @tkqubo @GiedriusGrabauskas /types/undertaker-registry/ @GiedriusGrabauskas /types/uniq/ @hansrwindhoff -/types/uniqid/ @me +/types/uniqid/ @idchlife /types/unique-hash-stream/ @BendingBender /types/unique-random/ @Kuniwak +/types/unist/ @bizen241 /types/unity-webapi/ @jmvrbanac /types/universal-analytics/ @Bartvds @DarkerTV /types/universal-router/ @jtmthf @@ -3220,7 +3550,9 @@ /types/uritemplate/ @teyc /types/url-assembler/ @wolfgang42 /types/url-join/ @rogierschouten @devrelm +/types/url-parse/ @ChernenkoPaul /types/url-regex/ @unindented +/types/url-search-params/ @nick121212 /types/url-template/ @marcinporebski /types/urlrouter/ @soywiz /types/urlsafe-base64/ @tkrotoff @@ -3244,7 +3576,7 @@ /types/valerie/ @conficient /types/valid-url/ @stevehipwell /types/validate.js/ @HillTravis -/types/validator/ @tgfjt @chrootsu @IOAyman @louy @kacepe +/types/validator/ @tgfjt @chrootsu @IOAyman @louy @kacepe @deptno /types/validatorjs/ @LKay /types/vanilla-tilt/ @BrunnerLivio /types/vary/ @BendingBender @@ -3257,8 +3589,9 @@ /types/vertx3-eventbus-client/ @oddeirik /types/vex-js/ @gdcohan /types/vexflow/ @rquiring @sebastianhaas @bohoffi +/types/vfile/ @bizen241 @rokt33r /types/victory/ @asvetliakov @snerks @Havret -/types/video.js/ @vbortone +/types/video.js/ @vbortone @scleriot /types/viewability-helper/ @lironzluf /types/viewerjs/ @lrh3321 /types/viewporter/ @borisyankov @@ -3271,7 +3604,7 @@ /types/vinyl-paths/ @tkQubo /types/virtual-dom/ @chbrown /types/virtual-keyboard/ @bsurai -/types/vis/ @MichaelBitard @macleodbroad-wf @adripanico @seveves @kaktus40 @mmaitre314 +/types/vis/ @MichaelBitard @macleodbroad-wf @adripanico @seveves @kaktus40 @mmaitre314 @supercargo /types/vision/ @jasonswearingen @AJamesPhillips /types/vitalsigns/ @cyrilschumacher /types/vivus/ @DanielRosenwasser @lekhmanrus @@ -3282,7 +3615,12 @@ /types/voximplant-websdk/ @aylarov /types/vue-i18n/ @aicest /types/vue-resource/ @kaorun343 +/types/vue-scrollto/ @vincekovacs /types/w2ui/ @Ptival +/types/w3c-generic-sensor/ @kenchris +/types/w3c-screen-orientation/ @kenchris +/types/w3c-web-usb/ @larsgk +/types/waitme/ @totpero /types/wake_on_lan/ @SrTobi /types/wallabyjs/ @andrewconnell /types/wallpaper/ @BendingBender @@ -3292,8 +3630,9 @@ /types/watchify/ @TeamworkGuy2 /types/watchpack/ @e-cloud /types/waterline/ @arvitaly -/types/watson-developer-cloud/ @waldo000000 +/types/watson-developer-cloud/ @waldo000000 @Naktibalda /types/waypoints/ @dominikbulaj @Koloto +/types/wcwidth/ @rokt33r /types/weapp-api/ @vargeek /types/web-animations-js/ @kritollm /types/web-bluetooth/ @urish @@ -3309,16 +3648,19 @@ /types/webgme/ @phreed /types/webix/ @mkozhukh /types/webmidi/ @lostfictions -/types/webpack/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 +/types/webpack/ @tkqubo @bumbleblym @bcherny @tommytroylin @mohsen1 @jcreamer898 @ahmed-taj /types/webpack-bundle-analyzer/ @kryops /types/webpack-chain/ @eirikurn @psachs21 +/types/webpack-chunk-hash/ @mtraynham /types/webpack-dev-middleware/ @bumbleblym -/types/webpack-dev-server/ @maestroh @daveparslow +/types/webpack-dev-server/ @maestroh @daveparslow @ZheyangSong /types/webpack-dotenv-plugin/ @kryops -/types/webpack-env/ @use-strict +/types/webpack-env/ @use-strict @rhonsby /types/webpack-fail-plugin/ @deevus /types/webpack-hot-middleware/ @bumbleblym -/types/webpack-merge/ @deevus +/types/webpack-merge/v0/ @deevus +/types/webpack-merge/ @deevus @mtraynham +/types/webpack-node-externals/ @mtraynham /types/webpack-notifier/ @bumbleblym /types/webpack-sources/ @e-cloud @chriseppstein /types/webpack-stream/ @iclanton @bumbleblym @@ -3362,14 +3704,14 @@ /types/wrench/ @soywiz /types/write-file-atomic/ @BendingBender /types/write-json-file/ @DenisCarriere -/types/ws/ @loyd @elithrar +/types/ws/ @loyd @elithrar @mlamp /types/wu/ @phiresky /types/wx-js-sdk-dt/ @agasbzj /types/x-editable/ @sirkirby /types/xadesjs/ @microshine /types/xdate/ @yamada28go /types/xdg-basedir/ @tlaziuk -/types/xlsx/ @themauveavenger +/types/xhr-mock/ @joscha /types/xml/ @YuJianrong /types/xml-parser/ @mhfrantz /types/xml2js/ @michelsalib @jasonrm @ccurrens @edwardhinkle @@ -3386,7 +3728,9 @@ /types/xsd-schema-validator/ @Goldsmith42 /types/xsockets/ @pushplay /types/xterm/ @blink1073 @LucianBuzzo +/types/xxhashjs/ @mDibyo /types/yallist/ @BendingBender +/types/yandex-maps/ @Delagen /types/yandex-money-sdk/ @chrootsu /types/yargs/ @poelstra @mizunashi-mana @pushplay @jeffkenney /types/yayson/ @Codesleuth @@ -3401,7 +3745,9 @@ /types/youtube/ @DazWilkin @JoshuaKGoldberg @eliotfallon213 /types/yui/ @giabao /types/z-schema/ @pgonzal +/types/zapier-platform-core/ @bradleyayers /types/zen-observable/ @aicest +/types/zen-push/ @daprahamian /types/zepto/ @jbaldwin /types/zeroclipboard/v1/ @ejsmith @niemyjski @balassy @leonyu /types/zeroclipboard/ @ejsmith @niemyjski @balassy @leonyu @@ -3409,5 +3755,6 @@ /types/zetapush-js/ @ghoullier /types/zip.js/ @lgrignon /types/zmq/ @davemckeown +/types/zookeeper/ @xialeistudio /types/zui/ @yuanxu /types/zynga-scroller/ @haskellcamargo diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 4078b4808b..536e38c4e2 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,5 +1,9 @@ +If you know how to fix the issue, make a pull request instead. + - [ ] I tried using the `@types/xxxx` package and had problems. - [ ] I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript - [ ] I have a question that is inappropriate for [StackOverflow](https://stackoverflow.com/). (Please ask any appropriate questions there). - [ ] [Mention](https://github.com/blog/821-mention-somebody-they-re-notified) the authors (see `Definitions by:` in `index.d.ts`) so they can respond. - Authors: @.... + +If you do not mention the authors the issue will be ignored. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 979a8311e0..4217471f9d 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -12,7 +12,7 @@ If adding a new definition: - [ ] The package does not provide its own types, and you can not add them. - [ ] If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package. - [ ] Create it with `dts-gen --dt`, not by basing it on an existing project. -- [ ] `tslint.json` should be present, and `tsconfig.json` should have `noImplicitAny`, `noImplicitThis`, and `strictNullChecks` set to `true`. +- [ ] `tslint.json` should be present, and `tsconfig.json` should have `noImplicitAny`, `noImplicitThis`, `strictNullChecks`, and `strictFunctionTypes` set to `true`. If changing an existing definition: - [ ] Provide a URL to documentation or source code which provides context for the suggested changes: <> diff --git a/.travis.yml b/.travis.yml index 07914721a9..9bd31bda14 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: node_js node_js: - - node + - 8 sudo: false diff --git a/README.md b/README.md index b826bf5ad5..7e543c937a 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ or just look for any ".d.ts" files in the package and manually include them with These can be used by TypeScript 1.0. * [Typings](https://github.com/typings/typings) -* ~~[NuGet](http://nuget.org/Tpackages?q=DefinitelyTyped)~~ (use preferred alternatives, nuget DT type publishing has been turned off) +* ~~[NuGet](http://nuget.org/packages?q=DefinitelyTyped)~~ (use preferred alternatives, nuget DT type publishing has been turned off) * Manually download from the `master` branch of this repository You may need to add manual [references](http://www.typescriptlang.org/docs/handbook/triple-slash-directives.html). diff --git a/notNeededPackages.json b/notNeededPackages.json index 0c6f29e3f4..306865851b 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -54,6 +54,12 @@ "sourceRepoURL": "https://github.com/ranisalt/node-argon2", "asOfVersion": "0.15.0" }, + { + "libraryName": "askmethat-rating", + "typingsPackageName": "askmethat-rating", + "sourceRepoURL": "https://github.com/AlexTeixeira/Askmethat-Rating", + "asOfVersion": "0.4.0" + }, { "libraryName": "aws-sdk", "typingsPackageName": "aws-sdk", @@ -108,6 +114,12 @@ "sourceRepoURL": "https://github.com/blakeembrey/camel-case", "asOfVersion": "1.2.1" }, + { + "libraryName": "chalk", + "typingsPackageName": "chalk", + "sourceRepoURL": "https://github.com/chalk/chalk", + "asOfVersion": "2.2.0" + }, { "libraryName": "change-case", "typingsPackageName": "change-case", @@ -174,6 +186,12 @@ "sourceRepoURL": "https://github.com/loopline-systems/electron-builder", "asOfVersion": "2.8.0" }, + { + "libraryName": "error-stack-parser", + "typingsPackageName": "error-stack-parser", + "sourceRepoURL": "https://github.com/stacktracejs/error-stack-parser", + "asOfVersion": "2.0.0" + }, { "libraryName": "eventemitter2", "typingsPackageName": "eventemitter2", @@ -210,6 +228,12 @@ "sourceRepoURL": "http://fineuploader.com/", "asOfVersion": "5.14.0" }, + { + "libraryName": "flatpickr", + "typingsPackageName": "flatpickr", + "sourceRepoURL": "https://github.com/chmln/flatpickr", + "asOfVersion": "3.1.2" + }, { "libraryName": "gaea-model", "typingsPackageName": "gaea-model", @@ -312,6 +336,12 @@ "sourceRepoURL": "https://github.com/tdegrunt/jsonschema", "asOfVersion": "1.1.1" }, + { + "libraryName": "jsplumb", + "typingsPackageName": "jsplumb", + "sourceRepoURL": "https://github.com/jsplumb/jsPlumb", + "asOfVersion": "2.5.7" + }, { "libraryName": "knockout-paging", "typingsPackageName": "knockout-paging", @@ -354,6 +384,12 @@ "sourceRepoURL": "https://github.com/steelsojka/lodash-decorators", "asOfVersion": "4.0.0" }, + { + "libraryName": "log4js", + "typingsPackageName": "log4js", + "sourceRepoURL": "https://github.com/nomiddlename/log4js-node", + "asOfVersion": "2.3.5" + }, { "libraryName": "lower-case", "typingsPackageName": "lower-case", @@ -396,6 +432,12 @@ "sourceRepoURL": "https://github.com/moment/moment", "asOfVersion": "2.13.0" }, + { + "libraryName": "MQTT", + "typingsPackageName": "mqtt", + "sourceRepoURL": "https://github.com/mqttjs/MQTT.js", + "asOfVersion": "2.5.0" + }, { "libraryName": "ng-table", "typingsPackageName": "ng-table", @@ -474,6 +516,12 @@ "sourceRepoURL": "https://github.com/r3mi/poly2tri.js", "asOfVersion": "1.4.0" }, + { + "libraryName": "popper.js", + "typingsPackageName": "popper.js", + "sourceRepoURL": "https://github.com/FezVrasta/popper.js/", + "asOfVersion": "1.11.0" + }, { "libraryName": "Prando", "typingsPackageName": "prando", @@ -510,6 +558,12 @@ "sourceRepoURL": "https://github.com/gpbl/react-day-picker", "asOfVersion": "5.3.0" }, + { + "libraryName": "realm", + "typingsPackageName": "realm", + "sourceRepoURL": "https://github.com/realm/realm-js", + "asOfVersion": "1.13.0" + }, { "libraryName": "Redux", "typingsPackageName": "redux", diff --git a/types/absolute/tslint.json b/types/absolute/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/absolute/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/acc-wizard/tslint.json b/types/acc-wizard/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/acc-wizard/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/ace/tslint.json b/types/ace/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/ace/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/acl/tslint.json b/types/acl/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/acl/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/acorn/acorn-tests.ts b/types/acorn/acorn-tests.ts index 72ca71d2f6..7574df2481 100644 --- a/types/acorn/acorn-tests.ts +++ b/types/acorn/acorn-tests.ts @@ -1,13 +1,13 @@ import acorn = require('acorn'); import * as ESTree from 'estree'; -declare var token: acorn.Token; -declare var tokens: acorn.Token[]; -declare var comment: acorn.Comment; -declare var comments: acorn.Comment[]; -declare var program: ESTree.Program; -var any: any; -var string: string; +declare let token: acorn.Token; +declare let tokens: acorn.Token[]; +declare let comment: acorn.Comment; +declare let comments: acorn.Comment[]; +declare let program: ESTree.Program; +let any: any; +let string: string; // acorn string = acorn.version; @@ -32,16 +32,12 @@ const parser = new acorn.Parser({}, 'export default ""', 0); const node = new acorn.Node(parser, 1, 1); class LooseParser { - constructor(input: string, options = {}) { - - } + constructor(input: string, options = {}) {} // this means you can extend LooseParser - test() { - - } + test() {} } -acorn.addLooseExports(function () { +acorn.addLooseExports(() => { return { type: 'Program', sourceType: 'script', @@ -50,7 +46,7 @@ acorn.addLooseExports(function () { type: 'EmptyStatement' } ] - } + }; }, LooseParser, {}); acorn.parseExpressionAt('string', 2); @@ -63,8 +59,7 @@ acorn.isIdentifierChar(56); acorn.getLineInfo('string', 56); -acorn.plugins['test'] = function (p: acorn.Parser, config: any) { -} +acorn.plugins['test'] = (p: acorn.Parser, config: any) => {}; acorn.tokenizer('console.log("hello world)', {locations: true}).getToken(); acorn.tokenizer('console.log("hello world)', {locations: true})[Symbol.iterator]().next(); diff --git a/types/acorn/index.d.ts b/types/acorn/index.d.ts index ce7da6d368..5d02bd716c 100644 --- a/types/acorn/index.d.ts +++ b/types/acorn/index.d.ts @@ -1,10 +1,8 @@ -// Type definitions for Acorn v4.0.3 +// Type definitions for Acorn 4.0 // Project: https://github.com/marijnh/acorn // Definitions by: RReverser , e-cloud // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - export as namespace acorn; export = acorn; import * as ESTree from 'estree'; @@ -181,7 +179,7 @@ declare namespace acorn { _typeof: TokenType; _void: TokenType; _delete: TokenType; - } + }; class TokContext { constructor(token: string, isExpr: boolean, preserveSpace: boolean, override: (p: Parser) => void); @@ -230,19 +228,18 @@ declare namespace acorn { const version: string; - interface IParse { - (input: string, options?: Options): ESTree.Program; - } + // TODO: rename type. + type IParse = (input: string, options?: Options) => ESTree.Program; const parse: IParse; function parseExpressionAt(input: string, pos?: number, options?: Options): ESTree.Expression; interface ITokenizer { - getToken() : Token, - [Symbol.iterator](): Iterator + getToken(): Token; + [Symbol.iterator](): Iterator; } - + function tokenizer(input: string, options: Options): ITokenizer; let parse_dammit: IParse | undefined; @@ -250,12 +247,10 @@ declare namespace acorn { let pluginsLoose: PluginsObject | undefined; interface ILooseParserClass { - new (input: string, options?: Options): ILooseParser + new (input: string, options?: Options): ILooseParser; } - interface ILooseParser { - - } + interface ILooseParser {} function addLooseExports(parse: IParse, parser: ILooseParserClass, plugins: PluginsObject): void; } diff --git a/types/acorn/tslint.json b/types/acorn/tslint.json new file mode 100644 index 0000000000..2d05b8507c --- /dev/null +++ b/types/acorn/tslint.json @@ -0,0 +1,9 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "export-just-namespace": false, + "interface-name": false, + "no-empty-interface": false, + "no-unnecessary-class": false + } +} diff --git a/types/actioncable/tslint.json b/types/actioncable/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/actioncable/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/actions-on-google/NOTICE b/types/actions-on-google/NOTICE new file mode 100644 index 0000000000..262b08db36 --- /dev/null +++ b/types/actions-on-google/NOTICE @@ -0,0 +1,13 @@ +License Notices: + +The API definitions are from Actions on Google reference site [1] and actions-on-google library [2]. +The actions-on-google library is licensed under the Apache 2.0 License [3]. + +The code documentation is reproduced from work created and shared by Google [4] +and used according to terms described in the Creative Commons 3.0 Attribution License [5]. + +[1] https://developers.google.com/actions/ +[2] https://github.com/actions-on-google/actions-on-google-nodejs +[3] http://www.apache.org/licenses/LICENSE-2.0 +[4] https://developers.google.com/readme/policies/ +[5] http://creativecommons.org/licenses/by/3.0/ diff --git a/types/actions-on-google/actions-on-google-tests.ts b/types/actions-on-google/actions-on-google-tests.ts new file mode 100644 index 0000000000..e57e1e8d98 --- /dev/null +++ b/types/actions-on-google/actions-on-google-tests.ts @@ -0,0 +1,33 @@ +import { ActionsSdkApp, ActionsSdkAppOptions, DialogflowApp, DialogflowAppOptions, AssistantApp, + Responses, Transactions } from 'actions-on-google'; +import * as express from 'express'; + +function testActionsSdk(request: express.Request, response: express.Response) { + const app = new ActionsSdkApp({request, response}); + const actionMap = new Map(); + actionMap.set(app.StandardIntents.MAIN, () => { + const richResponse: Responses.RichResponse = app.buildRichResponse() + .addSimpleResponse('Hello world') + .addSuggestions(['foo', 'bar']); + app.ask(richResponse); + }); + app.handleRequest(actionMap); +} + +function testDialogflow(request: express.Request, response: express.Response) { + const app = new DialogflowApp({request, response}); + const actionMap = new Map(); + actionMap.set(app.StandardIntents.MAIN, () => { + const order: Transactions.Order = app.buildOrder('foo'); + app.askForTransactionDecision(order, { + type: app.Transactions.PaymentType.PAYMENT_CARD, + displayName: 'VISA-1234', + deliveryAddressRequired: true + }); + }); + app.handleRequest(actionMap); +} + +const expressApp = express(); +expressApp.get('/actionssdk', testActionsSdk); +expressApp.get('/dialogflow', testDialogflow); diff --git a/types/actions-on-google/actions-sdk-app.d.ts b/types/actions-on-google/actions-sdk-app.d.ts new file mode 100644 index 0000000000..8de0de0cfb --- /dev/null +++ b/types/actions-on-google/actions-sdk-app.d.ts @@ -0,0 +1,390 @@ +import * as express from 'express'; + +import { AssistantApp } from './assistant-app'; +import { Carousel, List, RichResponse, SimpleResponse } from './response-builder'; + +// --------------------------------------------------------------------------- +// Actions SDK support +// --------------------------------------------------------------------------- + +export interface ActionsSdkAppOptions { + /** Express HTTP request object. */ + request: express.Request; + /** Express HTTP response object. */ + response: express.Response; + /** Function callback when session starts. */ + sessionStarted?(): any; +} + +/** + * This is the class that handles the conversation API directly from Assistant, + * providing implementation for all the methods available in the API. + */ +export class ActionsSdkApp extends AssistantApp { + /** + * Constructor for ActionsSdkApp object. + * To be used in the Actions SDK HTTP endpoint logic. + * + * @example + * const ActionsSdkApp = require('actions-on-google').ActionsSdkApp; + * const app = new ActionsSdkApp({request: request, response: response, + * sessionStarted:sessionStarted}); + * + * @actionssdk + */ + constructor(options: ActionsSdkAppOptions); + + /** + * Validates whether request is from Assistant through signature verification. + * Uses Google-Auth-Library to verify authorization token against given + * Google Cloud Project ID. Auth token is given in request header with key, + * "Authorization". + * + * @example + * const app = new ActionsSdkApp({request, response}); + * app.isRequestFromAssistant('nodejs-cloud-test-project-1234') + * .then(() => { + * app.ask('Hey there, thanks for stopping by!'); + * }) + * .catch(err => { + * response.status(400).send(); + * }); + * + * @param projectId Google Cloud Project ID for the Assistant app. + * @return Promise resolving with google-auth-library LoginTicket + * if request is from a valid source, otherwise rejects with the error reason + * for an invalid token. + * @actionssdk + */ + isRequestFromAssistant(projectId: string): Promise; + + /** + * Gets the request Conversation API version. + * + * @example + * const app = new ActionsSdkApp({request: request, response: response}); + * const apiVersion = app.getApiVersion(); + * + * @return Version value or null if no value. + * @actionssdk + */ + getApiVersion(): string; + + /** + * Gets the user's raw input query. + * + * @example + * const app = new ActionsSdkApp({request: request, response: response}); + * app.tell('You said ' + app.getRawInput()); + * + * @return User's raw query or null if no value. + * @actionssdk + */ + getRawInput(): string; + + /** + * Gets previous JSON dialog state that the app sent to Assistant. + * Alternatively, use the app.data field to store JSON values between requests. + * + * @example + * const app = new ActionsSdkApp({request: request, response: response}); + * const dialogState = app.getDialogState(); + * + * @return JSON object provided to the Assistant in the previous + * user turn or {} if no value. + * @actionssdk + */ + getDialogState(): any; + + /** + * Gets the "versionLabel" specified inside the Action Package. + * Used by app to do version control. + * + * @example + * const app = new ActionsSdkApp({request: request, response: response}); + * const actionVersionLabel = app.getActionVersionLabel(); + * + * @return The specified version label or null if unspecified. + * @actionssdk + */ + getActionVersionLabel(): string; + + /** + * Gets the unique conversation ID. It's a new ID for the initial query, + * and stays the same until the end of the conversation. + * + * @example + * const app = new ActionsSdkApp({request: request, response: response}); + * const conversationId = app.getConversationId(); + * + * @return Conversation ID or null if no value. + * @actionssdk + */ + getConversationId(): string; + + /** + * Get the current intent. Alternatively, using a handler Map with + * {@link AssistantApp#handleRequest|handleRequest}, the client library will + * automatically handle the incoming intents. + * + * @example + * const app = new ActionsSdkApp({request: request, response: response}); + * + * function responseHandler (app) { + * const intent = app.getIntent(); + * switch (intent) { + * case app.StandardIntents.MAIN: + * const inputPrompt = app.buildInputPrompt(false, 'Welcome to action snippets! Say anything.'); + * app.ask(inputPrompt); + * break; + * + * case app.StandardIntents.TEXT: + * app.tell('You said ' + app.getRawInput()); + * break; + * } + * } + * + * app.handleRequest(responseHandler); + * + * @return Intent id or null if no value. + * @actionssdk + */ + getIntent(): string; + + /** + * Get the argument value by name from the current intent. If the argument + * is not a text argument, the entire argument object is returned. + * + * Note: If incoming request is using an API version under 2 (e.g. 'v1'), + * the argument object will be in Proto2 format (snake_case, etc). + * + * @param argName Name of the argument. + * @return Argument value matching argName + * or null if no matching argument. + * @actionssdk + */ + getArgument(argName: string): string; + + /** + * Returns the option key user chose from options response. + * + * @example + * const app = new App({request: req, response: res}); + * + * function pickOption (app) { + * if (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) { + * app.askWithCarousel('Which of these looks good?', + * app.buildCarousel().addItems( + * app.buildOptionItem('another_choice', ['Another choice']). + * setTitle('Another choice').setDescription('Choose me!'))); + * } else { + * app.ask('What would you like?'); + * } + * } + * + * function optionPicked (app) { + * app.ask('You picked ' + app.getSelectedOption()); + * } + * + * const actionMap = new Map(); + * actionMap.set(app.StandardIntents.TEXT, pickOption); + * actionMap.set(app.StandardIntents.OPTION, optionPicked); + * + * app.handleRequest(actionMap); + * + * @return Option key of selected item. Null if no option selected or + * if current intent is not OPTION intent. + * @actionssdk + */ + getSelectedOption(): string; + + /** + * Asks to collect user's input; all user's queries need to be sent to + * the app. + * {@link https://developers.google.com/actions/policies/general-policies#user_experience|The guidelines when prompting the user for a response must be followed at all times}. + * + * @example + * const app = new ActionsSdkApp({request: request, response: response}); + * + * function mainIntent (app) { + * const inputPrompt = app.buildInputPrompt(true, 'Hi! ' + + * 'I can read out an ordinal like ' + + * '123. Say a number.', + * ['I didn\'t hear a number', 'If you\'re still there, what\'s the number?', 'What is the number?']); + * app.ask(inputPrompt); + * } + * + * function rawInput (app) { + * if (app.getRawInput() === 'bye') { + * app.tell('Goodbye!'); + * } else { + * const inputPrompt = app.buildInputPrompt(true, 'You said, ' + + * app.getRawInput() + '', + * ['I didn\'t hear a number', 'If you\'re still there, what\'s the number?', 'What is the number?']); + * app.ask(inputPrompt); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(app.StandardIntents.MAIN, mainIntent); + * actionMap.set(app.StandardIntents.TEXT, rawInput); + * + * app.handleRequest(actionMap); + * + * @param inputPrompt Holding initial and + * no-input prompts. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by App. + * @return The response that is sent to Assistant to ask user to provide input. + * @actionssdk + */ + ask(inputPrompt: object | SimpleResponse | RichResponse, dialogState?: object): express.Response | null; + + /** + * Asks to collect user's input with a list. + * + * @example + * const app = new ActionsSdkApp({request, response}); + * + * function welcomeIntent (app) { + * app.askWithlist('Which of these looks good?', + * app.buildList('List title') + * .addItems([ + * app.buildOptionItem(SELECTION_KEY_ONE, + * ['synonym of KEY_ONE 1', 'synonym of KEY_ONE 2']) + * .setTitle('Number one'), + * app.buildOptionItem(SELECTION_KEY_TWO, + * ['synonym of KEY_TWO 1', 'synonym of KEY_TWO 2']) + * .setTitle('Number two'), + * ])); + * } + * + * function optionIntent (app) { + * if (app.getSelectedOption() === SELECTION_KEY_ONE) { + * app.tell('Number one is a great choice!'); + * } else { + * app.tell('Number two is a great choice!'); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(app.StandardIntents.TEXT, welcomeIntent); + * actionMap.set(app.StandardIntents.OPTION, optionIntent); + * app.handleRequest(actionMap); + * + * @param inputPrompt Holding initial and + * no-input prompts. Cannot contain basic card. + * @param list List built with {@link AssistantApp#buildList|buildList}. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. + * @return The response that is sent to Assistant to ask user to provide input. + * @actionssdk + */ + askWithList(inputPrompt: object | SimpleResponse | RichResponse, list: List, dialogState?: object): express.Response | null; + + /** + * Asks to collect user's input with a carousel. + * + * @example + * const app = new ActionsSdkApp({request, response}); + * + * function welcomeIntent (app) { + * app.askWithCarousel('Which of these looks good?', + * app.buildCarousel() + * .addItems([ + * app.buildOptionItem(SELECTION_KEY_ONE, + * ['synonym of KEY_ONE 1', 'synonym of KEY_ONE 2']) + * .setTitle('Number one'), + * app.buildOptionItem(SELECTION_KEY_TWO, + * ['synonym of KEY_TWO 1', 'synonym of KEY_TWO 2']) + * .setTitle('Number two'), + * ])); + * } + * + * function optionIntent (app) { + * if (app.getSelectedOption() === SELECTION_KEY_ONE) { + * app.tell('Number one is a great choice!'); + * } else { + * app.tell('Number two is a great choice!'); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(app.StandardIntents.TEXT, welcomeIntent); + * actionMap.set(app.StandardIntents.OPTION, optionIntent); + * app.handleRequest(actionMap); + * + * @param inputPrompt Holding initial and + * no-input prompts. Cannot contain basic card. + * @param carousel Carousel built with + * {@link AssistantApp#buildCarousel|buildCarousel}. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. + * @return The response that is sent to Assistant to ask user to provide input. + * @actionssdk + */ + askWithCarousel(inputPrompt: object | SimpleResponse | RichResponse, carousel: Carousel, dialogState?: object): express.Response | null; + + /** + * Tells Assistant to render the speech response and close the mic. + * + * @example + * const app = new ActionsSdkApp({request: request, response: response}); + * + * function mainIntent (app) { + * const inputPrompt = app.buildInputPrompt(true, 'Hi! ' + + * 'I can read out an ordinal like ' + + * '123. Say a number.', + * ['I didn\'t hear a number', 'If you\'re still there, what\'s the number?', 'What is the number?']); + * app.ask(inputPrompt); + * } + * + * function rawInput (app) { + * if (app.getRawInput() === 'bye') { + * app.tell('Goodbye!'); + * } else { + * const inputPrompt = app.buildInputPrompt(true, 'You said, ' + + * app.getRawInput() + '', + * ['I didn\'t hear a number', 'If you\'re still there, what\'s the number?', 'What is the number?']); + * app.ask(inputPrompt); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(app.StandardIntents.MAIN, mainIntent); + * actionMap.set(app.StandardIntents.TEXT, rawInput); + * + * app.handleRequest(actionMap); + * + * @param textToSpeech Final response. + * Spoken response can be SSML. + * @return The HTTP response that is sent back to Assistant. + * @actionssdk + */ + tell(textToSpeech: string | SimpleResponse | RichResponse): express.Response | null; + + /** + * Builds the {@link https://developers.google.com/actions/reference/conversation#InputPrompt|InputPrompt object} + * from initial prompt and no-input prompts. + * + * The App needs one initial prompt to start the conversation. If there is no user response, + * the App re-opens the mic and renders the no-input prompts three times + * (one for each no-input prompt that was configured) to help the user + * provide the right response. + * + * Note: we highly recommend app to provide all the prompts required here in order to ensure a + * good user experience. + * + * @example + * const inputPrompt = app.buildInputPrompt(false, 'Welcome to action snippets! Say a number.', + * ['Say any number', 'Pick a number', 'What is the number?']); + * app.ask(inputPrompt); + * + * @param isSsml Indicates whether the text to speech is SSML or not. + * @param initialPrompt The initial prompt the App asks the user. + * @param noInputs Array of re-prompts when the user does not respond (max 3). + * @return. + * @actionssdk + */ + buildInputPrompt(isSsml: boolean, initialPrompt: string, noInputs?: string[]): object; +} diff --git a/types/actions-on-google/assistant-app.d.ts b/types/actions-on-google/assistant-app.d.ts new file mode 100644 index 0000000000..d33f447a2e --- /dev/null +++ b/types/actions-on-google/assistant-app.d.ts @@ -0,0 +1,1316 @@ +import * as express from 'express'; + +import { BasicCard, Carousel, List, OptionItem, RichResponse } from './response-builder'; +import { ActionPaymentTransactionConfig, Cart, GooglePaymentTransactionConfig, LineItem, + Location, Order, OrderUpdate, TransactionDecision, TransactionValues } from './transactions'; + +/** + * List of standard intents that the app provides. + * @actionssdk + * @dialogflow + */ +export enum StandardIntents { + /** + * App fires MAIN intent for queries like [talk to $app]. + */ + MAIN, + /** + * App fires TEXT intent when action issues ask intent. + */ + TEXT, + /** + * App fires PERMISSION intent when action invokes askForPermission. + */ + PERMISSION, + /** + * App fires OPTION intent when user chooses from options provided. + */ + OPTION, + /** + * App fires TRANSACTION_REQUIREMENTS_CHECK intent when action sets up transaction. + */ + TRANSACTION_REQUIREMENTS_CHECK, + /** + * App fires DELIVERY_ADDRESS intent when action asks for delivery address. + */ + DELIVERY_ADDRESS, + /** + * App fires TRANSACTION_DECISION intent when action asks for transaction decision. + */ + TRANSACTION_DECISION, + /** + * App fires CONFIRMATION intent when requesting affirmation from user. + */ + CONFIRMATION, + /** + * App fires DATETIME intent when requesting date/time from user. + */ + DATETIME, + /** + * App fires SIGN_IN intent when requesting sign-in from user. + */ + SIGN_IN, + /** + * App fires NO_INPUT intent when user doesn't provide input. + */ + NO_INPUT, + /** + * App fires CANCEL intent when user exits app mid-dialog. + */ + CANCEL, + /** + * App fires NEW_SURFACE intent when requesting handoff to a new surface from user. + */ + NEW_SURFACE, +} + +/** + * List of supported permissions the app supports. + * @actionssdk + * @dialogflow + */ +export enum SupportedPermissions { + /** + * The user's name as defined in the + * {@link https://developers.google.com/actions/reference/conversation#UserProfile|UserProfile object} + */ + NAME, + /** + * The location of the user's current device, as defined in the + * {@link https://developers.google.com/actions/reference/conversation#Location|Location object}. + */ + DEVICE_PRECISE_LOCATION, + /** + * City and zipcode corresponding to the location of the user's current device, as defined in the + * {@link https://developers.google.com/actions/reference/conversation#Location|Location object}. + */ + DEVICE_COARSE_LOCATION, +} + +/** + * List of built-in argument names. + * @actionssdk + * @dialogflow + */ +export enum BuiltInArgNames { + /** + * Permission granted argument. + */ + PERMISSION_GRANTED, + /** + * Option selected argument. + */ + OPTION, + /** + * Transaction requirements check result argument. + */ + TRANSACTION_REQ_CHECK_RESULT, + /** + * Delivery address value argument. + */ + DELIVERY_ADDRESS_VALUE, + /** + * Transactions decision argument. + */ + TRANSACTION_DECISION_VALUE, + /** + * Confirmation argument. + */ + CONFIRMATION, + /** + * DateTime argument. + */ + DATETIME, + /** + * Sign in status argument. + */ + SIGN_IN, + /** + * Reprompt count for consecutive NO_INPUT intents. + */ + REPROMPT_COUNT, + /** + * Flag representing finality of NO_INPUT intent. + */ + IS_FINAL_REPROMPT, + /** + * New surface value argument. + */ + NEW_SURFACE, +} + +/** + * List of possible conversation stages, as defined in the + * {@link https://developers.google.com/actions/reference/conversation#Conversation|Conversation object}. + * @actionssdk + * @dialogflow + */ +export enum ConversationStages { + /** + * Unspecified conversation state. + */ + UNSPECIFIED, + /** + * A new conversation. + */ + NEW, + /** + * An active (ongoing) conversation. + */ + ACTIVE, +} + +/** + * List of surface capabilities supported by the app. + * @actionssdk + * @dialogflow + */ +export enum SurfaceCapabilities { + /** + * The ability to output audio. + */ + AUDIO_OUTPUT, + /** + * The ability to output on a screen + */ + SCREEN_OUTPUT, +} + +/** + * List of possible user input types. + * @actionssdk + * @dialogflow + */ +export enum InputTypes { + /** + * Unspecified. + */ + UNSPECIFIED, + /** + * Input given by touch. + */ + TOUCH, + /** + * Input given by voice (spoken). + */ + VOICE, + /** + * Input given by keyboard (typed). + */ + KEYBOARD +} + +/** + * List of possible sign in result status values. + * @actionssdk + * @dialogflow + */ +export enum SignInStatus { + /** + * Unknown status. + */ + UNSPECIFIED, + /** + * User successfully completed the account linking. + */ + OK, + /** + * Cancelled or dismissed account linking. + */ + CANCELLED, + /** + * System or network error. + */ + ERROR +} + +/** + * User provided date/time info. + */ +export interface DateTime { + date: { + year: number; + month: number; + day: number; + }; + time: { + hours: number; + minutes: number; + seconds: number; + nanos: number; + }; +} + +/** + * User's permissioned name info. + */ +export interface UserName { + /** User's display name. */ + displayName: string; + /** User's given name. */ + givenName: string; + /** User's family name. */ + familyName: string; +} + +/** + * User's permissioned device location. + */ +export interface DeviceLocation { + /** {latitude, longitude}. Requested with SupportedPermissions.DEVICE_PRECISE_LOCATION. */ + coordinates: object; + /** Full, formatted street address. Requested with SupportedPermissions.DEVICE_PRECISE_LOCATION. */ + address: string; + /** Zip code. Requested with SupportedPermissions.DEVICE_COARSE_LOCATION. */ + zipCode: string; + /** Device city. Requested with SupportedPermissions.DEVICE_COARSE_LOCATION. */ + city: string; +} + +/** + * User object. + */ +export interface User { + /** Random string ID for Google user. */ + userId: string; + /** User name information. Null if not requested with {@link AssistantApp#askForPermission|askForPermission(SupportedPermissions.NAME)}. */ + userName: UserName; + /** Unique Oauth2 token. Only available with account linking. */ + accessToken: string; +} + +/** + * Actions on Google Surface. + */ +export interface Surface { + /** Capabilities of the surface. */ + capabilities: Capability[]; +} + +/** + * Surface capability. + */ +export interface Capability { + /** Name of the capability. */ + name: string; +} + +/** + * The Actions on Google client library AssistantApp base class. + * + * This class contains the methods that are shared between platforms to support the conversation API + * protocol from Assistant. It also exports the 'State' class as a helper to represent states by + * name. + */ +export class AssistantApp { + /** + * The session state. + */ + state: string; + + /** + * The session data in JSON format. + */ + data: object; + + /** + * List of standard intents that the app provides. + * @actionssdk + * @dialogflow + */ + readonly StandardIntents: typeof StandardIntents; + + /** + * List of supported permissions the app supports. + * @actionssdk + * @dialogflow + */ + readonly SupportedPermissions: typeof SupportedPermissions; + + /** + * List of built-in argument names. + * @actionssdk + * @dialogflow + */ + readonly BuiltInArgNames: typeof BuiltInArgNames; + + /** + * List of possible conversation stages, as defined in the + * {@link https://developers.google.com/actions/reference/conversation#Conversation|Conversation object}. + * @actionssdk + * @dialogflow + */ + readonly ConversationStages: typeof ConversationStages; + + /** + * List of surface capabilities supported by the app. + * @actionssdk + * @dialogflow + */ + readonly SurfaceCapabilities: typeof SurfaceCapabilities; + + /** + * List of possible user input types. + * @actionssdk + * @dialogflow + */ + readonly InputTypes: typeof InputTypes; + + /** + * List of possible sign in result status values. + * @actionssdk + * @dialogflow + */ + readonly SignInStatus: typeof SignInStatus; + + /** + * Values related to supporting {@link Transactions}. + */ + readonly Transactions: typeof TransactionValues; + + // --------------------------------------------------------------------------- + // Public APIs + // --------------------------------------------------------------------------- + + /** + * Handles the incoming Assistant request using a handler or Map of handlers. + * Each handler can be a function callback or Promise. + * + * @example + * // Actions SDK + * const app = new ActionsSdkApp({request: request, response: response}); + * + * function mainIntent (app) { + * const inputPrompt = app.buildInputPrompt(true, 'Hi! ' + + * 'I can read out an ordinal like ' + + * '123. Say a number.', + * ['I didn\'t hear a number', 'If you\'re still there, what\'s the number?', 'What is the number?']); + * app.ask(inputPrompt); + * } + * + * function rawInput (app) { + * if (app.getRawInput() === 'bye') { + * app.tell('Goodbye!'); + * } else { + * const inputPrompt = app.buildInputPrompt(true, 'You said, ' + + * app.getRawInput() + '', + * ['I didn\'t hear a number', 'If you\'re still there, what\'s the number?', 'What is the number?']); + * app.ask(inputPrompt); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(app.StandardIntents.MAIN, mainIntent); + * actionMap.set(app.StandardIntents.TEXT, rawInput); + * + * app.handleRequest(actionMap); + * + * // Dialogflow + * const app = new DialogflowApp({request: req, response: res}); + * const NAME_ACTION = 'make_name'; + * const COLOR_ARGUMENT = 'color'; + * const NUMBER_ARGUMENT = 'number'; + * + * function makeName (app) { + * const number = app.getArgument(NUMBER_ARGUMENT); + * const color = app.getArgument(COLOR_ARGUMENT); + * app.tell('Alright, your silly name is ' + + * color + ' ' + number + + * '! I hope you like it. See you next time.'); + * } + * + * const actionMap = new Map(); + * actionMap.set(NAME_ACTION, makeName); + * app.handleRequest(actionMap); + * + * @param handler The handler (or Map of handlers) for the request. + * @actionssdk + * @dialogflow + */ + handleRequest(handler: ((app: AssistantApp) => any) | (Map any>)): void; + + /** + * Equivalent to {@link AssistantApp#askForPermission|askForPermission}, + * but allows you to prompt the user for more than one permission at once. + * + * Notes: + * + * * The order in which you specify the permission prompts does not matter - + * it is controlled by the Assistant to provide a consistent user experience. + * * The user will be able to either accept all permissions at once, or none. + * If you wish to allow them to selectively accept one or other, make several + * dialog turns asking for each permission independently with askForPermission. + * * Asking for DEVICE_COARSE_LOCATION and DEVICE_PRECISE_LOCATION at once is + * equivalent to just asking for DEVICE_PRECISE_LOCATION + * + * @example + * const app = new DialogflowApp({request: req, response: res}); + * const REQUEST_PERMISSION_ACTION = 'request_permission'; + * const GET_RIDE_ACTION = 'get_ride'; + * + * function requestPermission (app) { + * const permission = [ + * app.SupportedPermissions.NAME, + * app.SupportedPermissions.DEVICE_PRECISE_LOCATION + * ]; + * app.askForPermissions('To pick you up', permissions); + * } + * + * function sendRide (app) { + * if (app.isPermissionGranted()) { + * const displayName = app.getUserName().displayName; + * const address = app.getDeviceLocation().address; + * app.tell('I will tell your driver to pick up ' + displayName + + * ' at ' + address); + * } else { + * // Response shows that user did not grant permission + * app.tell('Sorry, I could not figure out where to pick you up.'); + * } + * } + * const actionMap = new Map(); + * actionMap.set(REQUEST_PERMISSION_ACTION, requestPermission); + * actionMap.set(GET_RIDE_ACTION, sendRide); + * app.handleRequest(actionMap); + * + * @param context Context why the permission is being asked; it's the TTS + * prompt prefix (action phrase) we ask the user. + * @param permissions Array of permissions App supports, each of + * which comes from AssistantApp.SupportedPermissions. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. Used in {@link ActionsSdkAssistant}. + * @return A response is sent to Assistant to ask for the user's permission; for any + * invalid input, we return null. + * @actionssdk + * @dialogflow + */ + askForPermissions(context: string, permissions: string[], dialogState?: object): express.Response | null; + + /** + * Checks whether user is in transactable state. + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * const WELCOME_INTENT = 'input.welcome'; + * const TXN_REQ_COMPLETE = 'txn.req.complete'; + * + * let transactionConfig = { + * deliveryAddressRequired: false, + * type: app.Transactions.PaymentType.BANK, + * displayName: 'Checking-1234' + * }; + * function welcomeIntent (app) { + * app.askForTransactionRequirements(transactionConfig); + * } + * + * function txnReqCheck (app) { + * if (app.getTransactionRequirementsResult() === app.Transactions.ResultType.OK) { + * // continue cart building flow + * } else { + * // don't continue cart building + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(TXN_REQ_COMPLETE, txnReqCheck); + * app.handleRequest(actionMap); + * + * @param + * transactionConfig Configuration for the transaction. Includes payment + * options and order options. Optional if order has no payment or + * delivery. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. Used in {@link ActionsSdkAssistant}. + * @return HTTP response. + * @actionssdk + * @dialogflow + */ + askForTransactionRequirements(transactionConfig?: ActionPaymentTransactionConfig | GooglePaymentTransactionConfig, dialogState?: object): express.Response | null; + + /** + * Asks user to confirm transaction information. + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * const WELCOME_INTENT = 'input.welcome'; + * const TXN_COMPLETE = 'txn.complete'; + * + * let transactionConfig = { + * deliveryAddressRequired: false, + * type: app.Transactions.PaymentType.BANK, + * displayName: 'Checking-1234' + * }; + * + * let order = app.buildOrder(); + * // fill order cart + * + * function welcomeIntent (app) { + * app.askForTransaction(order, transactionConfig); + * } + * + * function txnComplete (app) { + * // respond with order update + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(TXN_COMPLETE, txnComplete); + * app.handleRequest(actionMap); + * + * @param order Order built with buildOrder(). + * @param + * transactionConfig Configuration for the transaction. Includes payment + * options and order options. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. Used in {@link ActionsSdkAssistant}. + * @return HTTP response + * @dialogflow + */ + askForTransactionDecision(order: Order, transactionConfig: ActionPaymentTransactionConfig | GooglePaymentTransactionConfig, dialogState?: object): express.Response | null; + + /** + * Asks the Assistant to guide the user to grant a permission. For example, + * if you want your app to get access to the user's name, you would invoke + * the askForPermission method with a context containing the reason for the request, + * and the AssistantApp.SupportedPermissions.NAME permission. With this, the Assistant will ask + * the user, in your agent's voice, the following: '[Context with reason for the request], + * I'll just need to get your name from Google, is that OK?'. + * + * Once the user accepts or denies the request, the Assistant will fire another intent: + * assistant.intent.action.PERMISSION with a boolean argument: AssistantApp.BuiltInArgNames.PERMISSION_GRANTED + * and, if granted, the information that you requested. + * + * Read more: + * + * * {@link https://developers.google.com/actions/reference/conversation#ExpectedIntent|Supported Permissions} + * * Check if the permission has been granted with {@link AssistantApp#isPermissionGranted|isPermissionsGranted} + * * {@link AssistantApp#getDeviceLocation|getDeviceLocation} + * * {@link AssistantApp#getUserName|getUserName} + * + * @example + * const app = new DialogflowApp({request: req, response: res}); + * const REQUEST_PERMISSION_ACTION = 'request_permission'; + * const GET_RIDE_ACTION = 'get_ride'; + * + * function requestPermission (app) { + * const permission = app.SupportedPermissions.NAME; + * app.askForPermission('To pick you up', permission); + * } + * + * function sendRide (app) { + * if (app.isPermissionGranted()) { + * const displayName = app.getUserName().displayName; + * app.tell('I will tell your driver to pick up ' + displayName); + * } else { + * // Response shows that user did not grant permission + * app.tell('Sorry, I could not figure out who to pick up.'); + * } + * } + * const actionMap = new Map(); + * actionMap.set(REQUEST_PERMISSION_ACTION, requestPermission); + * actionMap.set(GET_RIDE_ACTION, sendRide); + * app.handleRequest(actionMap); + * + * @param context Context why permission is asked; it's the TTS + * prompt prefix (action phrase) we ask the user. + * @param permission One of the permissions Assistant supports, each of + * which comes from AssistantApp.SupportedPermissions. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. + * @return A response is sent to the Assistant to ask for the user's permission; + * for any invalid input, we return null. + * @actionssdk + * @dialogflow + */ + askForPermission(context: string, permission: string, dialogState?: object): express.Response | null; + + /** + * Returns true if the request follows a previous request asking for + * permission from the user and the user granted the permission(s). Otherwise, + * false. Use with {@link AssistantApp#askForPermissions|askForPermissions}. + * + * @example + * const app = new ActionsSdkApp({request: request, response: response}); + * // or + * const app = new DialogflowApp({request: request, response: response}); + * app.askForPermissions("To get you a ride", [ + * app.SupportedPermissions.NAME, + * app.SupportedPermissions.DEVICE_PRECISE_LOCATION + * ]); + * // ... + * // In response handler for subsequent intent: + * if (app.isPermissionGranted()) { + * // Use the requested permission(s) to get the user a ride + * } + * + * @return true if permissions granted. + * @dialogflow + * @actionssdk + */ + isPermissionGranted(): boolean; + + /** + * Asks user for delivery address. + * + * @example + * // For DialogflowApp: + * const app = new DialogflowApp({request, response}); + * const WELCOME_INTENT = 'input.welcome'; + * const DELIVERY_INTENT = 'delivery.address'; + * + * function welcomeIntent (app) { + * app.askForDeliveryAddress('To make sure I can deliver to you'); + * } + * + * function addressIntent (app) { + * const postalCode = app.getDeliveryAddress().postalAddress.postalCode; + * if (isInDeliveryZone(postalCode)) { + * app.tell('Great looks like you\'re in our delivery area!'); + * } else { + * app.tell('I\'m sorry it looks like we can\'t deliver to you.'); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(DELIVERY_INTENT, addressIntent); + * app.handleRequest(actionMap); + * + * // For ActionsSdkApp: + * const app = new ActionsSdkApp({request, response}); + * const WELCOME_INTENT = app.StandardIntents.MAIN; + * const DELIVERY_INTENT = app.StandardIntents.DELIVERY_ADDRESS; + * + * function welcomeIntent (app) { + * app.askForDeliveryAddress('To make sure I can deliver to you'); + * } + * + * function addressIntent (app) { + * const postalCode = app.getDeliveryAddress().postalAddress.postalCode; + * if (isInDeliveryZone(postalCode)) { + * app.tell('Great looks like you\'re in our delivery area!'); + * } else { + * app.tell('I\'m sorry it looks like we can\'t deliver to you.'); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(DELIVERY_INTENT, addressIntent); + * app.handleRequest(actionMap); + * + * @param reason Reason given to user for asking delivery address. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. + * @return HTTP response. + * @actionssdk + * @dialogflow + */ + askForDeliveryAddress(reason: string, dialogState?: object): express.Response | null; + + /** + * Asks user for a confirmation. + * + * @example + * const app = new DialogflowApp({ request, response }); + * const WELCOME_INTENT = 'input.welcome'; + * const CONFIRMATION = 'confirmation'; + * + * function welcomeIntent (app) { + * app.askForConfirmation('Are you sure you want to do that?'); + * } + * + * function confirmation (app) { + * if (app.getUserConfirmation()) { + * app.tell('Great! I\'m glad you want to do it!'); + * } else { + * app.tell('That\'s okay. Let\'s not do it now.'); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(CONFIRMATION, confirmation); + * app.handleRequest(actionMap); + * + * @param prompt The confirmation prompt presented to the user to + * query for an affirmative or negative response. If undefined or null, + * Google will use a generic yes/no prompt. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. Used in {@link ActionsSdkAssistant}. + * @return HTTP response. + * @actionssdk + * @dialogflow + */ + askForConfirmation(prompt?: string, dialogState?: object): express.Response | null; + + /** + * Asks user for a timezone-agnostic date and time. + * + * @example + * const app = new DialogflowApp({ request, response }); + * const WELCOME_INTENT = 'input.welcome'; + * const DATETIME = 'datetime'; + * + * function welcomeIntent (app) { + * app.askForDateTime('When do you want to come in?', + * 'Which date works best for you?', + * 'What time of day works best for you?'); + * } + * + * function datetime (app) { + * app.tell({speech: 'Great see you at your appointment!', + * displayText: 'Great, we will see you on ' + * + app.getDateTime().date.month + * + '/' + app.getDateTime().date.day + * + ' at ' + app.getDateTime().time.hours + * + (app.getDateTime().time.minutes || '')}); + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(DATETIME, datetime); + * app.handleRequest(actionMap); + * + * @param initialPrompt The initial prompt used to ask for a + * date and time. If undefined or null, Google will use a generic + * prompt. + * @param datePrompt The prompt used to specifically ask for the + * date if not provided by user. If undefined or null, Google will use a + * generic prompt. + * @param timePrompt The prompt used to specifically ask for the + * time if not provided by user. If undefined or null, Google will use a + * generic prompt. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. Used in {@link ActionsSdkAssistant}. + * @return HTTP response. + * @actionssdk + * @dialogflow + */ + askForDateTime(initialPrompt?: string, datePrompt?: string, timePrompt?: string, dialogState?: object): express.Response | null; + + /** + * Hands the user off to a web sign in flow. App sign in and OAuth credentials + * are set in the {@link https://console.actions.google.com|Actions Console}. + * Retrieve the access token in subsequent intents using + * app.getUser().accessToken. + * + * Note: Currently this API requires enabling the app for Transactions APIs. + * To do this, fill out the App Info section of the Actions Console project + * and check the box indicating the use of Transactions under "Privacy and + * consent". + * + * @example + * const app = new DialogflowApp({ request, response }); + * const WELCOME_INTENT = 'input.welcome'; + * const SIGN_IN = 'sign.in'; + * + * function welcomeIntent (app) { + * app.askForSignIn(); + * } + * + * function signIn (app) { + * if (app.getSignInStatus() === app.SignInstatus.OK) { + * let accessToken = app.getUser().accessToken; + * app.ask('Great, thanks for signing in!'); + * } else { + * app.ask('I won\'t be able to save your data, but let\'s continue!'); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(SIGN_IN, signIn); + * app.handleRequest(actionMap); + * + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. Used in {@link ActionsSdkAssistant}. + * @return HTTP response. + * @actionssdk + * @dialogflow + */ + askForSignIn(dialogState?: object): express.Response | null; + + /** + * Requests the user to switch to another surface during the conversation. + * + * @example + * const app = new DialogflowApp({ request, response }); + * const WELCOME_INTENT = 'input.welcome'; + * const SHOW_IMAGE = 'show.image'; + * + * function welcomeIntent (app) { + * if (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) { + * showPicture(app); + * } else if (app.hasAvailableSurfaceCapabilities(app.SurfaceCapabilities.SCREEN_OUTPUT)) { + * app.askForNewSurface('To show you an image', + * 'Check out this image', + * [app.SurfaceCapabilities.SCREEN_OUTPUT] + * ); + * } else { + * app.tell('This part of the app only works on screen devices. Sorry about that'); + * } + * } + * + * function showImage (app) { + * if (!app.isNewSurface()) { + * app.tell('Ok, I understand. You don't want to see pictures. Bye'); + * } else { + * showPicture(app, pictureType); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(SHOW_IMAGE, showImage); + * app.handleRequest(actionMap); + * + * @param context Context why new surface is requested; it's the TTS + * prompt prefix (action phrase) we ask the user. + * @param notificationTitle Title of the notification appearing on + * new surface device. + * @param capabilities The list of capabilities required in + * the surface. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. Used in {@link ActionsSdkAssistant}. + * @return HTTP response. + * @dialogflow + * @actionssdk + */ + askForNewSurface(context: string, notificationTitle: string, capabilities: SurfaceCapabilities[], dialogState?: object): express.Response | null; + + /** + * Gets the {@link User} object. + * The user object contains information about the user, including + * a string identifier and personal information (requires requesting permissions, + * see {@link AssistantApp#askForPermissions|askForPermissions}). + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * // or + * const app = new ActionsSdkApp({request: request, response: response}); + * const userId = app.getUser().userId; + * + * @return Null if no value. + * @actionssdk + * @dialogflow + */ + getUser(): User; + + /** + * If granted permission to user's name in previous intent, returns user's + * display name, family name, and given name. If name info is unavailable, + * returns null. + * + * @example + * const app = new DialogflowApp({request: req, response: res}); + * const REQUEST_PERMISSION_ACTION = 'request_permission'; + * const SAY_NAME_ACTION = 'get_name'; + * + * function requestPermission (app) { + * const permission = app.SupportedPermissions.NAME; + * app.askForPermission('To know who you are', permission); + * } + * + * function sayName (app) { + * if (app.isPermissionGranted()) { + * app.tell('Your name is ' + app.getUserName().displayName)); + * } else { + * // Response shows that user did not grant permission + * app.tell('Sorry, I could not get your name.'); + * } + * } + * const actionMap = new Map(); + * actionMap.set(REQUEST_PERMISSION_ACTION, requestPermission); + * actionMap.set(SAY_NAME_ACTION, sayName); + * app.handleRequest(actionMap); + * @return Null if name permission is not granted. + * @actionssdk + * @dialogflow + */ + getUserName(): UserName; + + /** + * Gets the user locale. Returned string represents the regional language + * information of the user set in their Assistant settings. + * For example, 'en-US' represents US English. + * + * @example + * const app = new DialogflowApp({request, response}); + * const locale = app.getUserLocale(); + * + * @return User's locale, e.g. 'en-US'. Null if no locale given. + * @actionssdk + * @dialogflow + */ + getUserLocale(): string; + + /** + * If granted permission to device's location in previous intent, returns device's + * location (see {@link AssistantApp#askForPermissions|askForPermissions}). + * If device info is unavailable, returns null. + * + * @example + * const app = new DialogflowApp({request: req, response: res}); + * // or + * const app = new ActionsSdkApp({request: req, response: res}); + * app.askForPermission("To get you a ride", + * app.SupportedPermissions.DEVICE_PRECISE_LOCATION); + * // ... + * // In response handler for permissions fallback intent: + * if (app.isPermissionGranted()) { + * sendCarTo(app.getDeviceLocation().coordinates); + * } + * + * @return Null if location permission is not granted. + * @actionssdk + * @dialogflow + */ + getDeviceLocation(): DeviceLocation; + + /** + * Gets type of input used for this request. + * @return One of AssistantApp.InputTypes. + * Null if no input type given. + * @dialogflow + * @actionssdk + */ + getInputType(): number | string; + + /** + * Get the argument value by name from the current intent. + * If the argument is included in originalRequest, and is not a text argument, + * the entire argument object is returned. + * + * Note: If incoming request is using an API version under 2 (e.g. 'v1'), + * the argument object will be in Proto2 format (snake_case, etc). + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * const WELCOME_INTENT = 'input.welcome'; + * const NUMBER_INTENT = 'input.number'; + * + * function welcomeIntent (app) { + * app.ask('Welcome to action snippets! Say a number.'); + * } + * + * function numberIntent (app) { + * const number = app.getArgument(NUMBER_ARGUMENT); + * app.tell('You said ' + number); + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(NUMBER_INTENT, numberIntent); + * app.handleRequest(actionMap); + * + * @param argName Name of the argument. + * @return Argument value matching argName + * or null if no matching argument. + * @dialogflow + * @actionssdk + */ + getArgumentCommon(argName: string): object; + + /** + * Gets transactability of user. Only use after calling + * askForTransactionRequirements. Null if no result given. + * + * @return One of Transactions.ResultType. + * @dialogflow + * @actionssdk + */ + getTransactionRequirementsResult(): string; + + /** + * Gets order delivery address. Only use after calling askForDeliveryAddress. + * + * @return Delivery address information. Null if user + * denies permission, or no address given. + * @dialogflow + * @actionssdk + */ + getDeliveryAddress(): Location; + + /** + * Gets transaction decision information. Only use after calling + * askForTransactionDecision. + * + * @return Transaction decision data. Returns object with + * userDecision only if user declines. userDecision will be one of + * Transactions.ConfirmationDecision. Null if no decision given. + * @dialogflow + * @actionssdk + */ + getTransactionDecision(): TransactionDecision; + + /** + * Gets confirmation decision. Use after askForConfirmation. + * + * @return False if user replied with negative response. Null if no user + * confirmation decision given. + * @dialogflow + * @actionssdk + */ + getUserConfirmation(): boolean | null; + + /** + * Gets user provided date and time. Use after askForDateTime. + * + * @return Date and time given by the user. Null if no user + * date and time given. + * @dialogflow + * @actionssdk + */ + getDateTime(): DateTime; + + /** + * Gets status of user sign in request. + * + * @return Result of user sign in request. One of + * DialogflowApp.SignInStatus or ActionsSdkApp.SignInStatus + * Null if no sign in status. + * @dialogflow + * @actionssdk + */ + getSignInStatus(): string; + + /** + * Returns true if user device has a given surface capability. + * + * @param requestedCapability Must be one of {@link SurfaceCapabilities}. + * @return True if user device has the given capability. + * + * @example + * const app = new DialogflowApp({request: req, response: res}); + * const DESCRIBE_SOMETHING = 'DESCRIBE_SOMETHING'; + * + * function describe (app) { + * if (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) { + * app.tell(richResponseWithBasicCard); + * } else { + * app.tell('Let me tell you about ...'); + * } + * } + * const actionMap = new Map(); + * actionMap.set(DESCRIBE_SOMETHING, describe); + * app.handleRequest(actionMap); + * + * @dialogflow + * @actionssdk + */ + hasSurfaceCapability(requestedCapability: SurfaceCapabilities): boolean; + + /** + * Gets surface capabilities of user device. + * + * @return Supported surface capabilities, as defined in + * AssistantApp.SurfaceCapabilities. + * @dialogflow + * @actionssdk + */ + getSurfaceCapabilities(): string[]; + + /** + * Returns the set of other available surfaces for the user. + * + * @return Empty if no available surfaces. + * @actionssdk + * @dialogflow + */ + getAvailableSurfaces(): Surface[]; + + /** + * Returns true if user has an available surface which includes all given + * capabilities. Available surfaces capabilities may exist on surfaces other + * than that used for an ongoing conversation. + * + * @param capabilities Must be one of + * {@link SurfaceCapabilities}. + * @return True if user has a capability available on some surface. + * + * @dialogflow + * @actionssdk + */ + hasAvailableSurfaceCapabilities(capabilities: SurfaceCapabilities | SurfaceCapabilities[]): boolean; + + /** + * Returns the result of the AskForNewSurface helper. + * + * @return True if user has triggered conversation on a new device + * following the NEW_SURFACE intent. + * @actionssdk + * @dialogflow + */ + isNewSurface(): boolean; + + /** + * Returns true if the app is being tested in sandbox mode. Enable sandbox + * mode in the (Actions console)[console.actions.google.com] to test + * transactions. + * + * @return True if app is being used in Sandbox mode. + * @dialogflow + * @actionssdk + */ + isInSandbox(): boolean; + + /** + * Returns the number of subsequent reprompts related to silent input from the + * user. This should be used along with the NO_INPUT intent to reprompt the + * user for input in cases where the Google Assistant could not pick up any + * speech. + * + * @example + * const app = new ActionsSdkApp({request, response}); + * + * function welcome (app) { + * app.ask('Welcome to your app!'); + * } + * + * function noInput (app) { + * if (app.getRepromptCount() === 0) { + * app.ask(`What was that?`); + * } else if (app.getRepromptCount() === 1) { + * app.ask(`Sorry I didn't catch that. Could you repeat yourself?`); + * } else if (app.isFinalReprompt()) { + * app.tell(`Okay let's try this again later.`); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(app.StandardIntents.MAIN, welcome); + * actionMap.set(app.StandardIntents.NO_INPUT, noInput); + * app.handleRequest(actionMap); + * + * @return The current reprompt count. Null if no reprompt count + * available (e.g. not in the NO_INPUT intent). + * @dialogflow + * @actionssdk + */ + getRepromptCount(): number; + + /** + * Returns true if it is the final reprompt related to silent input from the + * user. This should be used along with the NO_INPUT intent to give the final + * response to the user after multiple silences and should be an app.tell + * which ends the conversation. + * + * @example + * const app = new ActionsSdkApp({request, response}); + * + * function welcome (app) { + * app.ask('Welcome to your app!'); + * } + * + * function noInput (app) { + * if (app.getRepromptCount() === 0) { + * app.ask(`What was that?`); + * } else if (app.getRepromptCount() === 1) { + * app.ask(`Sorry I didn't catch that. Could you repeat yourself?`); + * } else if (app.isFinalReprompt()) { + * app.tell(`Okay let's try this again later.`); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(app.StandardIntents.MAIN, welcome); + * actionMap.set(app.StandardIntents.NO_INPUT, noInput); + * app.handleRequest(actionMap); + * + * @return True if in a NO_INPUT intent and this is the final turn + * of dialog. + * @dialogflow + * @actionssdk + */ + isFinalReprompt(): boolean; + + // --------------------------------------------------------------------------- + // Response Builders + // --------------------------------------------------------------------------- + + /** + * Constructs RichResponse with chainable property setters. + * + * @param richResponse RichResponse to clone. + * @return Constructed RichResponse. + */ + buildRichResponse(richResponse?: RichResponse): RichResponse; + + /** + * Constructs BasicCard with chainable property setters. + * + * @param bodyText Body text of the card. Can be set using setTitle + * instead. + * @return Constructed BasicCard. + */ + buildBasicCard(bodyText?: string): BasicCard; + + /** + * Constructs List with chainable property setters. + * + * @param title A title to set for a new List. + * @return Constructed List. + */ + buildList(title?: string): List; + + /** + * Constructs Carousel with chainable property setters. + * + * @return Constructed Carousel. + */ + buildCarousel(): Carousel; + + /** + * Constructs OptionItem with chainable property setters. + * + * @param key A unique key to identify this option. This key will + * be returned as an argument in the resulting actions.intent.OPTION + * intent. + * @param synonyms A list of synonyms which the user may + * use to identify this option instead of the option key. + * @return Constructed OptionItem. + */ + buildOptionItem(key?: string, synonyms?: string | string[]): OptionItem; + + // --------------------------------------------------------------------------- + // Transaction Builders + // --------------------------------------------------------------------------- + + /** + * Constructs Order with chainable property setters. + * + * @param orderId Unique identifier for the order. + * @return Constructed Order. + */ + buildOrder(orderId: string): Order; + + /** + * Constructs Cart with chainable property setters. + * + * @param cartId Unique identifier for the cart. + * @return Constructed Cart. + */ + buildCart(cartId?: string): Cart; + + /** + * Constructs LineItem with chainable property setters. + * Because of a previous bug, the parameters are swapped compared to + * the LineItem constructor to prevent a breaking change. + * + * @param name Name of the line item. + * @param id Unique identifier for the item. + * @return Constructed LineItem. + */ + buildLineItem(name: string, id: string): LineItem; + + /** + * Constructs OrderUpdate with chainable property setters. + * + * @param orderId Unique identifier of the order. + * @param isGoogleOrderId True if the order ID is provided by + * Google. False if the order ID is app provided. + * @return Constructed OrderUpdate. + */ + buildOrderUpdate(orderId: string, isGoogleOrderId: boolean): OrderUpdate; +} diff --git a/types/actions-on-google/dialogflow-app.d.ts b/types/actions-on-google/dialogflow-app.d.ts new file mode 100644 index 0000000000..ab768241c2 --- /dev/null +++ b/types/actions-on-google/dialogflow-app.d.ts @@ -0,0 +1,571 @@ +import * as express from 'express'; + +import { AssistantApp } from './assistant-app'; +import { Carousel, List, RichResponse, SimpleResponse } from './response-builder'; + +// --------------------------------------------------------------------------- +// Dialogflow support +// --------------------------------------------------------------------------- + +/** + * Dialogflow {@link https://dialogflow.com/docs/concept-contexts|Context}. + */ +export interface Context { + /** Full name of the context. */ + name: string; + /** + * Parameters carried within this context. + * See {@link https://dialogflow.com/docs/concept-actions#section-extracting-values-from-contexts|here}. + */ + parameters: object; + /** Remaining number of intents */ + lifespan: number; +} + +export interface DialogflowAppOptions { + /** Express HTTP request object. */ + request: express.Request; + /** Express HTTP response object. */ + response: express.Response; + /** + * Function callback when session starts. + * Only called if webhook is enabled for welcome/triggering intents, and + * called from Web Simulator or Google Home device (i.e., not Dialogflow simulator). + */ + sessionStarted?(): any; +} + +/** + * This is the class that handles the communication with Dialogflow's fulfillment API. + */ +export class DialogflowApp extends AssistantApp { + /** + * Constructor for DialogflowApp object. + * To be used in the Dialogflow fulfillment webhook logic. + * + * @example + * const DialogflowApp = require('actions-on-google').DialogflowApp; + * const app = new DialogflowApp({request: request, response: response, + * sessionStarted:sessionStarted}); + * + * @dialogflow + */ + constructor(options: DialogflowAppOptions); + + /** + * @deprecated + * Verifies whether the request comes from Dialogflow. + * + * @param key The header key specified by the developer in the + * Dialogflow Fulfillment settings of the app. + * @param value The private value specified by the developer inside the + * fulfillment header. + * @return True if the request comes from Dialogflow. + * @dialogflow + */ + isRequestFromApiAi(key: string, value: string): boolean; + + /** + * Verifies whether the request comes from Dialogflow. + * + * @param key The header key specified by the developer in the + * Dialogflow Fulfillment settings of the app. + * @param value The private value specified by the developer inside the + * fulfillment header. + * @return True if the request comes from Dialogflow. + * @dialogflow + */ + isRequestFromDialogflow(key: string, value: string): boolean; + + /** + * Get the current intent. Alternatively, using a handler Map with + * {@link AssistantApp#handleRequest|handleRequest}, + * the client library will automatically handle the incoming intents. + * 'Intent' in the Dialogflow context translates into the current action. + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * + * function responseHandler (app) { + * const intent = app.getIntent(); + * switch (intent) { + * case WELCOME_INTENT: + * app.ask('Welcome to action snippets! Say a number.'); + * break; + * + * case NUMBER_INTENT: + * const number = app.getArgument(NUMBER_ARGUMENT); + * app.tell('You said ' + number); + * break; + * } + * } + * + * app.handleRequest(responseHandler); + * + * @return Intent id or null if no value (action name). + * @dialogflow + */ + getIntent(): string; + + /** + * Get the argument value by name from the current intent. If the argument + * is included in originalRequest, and is not a text argument, the entire + * argument object is returned. + * + * Note: If incoming request is using an API version under 2 (e.g. 'v1'), + * the argument object will be in Proto2 format (snake_case, etc). + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * const WELCOME_INTENT = 'input.welcome'; + * const NUMBER_INTENT = 'input.number'; + * + * function welcomeIntent (app) { + * app.ask('Welcome to action snippets! Say a number.'); + * } + * + * function numberIntent (app) { + * const number = app.getArgument(NUMBER_ARGUMENT); + * app.tell('You said ' + number); + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(NUMBER_INTENT, numberIntent); + * app.handleRequest(actionMap); + * + * @param argName Name of the argument. + * @return Argument value matching argName + * or null if no matching argument. + * @dialogflow + */ + getArgument(argName: string): object; + + /** + * Get the context argument value by name from the current intent. Context + * arguments include parameters collected in previous intents during the + * lifespan of the given context. If the context argument has an original + * value, usually representing the underlying entity value, that will be given + * as part of the return object. + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * const WELCOME_INTENT = 'input.welcome'; + * const NUMBER_INTENT = 'input.number'; + * const OUT_CONTEXT = 'output_context'; + * const NUMBER_ARG = 'myNumberArg'; + * + * function welcomeIntent (app) { + * const parameters = {}; + * parameters[NUMBER_ARG] = '42'; + * app.setContext(OUT_CONTEXT, 1, parameters); + * app.ask('Welcome to action snippets! Ask me for your number.'); + * } + * + * function numberIntent (app) { + * const number = app.getContextArgument(OUT_CONTEXT, NUMBER_ARG); + * // number === { value: 42 } + * app.tell('Your number is ' + number.value); + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(NUMBER_INTENT, numberIntent); + * app.handleRequest(actionMap); + * + * @param contextName Name of the context. + * @param argName Name of the argument. + * @return Object containing value property and optional original + * property matching context argument. Null if no matching argument. + * @dialogflow + */ + getContextArgument(contextName: string, argName: string): object; + + /** + * Returns the RichResponse constructed in Dialogflow response builder. + * + * @example + * const app = new App({request: req, response: res}); + * + * function tellFact (app) { + * let fact = 'Google was founded in 1998'; + * + * if (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) { + * app.ask(app.getIncomingRichResponse().addSimpleResponse('Here\'s a ' + + * 'fact for you. ' + fact + ' Which one do you want to hear about ' + + * 'next, Google\'s history or headquarters?')); + * } else { + * app.ask('Here\'s a fact for you. ' + fact + ' Which one ' + + * 'do you want to hear about next, Google\'s history or headquarters?'); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set('tell.fact', tellFact); + * + * app.handleRequest(actionMap); + * + * @return RichResponse created in Dialogflow. If no RichResponse was + * created, an empty RichResponse is returned. + * @dialogflow + */ + getIncomingRichResponse(): RichResponse; + + /** + * Returns the List constructed in Dialogflow response builder. + * + * @example + * const app = new App({request: req, response: res}); + * + * function pickOption (app) { + * if (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) { + * app.askWithList('Which of these looks good?', + * app.getIncomingList().addItems( + * app.buildOptionItem('another_choice', ['Another choice']). + * setTitle('Another choice'))); + * } else { + * app.ask('What would you like?'); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set('pick.option', pickOption); + * + * app.handleRequest(actionMap); + * + * @return List created in Dialogflow. If no List was created, an empty + * List is returned. + * @dialogflow + */ + getIncomingList(): List; + + /** + * Returns the Carousel constructed in Dialogflow response builder. + * + * @example + * const app = new App({request: req, response: res}); + * + * function pickOption (app) { + * if (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) { + * app.askWithCarousel('Which of these looks good?', + * app.getIncomingCarousel().addItems( + * app.buildOptionItem('another_choice', ['Another choice']). + * setTitle('Another choice').setDescription('Choose me!'))); + * } else { + * app.ask('What would you like?'); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set('pick.option', pickOption); + * + * app.handleRequest(actionMap); + * + * @return Carousel created in Dialogflow. If no Carousel was created, + * an empty Carousel is returned. + * @dialogflow + */ + getIncomingCarousel(): Carousel; + + /** + * Returns the option key user chose from options response. + * + * @example + * const app = new App({request: req, response: res}); + * + * function pickOption (app) { + * if (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) { + * app.askWithCarousel('Which of these looks good?', + * app.getIncomingCarousel().addItems( + * app.buildOptionItem('another_choice', ['Another choice']). + * setTitle('Another choice').setDescription('Choose me!'))); + * } else { + * app.ask('What would you like?'); + * } + * } + * + * function optionPicked (app) { + * app.ask('You picked ' + app.getSelectedOption()); + * } + * + * const actionMap = new Map(); + * actionMap.set('pick.option', pickOption); + * actionMap.set('option.picked', optionPicked); + * + * app.handleRequest(actionMap); + * + * @return Option key of selected item. Null if no option selected or + * if current intent is not OPTION intent. + * @dialogflow + */ + getSelectedOption(): string; + + /** + * Asks to collect the user's input. + * {@link https://developers.google.com/actions/policies/general-policies#user_experience|The guidelines when prompting the user for a response must be followed at all times}. + * + * NOTE: Due to a bug, if you specify the no-input prompts, + * the mic is closed after the 3rd prompt, so you should use the 3rd prompt + * for a bye message until the bug is fixed. + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * const WELCOME_INTENT = 'input.welcome'; + * const NUMBER_INTENT = 'input.number'; + * + * function welcomeIntent (app) { + * app.ask('Welcome to action snippets! Say a number.', + * ['Say any number', 'Pick a number', 'We can stop here. See you soon.']); + * } + * + * function numberIntent (app) { + * const number = app.getArgument(NUMBER_ARGUMENT); + * app.tell('You said ' + number); + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(NUMBER_INTENT, numberIntent); + * app.handleRequest(actionMap); + * + * @param inputPrompt The input prompt + * response. + * @param noInputs Array of re-prompts when the user does not respond (max 3). + * @return HTTP response. + * @dialogflow + */ + ask(inputPrompt: string | SimpleResponse | RichResponse, noInputs?: string[]): express.Response | null; + + /** + * Asks to collect the user's input with a list. + * + * @example + * const app = new DialogflowApp({request, response}); + * const WELCOME_INTENT = 'input.welcome'; + * const OPTION_INTENT = 'option.select'; + * + * function welcomeIntent (app) { + * app.askWithList('Which of these looks good?', + * app.buildList('List title') + * .addItems([ + * app.buildOptionItem(SELECTION_KEY_ONE, + * ['synonym of KEY_ONE 1', 'synonym of KEY_ONE 2']) + * .setTitle('Title of First List Item'), + * app.buildOptionItem(SELECTION_KEY_TWO, + * ['synonym of KEY_TWO 1', 'synonym of KEY_TWO 2']) + * .setTitle('Title of Second List Item'), + * ])); + * } + * + * function optionIntent (app) { + * if (app.getSelectedOption() === SELECTION_KEY_ONE) { + * app.tell('Number one is a great choice!'); + * } else { + * app.tell('Number two is a great choice!'); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(OPTION_INTENT, optionIntent); + * app.handleRequest(actionMap); + * + * @param inputPrompt The input prompt + * response. + * @param.list List built with {@link AssistantApp#buildList|buildList} + * @return HTTP response. + * @dialogflow + */ + askWithList(inputPrompt: string | RichResponse | SimpleResponse, list: List): express.Response | null; + + /** + * Asks to collect the user's input with a carousel. + * + * @example + * const app = new DialogflowApp({request, response}); + * const WELCOME_INTENT = 'input.welcome'; + * const OPTION_INTENT = 'option.select'; + * + * function welcomeIntent (app) { + * app.askWithCarousel('Which of these looks good?', + * app.buildCarousel() + * .addItems([ + * app.buildOptionItem(SELECTION_KEY_ONE, + * ['synonym of KEY_ONE 1', 'synonym of KEY_ONE 2']) + * .setTitle('Number one'), + * app.buildOptionItem(SELECTION_KEY_TWO, + * ['synonym of KEY_TWO 1', 'synonym of KEY_TWO 2']) + * .setTitle('Number two'), + * ])); + * } + * + * function optionIntent (app) { + * if (app.getSelectedOption() === SELECTION_KEY_ONE) { + * app.tell('Number one is a great choice!'); + * } else { + * app.tell('Number two is a great choice!'); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(OPTION_INTENT, optionIntent); + * app.handleRequest(actionMap); + * + * @param inputPrompt The input prompt + * response. + * @param carousel Carousel built with + * {@link AssistantApp#buildCarousel|buildCarousel}. + * @return HTTP response. + * @dialogflow + */ + askWithCarousel(inputPrompt: string | RichResponse | SimpleResponse, carousel: Carousel): express.Response | null; + + /** + * Tells the Assistant to render the speech response and close the mic. + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * const WELCOME_INTENT = 'input.welcome'; + * const NUMBER_INTENT = 'input.number'; + * + * function welcomeIntent (app) { + * app.ask('Welcome to action snippets! Say a number.'); + * } + * + * function numberIntent (app) { + * const number = app.getArgument(NUMBER_ARGUMENT); + * app.tell('You said ' + number); + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(NUMBER_INTENT, numberIntent); + * app.handleRequest(actionMap); + * + * @param speechResponse Final response. + * Spoken response can be SSML. + * @return The response that is sent back to Assistant. + * @dialogflow + */ + tell(speechResponse: string | SimpleResponse | RichResponse): express.Response | null; + + /** + * Set a new context for the current intent. + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * const CONTEXT_NUMBER = 'number'; + * const NUMBER_ARGUMENT = 'myNumber'; + * + * function welcomeIntent (app) { + * app.setContext(CONTEXT_NUMBER); + * app.ask('Welcome to action snippets! Say a number.'); + * } + * + * function numberIntent (app) { + * const number = app.getArgument(NUMBER_ARGUMENT); + * app.tell('You said ' + number); + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(NUMBER_INTENT, numberIntent); + * app.handleRequest(actionMap); + * + * @param name Name of the context. Dialogflow converts to lowercase. + * @param [lifespan=1] Context lifespan. + * @param parameters Context JSON parameters. + * @return Null if the context name is not defined. + * @dialogflow + */ + setContext(name: string, lifespan?: number, parameters?: any): null | undefined; + + /** + * Returns the incoming contexts for this intent. + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * const CONTEXT_NUMBER = 'number'; + * const NUMBER_ARGUMENT = 'myNumber'; + * + * function welcomeIntent (app) { + * app.setContext(CONTEXT_NUMBER); + * app.ask('Welcome to action snippets! Say a number.'); + * } + * + * function numberIntent (app) { + * let contexts = app.getContexts(); + * // contexts === [{ + * // name: 'number', + * // lifespan: 0, + * // parameters: { + * // myNumber: '23', + * // myNumber.original: '23' + * // } + * // }] + * const number = app.getArgument(NUMBER_ARGUMENT); + * app.tell('You said ' + number); + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(NUMBER_INTENT, numberIntent); + * app.handleRequest(actionMap); + * + * @return Empty if no active contexts. + * @dialogflow + */ + getContexts(): Context[]; + + /** + * Returns the incoming context by name for this intent. + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * const CONTEXT_NUMBER = 'number'; + * const NUMBER_ARGUMENT = 'myNumber'; + * + * function welcomeIntent (app) { + * app.setContext(CONTEXT_NUMBER); + * app.ask('Welcome to action snippets! Say a number.'); + * } + * + * function numberIntent (app) { + * let context = app.getContext(CONTEXT_NUMBER); + * // context === { + * // name: 'number', + * // lifespan: 0, + * // parameters: { + * // myNumber: '23', + * // myNumber.original: '23' + * // } + * // } + * const number = app.getArgument(NUMBER_ARGUMENT); + * app.tell('You said ' + number); + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_INTENT, welcomeIntent); + * actionMap.set(NUMBER_INTENT, numberIntent); + * app.handleRequest(actionMap); + * + * @param name The name of the Context to retrieve. + * @return Context value matching name + * or null if no matching context. + * @dialogflow + */ + getContext(name: string): object; + + /** + * Gets the user's raw input query. + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * app.tell('You said ' + app.getRawInput()); + * + * @return User's raw query or null if no value. + * @dialogflow + */ + getRawInput(): string; +} diff --git a/types/actions-on-google/index.d.ts b/types/actions-on-google/index.d.ts new file mode 100644 index 0000000000..5f7baba3b8 --- /dev/null +++ b/types/actions-on-google/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for actions-on-google 1.5 +// Project: https://github.com/actions-on-google/actions-on-google-nodejs +// Definitions by: Joel Hegg +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/** + * The Actions on Google client library. + * https://developers.google.com/actions/ + */ + +import * as Transactions from './transactions'; +import * as Responses from './response-builder'; + +export { AssistantApp } from './assistant-app'; +export { ActionsSdkApp, ActionsSdkAppOptions } from './actions-sdk-app'; +export { DialogflowApp, DialogflowAppOptions } from './dialogflow-app'; +export { Transactions }; +export { Responses }; +// Backwards compatibility +export { AssistantApp as Assistant } from './assistant-app'; +export { ActionsSdkApp as ActionsSdkAssistant } from './actions-sdk-app'; +export { DialogflowApp as ApiAiAssistant } from './dialogflow-app'; +export { DialogflowApp as ApiAiApp } from './dialogflow-app'; diff --git a/types/actions-on-google/response-builder.d.ts b/types/actions-on-google/response-builder.d.ts new file mode 100644 index 0000000000..1e11984551 --- /dev/null +++ b/types/actions-on-google/response-builder.d.ts @@ -0,0 +1,386 @@ +/** + * A collection of response builders. + */ + +import { OrderUpdate } from './transactions'; + +/** + * Simple Response type. + */ +export interface SimpleResponse { + /** Speech to be spoken to user. SSML allowed. */ + speech: string; + /** Optional text to be shown to user */ + displayText?: string; +} + +/** + * Suggestions to show with response. + */ +export interface Suggestion { + /** Text of the suggestion. */ + title: string; +} + +/** + * Link Out Suggestion. Used in rich response as a suggestion chip which, when + * selected, links out to external URL. + */ +export interface LinkOutSuggestion { + /** Text shown on the suggestion chip. */ + title: string; + /** String URL to open. */ + url: string; +} + +/** + * Image type shown on visual elements. + */ +export interface Image { + /** Image source URL. */ + url: string; + /** Text to replace for image for accessibility. */ + accessibilityText: string; + /** Width of the image. */ + width: number; + /** Height of the image. */ + height: number; +} + +/** + * Basic Card Button. Shown below basic cards. Open a URL when selected. + */ +export interface Button { + /** Text shown on the button. */ + title: string; + /** Action to take when selected. */ + openUrlAction: { + /** String URL to open. */ + url: string; + }; +} + +/** + * Option info. Provides unique identifier for a given OptionItem. + */ +export interface OptionInfo { + /** Unique string ID for this option. */ + key: string; + /** Synonyms that can be used by the user to indicate this option if they do not use the key. */ + synonyms: string[]; +} + +/** + * Class for initializing and constructing Rich Responses with chainable interface. + */ +export class RichResponse { + /** + * Constructor for RichResponse. Accepts optional RichResponse to clone. + * + * @param richResponse Optional RichResponse to clone. + */ + constructor(richResponse?: RichResponse); + + /** + * Ordered list of either SimpleResponse objects or BasicCard objects. + * First item must be SimpleResponse. There can be at most one card. + */ + items: Array; + + /** + * Ordered list of text suggestions to display. Optional. + */ + suggestions: Suggestion[]; + + /** + * Link Out Suggestion chip for this rich response. Optional. + */ + linkOutSuggestion?: LinkOutSuggestion; + + /** + * Adds a SimpleResponse to list of items. + * + * @param simpleResponse Simple response to present to + * user. If just a string, display text will not be set. + * @return Returns current constructed RichResponse. + */ + addSimpleResponse(simpleResponse: string | SimpleResponse): RichResponse; + + /** + * Adds a BasicCard to list of items. + * + * @param basicCard Basic card to include in response. + * @return Returns current constructed RichResponse. + */ + addBasicCard(basicCard: BasicCard): RichResponse; + + /** + * Adds a single suggestion or list of suggestions to list of items. + * + * @param suggestions Either a single string suggestion + * or list of suggestions to add. + * @return Returns current constructed RichResponse. + */ + addSuggestions(suggestions: string | string[]): RichResponse; + + /** + * Returns true if the given suggestion text is valid to be added to the suggestion list. A valid + * text string is not longer than 25 characters. + * @param suggestionText Text to validate as suggestion. + * @return True if the text is valid, false otherwise.s + */ + isValidSuggestionText(suggestionText: string): boolean; + + /** + * Sets the suggestion link for this rich response. + * + * @param destinationName Name of the link out destination. + * @param suggestionUrl - String URL to open when suggestion is used. + * @return Returns current constructed RichResponse. + */ + addSuggestionLink(destinationName: string, suggestionUrl: string): RichResponse; + + /** + * Adds an order update to this response. Use after a successful transaction + * decision to confirm the order. + * + * @param orderUpdate OrderUpdate object to add. + * @return Returns current constructed RichResponse. + */ + addOrderUpdate(orderUpdate: OrderUpdate): RichResponse; +} + +/** + * Class for initializing and constructing Basic Cards with chainable interface. + */ +export class BasicCard { + /** + * Constructor for BasicCard. Accepts optional BasicCard to clone. + * + * @param basicCard Optional BasicCard to clone. + */ + constructor(basicCard?: BasicCard); + + /** + * Title of the card. Optional. + */ + title?: string; + + /** + * Body text to show on the card. Required, unless image is present. + */ + formattedText: string; + + /** + * Subtitle of the card. Optional. + */ + subtitle?: string; + + /** + * Image to show on the card. Optional. + */ + image?: Image; + + /** + * Ordered list of buttons to show below card. Optional. + */ + buttons: Button[]; + + /** + * Sets the title for this Basic Card. + * + * @param title Title to show on card. + * @return Returns current constructed BasicCard. + */ + setTitle(title: string): BasicCard; + + /** + * Sets the subtitle for this Basic Card. + * + * @param subtitle Subtitle to show on card. + * @return Returns current constructed BasicCard. + */ + setSubtitle(subtitle: string): BasicCard; + + /** + * Sets the body text for this Basic Card. + * + * @param bodyText Body text to show on card. + * @return Returns current constructed BasicCard. + */ + setBodyText(bodyText: string): BasicCard; + + /** + * Sets the image for this Basic Card. + * + * @param url Image source URL. + * @param accessibilityText Text to replace for image for + * accessibility. + * @param width Width of the image. + * @param height Height of the image. + * @return Returns current constructed BasicCard. + */ + setImage(url: string, accessibilityText: string, width?: number, height?: number): BasicCard; + + /** + * Adds a button below card. + * + * @param text Text to show on button. + * @param url URL to open when button is selected. + * @return Returns current constructed BasicCard. + */ + addButton(text: string, url: string): BasicCard; +} + +/** + * Class for initializing and constructing Lists with chainable interface. + */ +export class List { + /** + * Constructor for List. Accepts optional List to clone, string title, or + * list of items to copy. + * + * @param list Either a list to clone, a title + * to set for a new List, or an array of OptionItem to initialize a new + * list. + */ + constructor(list?: List | string | OptionItem[]); + + /** + * Title of the list. Optional. + */ + title?: string; + + /** + * List of 2-20 items to show in this list. Required. + */ + items: OptionItem[]; + + /** + * Sets the title for this List. + * + * @param title Title to show on list. + * @return Returns current constructed List. + */ + setTitle(title: string): List; + + /** + * Adds a single item or list of items to the list. + * + * @param optionItems OptionItems to add. + * @return Returns current constructed List. + */ + addItems(optionItems: OptionItem | OptionItem[]): List; +} + +/** + * Class for initializing and constructing Carousel with chainable interface. + */ +export class Carousel { + /** + * Constructor for Carousel. Accepts optional Carousel to clone or list of + * items to copy. + * + * @param carousel Either a carousel to clone + * or an array of OptionItem to initialize a new carousel + */ + constructor(carousel?: Carousel | OptionItem[]); + + /** + * List of 2-20 items to show in this carousel. Required. + */ + items: OptionItem[]; + + /** + * Adds a single item or list of items to the carousel. + * + * @param optionItems OptionItems to add. + * @return Returns current constructed Carousel. + */ + addItems(optionItems: OptionItem | OptionItem[]): Carousel; +} + +/** + * Class for initializing and constructing Option Items with chainable interface. + */ +export class OptionItem { + /** + * Constructor for OptionItem. Accepts optional OptionItem to clone. + * + * @param optionItem Optional OptionItem to clone. + */ + constructor(optionItem?: OptionItem); + + /** + * Option info of the option item. Required. + */ + optionInfo: OptionInfo; + + /** + * Title of the option item. Required. + */ + title: string; + + /** + * Description text of the item. Optional. + */ + description?: string; + + /** + * Image to show on item. Optional. + */ + image?: Image; + + /** + * Sets the title for this Option Item. + * + * @param title Title to show on item. + * @return Returns current constructed OptionItem. + */ + setTitle(title: string): OptionItem; + + /** + * Sets the description for this Option Item. + * + * @param description Description to show on item. + * @return Returns current constructed OptionItem. + */ + setDescription(description: string): OptionItem; + + /** + * Sets the image for this Option Item. + * + * @param url Image source URL. + * @param accessibilityText Text to replace for image for + * accessibility. + * @param width Width of the image. + * @param height Height of the image. + * @return Returns current constructed OptionItem. + */ + setImage(url: string, accessibilityText: string, width?: number, height?: number): OptionItem; + + /** + * Sets the key for the OptionInfo of this Option Item. This will be returned + * as an argument in the resulting actions.intent.OPTION intent. + * + * @param key Key to uniquely identify this item. + * @return Returns current constructed OptionItem. + */ + setKey(key: string): OptionItem; + + /** + * Adds a single synonym or list of synonyms to item. + * + * @param synonyms Either a single string synonyms + * or list of synonyms to add. + * @return Returns current constructed OptionItem. + */ + addSynonyms(synonyms: string | string[]): OptionItem; +} + +/** + * Check if given text contains SSML. + * @param text Text to check. + * @return True if text contains SSML, false otherwise. + */ +export function isSsml(text: string): boolean; diff --git a/types/actions-on-google/transactions.d.ts b/types/actions-on-google/transactions.d.ts new file mode 100644 index 0000000000..8cc26165db --- /dev/null +++ b/types/actions-on-google/transactions.d.ts @@ -0,0 +1,1023 @@ +/** + * A collection of Transaction related constants, utility functions, and + * builders. + */ + +import { Image } from './response-builder'; + +/** + * Price type. + */ +export interface Price { + /** One of Transaction.PriceType. */ + type: PriceType; + amount: { + /** Currency code of price. */ + currencyCode: string; + /** Unit count of price. */ + units: number; + /** Partial unit count of price. */ + nanos?: number; + }; +} + +/** + * Order rejection info. + */ +export interface RejectionInfo { + /** One of Transaction.RejectionType. */ + type: RejectionType; + /** Reason for the order rejection. */ + reason: string; +} + +/** + * Order receipt info. + */ +export interface ReceiptInfo { + /** Action provided order ID. Used when the order has been received by the integrator. */ + confirmedActionOrderId: string; +} + +/** + * Order cancellation info. + */ +export interface CancellationInfo { + /** Reason for the cancellation. */ + reason: string; +} + +/** + * Order transit info. + */ +export interface TransitInfo { + /** UTC timestamp of the transit update. */ + updatedTime: { + /** Seconds since Unix epoch. */ + seconds: number; + /** Partial seconds since Unix epoch. */ + nanos?: number; + }; +} + +/** + * Order fulfillment info. + */ +export interface FulfillmentInfo { + /** UTC timestamp of the fulfillment update. */ + deliveryTime: { + /** Seconds since Unix epoch. */ + seconds: number; + /** Partial seconds since Unix epoch. */ + nanos?: number; + }; +} + +/** + * Order return info. + */ +export interface ReturnInfo { + /** Reason for the return. */ + reason: string; +} + +/** + * Transaction config for transactions not involving a Google provided + * payment instrument. + */ +export interface ActionPaymentTransactionConfig { + /** True if delivery address is required for the transaction. */ + deliveryAddressRequired: boolean; + /** One of Transactions.PaymentType. */ + type: PaymentType; + /** The name of the instrument displayed on receipt. For example, for card payment, could be "VISA-1234". */ + displayName: string; + customerInfoOptions?: CustomerInfoOptions; +} + +/** + * Transaction config for transactions involving a Google provided payment + * instrument. + */ +export interface GooglePaymentTransactionConfig { + /** True if delivery address is required for the transaction. */ + deliveryAddressRequired: boolean; + /** Tokenization parameters provided by payment gateway. */ + tokenizationParameters: object; + /** List of accepted card networks. Must be any number of Transactions.CardNetwork. */ + cardNetworks: CardNetwork[]; + /** True if prepaid cards are not allowed for transaction. */ + prepaidCardDisallowed: boolean; + customerInfoOptions?: CustomerInfoOptions; +} + +/** + * Customer information requested as part of the transaction + */ +export interface CustomerInfoOptions { + customerInfoProperties: string[]; +} + +/** + * Generic Location type. + */ +export interface Location { + postalAddress: { + regionCode: string; + languageCode: string; + postalCode: string; + administrativeArea: string; + locality: string; + addressLines: string[]; + recipients: string; + }; + phoneNumber: string; + notes: string; +} + +/** + * Decision and order information returned when calling getTransactionDecision(). + */ +export interface TransactionDecision { + /** One of Transactions.ConfirmationDecision. */ + userDecision: ConfirmationDecision; + checkResult: { + /** One of Transactions.ResultType. */ + resultType: ResultType; + }; + order: { + /** The proposed order used in the transaction decision. */ + finalOrder: Order; + /** Order ID assigned by Google. */ + googleOrderId: string; + /** User visible order ID set in proposed order. */ + actionOrderId: string; + orderDate: { + seconds: string; + nanos: number; + }; + paymentInfo: object; + customerInfo: { + /** Customer email. */ + email: string; + }; + }; + /** + * The delivery address if user requested. + * Will appear if userDecision is Transactions.DELIVERY_ADDRESS_UPDATED. + */ + deliveryAddress: Location; +} + +/** + * Values related to supporting transactions + */ +export const TransactionValues: { + /** List of transaction card networks available when paying with Google. */ + readonly CardNetwork: typeof CardNetwork; + /** List of possible item types. */ + readonly ItemType: typeof ItemType; + /** List of price types. */ + readonly PriceType: typeof PriceType; + /** List of possible item types. */ + readonly PaymentType: typeof PaymentType; + /** List of customer information properties that can be requested. */ + readonly CustomerInfoProperties: typeof CustomerInfoProperties; + /** List of possible order confirmation user decisions */ + readonly ConfirmationDecision: typeof ConfirmationDecision; + /** List of possible order states. */ + readonly OrderState: typeof OrderState; + /** List of possible actions to take on the order. */ + readonly OrderAction: typeof OrderAction; + /** List of possible types of order rejection. */ + readonly RejectionType: typeof RejectionType; + /** List of possible order state objects. */ + readonly OrderStateInfo: typeof OrderStateInfo; + /** List of possible order transaction requirements check result types. */ + readonly ResultType: typeof ResultType; + /** List of possible user decisions to give delivery address. */ + readonly DeliveryAddressDecision: typeof DeliveryAddressDecision; + /** List of possible order location types. */ + readonly LocationType: typeof LocationType; + /** List of possible order time types. */ + readonly TimeType: typeof TimeType; +}; + +/** + * List of transaction card networks available when paying with Google. + */ +export enum CardNetwork { + /** + * Unspecified. + */ + UNSPECIFIED, + /** + * American Express. + */ + AMEX, + /** + * Discover. + */ + DISCOVER, + /** + * Master Card. + */ + MASTERCARD, + /** + * Visa. + */ + VISA, + /** + * JCB. + */ + JCB +} + +/** + * List of possible item types. + */ +export enum ItemType { + /** + * Unspecified. + */ + UNSPECIFIED, + /** + * Regular. + */ + REGULAR, + /** + * Tax. + */ + TAX, + /** + * Discount + */ + DISCOUNT, + /** + * Gratuity + */ + GRATUITY, + /** + * Delivery + */ + DELIVERY, + /** + * Subtotal + */ + SUBTOTAL, + /** + * Fee. For everything else, there's fee. + */ + FEE +} + +/** + * List of price types. + */ +export enum PriceType { + /** + * Unknown. + */ + UNKNOWN, + /** + * Estimate. + */ + ESTIMATE, + /** + * Actual. + */ + ACTUAL +} + +/** + * List of possible item types. + */ +export enum PaymentType { + /** + * Unspecified. + */ + UNSPECIFIED, + /** + * Payment card. + */ + PAYMENT_CARD, + /** + * Bank. + */ + BANK, + /** + * Loyalty program. + */ + LOYALTY_PROGRAM, + /** + * On order fulfillment, such as cash on delivery. + */ + ON_FULFILLMENT, + /** + * Gift card. + */ + GIFT_CARD +} + +/** + * List of customer information properties that can be requested. + */ +export enum CustomerInfoProperties { + EMAIL +} + +/** + * List of possible order confirmation user decisions + */ +export enum ConfirmationDecision { + /** + * Order was approved by user. + */ + ACCEPTED, + /** + * Order was declined by user. + */ + REJECTED, + /** + * Order was not declined, but the delivery address was updated during + * confirmation. + */ + DELIVERY_ADDRESS_UPDATED, + /** + * Order was not declined, but the cart was updated during confirmation. + */ + CART_CHANGE_REQUESTED +} + +/** + * List of possible order states. + */ +export enum OrderState { + /** + * Order was rejected. + */ + REJECTED, + /** + * Order was confirmed by integrator and is active. + */ + CONFIRMED, + /** + * User cancelled the order. + */ + CANCELLED, + /** + * Order is being delivered. + */ + IN_TRANSIT, + /** + * User performed a return. + */ + RETURNED, + /** + * User received what was ordered. + */ + FULFILLED +} + +/** + * List of possible actions to take on the order. + */ +export enum OrderAction { + /** + * View details. + */ + VIEW_DETAILS, + /** + * Modify order. + */ + MODIFY, + /** + * Cancel order. + */ + CANCEL, + /** + * Return order. + */ + RETURN, + /** + * Exchange order. + */ + EXCHANGE, + /** + * Email. + */ + EMAIL, + /** + * Call. + */ + CALL, + /** + * Reorder. + */ + REORDER, + /** + * Review. + */ + REVIEW +} + +/** + * List of possible types of order rejection. + */ +export enum RejectionType { + /** + * Unknown + */ + UNKNOWN, + /** + * Payment was declined. + */ + PAYMENT_DECLINED +} + +/** + * List of possible order state objects. + */ +export enum OrderStateInfo { + /** + * Information about order rejection. Used with {@link RejectionInfo}. + */ + REJECTION, + /** + * Information about order receipt. Used with {@link ReceiptInfo}. + */ + RECEIPT, + /** + * Information about order cancellation. Used with {@link CancellationInfo}. + */ + CANCELLATION, + /** + * Information about in-transit order. Used with {@link TransitInfo}. + */ + IN_TRANSIT, + /** + * Information about order fulfillment. Used with {@link FulfillmentInfo}. + */ + FULFILLMENT, + /** + * Information about order return. Used with {@link ReturnInfo}. + */ + RETURN +} + +/** + * List of possible order transaction requirements check result types. + */ +export enum ResultType { + /** + * Unspecified. + */ + UNSPECIFIED, + /** + * OK to continue transaction. + */ + OK, + /** + * User is expected to take action, e.g. enable payments, to continue + * transaction. + */ + USER_ACTION_REQUIRED, + /** + * Transactions are not supported on current device/surface. + */ + ASSISTANT_SURFACE_NOT_SUPPORTED, + /** + * Transactions are not supported for current region/country. + */ + REGION_NOT_SUPPORTED +} + +/** + * List of possible user decisions to give delivery address. + */ +export enum DeliveryAddressDecision { + /** + * Unknown. + */ + UNKNOWN, + /** + * User granted delivery address. + */ + ACCEPTED, + /** + * User denied to give delivery address. + */ + REJECTED +} + +/** + * List of possible order location types. + */ +export enum LocationType { + /** + * Unknown. + */ + UNKNOWN, + /** + * Delivery location for an order. + */ + DELIVERY, + /** + * Business location of order provider. + */ + BUSINESS, + /** + * Origin of the order. + */ + ORIGIN, + /** + * Destination of the order. + */ + DESTINATION +} + +/** + * List of possible order time types. + */ +export enum TimeType { + /** + * Unknown. + */ + UNKNOWN, + /** + * Date of delivery for the order. + */ + DELIVERY_DATE, + /** + * Estimated Time of Arrival for order. + */ + ETA, + /** + * Reservation time. + */ + RESERVATION_SLOT +} + +/** + * Class for initializing and constructing Order with chainable interface. + */ +export class Order { + /** + * Constructor for Order. + * + * @param orderId Unique identifier for the order. + */ + constructor(orderId: string); + + /** + * ID for the order. Required. + */ + id: string; + + /** + * Cart for the order. + */ + cart?: Cart; + + /** + * Items not held in the order cart. + */ + otherItems: LineItem[]; + + /** + * Image for the order. + */ + image?: Image; + + /** + * TOS for the order. + */ + termsOfServiceUrl?: string; + + /** + * Total price for the order. + */ + totalPrice?: Price; + + /** + * Extensions for this order. Used for vertical-specific order attributes, + * like times and locations. + */ + extension?: object; + + /** + * Set the cart for this order. + * + * @param cart Cart for this order. + * @return Returns current constructed Order. + */ + setCart(cart: Cart): Order; + + /** + * Adds a single item or list of items to the non-cart items list. + * + * @param items Line Items to add. + * @return Returns current constructed Order. + */ + addOtherItems(items: LineItem | LineItem[]): Order; + + /** + * Sets the image for this order. + * + * @param url Image source URL. + * @param accessibilityText Text to replace for image for + * accessibility. + * @param width Width of the image. + * @param height Height of the image. + * @return Returns current constructed Order. + */ + setImage(url: string, accessibilityText: string, width?: number, height?: number): Order; + + /** + * Set the TOS for this order. + * + * @param url String URL of the TOS. + * @return Returns current constructed Order. + */ + setTermsOfService(url: string): Order; + + /** + * Sets the total price for this order. + * + * @param priceType One of TransactionValues.PriceType. + * @param currencyCode Currency code of price. + * @param units Unit count of price. + * @param nanos Partial unit count of price. + * @return Returns current constructed Order. + */ + setTotalPrice(priceType: PriceType, currencyCode: string, units: number, nanos?: number): Order; + + /** + * Adds an associated location to the order. Up to 2 locations can be added. + * + * @param type One of TransactionValues.LocationType. + * @param location Location to add. + * @return Returns current constructed Order. + */ + addLocation(type: LocationType, location: Location): Order; + + /** + * Sets an associated time to the order. + * + * @param type One of TransactionValues.TimeType. + * @param time Time to add. Time should be ISO 8601 representation + * of time value. Could be date, datetime, or duration. + * @return Returns current constructed Order. + */ + setTime(type: TimeType, time: string): Order; +} + +/** + * Class for initializing and constructing Cart with chainable interface. + */ +export class Cart { + /** + * Constructor for Cart. + * + * @param cartId Optional unique identifier for the cart. + */ + constructor(cartId?: string); + + /** + * ID for the cart. Optional. + */ + id?: string; + + /** + * Merchant providing the cart. + */ + merchant?: object; + + /** + * Optional notes about the cart. + */ + notes?: string; + + /** + * Items held in the order cart. + */ + lineItems: LineItem[]; + + /** + * Non-line items. + */ + otherItems: LineItem[]; + + /** + * Set the merchant for this cart. + * + * @param id Merchant ID. + * @param name Name of the merchant. + * @return Returns current constructed Cart. + */ + setMerchant(id: string, name: string): Cart; + + /** + * Set the notes for this cart. + * + * @param notes Notes. + * @return Returns current constructed Cart. + */ + setNotes(notes: string): Cart; + + /** + * Adds a single item or list of items to the cart. + * + * @param items Line Items to add. + * @return Returns current constructed Cart. + */ + addLineItems(items: LineItem | LineItem[]): Cart; + + /** + * Adds a single item or list of items to the non-items list of this cart. + * + * @param items Line Items to add. + * @return Returns current constructed Cart. + */ + addOtherItems(items: LineItem | LineItem[]): Cart; +} + +/** + * Class for initializing and constructing LineItem with chainable interface. + */ +export class LineItem { + /** + * Constructor for LineItem. + * + * @param lineItemId Unique identifier for the item. + * @param name Name of the item. + */ + constructor(lineItemId: string, name: string); + + /** + * Item ID. + */ + id: string; + + /** + * Name of the item. + */ + name: string; + + /** + * Item price. + */ + price?: Price; + + /** + * Sublines for current item. Only valid if item type is REGULAR. + */ + subLines?: Array; + + /** + * Image of the item. + */ + image?: Image; + + /** + * Type of the item. One of TransactionValues.ItemType. + */ + type?: ItemType; + + /** + * Quantity of the item. + */ + quantity?: number; + + /** + * Description for the item. + */ + description?: string; + + /** + * Offer ID for the item. + */ + offerId?: string; + + /** + * Adds a single item or list of items or notes to the sublines. Only valid + * if item type is REGULAR. + * + * @param items Sublines to add. + * @return Returns current constructed LineItem. + */ + addSublines(items: string | LineItem | Array): LineItem; + + /** + * Sets the image for this item. + * + * @param url Image source URL. + * @param accessibilityText Text to replace for image for + * accessibility. + * @param width Width of the image. + * @param height Height of the image. + * @return Returns current constructed LineItem. + */ + setImage(url: string, accessibilityText: string, width?: number, height?: number): LineItem; + + /** + * Sets the price of this item. + * + * @param priceType One of TransactionValues.PriceType. + * @param currencyCode Currency code of price. + * @param units Unit count of price. + * @param nanos Partial unit count of price. + * @return Returns current constructed LineItem. + */ + setPrice(priceType: PriceType, currencyCode: string, units: number, nanos?: number): LineItem; + + /** + * Set the type of the item. + * + * @param type Type of the item. One of TransactionValues.ItemType. + * @return Returns current constructed LineItem. + */ + setType(type: ItemType): LineItem; + + /** + * Set the quantity of the item. + * + * @param quantity Quantity of the item. + * @return Returns current constructed LineItem. + */ + setQuantity(quantity: number): LineItem; + + /** + * Set the description of the item. + * + * @param description Description of the item. + * @return Returns current constructed LineItem. + */ + setDescription(description: string): LineItem; + + /** + * Set the Offer ID of the item. + * + * @param offerId Offer ID of the item. + * @return Returns current constructed LineItem. + */ + setOfferId(offerId: string): LineItem; +} + +/** + * Class for initializing and constructing OrderUpdate with chainable interface. + */ +export class OrderUpdate { + /** + * Constructor for OrderUpdate. + * + * @param orderId Unique identifier of the order. + * @param isGoogleOrderId True if the order ID is provided by + * Google. False if the order ID is app provided. + */ + constructor(orderId: string, isGoogleOrderId: boolean); + + /** + * Google provided identifier of the order. + */ + googleOrderId?: string; + + /** + * App provided identifier of the order. + */ + actionOrderId?: string; + + /** + * State of the order. + */ + orderState?: object; + + /** + * Updates for items in the order. Mapped by item id to state or price. + */ + lineItemUpdates: object; + + /** + * UTC timestamp of the order update. + */ + updateTime?: object; + + /** + * Actionable items presented to the user to manage the order. + */ + orderManagementActions: object[]; + + /** + * Notification content to the user for the order update. + */ + userNotification?: object; + + /** + * Updated total price of the order. + */ + totalPrice?: Price; + + /** + * Set the Google provided order ID of the order. + * + * @param orderId Google provided order ID. + * @return Returns current constructed OrderUpdate. + */ + setGoogleOrderId(orderId: string): OrderUpdate; + + /** + * Set the Action provided order ID of the order. + * + * @param orderId Action provided order ID. + * @return Returns current constructed OrderUpdate. + */ + setActionOrderId(orderId: string): OrderUpdate; + + /** + * Set the state of the order. + * + * @param state One of TransactionValues.OrderState. + * @param label Label for the order state. + * @return Returns current constructed OrderUpdate. + */ + setOrderState(state: OrderState, label: string): OrderUpdate; + + /** + * Set the update time of the order. + * + * @param seconds Seconds since Unix epoch. + * @param nanos Partial time units. + * @return Returns current constructed OrderUpdate. + */ + setUpdateTime(seconds: number, nanos?: number): OrderUpdate; + + /** + * Set the user notification content of the order update. + * + * @param title Title of the notification. + * @param text Text of the notification. + * @return Returns current constructed OrderUpdate. + */ + setUserNotification(title: string, text: object): OrderUpdate; + + /** + * Sets the total price for this order. + * + * @param priceType One of TransactionValues.PriceType. + * @param currencyCode Currency code of price. + * @param units Unit count of price. + * @param nanos Partial unit count of price. + * @return Returns current constructed OrderUpdate. + */ + setTotalPrice(priceType: PriceType, currencyCode: string, units: number, nanos?: number): OrderUpdate; + + /** + * Adds an actionable item for the user to manage the order. + * + * @param type One of TransactionValues.OrderActions. + * @param label Button label. + * @param url URL to open when button is clicked. + * @return Returns current constructed OrderUpdate. + */ + addOrderManagementAction(type: OrderAction, label: string, url: string): OrderUpdate; + + /** + * Adds a single price update for a particular line item in the order. + * + * @param itemId Line item ID for the order item updated. + * @param priceType One of TransactionValues.PriceType. + * @param currencyCode Currency code of new price. + * @param units Unit count of new price. + * @param nanos Partial unit count of new price. + * @param reason Reason for the price change. Required unless a + * reason for this line item change was already declared in + * addLineItemStateUpdate. + * @return Returns current constructed OrderUpdate. + */ + addLineItemPriceUpdate(itemId: string, priceType: PriceType, currencyCode: string, units: number, nanos?: number, reason?: string): OrderUpdate; + + /** + * Adds a single state update for a particular line item in the order. + * + * @param itemId Line item ID for the order item updated. + * @param state One of TransactionValues.OrderState. + * @param label Label for the new item state. + * @param reason Reason for the price change. This will overwrite + * any reason given in addLineitemPriceUpdate. + * @return Returns current constructed OrderUpdate. + */ + addLineItemStateUpdate(itemId: string, state: OrderState, label: string, reason?: string): OrderUpdate; + + /** + * Sets some extra information about the order. Takes an order update info + * type, and any accompanying data. This should only be called once per + * order update. + * + * @param type One of TransactionValues.OrderStateInfo. + * @param data Proper Object matching the data necessary for the info + * type. For instance, for the TransactionValues.OrderStateInfo.RECEIPT info + * type, use the {@link ReceiptInfo} data type. + * @return Returns current constructed OrderUpdate. + */ + setInfo(type: string, data: object): OrderUpdate; +} diff --git a/types/actions-on-google/tsconfig.json b/types/actions-on-google/tsconfig.json new file mode 100644 index 0000000000..6682b5c194 --- /dev/null +++ b/types/actions-on-google/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "assistant-app.d.ts", + "actions-sdk-app.d.ts", + "dialogflow-app.d.ts", + "response-builder.d.ts", + "transactions.d.ts", + "actions-on-google-tests.ts" + ] +} diff --git a/types/askmethat-rating/tslint.json b/types/actions-on-google/tslint.json similarity index 100% rename from types/askmethat-rating/tslint.json rename to types/actions-on-google/tslint.json diff --git a/types/activex-access/package.json b/types/activex-access/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-access/package.json +++ b/types/activex-access/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-adodb/package.json b/types/activex-adodb/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-adodb/package.json +++ b/types/activex-adodb/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-dao/package.json b/types/activex-dao/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-dao/package.json +++ b/types/activex-dao/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-excel/package.json b/types/activex-excel/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-excel/package.json +++ b/types/activex-excel/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-infopath/package.json b/types/activex-infopath/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-infopath/package.json +++ b/types/activex-infopath/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-libreoffice/tslint.json b/types/activex-libreoffice/tslint.json index 098cdac415..8e56cb082c 100644 --- a/types/activex-libreoffice/tslint.json +++ b/types/activex-libreoffice/tslint.json @@ -3,6 +3,8 @@ "rules": { "interface-name": [false], "ban-types": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, "no-unnecessary-qualifier": false } } \ No newline at end of file diff --git a/types/activex-msforms/package.json b/types/activex-msforms/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-msforms/package.json +++ b/types/activex-msforms/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-mshtml/package.json b/types/activex-mshtml/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-mshtml/package.json +++ b/types/activex-mshtml/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-msxml2/package.json b/types/activex-msxml2/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-msxml2/package.json +++ b/types/activex-msxml2/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-office/package.json b/types/activex-office/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-office/package.json +++ b/types/activex-office/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-outlook/package.json b/types/activex-outlook/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-outlook/package.json +++ b/types/activex-outlook/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-powerpoint/package.json b/types/activex-powerpoint/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-powerpoint/package.json +++ b/types/activex-powerpoint/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-scripting/package.json b/types/activex-scripting/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-scripting/package.json +++ b/types/activex-scripting/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-stdole/package.json b/types/activex-stdole/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-stdole/package.json +++ b/types/activex-stdole/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-vbide/package.json b/types/activex-vbide/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-vbide/package.json +++ b/types/activex-vbide/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-wia/package.json b/types/activex-wia/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-wia/package.json +++ b/types/activex-wia/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/activex-word/package.json b/types/activex-word/package.json index d9b1031263..cff3db7dba 100644 --- a/types/activex-word/package.json +++ b/types/activex-word/package.json @@ -3,4 +3,4 @@ "dependencies": { "activex-helpers": "*" } -} \ No newline at end of file +} diff --git a/types/adal/tslint.json b/types/adal/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/adal/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/add2home/tslint.json b/types/add2home/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/add2home/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/adm-zip/tslint.json b/types/adm-zip/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/adm-zip/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/adone/glosses/collections.d.ts b/types/adone/glosses/collections.d.ts index c21c13abb9..cba89c3cf2 100644 --- a/types/adone/glosses/collections.d.ts +++ b/types/adone/glosses/collections.d.ts @@ -455,7 +455,6 @@ declare namespace adone { * Writes a 32bit le float * * @param offset Offset to write to - * @returns {this} */ writeFloatLE(value: number, offset?: number): this; @@ -802,8 +801,7 @@ declare namespace adone { * Resizes this ByteArray to be backed by a buffer of at least the given capacity. * Will do nothing if already that large or larger. * - * @param {number} capacity Capacity required - * @returns {this} + * @param capacity Capacity required */ resize(capacity: number): this; @@ -1679,8 +1677,8 @@ declare namespace adone { * Returns a new BufferList object containing the bytes within the range specified. * No copies will be performed. All buffers in the result share memory with the original list. * - * @param {number} start slice from - * @param {number} end slice to + * @param start slice from + * @param end slice to */ shallowSlice(start?: number, end?: number): BufferList; @@ -1705,11 +1703,11 @@ declare namespace adone { destroy(): void; then( - onfulfilled?: ((value: Buffer) => T1 | PromiseLike) | undefined | null, - onrejected?: ((reason: any) => T2 | PromiseLike) | undefined | null + onfulfilled?: ((value: Buffer) => T1 | PromiseLike) | null, + onrejected?: ((reason: any) => T2 | PromiseLike) | null ): PromiseLike; - catch(onrejected?: ((reason: any) => T | PromiseLike) | undefined | null): PromiseLike; + catch(onrejected?: ((reason: any) => T | PromiseLike) | null): PromiseLike; } /** diff --git a/types/adone/glosses/datetime.d.ts b/types/adone/glosses/datetime.d.ts index 417f706d95..5ce320f613 100644 --- a/types/adone/glosses/datetime.d.ts +++ b/types/adone/glosses/datetime.d.ts @@ -731,9 +731,6 @@ declare namespace adone { */ creationData(): DatetimeCreationData; - /** - * - */ parsingFlags(): DatetimeParsingFlags; /** diff --git a/types/adone/glosses/math/matrix.d.ts b/types/adone/glosses/math/matrix.d.ts index 0340929ed6..2b0e54e450 100644 --- a/types/adone/glosses/math/matrix.d.ts +++ b/types/adone/glosses/math/matrix.d.ts @@ -149,18 +149,18 @@ declare namespace adone.math { /** * Math.ceil the components of a vec2 * - * @param {vec2} out the receiving vector - * @param {vec2} a vector to ceil - * @returns {vec2} out + * @param out the receiving vector + * @param a vector to ceil + * @returns out */ function ceil(out: I.vec2, a: I.vec2 | number[]): I.vec2; /** * Math.floor the components of a vec2 * - * @param {vec2} out the receiving vector - * @param {vec2} a vector to floor - * @returns {vec2} out + * @param out the receiving vector + * @param a vector to floor + * @returns out */ function floor(out: I.vec2, a: I.vec2 | number[]): I.vec2; @@ -187,9 +187,9 @@ declare namespace adone.math { /** * Math.round the components of a vec2 * - * @param {vec2} out the receiving vector - * @param {vec2} a vector to round - * @returns {vec2} out + * @param out the receiving vector + * @param a vector to round + * @returns out */ function round(out: I.vec2, a: I.vec2 | number[]): I.vec2; @@ -438,18 +438,18 @@ declare namespace adone.math { /** * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===) * - * @param {vec2} a The first vector. - * @param {vec2} b The second vector. - * @returns {boolean} True if the vectors are equal, false otherwise. + * @param a The first vector. + * @param b The second vector. + * @returns True if the vectors are equal, false otherwise. */ function exactEquals(a: I.vec2 | number[], b: I.vec2 | number[]): boolean; /** * Returns whether or not the vectors have approximately the same elements in the same position. * - * @param {vec2} a The first vector. - * @param {vec2} b The second vector. - * @returns {boolean} True if the vectors are equal, false otherwise. + * @param a The first vector. + * @param b The second vector. + * @returns True if the vectors are equal, false otherwise. */ function equals(a: I.vec2 | number[], b: I.vec2 | number[]): boolean; } @@ -580,18 +580,18 @@ declare namespace adone.math { /** * Math.ceil the components of a vec3 * - * @param {vec3} out the receiving vector - * @param {vec3} a vector to ceil - * @returns {vec3} out + * @param out the receiving vector + * @param a vector to ceil + * @returns out */ function ceil(out: I.vec3, a: I.vec3 | number[]): I.vec3; /** * Math.floor the components of a vec3 * - * @param {vec3} out the receiving vector - * @param {vec3} a vector to floor - * @returns {vec3} out + * @param out the receiving vector + * @param a vector to floor + * @returns out */ function floor(out: I.vec3, a: I.vec3 | number[]): I.vec3; @@ -618,9 +618,9 @@ declare namespace adone.math { /** * Math.round the components of a vec3 * - * @param {vec3} out the receiving vector - * @param {vec3} a vector to round - * @returns {vec3} out + * @param out the receiving vector + * @param a vector to round + * @returns out */ function round(out: I.vec3, a: I.vec3 | number[]): I.vec3; @@ -773,26 +773,26 @@ declare namespace adone.math { /** * Performs a hermite interpolation with two control points * - * @param {vec3} out the receiving vector - * @param {vec3} a the first operand - * @param {vec3} b the second operand - * @param {vec3} c the third operand - * @param {vec3} d the fourth operand - * @param {number} t interpolation amount between the two inputs - * @returns {vec3} out + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param c the third operand + * @param d the fourth operand + * @param t interpolation amount between the two inputs + * @returns out */ function hermite(out: I.vec3, a: I.vec3 | number[], b: I.vec3 | number[], c: I.vec3 | number[], d: I.vec3 | number[], t: number): I.vec3; /** * Performs a bezier interpolation with two control points * - * @param {vec3} out the receiving vector - * @param {vec3} a the first operand - * @param {vec3} b the second operand - * @param {vec3} c the third operand - * @param {vec3} d the fourth operand - * @param {number} t interpolation amount between the two inputs - * @returns {vec3} out + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param c the third operand + * @param d the fourth operand + * @param t interpolation amount between the two inputs + * @returns out */ function bezier(out: I.vec3, a: I.vec3 | number[], b: I.vec3 | number[], c: I.vec3 | number[], d: I.vec3 | number[], t: number): I.vec3; @@ -884,7 +884,6 @@ declare namespace adone.math { * @param fn Function to call for each vector in the array * @param arg additional argument to pass to fn * @returns a - * @function */ function forEach(a: Float32Array, stride: number, offset: number, count: number, fn: (a: I.vec3 | number[], b: I.vec3 | number[], arg: any) => void, arg: any): Float32Array; @@ -898,7 +897,6 @@ declare namespace adone.math { * @param count Number of vec3s to iterate over. If 0 iterates over entire array * @param fn Function to call for each vector in the array * @returns a - * @function */ function forEach(a: Float32Array, stride: number, offset: number, count: number, fn: (a: I.vec3 | number[], b: I.vec3 | number[]) => void): Float32Array; @@ -922,18 +920,18 @@ declare namespace adone.math { /** * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) * - * @param {vec3} a The first vector. - * @param {vec3} b The second vector. - * @returns {boolean} True if the vectors are equal, false otherwise. + * @param a The first vector. + * @param b The second vector. + * @returns True if the vectors are equal, false otherwise. */ function exactEquals(a: I.vec3 | number[], b: I.vec3 | number[]): boolean; /** * Returns whether or not the vectors have approximately the same elements in the same position. * - * @param {vec3} a The first vector. - * @param {vec3} b The second vector. - * @returns {boolean} True if the vectors are equal, false otherwise. + * @param a The first vector. + * @param b The second vector. + * @returns True if the vectors are equal, false otherwise. */ function equals(a: I.vec3 | number[], b: I.vec3 | number[]): boolean; } @@ -1066,18 +1064,18 @@ declare namespace adone.math { /** * Math.ceil the components of a vec4 * - * @param {vec4} out the receiving vector - * @param {vec4} a vector to ceil - * @returns {vec4} out + * @param out the receiving vector + * @param a vector to ceil + * @returns out */ function ceil(out: I.vec4, a: I.vec4 | number[]): I.vec4; /** * Math.floor the components of a vec4 * - * @param {vec4} out the receiving vector - * @param {vec4} a vector to floor - * @returns {vec4} out + * @param out the receiving vector + * @param a vector to floor + * @returns out */ function floor(out: I.vec4, a: I.vec4 | number[]): I.vec4; @@ -1104,9 +1102,9 @@ declare namespace adone.math { /** * Math.round the components of a vec4 * - * @param {vec4} out the receiving vector - * @param {vec4} a vector to round - * @returns {vec4} out + * @param out the receiving vector + * @param a vector to round + * @returns out */ function round(out: I.vec4, a: I.vec4 | number[]): I.vec4; @@ -1294,7 +1292,6 @@ declare namespace adone.math { * @param fn Function to call for each vector in the array * @param arg additional argument to pass to fn * @returns a - * @function */ function forEach(a: Float32Array, stride: number, offset: number, count: number, fn: (a: I.vec4 | number[], b: I.vec4 | number[], arg: any) => void, arg: any): Float32Array; @@ -1308,7 +1305,6 @@ declare namespace adone.math { * @param count Number of vec4s to iterate over. If 0 iterates over entire array * @param fn Function to call for each vector in the array * @returns a - * @function */ function forEach(a: Float32Array, stride: number, offset: number, count: number, fn: (a: I.vec4 | number[], b: I.vec4 | number[]) => void): Float32Array; @@ -1324,18 +1320,18 @@ declare namespace adone.math { /** * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) * - * @param {vec4} a The first vector. - * @param {vec4} b The second vector. - * @returns {boolean} True if the vectors are equal, false otherwise. + * @param a The first vector. + * @param b The second vector. + * @returns True if the vectors are equal, false otherwise. */ function exactEquals(a: I.vec4 | number[], b: I.vec4 | number[]): boolean; /** * Returns whether or not the vectors have approximately the same elements in the same position. * - * @param {vec4} a The first vector. - * @param {vec4} b The second vector. - * @returns {boolean} True if the vectors are equal, false otherwise. + * @param a The first vector. + * @param b The second vector. + * @returns True if the vectors are equal, false otherwise. */ function equals(a: I.vec4 | number[], b: I.vec4 | number[]): boolean; } @@ -1383,23 +1379,23 @@ declare namespace adone.math { /** * Create a new mat2 with the given values * - * @param {number} m00 Component in column 0, row 0 position (index 0) - * @param {number} m01 Component in column 0, row 1 position (index 1) - * @param {number} m10 Component in column 1, row 0 position (index 2) - * @param {number} m11 Component in column 1, row 1 position (index 3) - * @returns {mat2} out A new 2x2 matrix + * @param m00 Component in column 0, row 0 position (index 0) + * @param m01 Component in column 0, row 1 position (index 1) + * @param m10 Component in column 1, row 0 position (index 2) + * @param m11 Component in column 1, row 1 position (index 3) + * @returns out A new 2x2 matrix */ function fromValues(m00: number, m01: number, m10: number, m11: number): I.mat2; /** * Set the components of a mat2 to the given values * - * @param {mat2} out the receiving matrix - * @param {number} m00 Component in column 0, row 0 position (index 0) - * @param {number} m01 Component in column 0, row 1 position (index 1) - * @param {number} m10 Component in column 1, row 0 position (index 2) - * @param {number} m11 Component in column 1, row 1 position (index 3) - * @returns {mat2} out + * @param out the receiving matrix + * @param m00 Component in column 0, row 0 position (index 0) + * @param m01 Component in column 0, row 1 position (index 1) + * @param m10 Component in column 1, row 0 position (index 2) + * @param m11 Component in column 1, row 1 position (index 3) + * @returns out */ function set(out: I.mat2, m00: number, m01: number, m10: number, m11: number): I.mat2; @@ -1485,9 +1481,9 @@ declare namespace adone.math { * mat2.identity(dest); * mat2.rotate(dest, dest, rad); * - * @param {mat2} out mat2 receiving operation result - * @param {number} rad the angle to rotate the matrix by - * @returns {mat2} out + * @param out mat2 receiving operation result + * @param rad the angle to rotate the matrix by + * @returns out */ function fromRotation(out: I.mat2, rad: number): I.mat2; @@ -1498,9 +1494,9 @@ declare namespace adone.math { * mat2.identity(dest); * mat2.scale(dest, dest, vec); * - * @param {mat2} out mat2 receiving operation result - * @param {vec2} v Scaling vector - * @returns {mat2} out + * @param out mat2 receiving operation result + * @param v Scaling vector + * @returns out */ function fromScaling(out: I.mat2, v: I.vec2 | number[]): I.mat2; @@ -1532,69 +1528,69 @@ declare namespace adone.math { /** * Adds two mat2's * - * @param {mat2} out the receiving matrix - * @param {mat2} a the first operand - * @param {mat2} b the second operand - * @returns {mat2} out + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out */ function add(out: I.mat2, a: I.mat2, b: I.mat2): I.mat2; /** * Subtracts matrix b from matrix a * - * @param {mat2} out the receiving matrix - * @param {mat2} a the first operand - * @param {mat2} b the second operand - * @returns {mat2} out + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out */ function subtract(out: I.mat2, a: I.mat2, b: I.mat2): I.mat2; /** * Subtracts matrix b from matrix a * - * @param {mat2} out the receiving matrix - * @param {mat2} a the first operand - * @param {mat2} b the second operand - * @returns {mat2} out + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out */ function sub(out: I.mat2, a: I.mat2, b: I.mat2): I.mat2; /** * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) * - * @param {mat2} a The first matrix. - * @param {mat2} b The second matrix. - * @returns {boolean} True if the matrices are equal, false otherwise. + * @param a The first matrix. + * @param b The second matrix. + * @returns True if the matrices are equal, false otherwise. */ function exactEquals(a: I.mat2, b: I.mat2): boolean; /** * Returns whether or not the matrices have approximately the same elements in the same position. * - * @param {mat2} a The first matrix. - * @param {mat2} b The second matrix. - * @returns {boolean} True if the matrices are equal, false otherwise. + * @param a The first matrix. + * @param b The second matrix. + * @returns True if the matrices are equal, false otherwise. */ function equals(a: I.mat2, b: I.mat2): boolean; /** * Multiply each element of the matrix by a scalar. * - * @param {mat2} out the receiving matrix - * @param {mat2} a the matrix to scale - * @param {number} b amount to scale the matrix's elements by - * @returns {mat2} out + * @param out the receiving matrix + * @param a the matrix to scale + * @param b amount to scale the matrix's elements by + * @returns out */ function multiplyScalar(out: I.mat2, a: I.mat2, b: number): I.mat2; /** * Adds two mat2's after multiplying each element of the second operand by a scalar value. * - * @param {mat2} out the receiving vector - * @param {mat2} a the first operand - * @param {mat2} b the second operand - * @param {number} scale the amount to scale b's elements by before adding - * @returns {mat2} out + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param scale the amount to scale b's elements by before adding + * @returns out */ function multiplyScalarAndAdd(out: I.mat2, a: I.mat2, b: I.mat2, scale: number): I.mat2; } @@ -1642,27 +1638,27 @@ declare namespace adone.math { /** * Create a new mat2d with the given values * - * @param {number} a Component A (index 0) - * @param {number} b Component B (index 1) - * @param {number} c Component C (index 2) - * @param {number} d Component D (index 3) - * @param {number} tx Component TX (index 4) - * @param {number} ty Component TY (index 5) - * @returns {mat2d} A new mat2d + * @param a Component A (index 0) + * @param b Component B (index 1) + * @param c Component C (index 2) + * @param d Component D (index 3) + * @param tx Component TX (index 4) + * @param ty Component TY (index 5) + * @returns A new mat2d */ function fromValues(a: number, b: number, c: number, d: number, tx: number, ty: number): I.mat2d; /** * Set the components of a mat2d to the given values * - * @param {mat2d} out the receiving matrix - * @param {number} a Component A (index 0) - * @param {number} b Component B (index 1) - * @param {number} c Component C (index 2) - * @param {number} d Component D (index 3) - * @param {number} tx Component TX (index 4) - * @param {number} ty Component TY (index 5) - * @returns {mat2d} out + * @param out the receiving matrix + * @param a Component A (index 0) + * @param b Component B (index 1) + * @param c Component C (index 2) + * @param d Component D (index 3) + * @param tx Component TX (index 4) + * @param ty Component TY (index 5) + * @returns out */ function set(out: I.mat2d, a: number, b: number, c: number, d: number, tx: number, ty: number): I.mat2d; @@ -1740,9 +1736,9 @@ declare namespace adone.math { * mat2d.identity(dest); * mat2d.rotate(dest, dest, rad); * - * @param {mat2d} out mat2d receiving operation result - * @param {number} rad the angle to rotate the matrix by - * @returns {mat2d} out + * @param out mat2d receiving operation result + * @param rad the angle to rotate the matrix by + * @returns out */ function fromRotation(out: I.mat2d, rad: number): I.mat2d; @@ -1753,9 +1749,9 @@ declare namespace adone.math { * mat2d.identity(dest); * mat2d.scale(dest, dest, vec); * - * @param {mat2d} out mat2d receiving operation result - * @param {vec2} v Scaling vector - * @returns {mat2d} out + * @param out mat2d receiving operation result + * @param v Scaling vector + * @returns out */ function fromScaling(out: I.mat2d, v: I.vec2 | number[]): I.mat2d; @@ -1766,9 +1762,9 @@ declare namespace adone.math { * mat2d.identity(dest); * mat2d.translate(dest, dest, vec); * - * @param {mat2d} out mat2d receiving operation result - * @param {vec2} v Translation vector - * @returns {mat2d} out + * @param out mat2d receiving operation result + * @param v Translation vector + * @returns out */ function fromTranslation(out: I.mat2d, v: I.vec2 | number[]): I.mat2d; @@ -1791,69 +1787,69 @@ declare namespace adone.math { /** * Adds two mat2d's * - * @param {mat2d} out the receiving matrix - * @param {mat2d} a the first operand - * @param {mat2d} b the second operand - * @returns {mat2d} out + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out */ function add(out: I.mat2d, a: I.mat2d, b: I.mat2d): I.mat2d; /** * Subtracts matrix b from matrix a * - * @param {mat2d} out the receiving matrix - * @param {mat2d} a the first operand - * @param {mat2d} b the second operand - * @returns {mat2d} out + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out */ function subtract(out: I.mat2d, a: I.mat2d, b: I.mat2d): I.mat2d; /** * Subtracts matrix b from matrix a * - * @param {mat2d} out the receiving matrix - * @param {mat2d} a the first operand - * @param {mat2d} b the second operand - * @returns {mat2d} out + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out */ function sub(out: I.mat2d, a: I.mat2d, b: I.mat2d): I.mat2d; /** * Multiply each element of the matrix by a scalar. * - * @param {mat2d} out the receiving matrix - * @param {mat2d} a the matrix to scale - * @param {number} b amount to scale the matrix's elements by - * @returns {mat2d} out + * @param out the receiving matrix + * @param a the matrix to scale + * @param b amount to scale the matrix's elements by + * @returns out */ function multiplyScalar(out: I.mat2d, a: I.mat2d, b: number): I.mat2d; /** * Adds two mat2d's after multiplying each element of the second operand by a scalar value. * - * @param {mat2d} out the receiving vector - * @param {mat2d} a the first operand - * @param {mat2d} b the second operand - * @param {number} scale the amount to scale b's elements by before adding - * @returns {mat2d} out + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param scale the amount to scale b's elements by before adding + * @returns out */ function multiplyScalarAndAdd(out: I.mat2d, a: I.mat2d, b: I.mat2d, scale: number): I.mat2d; /** * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) * - * @param {mat2d} a The first matrix. - * @param {mat2d} b The second matrix. - * @returns {boolean} True if the matrices are equal, false otherwise. + * @param a The first matrix. + * @param b The second matrix. + * @returns True if the matrices are equal, false otherwise. */ function exactEquals(a: I.mat2d, b: I.mat2d): boolean; /** * Returns whether or not the matrices have approximately the same elements in the same position. * - * @param {mat2d} a The first matrix. - * @param {mat2d} b The second matrix. - * @returns {boolean} True if the matrices are equal, false otherwise. + * @param a The first matrix. + * @param b The second matrix. + * @returns True if the matrices are equal, false otherwise. */ function equals(a: I.mat2d, b: I.mat2d): boolean; } @@ -1876,9 +1872,9 @@ declare namespace adone.math { /** * Copies the upper-left 3x3 values into the given mat3. * - * @param {mat3} out the receiving 3x3 matrix - * @param {mat4} a the source 4x4 matrix - * @returns {mat3} out + * @param out the receiving 3x3 matrix + * @param a the source 4x4 matrix + * @returns out */ function fromMat4(out: I.mat3, a: I.mat4): I.mat3; @@ -1902,33 +1898,33 @@ declare namespace adone.math { /** * Create a new mat3 with the given values * - * @param {number} m00 Component in column 0, row 0 position (index 0) - * @param {number} m01 Component in column 0, row 1 position (index 1) - * @param {number} m02 Component in column 0, row 2 position (index 2) - * @param {number} m10 Component in column 1, row 0 position (index 3) - * @param {number} m11 Component in column 1, row 1 position (index 4) - * @param {number} m12 Component in column 1, row 2 position (index 5) - * @param {number} m20 Component in column 2, row 0 position (index 6) - * @param {number} m21 Component in column 2, row 1 position (index 7) - * @param {number} m22 Component in column 2, row 2 position (index 8) - * @returns {mat3} A new mat3 + * @param m00 Component in column 0, row 0 position (index 0) + * @param m01 Component in column 0, row 1 position (index 1) + * @param m02 Component in column 0, row 2 position (index 2) + * @param m10 Component in column 1, row 0 position (index 3) + * @param m11 Component in column 1, row 1 position (index 4) + * @param m12 Component in column 1, row 2 position (index 5) + * @param m20 Component in column 2, row 0 position (index 6) + * @param m21 Component in column 2, row 1 position (index 7) + * @param m22 Component in column 2, row 2 position (index 8) + * @returns A new mat3 */ function fromValues(m00: number, m01: number, m02: number, m10: number, m11: number, m12: number, m20: number, m21: number, m22: number): I.mat3; /** * Set the components of a mat3 to the given values * - * @param {mat3} out the receiving matrix - * @param {number} m00 Component in column 0, row 0 position (index 0) - * @param {number} m01 Component in column 0, row 1 position (index 1) - * @param {number} m02 Component in column 0, row 2 position (index 2) - * @param {number} m10 Component in column 1, row 0 position (index 3) - * @param {number} m11 Component in column 1, row 1 position (index 4) - * @param {number} m12 Component in column 1, row 2 position (index 5) - * @param {number} m20 Component in column 2, row 0 position (index 6) - * @param {number} m21 Component in column 2, row 1 position (index 7) - * @param {number} m22 Component in column 2, row 2 position (index 8) - * @returns {mat3} out + * @param out the receiving matrix + * @param m00 Component in column 0, row 0 position (index 0) + * @param m01 Component in column 0, row 1 position (index 1) + * @param m02 Component in column 0, row 2 position (index 2) + * @param m10 Component in column 1, row 0 position (index 3) + * @param m11 Component in column 1, row 1 position (index 4) + * @param m12 Component in column 1, row 2 position (index 5) + * @param m20 Component in column 2, row 0 position (index 6) + * @param m21 Component in column 2, row 1 position (index 7) + * @param m22 Component in column 2, row 2 position (index 8) + * @returns out */ function set(out: I.mat3, m00: number, m01: number, m02: number, m10: number, m11: number, m12: number, m20: number, m21: number, m22: number): I.mat3; @@ -2032,9 +2028,9 @@ declare namespace adone.math { * mat3.identity(dest); * mat3.translate(dest, dest, vec); * - * @param {mat3} out mat3 receiving operation result - * @param {vec2} v Translation vector - * @returns {mat3} out + * @param out mat3 receiving operation result + * @param v Translation vector + * @returns out */ function fromTranslation(out: I.mat3, v: I.vec2 | number[]): I.mat3; @@ -2045,9 +2041,9 @@ declare namespace adone.math { * mat3.identity(dest); * mat3.rotate(dest, dest, rad); * - * @param {mat3} out mat3 receiving operation result - * @param {number} rad the angle to rotate the matrix by - * @returns {mat3} out + * @param out mat3 receiving operation result + * @param rad the angle to rotate the matrix by + * @returns out */ function fromRotation(out: I.mat3, rad: number): I.mat3; @@ -2058,9 +2054,9 @@ declare namespace adone.math { * mat3.identity(dest); * mat3.scale(dest, dest, vec); * - * @param {mat3} out mat3 receiving operation result - * @param {vec2} v Scaling vector - * @returns {mat3} out + * @param out mat3 receiving operation result + * @param v Scaling vector + * @returns out */ function fromScaling(out: I.mat3, v: I.vec2 | number[]): I.mat3; @@ -2068,7 +2064,7 @@ declare namespace adone.math { * Copies the values from a mat2d into a mat3 * * @param out the receiving matrix - * @param {mat2d} a the matrix to copy + * @param a the matrix to copy * @returns out */ function fromMat2d(out: I.mat3, a: I.mat2d): I.mat3; @@ -2112,69 +2108,69 @@ declare namespace adone.math { /** * Adds two mat3's * - * @param {mat3} out the receiving matrix - * @param {mat3} a the first operand - * @param {mat3} b the second operand - * @returns {mat3} out + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out */ function add(out: I.mat3, a: I.mat3, b: I.mat3): I.mat3; /** * Subtracts matrix b from matrix a * - * @param {mat3} out the receiving matrix - * @param {mat3} a the first operand - * @param {mat3} b the second operand - * @returns {mat3} out + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out */ function subtract(out: I.mat3, a: I.mat3, b: I.mat3): I.mat3; /** * Subtracts matrix b from matrix a * - * @param {mat3} out the receiving matrix - * @param {mat3} a the first operand - * @param {mat3} b the second operand - * @returns {mat3} out + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out */ function sub(out: I.mat3, a: I.mat3, b: I.mat3): I.mat3; /** * Multiply each element of the matrix by a scalar. * - * @param {mat3} out the receiving matrix - * @param {mat3} a the matrix to scale - * @param {number} b amount to scale the matrix's elements by - * @returns {mat3} out + * @param out the receiving matrix + * @param a the matrix to scale + * @param b amount to scale the matrix's elements by + * @returns out */ function multiplyScalar(out: I.mat3, a: I.mat3, b: number): I.mat3; /** * Adds two mat3's after multiplying each element of the second operand by a scalar value. * - * @param {mat3} out the receiving vector - * @param {mat3} a the first operand - * @param {mat3} b the second operand - * @param {number} scale the amount to scale b's elements by before adding - * @returns {mat3} out + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param scale the amount to scale b's elements by before adding + * @returns out */ function multiplyScalarAndAdd(out: I.mat3, a: I.mat3, b: I.mat3, scale: number): I.mat3; /** * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) * - * @param {mat3} a The first matrix. - * @param {mat3} b The second matrix. - * @returns {boolean} True if the matrices are equal, false otherwise. + * @param a The first matrix. + * @param b The second matrix. + * @returns True if the matrices are equal, false otherwise. */ function exactEquals(a: I.mat3, b: I.mat3): boolean; /** * Returns whether or not the matrices have approximately the same elements in the same position. * - * @param {mat3} a The first matrix. - * @param {mat3} b The second matrix. - * @returns {boolean} True if the matrices are equal, false otherwise. + * @param a The first matrix. + * @param b The second matrix. + * @returns True if the matrices are equal, false otherwise. */ function equals(a: I.mat3, b: I.mat3): boolean; } @@ -2214,23 +2210,23 @@ declare namespace adone.math { /** * Create a new mat4 with the given values * - * @param {number} m00 Component in column 0, row 0 position (index 0) - * @param {number} m01 Component in column 0, row 1 position (index 1) - * @param {number} m02 Component in column 0, row 2 position (index 2) - * @param {number} m03 Component in column 0, row 3 position (index 3) - * @param {number} m10 Component in column 1, row 0 position (index 4) - * @param {number} m11 Component in column 1, row 1 position (index 5) - * @param {number} m12 Component in column 1, row 2 position (index 6) - * @param {number} m13 Component in column 1, row 3 position (index 7) - * @param {number} m20 Component in column 2, row 0 position (index 8) - * @param {number} m21 Component in column 2, row 1 position (index 9) - * @param {number} m22 Component in column 2, row 2 position (index 10) - * @param {number} m23 Component in column 2, row 3 position (index 11) - * @param {number} m30 Component in column 3, row 0 position (index 12) - * @param {number} m31 Component in column 3, row 1 position (index 13) - * @param {number} m32 Component in column 3, row 2 position (index 14) - * @param {number} m33 Component in column 3, row 3 position (index 15) - * @returns {mat4} A new mat4 + * @param m00 Component in column 0, row 0 position (index 0) + * @param m01 Component in column 0, row 1 position (index 1) + * @param m02 Component in column 0, row 2 position (index 2) + * @param m03 Component in column 0, row 3 position (index 3) + * @param m10 Component in column 1, row 0 position (index 4) + * @param m11 Component in column 1, row 1 position (index 5) + * @param m12 Component in column 1, row 2 position (index 6) + * @param m13 Component in column 1, row 3 position (index 7) + * @param m20 Component in column 2, row 0 position (index 8) + * @param m21 Component in column 2, row 1 position (index 9) + * @param m22 Component in column 2, row 2 position (index 10) + * @param m23 Component in column 2, row 3 position (index 11) + * @param m30 Component in column 3, row 0 position (index 12) + * @param m31 Component in column 3, row 1 position (index 13) + * @param m32 Component in column 3, row 2 position (index 14) + * @param m33 Component in column 3, row 3 position (index 15) + * @returns A new mat4 */ function fromValues( m00: number, @@ -2254,24 +2250,24 @@ declare namespace adone.math { /** * Set the components of a mat4 to the given values * - * @param {mat4} out the receiving matrix - * @param {number} m00 Component in column 0, row 0 position (index 0) - * @param {number} m01 Component in column 0, row 1 position (index 1) - * @param {number} m02 Component in column 0, row 2 position (index 2) - * @param {number} m03 Component in column 0, row 3 position (index 3) - * @param {number} m10 Component in column 1, row 0 position (index 4) - * @param {number} m11 Component in column 1, row 1 position (index 5) - * @param {number} m12 Component in column 1, row 2 position (index 6) - * @param {number} m13 Component in column 1, row 3 position (index 7) - * @param {number} m20 Component in column 2, row 0 position (index 8) - * @param {number} m21 Component in column 2, row 1 position (index 9) - * @param {number} m22 Component in column 2, row 2 position (index 10) - * @param {number} m23 Component in column 2, row 3 position (index 11) - * @param {number} m30 Component in column 3, row 0 position (index 12) - * @param {number} m31 Component in column 3, row 1 position (index 13) - * @param {number} m32 Component in column 3, row 2 position (index 14) - * @param {number} m33 Component in column 3, row 3 position (index 15) - * @returns {mat4} out + * @param out the receiving matrix + * @param m00 Component in column 0, row 0 position (index 0) + * @param m01 Component in column 0, row 1 position (index 1) + * @param m02 Component in column 0, row 2 position (index 2) + * @param m03 Component in column 0, row 3 position (index 3) + * @param m10 Component in column 1, row 0 position (index 4) + * @param m11 Component in column 1, row 1 position (index 5) + * @param m12 Component in column 1, row 2 position (index 6) + * @param m13 Component in column 1, row 3 position (index 7) + * @param m20 Component in column 2, row 0 position (index 8) + * @param m21 Component in column 2, row 1 position (index 9) + * @param m22 Component in column 2, row 2 position (index 10) + * @param m23 Component in column 2, row 3 position (index 11) + * @param m30 Component in column 3, row 0 position (index 12) + * @param m31 Component in column 3, row 1 position (index 13) + * @param m32 Component in column 3, row 2 position (index 14) + * @param m33 Component in column 3, row 3 position (index 15) + * @returns out */ function set( out: I.mat4, @@ -2424,9 +2420,9 @@ declare namespace adone.math { * mat4.identity(dest); * mat4.translate(dest, dest, vec); * - * @param {mat4} out mat4 receiving operation result - * @param {vec3} v Translation vector - * @returns {mat4} out + * @param out mat4 receiving operation result + * @param v Translation vector + * @returns out */ function fromTranslation(out: I.mat4, v: I.vec3 | number[]): I.mat4; @@ -2437,9 +2433,9 @@ declare namespace adone.math { * mat4.identity(dest); * mat4.scale(dest, dest, vec); * - * @param {mat4} out mat4 receiving operation result - * @param {vec3} v Scaling vector - * @returns {mat4} out + * @param out mat4 receiving operation result + * @param v Scaling vector + * @returns out */ function fromScaling(out: I.mat4, v: I.vec3 | number[]): I.mat4; @@ -2450,10 +2446,10 @@ declare namespace adone.math { * mat4.identity(dest); * mat4.rotate(dest, dest, rad, axis); * - * @param {mat4} out mat4 receiving operation result - * @param {number} rad the angle to rotate the matrix by - * @param {vec3} axis the axis to rotate around - * @returns {mat4} out + * @param out mat4 receiving operation result + * @param rad the angle to rotate the matrix by + * @param axis the axis to rotate around + * @returns out */ function fromRotation(out: I.mat4, rad: number, axis: I.vec3 | number[]): I.mat4; @@ -2464,9 +2460,9 @@ declare namespace adone.math { * mat4.identity(dest); * mat4.rotateX(dest, dest, rad); * - * @param {mat4} out mat4 receiving operation result - * @param {number} rad the angle to rotate the matrix by - * @returns {mat4} out + * @param out mat4 receiving operation result + * @param rad the angle to rotate the matrix by + * @returns out */ function fromXRotation(out: I.mat4, rad: number): I.mat4; @@ -2477,9 +2473,9 @@ declare namespace adone.math { * mat4.identity(dest); * mat4.rotateY(dest, dest, rad); * - * @param {mat4} out mat4 receiving operation result - * @param {number} rad the angle to rotate the matrix by - * @returns {mat4} out + * @param out mat4 receiving operation result + * @param rad the angle to rotate the matrix by + * @returns out */ function fromYRotation(out: I.mat4, rad: number): I.mat4; @@ -2490,9 +2486,9 @@ declare namespace adone.math { * mat4.identity(dest); * mat4.rotateZ(dest, dest, rad); * - * @param {mat4} out mat4 receiving operation result - * @param {number} rad the angle to rotate the matrix by - * @returns {mat4} out + * @param out mat4 receiving operation result + * @param rad the angle to rotate the matrix by + * @returns out */ function fromZRotation(out: I.mat4, rad: number): I.mat4; @@ -2518,9 +2514,9 @@ declare namespace adone.math { * matrix. If a matrix is built with fromRotationTranslation, * the returned vector will be the same as the translation vector * originally supplied. - * @param {vec3} out Vector to receive translation component - * @param {mat4} mat Matrix to be decomposed (input) - * @return {vec3} out + * @param out Vector to receive translation component + * @param mat Matrix to be decomposed (input) + * @return out */ function getTranslation(out: I.vec3, mat: I.mat4): I.vec3; @@ -2529,9 +2525,9 @@ declare namespace adone.math { * If a matrix is built with fromRotationTranslationScale with a * normalized Quaternion parameter, the returned vector will be * the same as the scaling vector originally supplied. - * @param {vec3} out Vector to receive scaling factor component - * @param {mat4} mat Matrix to be decomposed (input) - * @return {vec3} out + * @param out Vector to receive scaling factor component + * @param mat Matrix to be decomposed (input) + * @return out */ function getScaling(out: I.vec3, mat: I.mat4): I.vec3; @@ -2540,9 +2536,9 @@ declare namespace adone.math { * of a transformation matrix. If a matrix is built with * fromRotationTranslation, the returned quaternion will be the * same as the quaternion originally supplied. - * @param {quat} out Quaternion to receive the rotation component - * @param {mat4} mat Matrix to be decomposed (input) - * @return {quat} out + * @param out Quaternion to receive the rotation component + * @param mat Matrix to be decomposed (input) + * @return out */ function getRotation(out: I.quat, mat: I.mat4): I.quat; @@ -2578,22 +2574,22 @@ declare namespace adone.math { * mat4.scale(dest, scale) * mat4.translate(dest, negativeOrigin); * - * @param {mat4} out mat4 receiving operation result - * @param {quat} q Rotation quaternion - * @param {vec3} v Translation vector - * @param {vec3} s Scaling vector - * @param {vec3} o The origin vector around which to scale and rotate - * @returns {mat4} out + * @param out mat4 receiving operation result + * @param q Rotation quaternion + * @param v Translation vector + * @param s Scaling vector + * @param o The origin vector around which to scale and rotate + * @returns out */ function fromRotationTranslationScaleOrigin(out: I.mat4, q: I.quat, v: I.vec3 | number[], s: I.vec3 | number[], o: I.vec3 | number[]): I.mat4; /** * Calculates a 4x4 matrix from the given quaternion * - * @param {mat4} out mat4 receiving operation result - * @param {quat} q Quaternion to create matrix from + * @param out mat4 receiving operation result + * @param q Quaternion to create matrix from * - * @returns {mat4} out + * @returns out */ function fromQuat(out: I.mat4, q: I.quat): I.mat4; @@ -2630,11 +2626,11 @@ declare namespace adone.math { * This is primarily useful for generating projection matrices to be used * with the still experimental WebVR API. * - * @param {mat4} out mat4 frustum matrix will be written into - * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees - * @param {number} near Near bound of the frustum - * @param {number} far Far bound of the frustum - * @returns {mat4} out + * @param out mat4 frustum matrix will be written into + * @param fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees + * @param near Near bound of the frustum + * @param far Far bound of the frustum + * @returns out */ function perspectiveFromFieldOfView( out: I.mat4, @@ -2692,69 +2688,69 @@ declare namespace adone.math { /** * Adds two mat4's * - * @param {mat4} out the receiving matrix - * @param {mat4} a the first operand - * @param {mat4} b the second operand - * @returns {mat4} out + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out */ function add(out: I.mat4, a: I.mat4, b: I.mat4): I.mat4; /** * Subtracts matrix b from matrix a * - * @param {mat4} out the receiving matrix - * @param {mat4} a the first operand - * @param {mat4} b the second operand - * @returns {mat4} out + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out */ function subtract(out: I.mat4, a: I.mat4, b: I.mat4): I.mat4; /** * Subtracts matrix b from matrix a * - * @param {mat4} out the receiving matrix - * @param {mat4} a the first operand - * @param {mat4} b the second operand - * @returns {mat4} out + * @param out the receiving matrix + * @param a the first operand + * @param b the second operand + * @returns out */ function sub(out: I.mat4, a: I.mat4, b: I.mat4): I.mat4; /** * Multiply each element of the matrix by a scalar. * - * @param {mat4} out the receiving matrix - * @param {mat4} a the matrix to scale - * @param {number} b amount to scale the matrix's elements by - * @returns {mat4} out + * @param out the receiving matrix + * @param a the matrix to scale + * @param b amount to scale the matrix's elements by + * @returns out */ function multiplyScalar(out: I.mat4, a: I.mat4, b: number): I.mat4; /** * Adds two mat4's after multiplying each element of the second operand by a scalar value. * - * @param {mat4} out the receiving vector - * @param {mat4} a the first operand - * @param {mat4} b the second operand - * @param {number} scale the amount to scale b's elements by before adding - * @returns {mat4} out + * @param out the receiving vector + * @param a the first operand + * @param b the second operand + * @param scale the amount to scale b's elements by before adding + * @returns out */ function multiplyScalarAndAdd(out: I.mat4, a: I.mat4, b: I.mat4, scale: number): I.mat4; /** * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) * - * @param {mat4} a The first matrix. - * @param {mat4} b The second matrix. - * @returns {boolean} True if the matrices are equal, false otherwise. + * @param a The first matrix. + * @param b The second matrix. + * @returns True if the matrices are equal, false otherwise. */ function exactEquals(a: I.mat4, b: I.mat4): boolean; /** * Returns whether or not the matrices have approximately the same elements in the same position. * - * @param {mat4} a The first matrix. - * @param {mat4} b The second matrix. - * @returns {boolean} True if the matrices are equal, false otherwise. + * @param a The first matrix. + * @param b The second matrix. + * @returns True if the matrices are equal, false otherwise. */ function equals(a: I.mat4, b: I.mat4): boolean; } @@ -2779,7 +2775,6 @@ declare namespace adone.math { * * @param a quaternion to clone * @returns a new quaternion - * @function */ function clone(a: I.quat): I.quat; @@ -2791,7 +2786,6 @@ declare namespace adone.math { * @param z Z component * @param w W component * @returns a new quaternion - * @function */ function fromValues(x: number, y: number, z: number, w: number): I.quat; @@ -2801,7 +2795,6 @@ declare namespace adone.math { * @param out the receiving quaternion * @param a the source quaternion * @returns out - * @function */ function copy(out: I.quat, a: I.quat): I.quat; @@ -2814,7 +2807,6 @@ declare namespace adone.math { * @param z Z component * @param w W component * @returns out - * @function */ function set(out: I.quat, x: number, y: number, z: number, w: number): I.quat; @@ -2832,10 +2824,10 @@ declare namespace adone.math { * * Both vectors are assumed to be unit length. * - * @param {quat} out the receiving quaternion. - * @param {vec3} a the initial vector - * @param {vec3} b the destination vector - * @returns {quat} out + * @param out the receiving quaternion. + * @param a the initial vector + * @param b the destination vector + * @returns out */ function rotationTo(out: I.quat, a: I.vec3 | number[], b: I.vec3 | number[]): I.quat; @@ -2857,10 +2849,10 @@ declare namespace adone.math { * axes. Each axis is a vec3 and is expected to be unit length and * perpendicular to all other specified axes. * - * @param {vec3} view the vector representing the viewing direction - * @param {vec3} right the vector representing the local "right" direction - * @param {vec3} up the vector representing the local "up" direction - * @returns {quat} out + * @param view the vector representing the viewing direction + * @param right the vector representing the local "right" direction + * @param up the vector representing the local "up" direction + * @returns out */ function setAxes(out: I.quat, view: I.vec3 | number[], right: I.vec3 | number[], up: I.vec3 | number[]): I.quat; @@ -2897,9 +2889,9 @@ declare namespace adone.math { * Example: The quaternion formed by axis [0, 0, 1] and * angle -90 is the same as the quaternion formed by * [0, 0, 1] and 270. This method favors the latter. - * @param {vec3} out_axis Vector receiving the axis of rotation - * @param {quat} q Quaternion to be decomposed - * @return {number} Angle, in radians, of the rotation + * @param out_axis Vector receiving the axis of rotation + * @param q Quaternion to be decomposed + * @return Angle, in radians, of the rotation */ function getAxisAngle(out_axis: I.vec3 | number[], q: I.quat): number; @@ -2910,7 +2902,6 @@ declare namespace adone.math { * @param a the first operand * @param b the second operand * @returns out - * @function */ function add(out: I.quat, a: I.quat, b: I.quat): I.quat; @@ -2941,7 +2932,6 @@ declare namespace adone.math { * @param a the vector to scale * @param b amount to scale the vector by * @returns out - * @function */ function scale(out: I.quat, a: I.quat, b: number): I.quat; @@ -2950,7 +2940,6 @@ declare namespace adone.math { * * @param a vector to calculate length of * @returns length of a - * @function */ function length(a: I.quat): number; @@ -2959,7 +2948,6 @@ declare namespace adone.math { * * @param a vector to calculate length of * @returns length of a - * @function */ function len(a: I.quat): number; @@ -2968,7 +2956,6 @@ declare namespace adone.math { * * @param a vector to calculate squared length of * @returns squared length of a - * @function */ function squaredLength(a: I.quat): number; @@ -2977,7 +2964,6 @@ declare namespace adone.math { * * @param a vector to calculate squared length of * @returns squared length of a - * @function */ function sqrLen(a: I.quat): number; @@ -2987,7 +2973,6 @@ declare namespace adone.math { * @param out the receiving quaternion * @param a quaternion to normalize * @returns out - * @function */ function normalize(out: I.quat, a: I.quat): I.quat; @@ -2997,7 +2982,6 @@ declare namespace adone.math { * @param a the first operand * @param b the second operand * @returns dot product of a and b - * @function */ function dot(a: I.quat, b: I.quat): number; @@ -3009,7 +2993,6 @@ declare namespace adone.math { * @param b the second operand * @param t interpolation amount between the two inputs * @returns out - * @function */ function lerp(out: I.quat, a: I.quat, b: I.quat, t: number): I.quat; @@ -3027,13 +3010,13 @@ declare namespace adone.math { /** * Performs a spherical linear interpolation with two control points * - * @param {quat} out the receiving quaternion - * @param {quat} a the first operand - * @param {quat} b the second operand - * @param {quat} c the third operand - * @param {quat} d the fourth operand - * @param {number} t interpolation amount - * @returns {quat} out + * @param out the receiving quaternion + * @param a the first operand + * @param b the second operand + * @param c the third operand + * @param d the fourth operand + * @param t interpolation amount + * @returns out */ function sqlerp(out: I.quat, a: I.quat, b: I.quat, c: I.quat, d: I.quat, t: number): I.quat; @@ -3103,7 +3086,6 @@ declare namespace adone.math { * @param out the receiving quaternion * @param m rotation matrix * @returns out - * @function */ function fromMat3(out: I.quat, m: I.mat3): I.quat; @@ -3121,18 +3103,18 @@ declare namespace adone.math { /** * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) * - * @param {quat} a The first vector. - * @param {quat} b The second vector. - * @returns {boolean} True if the quaternions are equal, false otherwise. + * @param a The first vector. + * @param b The second vector. + * @returns True if the quaternions are equal, false otherwise. */ function exactEquals(a: I.quat, b: I.quat): boolean; /** * Returns whether or not the quaternions have approximately the same elements in the same position. * - * @param {quat} a The first vector. - * @param {quat} b The second vector. - * @returns {boolean} True if the quaternions are equal, false otherwise. + * @param a The first vector. + * @param b The second vector. + * @returns True if the quaternions are equal, false otherwise. */ function equals(a: I.quat, b: I.quat): boolean; } diff --git a/types/adone/glosses/math/simd.d.ts b/types/adone/glosses/math/simd.d.ts index a90d761036..57f19e5eb3 100644 --- a/types/adone/glosses/math/simd.d.ts +++ b/types/adone/glosses/math/simd.d.ts @@ -53,41 +53,27 @@ declare namespace adone.math { /** * Returns a new instance with the lane values swizzled. - * @param a - * @param l1 - * @param l2 - * @param l3 - * @param l4 */ swizzle(a: Float32x4, l1: number, l2: number, l3: number, l4: number): Float32x4; /** * Returns a new instance with the lane values shuffled. - * @param a - * @param b - * @param l1 - * @param l2 - * @param l3 - * @param l4 */ shuffle(a: Float32x4, b: Float32x4, l1: number, l2: number, l3: number, l4: number): Float32x4; /** * Returns a new instance if the parameter is a valid SIMD data type and the same as Float32x4. Throws a TypeError otherwise. - * @param a */ check(a: Float32x4): Float32x4; /** * Creates a new SIMD.Float32x4 data type with all lanes set to a given value. - * @param n */ splat(n: number): Float32x4; /** * Returns a new instance with the given lane value replaced. * @param simd An instance of a corresponding SIMD type. - * @param lane * @param value A new value to be used for the lane. * @return A new SIMD data type with the given lane value replaced. */ @@ -121,16 +107,8 @@ declare namespace adone.math { div(a: Float32x4, b: Float32x4): Float32x4; - /** - * - * @param a - */ neg(a: Float32x4): Float32x4; - /** - * - * @param a - */ abs(a: Float32x4): Float32x4; min(a: Float32x4, b: Float32x4): Float32x4; @@ -143,16 +121,8 @@ declare namespace adone.math { reciprocalApproximation(a: Float32x4, b: Float32x4): Float32x4; - /** - * - * @param a - */ reciprocalSqrtApproximation(a: Float32x4): Float32x4; - /** - * - * @param a - */ sqrt(a: Float32x4): Float32x4; /** @@ -310,41 +280,27 @@ declare namespace adone.math { /** * Returns a new instance with the lane values swizzled. - * @param a - * @param l1 - * @param l2 - * @param l3 - * @param l4 */ swizzle(a: Int32x4, l1: number, l2: number, l3: number, l4: number): Int32x4; /** * Returns a new instance with the lane values shuffled. - * @param a - * @param b - * @param l1 - * @param l2 - * @param l3 - * @param l4 */ shuffle(a: Int32x4, b: Int32x4, l1: number, l2: number, l3: number, l4: number): Int32x4; /** * Returns a new instance if the parameter is a valid SIMD data type and the same as Int32x4. Throws a TypeError otherwise. - * @param a */ check(a: Int32x4): Int32x4; /** * Creates a new SIMD.Int32x4 data type with all lanes set to a given value. - * @param n */ splat(n: number): Int32x4; /** * Returns a new instance with the given lane value replaced. * @param simd An instance of a corresponding SIMD type. - * @param lane * @param value A new value to be used for the lane. * @return A new SIMD data type with the given lane value replaced. */ @@ -384,10 +340,6 @@ declare namespace adone.math { mul(a: Int32x4, b: Int32x4): Int32x4; - /** - * - * @param a - */ neg(a: Int32x4): Int32x4; /** @@ -565,49 +517,27 @@ declare namespace adone.math { /** * Returns a new instance with the lane values swizzled. - * @param a - * @param l1 - * @param l2 - * @param l3 - * @param l4 - * @param l5 - * @param l6 - * @param l7 - * @param l8 */ swizzle(a: Int16x8, l1: number, l2: number, l3: number, l4: number, l5: number, l6: number, l7: number, l8: number): Int16x8; /** * Returns a new instance with the lane values shuffled. - * @param a - * @param b - * @param l1 - * @param l2 - * @param l3 - * @param l4 - * @param l5 - * @param l6 - * @param l7 - * @param l8 */ shuffle(a: Int16x8, b: Int16x8, l1: number, l2: number, l3: number, l4: number, l5: number, l6: number, l7: number, l8: number): Int16x8; /** * Returns a new instance if the parameter is a valid SIMD data type and the same as Int16x8. Throws a TypeError otherwise. - * @param a */ check(a: Int16x8): Int16x8; /** * Creates a new SIMD.Int16x8 data type with all lanes set to a given value. - * @param n */ splat(n: number): Int16x8; /** * Returns a new instance with the given lane value replaced. * @param simd An instance of a corresponding SIMD type. - * @param lane * @param value A new value to be used for the lane. * @return A new SIMD data type with the given lane value replaced. */ @@ -647,10 +577,6 @@ declare namespace adone.math { mul(a: Int16x8, b: Int16x8): Int16x8; - /** - * - * @param a - */ neg(a: Int16x8): Int16x8; /** @@ -803,23 +729,6 @@ declare namespace adone.math { /** * Returns a new instance with the lane values swizzled. - * @param a - * @param l1 - * @param l2 - * @param l3 - * @param l4 - * @param l5 - * @param l6 - * @param l7 - * @param l8 - * @param l9 - * @param l10 - * @param l11 - * @param l12 - * @param l13 - * @param l14 - * @param l15 - * @param l16 */ swizzle( a: Int8x16, @@ -843,24 +752,6 @@ declare namespace adone.math { /** * Returns a new instance with the lane values shuffled. - * @param a - * @param b - * @param l1 - * @param l2 - * @param l3 - * @param l4 - * @param l5 - * @param l6 - * @param l7 - * @param l8 - * @param l9 - * @param l10 - * @param l11 - * @param l12 - * @param l13 - * @param l14 - * @param l15 - * @param l16 */ shuffle( a: Int8x16, @@ -885,20 +776,17 @@ declare namespace adone.math { /** * Returns a new instance if the parameter is a valid SIMD data type and the same as Int8x16. Throws a TypeError otherwise. - * @param a */ check(a: Int8x16): Int8x16; /** * Creates a new SIMD.Int8x16 data type with all lanes set to a given value. - * @param n */ splat(n: number): Int8x16; /** * Returns a new instance with the given lane value replaced. * @param simd An instance of a corresponding SIMD type. - * @param lane * @param value A new value to be used for the lane. * @return A new SIMD data type with the given lane value replaced. */ @@ -938,10 +826,6 @@ declare namespace adone.math { mul(a: Int8x16, b: Int8x16): Int8x16; - /** - * - * @param a - */ neg(a: Int8x16): Int8x16; /** @@ -1065,41 +949,27 @@ declare namespace adone.math { /** * Returns a new instance with the lane values swizzled. - * @param a - * @param l1 - * @param l2 - * @param l3 - * @param l4 */ swizzle(a: Uint32x4, l1: number, l2: number, l3: number, l4: number): Uint32x4; /** * Returns a new instance with the lane values shuffled. - * @param a - * @param b - * @param l1 - * @param l2 - * @param l3 - * @param l4 */ shuffle(a: Uint32x4, b: Uint32x4, l1: number, l2: number, l3: number, l4: number): Uint32x4; /** * Returns a new instance if the parameter is a valid SIMD data type and the same as Uint32x4. Throws a TypeError otherwise. - * @param a */ check(a: Uint32x4): Uint32x4; /** * Creates a new SIMD.Uint32x4 data type with all lanes set to a given value. - * @param n */ splat(n: number): Uint32x4; /** * Returns a new instance with the given lane value replaced. * @param simd An instance of a corresponding SIMD type. - * @param lane * @param value A new value to be used for the lane. * @return A new SIMD data type with the given lane value replaced. */ @@ -1314,49 +1184,27 @@ declare namespace adone.math { /** * Returns a new instance with the lane values swizzled. - * @param a - * @param l1 - * @param l2 - * @param l3 - * @param l4 - * @param l5 - * @param l6 - * @param l7 - * @param l8 */ swizzle(a: Uint16x8, l1: number, l2: number, l3: number, l4: number, l5: number, l6: number, l7: number, l8: number): Uint16x8; /** * Returns a new instance with the lane values shuffled. - * @param a - * @param b - * @param l1 - * @param l2 - * @param l3 - * @param l4 - * @param l5 - * @param l6 - * @param l7 - * @param l8 */ shuffle(a: Uint16x8, b: Uint16x8, l1: number, l2: number, l3: number, l4: number, l5: number, l6: number, l7: number, l8: number): Uint16x8; /** * Returns a new instance if the parameter is a valid SIMD data type and the same as Uint16x8. Throws a TypeError otherwise. - * @param a */ check(a: Uint16x8): Uint16x8; /** * Creates a new SIMD.Uint16x8 data type with all lanes set to a given value. - * @param n */ splat(n: number): Uint16x8; /** * Returns a new instance with the given lane value replaced. * @param simd An instance of a corresponding SIMD type. - * @param lane * @param value A new value to be used for the lane. * @return A new SIMD data type with the given lane value replaced. */ @@ -1546,23 +1394,6 @@ declare namespace adone.math { /** * Returns a new instance with the lane values swizzled. - * @param a - * @param l1 - * @param l2 - * @param l3 - * @param l4 - * @param l5 - * @param l6 - * @param l7 - * @param l8 - * @param l9 - * @param l10 - * @param l11 - * @param l12 - * @param l13 - * @param l14 - * @param l15 - * @param l16 */ swizzle( a: Uint8x16, @@ -1586,24 +1417,6 @@ declare namespace adone.math { /** * Returns a new instance with the lane values shuffled. - * @param a - * @param b - * @param l1 - * @param l2 - * @param l3 - * @param l4 - * @param l5 - * @param l6 - * @param l7 - * @param l8 - * @param l9 - * @param l10 - * @param l11 - * @param l12 - * @param l13 - * @param l14 - * @param l15 - * @param l16 */ shuffle( a: Uint8x16, @@ -1628,20 +1441,17 @@ declare namespace adone.math { /** * Returns a new instance if the parameter is a valid SIMD data type and the same as Uint8x16. Throws a TypeError otherwise. - * @param a */ check(a: Uint8x16): Uint8x16; /** * Creates a new SIMD.Uint8x16 data type with all lanes set to a given value. - * @param n */ splat(n: number): Uint8x16; /** * Returns a new instance with the given lane value replaced. * @param simd An instance of a corresponding SIMD type. - * @param lane * @param value A new value to be used for the lane. * @return A new SIMD data type with the given lane value replaced. */ @@ -1802,20 +1612,17 @@ declare namespace adone.math { /** * Returns a new instance if the parameter is a valid SIMD data type and the same as Bool32x4. Throws a TypeError otherwise. - * @param a */ check(a: Bool32x4): Bool32x4; /** * Creates a new SIMD.Bool32x4 data type with all lanes set to a given value. - * @param n */ splat(n: boolean): Bool32x4; /** * Returns a new instance with the given lane value replaced. * @param simd An instance of a corresponding SIMD type. - * @param lane * @param value A new value to be used for the lane. * @return A new SIMD data type with the given lane value replaced. */ @@ -1823,13 +1630,11 @@ declare namespace adone.math { /** * If all lane values are `true`, return `true`. - * @param a */ allTrue(a: Bool32x4): boolean; /** * If any lane values are `true`, return `true`. - * @param a */ anyTrue(a: Bool32x4): boolean; @@ -1888,20 +1693,17 @@ declare namespace adone.math { /** * Returns a new instance if the parameter is a valid SIMD data type and the same as Bool16x8. Throws a TypeError otherwise. - * @param a */ check(a: Bool16x8): Bool16x8; /** * Creates a new SIMD.Bool16x8 data type with all lanes set to a given value. - * @param n */ splat(n: boolean): Bool16x8; /** * Returns a new instance with the given lane value replaced. * @param simd An instance of a corresponding SIMD type. - * @param lane * @param value A new value to be used for the lane. * @return A new SIMD data type with the given lane value replaced. */ @@ -1909,13 +1711,11 @@ declare namespace adone.math { /** * If all lane values are `true`, return `true`. - * @param a */ allTrue(a: Bool16x8): boolean; /** * If any lane values are `true`, return `true`. - * @param a */ anyTrue(a: Bool16x8): boolean; @@ -1998,20 +1798,17 @@ declare namespace adone.math { /** * Returns a new instance if the parameter is a valid SIMD data type and the same as Bool8x16. Throws a TypeError otherwise. - * @param a */ check(a: Bool8x16): Bool8x16; /** * Creates a new SIMD.Bool8x16 data type with all lanes set to a given value. - * @param n */ splat(n: boolean): Bool8x16; /** * Returns a new instance with the given lane value replaced. * @param simd An instance of a corresponding SIMD type. - * @param lane * @param value A new value to be used for the lane. * @return A new SIMD data type with the given lane value replaced. */ @@ -2019,13 +1816,11 @@ declare namespace adone.math { /** * If all lane values are `true`, return `true`. - * @param a */ allTrue(a: Bool8x16): boolean; /** * If any lane values are `true`, return `true`. - * @param a */ anyTrue(a: Bool8x16): boolean; diff --git a/types/adone/glosses/promise.d.ts b/types/adone/glosses/promise.d.ts index d0f59b0340..cdfe0ec2f5 100644 --- a/types/adone/glosses/promise.d.ts +++ b/types/adone/glosses/promise.d.ts @@ -47,8 +47,8 @@ declare namespace adone { /** * Converts a function that returns promises to a node.js style callback function * - * @param {Function} fn Function - * @returns {Promise} the original promise + * @param fn Function + * @returns the original promise */ export function callbackify(fn: () => Promise): (callback: (err?: any, result?: R) => void) => Promise; export function callbackify(fn: (a: T) => Promise): (a: T, callback: (err?: any, result?: R) => void) => Promise; diff --git a/types/aframe/aframe-tests.ts b/types/aframe/aframe-tests.ts index 439d314f4a..5af66a09d1 100644 --- a/types/aframe/aframe-tests.ts +++ b/types/aframe/aframe-tests.ts @@ -1,5 +1,4 @@ // Global - const threeCamera = new AFRAME.THREE.Camera(); AFRAME.TWEEN.Easing; @@ -42,9 +41,18 @@ entity.addEventListener('child-detached', (event) => { const Component = AFRAME.registerComponent('test', {}); // Scene - const scene = document.querySelector('a-scene'); scene.hasLoaded; // System const system = scene.systems['systemName']; + +// Register Custom Geometry +AFRAME.registerGeometry('a-test-geometry', { + schema: { + groupIndex: { default: 0 } + }, + init(data) { + this.geometry = new THREE.Geometry(); + } +}); diff --git a/types/aframe/index.d.ts b/types/aframe/index.d.ts index f1f5cd7a20..803318a754 100644 --- a/types/aframe/index.d.ts +++ b/types/aframe/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for AFRAME 0.5 +// Type definitions for AFRAME 0.7 // Project: https://aframe.io/ // Definitions by: Paul Shannon +// Roberto Ritger // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -40,7 +41,7 @@ declare namespace AFrame { primitives: { [ key: string ]: Entity }; registerComponent(name: string, component: ComponentDefinition): ComponentConstructor; registerElement(name: string, element: ANode): void; - registerGeometry(name: string, geometery: THREE.Geometry): Geometry; + registerGeometry(name: string, geometry: GeometryDefinition): Geometry; registerPrimitive(name: string, primitive: PrimitiveDefinition): void; registerShader(name: string, shader: any): void; registerSystem(name: string, definition: SystemDefinition): void; @@ -101,7 +102,7 @@ declare namespace AFrame { name: string; schema: Schema; - init(): void; + init(data?: any): void; pause(): void; play(): void; remove(): void; @@ -124,7 +125,7 @@ declare namespace AFrame { multiple?: boolean; schema?: Schema; - init?(): void; + init?(data?: any): void; pause?(): void; play?(): void; remove?(): void; @@ -222,6 +223,10 @@ declare namespace AFrame { [ key: string ]: any; } + interface GeometryDefinition extends ComponentDefinition { + geometry?: THREE.Geometry; + } + interface GeometryDescriptor { Geometry: Geometry; schema: Schema; diff --git a/types/agenda/tslint.json b/types/agenda/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/agenda/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/alertify/tslint.json b/types/alertify/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/alertify/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/algoliasearch/algoliasearch-tests.ts b/types/algoliasearch/algoliasearch-tests.ts index dfcf27c94f..1786b07af7 100644 --- a/types/algoliasearch/algoliasearch-tests.ts +++ b/types/algoliasearch/algoliasearch-tests.ts @@ -1,144 +1,153 @@ -import * as algoliasearch from "algoliasearch"; -import { ClientOptions, SynonymOption, AlgoliaUserKeyOptions, SearchSynonymOptions, AlgoliaResponse, - AlgoliaSecuredApiOptions, AlgoliaIndexSettings, AlgoliaQueryParameters, AlgoliaIndex } from "algoliasearch"; +import * as algoliasearch from 'algoliasearch'; +import { + ClientOptions, + SynonymOption, + AlgoliaApiKeyOptions, + SearchSynonymOptions, + AlgoliaResponse, + AlgoliaSecuredApiOptions, + AlgoliaIndexSettings, + AlgoliaQueryParameters, + AlgoliaIndex, +} from 'algoliasearch'; let _algoliaResponse: AlgoliaResponse = { - hits: [{}, {}], - page: 0, - nbHits: 12, - nbPages: 6, - hitsPerPage: 2, - processingTimeMS: 32, - query: "", - params: "", + hits: [{}, {}], + page: 0, + nbHits: 12, + nbPages: 6, + hitsPerPage: 2, + processingTimeMS: 32, + query: '', + params: '', }; let _clientOptions: ClientOptions = { - timeout: 12, - protocol: "", - httpAgent: "", + timeout: 12, + protocol: '', + httpAgent: '', }; let _synonymOption: SynonymOption = { - forwardToSlaves: false, - replaceExistingSynonyms: false, + forwardToReplicas: false, + replaceExistingSynonyms: false, }; -let _algoliaUserKeyOptions: AlgoliaUserKeyOptions = { - validity: 0, - maxQueriesPerIPPerHour: 0, - indexes: [""], - queryParameters: { attributesToRetrieve: ["algolia"] }, - description: "", +let _algoliaApiKeyOptions: AlgoliaApiKeyOptions = { + validity: 0, + maxQueriesPerIPPerHour: 0, + indexes: [''], + queryParameters: { attributesToRetrieve: ['algolia'] }, + description: '', }; let _searchSynonymOptions: SearchSynonymOptions = { - query: "", - page: 0, - type: "", - hitsPerPage: 0, + query: '', + page: 0, + type: '', + hitsPerPage: 0, }; let _algoliaSecuredApiOptions: AlgoliaSecuredApiOptions = { - filters: "", - validUntil: 0, - restrictIndices: "", - userToken: "", + filters: '', + validUntil: 0, + restrictIndices: '', + userToken: '', }; let _algoliaIndexSettings: AlgoliaIndexSettings = { - attributesToIndex: [""], - attributesForFaceting: [""], - unretrievableAttributes: [""], - attributesToRetrieve: [""], - ranking: [""], - customRanking: [""], - slaves: [""], - maxValuesPerFacet: "", - attributesToHighlight: [""], - attributesToSnippet: [""], - highlightPreTag: "", - highlightPostTag: "", - snippetEllipsisText: "", - restrictHighlightAndSnippetArrays: false, - hitsPerPage: 0, - minWordSizefor1Typo: 0, - minWordSizefor2Typos: 0, - typoTolerance: false, - allowTyposOnNumericTokens: false, - ignorePlurals: false, - disableTypoToleranceOnAttributes: "", - separatorsToIndex: "", - queryType: "", - removeWordsIfNoResults: "", - advancedSyntax: false, - optionalWords: [""], - removeStopWords: [""], - disablePrefixOnAttributes: [""], - disableExactOnAttributes: [""], - exactOnSingleWordQuery: "", - alternativesAsExact: false, - attributeForDistinct: "", - distinct: false, - numericAttributesToIndex: [""], - allowCompressionOfIntegerArray: false, - altCorrections: [{}], - minProximity: 0, - placeholders: "", + attributesToIndex: [''], + attributesForFaceting: [''], + unretrievableAttributes: [''], + attributesToRetrieve: [''], + ranking: [''], + customRanking: [''], + replicas: [''], + maxValuesPerFacet: '', + attributesToHighlight: [''], + attributesToSnippet: [''], + highlightPreTag: '', + highlightPostTag: '', + snippetEllipsisText: '', + restrictHighlightAndSnippetArrays: false, + hitsPerPage: 0, + minWordSizefor1Typo: 0, + minWordSizefor2Typos: 0, + typoTolerance: false, + allowTyposOnNumericTokens: false, + ignorePlurals: false, + disableTypoToleranceOnAttributes: '', + separatorsToIndex: '', + queryType: '', + removeWordsIfNoResults: '', + advancedSyntax: false, + optionalWords: [''], + removeStopWords: [''], + disablePrefixOnAttributes: [''], + disableExactOnAttributes: [''], + exactOnSingleWordQuery: '', + alternativesAsExact: false, + attributeForDistinct: '', + distinct: false, + numericAttributesToIndex: [''], + allowCompressionOfIntegerArray: false, + altCorrections: [{}], + minProximity: 0, + placeholders: '', }; let _algoliaQueryParameters: AlgoliaQueryParameters = { - query: "", - filters: "", - attributesToRetrieve: [""], - restrictSearchableAttributes: [""], - facets: "", - maxValuesPerFacet: "", - attributesToHighlight: [""], - attributesToSnippet: [""], - highlightPreTag: "", - highlightPostTag: "", - snippetEllipsisText: "", - restrictHighlightAndSnippetArrays: false, - hitsPerPage: 0, - page: 0, - offset: 0, - length: 0, - minWordSizefor1Typo: 0, - minWordSizefor2Typos: 0, - typoTolerance: false, - allowTyposOnNumericTokens: false, - ignorePlurals: false, - disableTypoToleranceOnAttributes: "", - aroundLatLng: "", - aroundLatLngViaIP: "", - aroundRadius: "", - aroundPrecision: 0, - minimumAroundRadius: 0, - insideBoundingBox: "", - queryType: "", - insidePolygon: "", - removeWordsIfNoResults: "", - advancedSyntax: false, - optionalWords: [""], - removeStopWords: [""], - disableExactOnAttributes: [""], - exactOnSingleWordQuery: "", - alternativesAsExact: true, - distinct: 0, - getRankingInfo: false, - numericAttributesToIndex: [""], - numericFilters: [""], - tagFilters: "", - facetFilters: "", - analytics: false, - analyticsTags: [""], - synonyms: true, - replaceSynonymsInHighlight: false, - minProximity: 0, + query: '', + filters: '', + attributesToRetrieve: [''], + restrictSearchableAttributes: [''], + facets: '', + maxValuesPerFacet: '', + attributesToHighlight: [''], + attributesToSnippet: [''], + highlightPreTag: '', + highlightPostTag: '', + snippetEllipsisText: '', + restrictHighlightAndSnippetArrays: false, + hitsPerPage: 0, + page: 0, + offset: 0, + length: 0, + minWordSizefor1Typo: 0, + minWordSizefor2Typos: 0, + typoTolerance: false, + allowTyposOnNumericTokens: false, + ignorePlurals: false, + disableTypoToleranceOnAttributes: '', + aroundLatLng: '', + aroundLatLngViaIP: '', + aroundRadius: '', + aroundPrecision: 0, + minimumAroundRadius: 0, + insideBoundingBox: '', + queryType: '', + insidePolygon: '', + removeWordsIfNoResults: '', + advancedSyntax: false, + optionalWords: [''], + removeStopWords: [''], + disableExactOnAttributes: [''], + exactOnSingleWordQuery: '', + alternativesAsExact: true, + distinct: 0, + getRankingInfo: false, + numericAttributesToIndex: [''], + numericFilters: [''], + tagFilters: '', + facetFilters: '', + analytics: false, + analyticsTags: [''], + synonyms: true, + replaceSynonymsInHighlight: false, + minProximity: 0, }; -let index: AlgoliaIndex = algoliasearch("", "").initIndex(""); +let index: AlgoliaIndex = algoliasearch('', '').initIndex(''); -let search = index.search({query: ""}); - index.search({query: ""}, (err, res) => {}); +let search = index.search({ query: '' }); +index.search({ query: '' }, (err, res) => {}); diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts index 1bb77a50e9..f068fc4e22 100644 --- a/types/algoliasearch/index.d.ts +++ b/types/algoliasearch/index.d.ts @@ -1,1528 +1,1934 @@ -// Type definitions for algoliasearch-client-js 3.18.1 +// Type definitions for algoliasearch-client-js 3.24.6 // Project: https://github.com/algolia/algoliasearch-client-js // Definitions by: Baptiste Coquelle +// Haroen Viaene +// Aurélien Hervé // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 declare namespace algoliasearch { - 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 - */ - nbPages: 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; - } - /* - Interface for the algolia client object - */ - interface AlgoliaClient { - /** - * Initialization of the index - * @param name: index name - * return algolia index object - * https://github.com/algolia/algoliasearch-client-js#init-index---initindex - */ - initIndex(name: string): AlgoliaIndex; - /** - * Query on multiple index - * @param queries index name, query and query parameters - * @param cb callback(err, res) - * https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries - */ - search(queries: { indexName: string, query: string, options: AlgoliaQueryParameters }, cb: (err: Error, res: any) => void): void; - /** - * Query on multiple index - * @param queries index name, query and query parameters - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries - */ - search(queries: { indexName: string, query: string, options: AlgoliaQueryParameters }): Promise; - /** - * clear browser cache - * https://github.com/algolia/algoliasearch-client-js#cache - */ - clearCache(): void; - /** - * kill alive connections - * https://github.com/algolia/algoliasearch-client-js#keep-alive - */ - destroy(): void; - /** - * List all your indices along with their associated information (number of entries, disk size, etc.) - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#list-indices---listindexes - */ - listIndexes(cb: (err: Error, res: any) => void): void; - /** - * List all your indices along with their associated information (number of entries, disk size, etc.) - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#list-indices---listindexes - */ - listIndexes(): Promise; - /** - * Delete a specific index - * @param name - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#delete-index---deleteindex - */ - deleteIndex(name: string, cb: (err: Error, res: any) => void): void; - /** - * Delete a specific index - * @param name - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#delete-index---deleteindex - */ - deleteIndex(name: string): Promise; - /** - * Copy an index from a specific index to a new one - * @param from origin index - * @param to destination index - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#copy-index---copyindex - */ - copyIndex(from: string, to: string, cb: (err: Error, res: any) => void): void; - /** - * Copy an index from a specific index to a new one - * @param from origin index - * @param to destination index - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#copy-index---copyindex - */ - copyIndex(from: string, to: string): Promise; - /** - * Move index to a new one (and will overwrite the original one) - * @param from origin index - * @param to destination index - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#move-index---moveindex - */ - moveIndex(from: string, to: string, cb: (err: Error, res: any) => void): void; - /** - * Move index to a new one (and will overwrite the original one) - * @param from origin index - * @param to destination index - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#move-index---moveindex - */ - moveIndex(from: string, to: string): Promise; - /** - * Generate a public API key - * @param key api key - * @param filters - * https://github.com/algolia/algoliasearch-client-js#generate-key---generatesecuredapikey - */ - generateSecuredApiKey(key: string, filters: AlgoliaSecuredApiOptions): void; - /** - * Perform multiple operations with one API call to reduce latency - * @param action - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch - */ - batch(action: AlgoliaAction, cb: (err: Error, res: any) => void): void; - /** - * Perform multiple operations with one API call to reduce latency - * @param action - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch - */ - batch(action: AlgoliaAction): Promise; - /** - * Lists global API Keys - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse - */ - listUserKeys(cb: (err: Error, res: any) => void): void; - /** - * Lists global API Keys - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse - */ - listUserKeys(): Promise; - /** - * Add global API Keys - * @param scopes - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - addUserKey(scopes: string[], cb: (err: Error, res: any) => void): void; - /** - * Add global API Key - * @param scopes - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - addUserKey(scopes: string[], options: AlgoliaUserKeyOptions, cb: (err: Error, res: any) => void): void; - /** - * Add global API Keys - * @param scopes - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - addUserKey(scopes: string[], options?: AlgoliaUserKeyOptions): Promise; - /** - * Update global API key - * @param key - * @param scopes - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - updateUserKey(key: string, scopes: string[], cb: (err: Error, res: any) => void): void; - /** - * Update global API key - * @param key - * @param scopes - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - updateUserKey(key: string, scopes: string[], options: AlgoliaUserKeyOptions, cb: (err: Error, res: any) => void): void; - /** - * Update global API key - * @param key - * @param scopes - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - updateUserKey(key: string, scopes: string[], options?: AlgoliaUserKeyOptions): Promise; - /** - * Gets the rights of a global key - * @param key - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - getUserKeyACL(key: string, cb: (err: Error, res: any) => void): void; - /** - * Gets the rights of a global key - * @param key - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - getUserKeyACL(key: string): Promise; - /** - * Deletes a global key - * @param key - * @param cb(err,res) - * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteuserkey - */ - deleteUserKey(key: string, cb: (err: Error, res: any) => void): void; - /** - * Deletes a global key - * @param key - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteuserkey - */ - deleteUserKey(key: string): Promise; - /** - * Get 1000 last events - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs - */ - getLogs(options: LogsOptions, cb: (err: Error, res: any) => void): void; - /** - * Get 1000 last events - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs - */ - getLogs(options: LogsOptions): Promise; - } + interface AlgoliaResponse { /** - * Interface for the index algolia object + * Contains all the hits matching the query + * https://github.com/algolia/algoliasearch-client-js#response-format */ - interface AlgoliaIndex { - /** - * Gets a specific object - * @param objectID - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects - */ - getObject(objectID: string, cb: (err: Error, res: any) => void): void; - /** - * Gets specific attributes from an object - * @param objectID - * @param attributes - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects - */ - getObject(objectID: string, attributes: string[], cb: (err: Error, res: any) => void): void; - /** - * Gets a list of objects - * @param objectIDs - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects - */ - getObjects(objectIDs: string[], cb: (err: Error, res: any) => void): void; - /** - * Add a specific object - * @param object without objectID - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects - */ - addObject(object: {}, cb: (err: Error, res: any) => void): void; - /** - * Add a list of objects - * @param object with objectID - * @param objectID - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects - */ - addObject(object: {}, objectID: string, cb: (err: Error, res: any) => void): void; - /** - * Add list of objects - * @param objects - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects - */ - addObjects(objects: [{}], cb: (err: Error, res: any) => void): void; - /** - * Add or replace a specific object - * @param object - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects - */ - saveObject(object: {}, cb: (err: Error, res: any) => void): void; - /** - * Add or replace several objects - * @param objects - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects - */ - saveObjects(objects: [{}], cb: (err: Error, res: any) => void): void; - /** - * Update parameters of a specific object - * @param object - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects - */ - partialUpdateObject(object: {}, cb: (err: Error, res: any) => void): void; - /** - * Update parameters of a list of objects - * @param objects - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects - */ - partialUpdateObjects(objects: [{}], cb: (err: Error, res: any) => void): void; - /** - * Delete a specific object - * @param objectID - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects - */ - deleteObject(objectID: string, cb: (err: Error, res: any) => void): void; - /** - * Delete a list of objects - * @param objectIDs - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects - */ - deleteObjects(objectIDs: string[], cb: (err: Error, res: any) => void): void; - /** - * Delete objects that matches the query - * @param query - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#delete-by-query---deletebyquery - */ - deleteByQuery(query: string, cb: (err: Error, res: any) => void): void; - /** - * Delete objects that matches the query - * @param query - * @param params of the object - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#delete-by-query---deletebyquery - */ - deleteByQuery(query: string, params: {}, cb: (err: Error, res: any) => void): void; - /** - * Wait for an indexing task to be compete - * @param taskID - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#wait-for-operations---waittask - */ - waitTask(taskID: number, cb: (err: Error, res: any) => void): void; - /** - * Get an index settings - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#get-settings---getsettings - */ - getSettings(cb: (err: Error, res: any) => void): void; - /** - * Set an index settings - * @param settings - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#set-settings---setsettings - */ - setSettings(settings: AlgoliaIndexSettings, cb: (err: Error, res: any) => void): void; - /** - * Clear cache of an index - * https://github.com/algolia/algoliasearch-client-js#cache - */ - clearCache(): void; - /** - * Clear an index content - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#clear-index---clearindex - */ - clearIndex(cb: (err: Error, res: any) => void): void; - /** - * Save a synonym object - * @param synonym - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym - */ - saveSynonym(synonym: AlgoliaSynonym, options: SynonymOption, cb: (err: Error, res: any) => void): void; - /** - * Save a synonym object - * @param synonyms - * @param options - * @param cb(err, res) - */ - batchSynonyms(synonyms: AlgoliaSynonym[], options: SynonymOption, cb: (err: Error, res: any) => void): void; - /** - * Delete a specific synonym - * @param identifier - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#batch-synonyms---batchsynonyms - */ - deleteSynonym(identifier: string, options: SynonymOption, cb: (err: Error, res: any) => void): void; - /** - * Clear all synonyms of an index - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#clear-all-synonyms---clearsynonyms - */ - clearSynonyms(options: SynonymOption, cb: (err: Error, res: any) => void): void; - /** - * Get a specific synonym - * @param identifier - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#get-synonym---getsynonym - */ - getSynonym(identifier: string, cb: (err: Error, res: any) => void): void; - /** - * Search a synonyms - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms - */ - searchSynonyms(options: SearchSynonymOptions, cb: (err: Error, res: any) => void): void; - /** - * List index user keys - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#list-api-keys---listapikeys - */ - listUserKeys(cb: (err: Error, res: any) => void): void; - /** - * Add key for this index - * @param scopes - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - addUserKey(scopes: string[], cb: (err: Error, res: any) => void): void; - /** - * Add key for this index - * @param scopes - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - addUserKey(scopes: string[], options: AlgoliaUserKeyOptions, cb: (err: Error, res: any) => void): void; - /** - * Update a key for this index - * @param key - * @param scopes - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - updateUserKey(key: string, scopes: string[], cb: (err: Error, res: any) => void): void; - /** - * Update a key for this index - * @param key - * @param scopes - * @param options - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - updateUserKey(key: string, scopes: string[], options: AlgoliaUserKeyOptions, cb: (err: Error, res: any) => void): void; - /** - * Gets the rights of an index specific key - * @param key - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#get-key-permissions---getuserkeyacl - */ - getUserKeyACL(key: string, cb: (err: Error, res: any) => void): void; - /** - * Deletes an index specific key - * @param key - * @param cb(err, res) - * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteuserkey - */ - deleteUserKey(key: string, cb: (err: Error, res: any) => void): void; - /** - * Gets specific attributes from an object - * @param objectID - * @param attributes - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects - */ - getObject(objectID: string, attributes?: string[]): Promise ; - /** - * Gets a list of objects - * @param objectIDs - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects - */ - getObjects(objectIDs: string[]): Promise ; - /** - * Add a list of objects - * @param object with objectID - * @param objectID - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects - */ - addObject(object: {}, objectID?: string): Promise ; - /** - * Add list of objects - * @param objects - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects - */ - addObjects(objects: [{}]): Promise ; - /** - * Add or replace a specific object - * @param object - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects - */ - saveObject(object: {}): Promise ; - /** - * Add or replace several objects - * @param objects - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects - */ - saveObjects(objects: [{}]): Promise ; - /** - * Update parameters of a specific object - * @param object - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects - */ - partialUpdateObject(object: {}): Promise ; - /** - * Update parameters of a list of objects - * @param objects - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects - */ - partialUpdateObjects(objects: [{}]): Promise ; - /** - * Delete a specific object - * @param objectID - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects - */ - deleteObject(objectID: string): Promise ; - /** - * Delete a list of objects - * @param objectIDs - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects - */ - deleteObjects(objectIDs: string[]): Promise ; - /** - * Delete objects that matches the query - * @param query - * @param params of the object - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#delete-by-query---deletebyquery - */ - deleteByQuery(query: string, params?: {}): Promise ; - /** - * Wait for an indexing task to be compete - * @param taskID - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#wait-for-operations---waittask - */ - waitTask(taskID: number): Promise ; - /** - * Get an index settings - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#get-settings---getsettings - */ - getSettings(): Promise ; - /** - * Set an index settings - * @param settings - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#set-settings---setsettings - */ - setSettings(settings: AlgoliaIndexSettings): Promise ; - /** - * Search in an index - * @param params query parameter - * return {Promise} - * @param err() error callback - * https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search - */ - search(params: AlgoliaQueryParameters): Promise ; - /** - * Search in an index - * @param params query parameter - * @param cb(err, res) - * @param err() error callback - * https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search - */ - search(params: AlgoliaQueryParameters, cb: (err: Error, res: any) => void): void; - /** - * Browse an index - * @param query - * @param cb(err, content) - * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse - */ - browse(query: string, cb: (err: Error, res: any) => void): void; - /** - * Browse an index - * @param query - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse - */ - browse(query: string): Promise; - /** - * Browse an index from a cursor - * @param cursor - * @param cb(err, content) - * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse - */ - browseFrom(cursor: string, cb: (err: Error, res: any) => void): void; - /** - * Browse an index from a cursor - * @param cursor - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse - */ - browseFrom(cursor: string): Promise; - /** - * Browse an entire index - * return Promise - * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse - */ - browseAll(): Promise; - /** - * Clear an index content - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#clear-index---clearindex - */ - clearIndex(): Promise ; - /** - * Save a synonym object - * @param synonym - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym - */ - saveSynonym(synonym: AlgoliaSynonym, options: SynonymOption): Promise ; - /** - * Save a synonym object - * @param synonyms - * @param options - * return {Promise} - */ - batchSynonyms(synonyms: AlgoliaSynonym[], options: SynonymOption): Promise ; - /** - * Delete a specific synonym - * @param identifier - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#batch-synonyms---batchsynonyms - */ - deleteSynonym(identifier: string, options: SynonymOption): Promise ; - /** - * Clear all synonyms of an index - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#clear-all-synonyms---clearsynonyms - */ - clearSynonyms(options: SynonymOption): Promise ; - /** - * Get a specific synonym - * @param identifier - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#get-synonym---getsynonym - */ - getSynonym(identifier: string): Promise ; - /** - * Search a synonyms - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms - */ - searchSynonyms(options: SearchSynonymOptions): Promise ; - /** - * List index user keys - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#list-api-keys---listapikeys - */ - listUserKeys(): Promise ; - /** - * Add key for this index - * @param scopes - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - addUserKey(scopes: string[], options?: AlgoliaUserKeyOptions): Promise ; - /** - * Update a key for this index - * @param key - * @param scopes - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - updateUserKey(key: string, scopes: string[]): Promise ; - /** - * Update a key for this index - * @param key - * @param scopes - * @param options - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateuserkey - */ - updateUserKey(key: string, scopes: string[], options: AlgoliaUserKeyOptions): Promise ; - /** - * Gets the rights of an index specific key - * @param key - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#get-key-permissions---getuserkeyacl - */ - getUserKeyACL(key: string): Promise ; - /** - * Deletes an index specific key - * @param key - * return {Promise} - * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteuserkey - */ - deleteUserKey(key: string): Promise ; - } - /* - Interface describing available options when initializing a client - */ - interface ClientOptions { - /** - * Timeout for requests to our servers, in milliseconds - * default: 15s (node), 2s (browser) - * https://github.com/algolia/algoliasearch-client-js#client-options - */ - timeout?: number; - /** - * Protocol to use when communicating with algolia - * default: current protocol(browser), https(node) - * https://github.com/algolia/algoliasearch-client-js#client-options - */ - protocol?: string; - /** - * (node only) httpAgent instance to use when communicating with Algolia servers. - * https://github.com/algolia/algoliasearch-client-js#client-options - */ - httpAgent?: any; - /** - * read: array of read hosts to use to call Algolia servers, computed automatically - * write: array of read hosts to use to call Algolia servers, computed automatically - * https://github.com/algolia/algoliasearch-client-js#client-options - */ - hosts?: { read?: string[], write?: string[] }; - } - /* - Interface describing options available for gettings the logs - */ - interface LogsOptions { - /** - * Specify the first entry to retrieve (0-based, 0 is the most recent log entry). - * default: 0 - * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs - */ - offset?: number; - /** - * Specify the maximum number of entries to retrieve starting at the offset. - * default: 10 - * maximum: 1000 - * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs - */ - length?: number; - /** - * @deprecated - * Retrieve only logs with an HTTP code different than 200 or 201 - * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs - */ - onlyErrors?: boolean; - /** - * Specify the type of logs to retrieve - * 'query' Retrieve only the queries - * 'build' Retrieve only the build operations - * 'error' Retrieve only the errors (same as onlyErrors parameters) - * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs - */ - type?: string; - } + hits: any[]; /** - * Describe the action object used for batch operation + * Current page + * https://github.com/algolia/algoliasearch-client-js#response-format */ - interface AlgoliaAction { - /** - * Type of the batch action - * values: addObject, updateObject, partialUpdateObject, partialUpdateObjectNoCreate, deleteObject - * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch - */ - action: string; - /** - * Name of the index where the bact will be performed - * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch - */ + 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 + */ + nbPages: 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; + } + /* + Interface for the algolia client object + */ + interface AlgoliaClient { + /** + * Initialization of the index + * @param name: index name + * return algolia index object + * https://github.com/algolia/algoliasearch-client-js#init-index---initindex + */ + initIndex(name: string): AlgoliaIndex; + /** + * Query on multiple index + * @param queries index name, query and query parameters + * @param cb callback(err, res) + * https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries + */ + search( + queries: { indexName: string; - /** - * Object - * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch - */ - body: {}; - } - /** - * Describes the option used when creating user key - */ - interface AlgoliaUserKeyOptions { - /** - * Add a validity period. The key will be valid for a specific period of time (in seconds). - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - validity?: number; - /** - * Specify the maximum number of API calls allowed from an IP address per hour - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - maxQueriesPerIPPerHour?: number; - /** - * Specify the maximum number of hits this API key can retrieve in one call - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - maxHitsPerQuery?: boolean; - /** - * Specify the list of targeted indices - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - indexes?: string[]; - /** - * Specify the list of referers - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - referers?: string[]; - /** - * Specify the list of query parameters - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - queryParameters?: AlgoliaQueryParameters; - /** - * Specify a description to describe where the key is used. - * https://github.com/algolia/algoliasearch-client-js#add-user-key---adduserkey - */ - description?: string; - } - /** - * Describes option used when making operation on synonyms - */ - interface SynonymOption { - /** - * You can forward all settings updates to the slaves of an index - * https://github.com/algolia/algoliasearch-client-js#slave-settings - */ - forwardToSlaves?: boolean; - /** - * Replace all existing synonyms on the index with the content of the batch - * https://github.com/algolia/algoliasearch-client-js#batch-synonyms---batchsynonyms - */ - replaceExistingSynonyms?: boolean; - } - /** - * Describes options used when searching for synonyms - */ - interface SearchSynonymOptions { - /** - * The actual search query to find synonyms - * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms - */ - query?: string; - /** - * The page to fetch when browsing through several pages of results - * default: 100 - * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms - */ - page?: number; - /** - * Restrict the search to a specific type of synonym - * Use an empty string to search all types (default behavior) - * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms - */ - type?: string; - /** - * Number of hits per page - * default: 100 - * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms - */ - hitsPerPage?: number; - } - interface AlgoliaBrowseResponse { - cursor?: string; - hits: any[]; - params: string; query: string; - processingTimeMS: number; - } + params: AlgoliaQueryParameters; + }, + cb: (err: Error, res: any) => void + ): void; /** - * Describes a synonym object + * Query on multiple index + * @param queries index name, query and query parameters + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries */ - interface AlgoliaSynonym { + search(queries: { + indexName: string; + query: string; + params: AlgoliaQueryParameters; + }): Promise; + /** + * clear browser cache + * https://github.com/algolia/algoliasearch-client-js#cache + */ + clearCache(): void; + /** + * kill alive connections + * https://github.com/algolia/algoliasearch-client-js#keep-alive + */ + destroy(): void; + /** + * Add a header to be sent with all upcoming requests + */ + setExtraHeader(name: string, value: string): void; + /** + * Get the value of an extra header + */ + getExtraHeader(name: string): string; + /** + * remove an extra header for all upcoming requests + */ + unsetExtraHeader(name: string): void; + /** + * List all your indices along with their associated information (number of entries, disk size, etc.) + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#list-indices---listindexes + */ + listIndexes(cb: (err: Error, res: any) => void): void; + /** + * List all your indices along with their associated information (number of entries, disk size, etc.) + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#list-indices---listindexes + */ + listIndexes(): Promise; + /** + * Delete a specific index + * @param name + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#delete-index---deleteindex + */ + deleteIndex(name: string, cb: (err: Error, res: any) => void): void; + /** + * Delete a specific index + * @param name + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#delete-index---deleteindex + */ + deleteIndex(name: string): Promise; + /** + * Copy an index from a specific index to a new one + * @param from origin index + * @param to destination index + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#copy-index---copyindex + */ + copyIndex( + from: string, + to: string, + cb: (err: Error, res: any) => void + ): void; + /** + * Copy an index from a specific index to a new one + * @param from origin index + * @param to destination index + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#copy-index---copyindex + */ + copyIndex(from: string, to: string): Promise; + /** + * Move index to a new one (and will overwrite the original one) + * @param from origin index + * @param to destination index + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#move-index---moveindex + */ + moveIndex( + from: string, + to: string, + cb: (err: Error, res: any) => void + ): void; + /** + * Move index to a new one (and will overwrite the original one) + * @param from origin index + * @param to destination index + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#move-index---moveindex + */ + moveIndex(from: string, to: string): Promise; + /** + * Generate a public API key + * @param key api key + * @param filters + * https://github.com/algolia/algoliasearch-client-js#generate-key---generatesecuredapikey + */ + generateSecuredApiKey( + key: string, + filters: AlgoliaSecuredApiOptions + ): string; + /** + * Perform multiple operations with one API call to reduce latency + * @param action + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch + */ + batch(action: AlgoliaAction, cb: (err: Error, res: any) => void): void; + /** + * Perform multiple operations with one API call to reduce latency + * @param action + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch + */ + batch(action: AlgoliaAction): Promise; + /** + * Lists global API Keys + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + listApiKeys(cb: (err: Error, res: any) => void): void; + /** + * Lists global API Keys + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + listApiKeys(): Promise; + /** + * Add global API Keys + * @param scopes + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + addApiKey(scopes: string[], cb: (err: Error, res: any) => void): void; + /** + * Add global API Key + * @param scopes + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + addApiKey( + scopes: string[], + options: AlgoliaApiKeyOptions, + cb: (err: Error, res: any) => void + ): void; + /** + * Add global API Keys + * @param scopes + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + addApiKey(scopes: string[], options?: AlgoliaApiKeyOptions): Promise; + /** + * Update global API key + * @param key + * @param scopes + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey + */ + updateApiKey( + key: string, + scopes: string[], + cb: (err: Error, res: any) => void + ): void; + /** + * Update global API key + * @param key + * @param scopes + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey + */ + updateApiKey( + key: string, + scopes: string[], + options: AlgoliaApiKeyOptions, + cb: (err: Error, res: any) => void + ): void; + /** + * Update global API key + * @param key + * @param scopes + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey + */ + updateApiKey( + key: string, + scopes: string[], + options?: AlgoliaApiKeyOptions + ): Promise; + /** + * Gets the rights of a global key + * @param key + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey + */ + getApiKey(key: string, cb: (err: Error, res: any) => void): void; + /** + * Gets the rights of a global key + * @param key + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey + */ + getApiKey(key: string): Promise; + /** + * Deletes a global key + * @param key + * @param cb(err,res) + * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteapikey + */ + deleteApiKey(key: string, cb: (err: Error, res: any) => void): void; + /** + * Deletes a global key + * @param key + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteapikey + */ + deleteApiKey(key: string): Promise; + /** + * Get 1000 last events + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs + */ + getLogs(options: LogsOptions, cb: (err: Error, res: any) => void): void; + /** + * Get 1000 last events + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs + */ + getLogs(options: LogsOptions): Promise; + } + /** + * Interface for the index algolia object + */ + interface AlgoliaIndex { + /** + * Gets a specific object + * @param objectID + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects + */ + getObject(objectID: string, cb: (err: Error, res: any) => void): void; + /** + * Gets specific attributes from an object + * @param objectID + * @param attributes + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects + */ + getObject( + objectID: string, + attributes: string[], + cb: (err: Error, res: any) => void + ): void; + /** + * Gets a list of objects + * @param objectIDs + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects + */ + getObjects(objectIDs: string[], cb: (err: Error, res: any) => void): void; + /** + * Add a specific object + * @param object without objectID + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects + */ + addObject(object: {}, cb: (err: Error, res: any) => void): void; + /** + * Add a list of objects + * @param object with objectID + * @param objectID + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects + */ + addObject( + object: {}, + objectID: string, + cb: (err: Error, res: any) => void + ): void; + /** + * Add list of objects + * @param objects + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects + */ + addObjects(objects: [{}], cb: (err: Error, res: any) => void): void; + /** + * Add or replace a specific object + * @param object + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects + */ + saveObject(object: {}, cb: (err: Error, res: any) => void): void; + /** + * Add or replace several objects + * @param objects + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects + */ + saveObjects(objects: object[], cb: (err: Error, res: any) => void): void; + /** + * Update parameters of a specific object + * @param object + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects + */ + partialUpdateObject(object: {}, cb: (err: Error, res: any) => void): void; + /** + * Update parameters of a list of objects + * @param objects + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects + */ + partialUpdateObjects( + objects: [{}], + cb: (err: Error, res: any) => void + ): void; + /** + * Delete a specific object + * @param objectID + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects + */ + deleteObject(objectID: string, cb: (err: Error, res: any) => void): void; + /** + * Delete a list of objects + * @param objectIDs + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects + */ + deleteObjects( + objectIDs: string[], + cb: (err: Error, res: any) => void + ): void; + /** + * Delete objects that matches the query + * @param query + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#delete-by-query---deletebyquery + */ + deleteByQuery(query: string, cb: (err: Error, res: any) => void): void; + /** + * Delete objects that matches the query + * @param query + * @param params of the object + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#delete-by-query---deletebyquery + */ + deleteByQuery( + query: string, + params: {}, + cb: (err: Error, res: any) => void + ): void; + /** + * Delete objects that matches the query + * @param query + * @param params of the object + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#delete-by-query---deleteby + */ + deleteBy(params: {}, cb: (err: Error, res: any) => void): void; + /** + * Wait for an indexing task to be compete + * @param taskID + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#wait-for-operations---waittask + */ + waitTask(taskID: number, cb: (err: Error, res: any) => void): void; + /** + * Get an index settings + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#get-settings---getsettings + */ + getSettings(cb: (err: Error, res: any) => void): void; + /** + * Set an index settings + * @param settings + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#set-settings---setsettings + */ + setSettings( + settings: AlgoliaIndexSettings, + cb: (err: Error, res: any) => void + ): void; + /** + * Clear cache of an index + * https://github.com/algolia/algoliasearch-client-js#cache + */ + clearCache(): void; + /** + * Clear an index content + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#clear-index---clearindex + */ + clearIndex(cb: (err: Error, res: any) => void): void; + /** + * Save a synonym object + * @param synonym + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym + */ + saveSynonym( + synonym: AlgoliaSynonym, + options: SynonymOption, + cb: (err: Error, res: any) => void + ): void; + /** + * Save a synonym object + * @param synonyms + * @param options + * @param cb(err, res) + */ + batchSynonyms( + synonyms: AlgoliaSynonym[], + options: SynonymOption, + cb: (err: Error, res: any) => void + ): void; + /** + * Delete a specific synonym + * @param identifier + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#batch-synonyms---batchsynonyms + */ + deleteSynonym( + identifier: string, + options: SynonymOption, + cb: (err: Error, res: any) => void + ): void; + /** + * Clear all synonyms of an index + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#clear-all-synonyms---clearsynonyms + */ + clearSynonyms( + options: SynonymOption, + cb: (err: Error, res: any) => void + ): void; + /** + * Get a specific synonym + * @param identifier + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#get-synonym---getsynonym + */ + getSynonym(identifier: string, cb: (err: Error, res: any) => void): void; + /** + * Search a synonyms + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms + */ + searchSynonyms( + options: SearchSynonymOptions, + cb: (err: Error, res: any) => void + ): void; + /** + * Save a rule object + * @param rule + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#save-rule---saverule + */ + saveRule( + rule: AlgoliaRule, + options: RuleOption, + cb: (err: Error, res: any) => void + ): void; + /** + * Save a rule object + * @param rules + * @param options + * @param cb(err, res) + */ + batchRules( + rules: AlgoliaRule[], + options: RuleOption, + cb: (err: Error, res: any) => void + ): void; + /** + * Delete a specific rule + * @param identifier + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#batch-rules---batchrules + */ + deleteRule( + identifier: string, + options: RuleOption, + cb: (err: Error, res: any) => void + ): void; + /** + * Clear all rules of an index + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#clear-all-rules---clearrules + */ + clearRules(options: RuleOption, cb: (err: Error, res: any) => void): void; + /** + * Get a specific rule + * @param identifier + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#get-rule---getrule + */ + getRule(identifier: string, cb: (err: Error, res: any) => void): void; + /** + * Search a rules + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#search-rules---searchrules + */ + searchRules( + options: SearchRuleOptions, + cb: (err: Error, res: any) => void + ): void; + /** + * List index user keys + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#list-api-keys---listapikeys + */ + listApiKeys(cb: (err: Error, res: any) => void): void; + /** + * Add key for this index + * @param scopes + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + addApiKey(scopes: string[], cb: (err: Error, res: any) => void): void; + /** + * Add key for this index + * @param scopes + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + addApiKey( + scopes: string[], + options: AlgoliaApiKeyOptions, + cb: (err: Error, res: any) => void + ): void; + /** + * Update a key for this index + * @param key + * @param scopes + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey + */ + updateApiKey( + key: string, + scopes: string[], + cb: (err: Error, res: any) => void + ): void; + /** + * Update a key for this index + * @param key + * @param scopes + * @param options + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey + */ + updateApiKey( + key: string, + scopes: string[], + options: AlgoliaApiKeyOptions, + cb: (err: Error, res: any) => void + ): void; + /** + * Gets the rights of an index specific key + * @param key + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#get-key-permissions---getapikeyacl + */ + getApiKey(key: string, cb: (err: Error, res: any) => void): void; + /** + * Deletes an index specific key + * @param key + * @param cb(err, res) + * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteapikey + */ + deleteApiKey(key: string, cb: (err: Error, res: any) => void): void; + /** + * Gets specific attributes from an object + * @param objectID + * @param attributes + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects + */ + getObject(objectID: string, attributes?: string[]): Promise; + /** + * Gets a list of objects + * @param objectIDs + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#find-by-ids---getobjects + */ + getObjects(objectIDs: string[]): Promise; + /** + * Add a list of objects + * @param object with objectID + * @param objectID + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects + */ + addObject(object: {}, objectID?: string): Promise; + /** + * Add list of objects + * @param objects + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#add-objects---addobjects + */ + addObjects(objects: [{}]): Promise; + /** + * Add or replace a specific object + * @param object + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects + */ + saveObject(object: {}): Promise; + /** + * Add or replace several objects + * @param objects + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects + */ + saveObjects(objects: object[]): Promise; + /** + * Update parameters of a specific object + * @param object + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects + */ + partialUpdateObject(object: {}): Promise; + /** + * Update parameters of a list of objects + * @param objects + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#update-objects---saveobjects + */ + partialUpdateObjects(objects: [{}]): Promise; + /** + * Delete a specific object + * @param objectID + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects + */ + deleteObject(objectID: string): Promise; + /** + * Delete a list of objects + * @param objectIDs + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#delete-objects---deleteobjects + */ + deleteObjects(objectIDs: string[]): Promise; + /** + * Delete objects that matches the query + * @param query + * @param params of the object + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#delete-by-query---deletebyquery + */ + deleteByQuery(query: string, params?: {}): Promise; + /** + * Delete objects that matches the query + * @param params of the search + * return {Promise} + * https://www.algolia.com/doc/api-reference/api-methods/delete-by-query/ + */ + deleteBy(params: {}): Promise; + /** + * Wait for an indexing task to be compete + * @param taskID + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#wait-for-operations---waittask + */ + waitTask(taskID: number): Promise; + /** + * Get an index settings + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#get-settings---getsettings + */ + getSettings(): Promise; + /** + * Set an index settings + * @param settings + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#set-settings---setsettings + */ + setSettings(settings: AlgoliaIndexSettings): Promise; + /** + * Search in an index + * @param params query parameter + * return {Promise} + * @param err() error callback + * https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search + */ + search(params: AlgoliaQueryParameters): Promise; + /** + * Search in an index + * @param params query parameter + * @param cb(err, res) + * @param err() error callback + * https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search + */ + search( + params: AlgoliaQueryParameters, + cb: (err: Error, res: any) => void + ): void; + /** + * Search in an index + * @param params query parameter + * return {Promise} + * @param err() error callback + * https://www.algolia.com/doc/api-reference/api-methods/search-for-facet-values/ + */ + searchForFacetValues({ + facetName, + facetQuery, + ...qp, + }: { + facetName: string; + facetQuery: string; + } & AlgoliaQueryParameters + ): Promise; + /** + * Search in an index + * @param params query parameter + * @param cb(err, res) + * @param err() error callback + * https://www.algolia.com/doc/api-reference/api-methods/search-for-facet-values/ + */ + searchForFacetValues( + { + facetName, + facetQuery, + ...qp, + }: { + facetName: string; + facetQuery: string; + } & AlgoliaQueryParameters, + cb: (err: Error, res: any) => void + ): void; + /** + * Browse an index + * @param query + * @param cb(err, content) + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + browse(query: string, cb: (err: Error, res: any) => void): void; + /** + * Browse an index + * @param query + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + browse(query: string): Promise; + /** + * Browse an index from a cursor + * @param cursor + * @param cb(err, content) + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + browseFrom(cursor: string, cb: (err: Error, res: any) => void): void; + /** + * Browse an index from a cursor + * @param cursor + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + browseFrom(cursor: string): Promise; + /** + * Browse an entire index + * return Promise + * https://github.com/algolia/algoliasearch-client-js#backup--export-an-index---browse + */ + browseAll(): Promise; + /** + * Clear an index content + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#clear-index---clearindex + */ + clearIndex(): Promise; + /** + * Save a synonym object + * @param synonym + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym + */ + saveSynonym(synonym: AlgoliaSynonym, options: SynonymOption): Promise; + /** + * Save a synonym object + * @param synonyms + * @param options + * return {Promise} + */ + batchSynonyms( + synonyms: AlgoliaSynonym[], + options: SynonymOption + ): Promise; + /** + * Delete a specific synonym + * @param identifier + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#batch-synonyms---batchsynonyms + */ + deleteSynonym(identifier: string, options: SynonymOption): Promise; + /** + * Clear all synonyms of an index + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#clear-all-synonyms---clearsynonyms + */ + clearSynonyms(options: SynonymOption): Promise; + /** + * Get a specific synonym + * @param identifier + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#get-synonym---getsynonym + */ + getSynonym(identifier: string): Promise; + /** + * Search a synonyms + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms + */ + searchSynonyms(options: SearchSynonymOptions): Promise; + /** + * Save a rule object + * @param rule + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#save-rule---saverule + */ + saveRule(rule: AlgoliaRule, options: RuleOption): Promise; + /** + * Save a rule object + * @param rules + * @param options + * return {Promise} + */ + batchRules(rules: AlgoliaRule[], options: RuleOption): Promise; + /** + * Delete a specific rule + * @param identifier + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#batch-rules---batchrules + */ + deleteRule(identifier: string, options: RuleOption): Promise; + /** + * Clear all query rules of an index + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#clear-all-rules---clearrules + */ + clearRules(options: RuleOption): Promise; + /** + * Get a specific query rule + * @param identifier + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#get-rule---getrule + */ + getRule(identifier: string): Promise; + /** + * Search for query rules + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#search-rules---searchrules + */ + searchRules(options: SearchRuleOptions): Promise; + /** + * List index user keys + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#list-api-keys---listapikeys + */ + listApiKeys(): Promise; + /** + * Add key for this index + * @param scopes + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + addApiKey(scopes: string[], options?: AlgoliaApiKeyOptions): Promise; + /** + * Update a key for this index + * @param key + * @param scopes + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey + */ + updateApiKey(key: string, scopes: string[]): Promise; + /** + * Update a key for this index + * @param key + * @param scopes + * @param options + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#update-user-key---updateapikey + */ + updateApiKey( + key: string, + scopes: string[], + options: AlgoliaApiKeyOptions + ): Promise; + /** + * Gets the rights of an index specific key + * @param key + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#get-key-permissions---getapikeyacl + */ + getApiKey(key: string): Promise; + /** + * Deletes an index specific key + * @param key + * return {Promise} + * https://github.com/algolia/algoliasearch-client-js#delete-user-key---deleteapikey + */ + deleteApiKey(key: string): Promise; + } + /* +Interface describing available options when initializing a client +*/ + interface ClientOptions { + /** + * Timeout for requests to our servers, in milliseconds + * default: 15s (node), 2s (browser) + * https://github.com/algolia/algoliasearch-client-js#client-options + */ + timeout?: number; + /** + * Protocol to use when communicating with algolia + * default: current protocol(browser), https(node) + * https://github.com/algolia/algoliasearch-client-js#client-options + */ + protocol?: string; + /** + * (node only) httpAgent instance to use when communicating with Algolia servers. + * https://github.com/algolia/algoliasearch-client-js#client-options + */ + httpAgent?: any; + /** + * read: array of read hosts to use to call Algolia servers, computed automatically + * write: array of read hosts to use to call Algolia servers, computed automatically + * https://github.com/algolia/algoliasearch-client-js#client-options + */ + hosts?: { read?: string[]; write?: string[] }; + } + /* +Interface describing options available for gettings the logs +*/ + interface LogsOptions { + /** + * Specify the first entry to retrieve (0-based, 0 is the most recent log entry). + * default: 0 + * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs + */ + offset?: number; + /** + * Specify the maximum number of entries to retrieve starting at the offset. + * default: 10 + * maximum: 1000 + * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs + */ + length?: number; + /** + * @deprecated + * Retrieve only logs with an HTTP code different than 200 or 201 + * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs + */ + onlyErrors?: boolean; + /** + * Specify the type of logs to retrieve + * 'query' Retrieve only the queries + * 'build' Retrieve only the build operations + * 'error' Retrieve only the errors (same as onlyErrors parameters) + * https://github.com/algolia/algoliasearch-client-js#get-logs---getlogs + */ + type?: string; + } + /** + * Describe the action object used for batch operation + */ + interface AlgoliaAction { + /** + * Type of the batch action + * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch + */ + action: + | 'addObject' + | 'updateObject' + | 'partialUpdateObject' + | 'partialUpdateObjectNoCreate' + | 'deleteObject' + | 'delete' + | 'clear'; + /** + * Name of the index where the bact will be performed + * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch + */ + indexName: string; + /** + * Object + * https://github.com/algolia/algoliasearch-client-js#custom-batch---batch + */ + body: {}; + } + /** + * Describes the option used when creating user key + */ + interface AlgoliaApiKeyOptions { + /** + * Add a validity period. The key will be valid for a specific period of time (in seconds). + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + validity?: number; + /** + * Specify the maximum number of API calls allowed from an IP address per hour + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + maxQueriesPerIPPerHour?: number; + /** + * Specify the maximum number of hits this API key can retrieve in one call + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + maxHitsPerQuery?: boolean; + /** + * Specify the list of targeted indices + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + indexes?: string[]; + /** + * Specify the list of referers + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + referers?: string[]; + /** + * Specify the list of query parameters + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + queryParameters?: AlgoliaQueryParameters; + /** + * Specify a description to describe where the key is used. + * https://github.com/algolia/algoliasearch-client-js#add-user-key---addapikey + */ + description?: string; + } + /** + * Describes option used when making operation on synonyms + */ + interface SynonymOption { + /** + * You can forward all settings updates to the replicas of an index + * https://github.com/algolia/algoliasearch-client-js#replica-settings + */ + forwardToReplicas?: boolean; + /** + * Replace all existing synonyms on the index with the content of the batch + * https://github.com/algolia/algoliasearch-client-js#batch-synonyms---batchsynonyms + */ + replaceExistingSynonyms?: boolean; + } + /** + * Describes options used when searching for synonyms + */ + interface SearchSynonymOptions { + /** + * The actual search query to find synonyms + * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms + */ + query?: string; + /** + * The page to fetch when browsing through several pages of results + * default: 0 + * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms + */ + page?: number; + /** + * Restrict the search to a specific type of synonym + * Use an empty string to search all types (default behavior) + * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms + */ + type?: string; + /** + * Number of hits per page + * default: 100 + * https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms + */ + hitsPerPage?: number; + } + /** + * Describes option used when making operation on query rules + */ + interface RuleOption { + /** + * You can forward all settings updates to the replicas of an index + * https://github.com/algolia/algoliasearch-client-js#replica-settings + */ + forwardToReplicas?: boolean; + /** + * Replace all existing query rules on the index with the content of the batch + */ + clearExistingRules?: boolean; + } + /** + * Describes options used when searching for query rules + */ + interface SearchRuleOptions { + /** + * The actual search query to find synonyms + */ + query?: string; + /** + * When specified, restricts matches to rules with a specific anchoring type. + * When omitted, all anchoring types may match. + */ + anchoring?: string; + /** + * When specified, restricts matches to contextual rules with a specific context (exact match). + * When omitted, any generic or contextual rule (with any context) may match. + */ + context?: string; + /** + * Requested page (zero-based) + * default: 0 + */ + page?: number; + /** + * Number of hits per page + * default: 20 + */ + hitsPerPage?: number; + } + interface AlgoliaBrowseResponse { + cursor?: string; + hits: any[]; + params: string; + query: string; + processingTimeMS: number; + } + /** + * Describes a synonym object + */ + interface AlgoliaSynonym { + /** + * ObjectID of the synonym + * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym + */ + objectID: string; + /** + * Type of synonym + * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym + */ + type: 'synonym' | 'oneWaySynonym'; + /** + * Values used for the synonym + * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym + */ + synonyms: string[]; + } + /** + * Describes a query rule object + */ + interface AlgoliaRule { + /** + * ObjectID of the synonym + * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym + */ + objectID: string; + /** + * Condition of the rule + */ + condition: { + /** + * Query pattern + * syntax: https://www.algolia.com/doc/rest-api/query-rules/?language=php#query-pattern-syntax + */ + pattern: string; + /** + * Whether the pattern must match the beginning or the end of the query string, or both, or none. + */ + anchoring: 'is' | 'startsWith' | 'endsWith' | 'contains'; + /** + * Rule context (format: [A-Za-z0-9_-]+). + * When specified, the rule is contextual and applies only when the same context is specified + * at query time (using the ruleContexts parameter). + * When absent, the rule is generic and always applies + * (provided that its other conditions are met, of course). + */ + context?: string; + }; + /** + * Consequence of the rule. At least one of the following must be used: + */ + consequence: { + params?: { /** - * ObjectID of the synonym - * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym + * When a string, it replaces the entire query string. + * When an object, describes incremental edits to be made to the query string. + */ + query?: + | string + | { + /** + * Tokens (literals or placeholders) from the query pattern + * that should be removed from the query string. + */ + remove: string[]; + }; + /** + * Names of facets to which automatic filtering must be applied; + * they must match the facet name of a facet value placeholder in the query pattern. + */ + automaticFacetFilters?: string[]; + /** + * Same as automaticFacetFilters, but for optionalFacetFilters. + * The same syntax as query parameters can be used to specify a score: facetName. + */ + automaticOptionalFacetFilters?: string[]; + }; + /** + * Objects to promote as hits. Each object must contain the following fields + */ + promote?: { + /** + * Unique identifier of the object to promote */ objectID: string; /** - * Type of synonym - * values: synonym,oneWaySynonym - * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym + * Promoted rank for the object (zero-based) */ - type: string; - /** - * Values used for the synonym - * https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym - */ - synonyms: string[]; - } + position: number; + }[]; + /** + * Custom JSON object that will be appended to the userData array in the response. + * This object is not interpreted by the API. It is limited to 1kB of minified JSON. + */ + userData?: {}; + }; /** - * Describes the options used when generating new api keys + * This field is intended for rule management purposes, + * in particular to ease searching for rules and presenting them to human readers. + * It is not interpreted by the API. */ - interface AlgoliaSecuredApiOptions { - /** - * Filter the query with numeric, facet or/and tag filters - * default: "" - * https://github.com/algolia/algoliasearch-client-js#filters-1 - */ - filters?: string; - /** - * Defines the expiration date of the API key - * https://github.com/algolia/algoliasearch-client-js#valid-until - */ - validUntil?: number; - /** - * Restricts the key to a list of index names allowed for the secured API key - * https://github.com/algolia/algoliasearch-client-js#index-restriction - */ - restrictIndices?: string; - /** - * Allows you to restrict a single user to performing a maximum of N API calls per hour - * https://github.com/algolia/algoliasearch-client-js#user-rate-limiting - */ - userToken?: string; - } - + description?: string; + } + /** + * Describes the options used when generating new api keys + */ + interface AlgoliaSecuredApiOptions { /** - * Describes the settings available for configure your index + * Filter the query with numeric, facet or/and tag filters + * default: "" + * https://github.com/algolia/algoliasearch-client-js#filters-1 */ - interface AlgoliaIndexSettings { - /** - * The list of attributes you want index - * default: * - * https://github.com/algolia/algoliasearch-client-js#attributestoindex - */ - attributesToIndex?: string[]; - /** - * The list of attributes you want to use for faceting - * default: null - * https://github.com/algolia/algoliasearch-client-js#attributesforfaceting - */ - attributesForFaceting?: string[]; - /** - * The list of attributes that cannot be retrieved at query time - * default: null - * https://github.com/algolia/algoliasearch-client-js#unretrievableattributes - */ - unretrievableAttributes?: string[]; - /** - * A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer - * default: * - * https://github.com/algolia/algoliasearch-client-js#attributestoretrieve - */ - attributesToRetrieve?: string[]; - /** - * Controls the way results are sorted - * default: ['typo', 'geo', 'words', 'filters', 'proximity', 'attribute', 'exact', 'custom'] - * https://github.com/algolia/algoliasearch-client-js#ranking - */ - ranking?: string[]; - /** - * Lets you specify part of the ranking - * default: [] - * https://github.com/algolia/algoliasearch-client-js#customranking - */ - customRanking?: string[]; - /** - * The list of indices on which you want to replicate all write operations - * default: [] - * https://github.com/algolia/algoliasearch-client-js#slaves - */ - slaves?: string[]; - /** - * Limit the number of facet values returned for each facet - * default: "" - * https://github.com/algolia/algoliasearch-client-js#maxvaluesperfacet - */ - maxValuesPerFacet?: string; - /** - * Default list of attributes to highlight. If set to null, all indexed attributes are highlighted. - * default: null - * https://github.com/algolia/algoliasearch-client-js#attributestohighlight - */ - attributesToHighlight?: string[]; - /** - * Default list of attributes to snippet alongside the number of words to return - * default: null - * https://github.com/algolia/algoliasearch-client-js#attributestosnippet - */ - attributesToSnippet?: string[]; - /** - * Specify the string that is inserted before the highlighted parts in the query result - * default: - * https://github.com/algolia/algoliasearch-client-js#highlightpretag - */ - highlightPreTag?: string; - /** - * Specify the string that is inserted after the highlighted parts in the query result - * default: - * https://github.com/algolia/algoliasearch-client-js#highlightposttag - */ - highlightPostTag?: string; - /** - * String used as an ellipsis indicator when a snippet is truncated. - * default: … - * https://github.com/algolia/algoliasearch-client-js#snippetellipsistext - */ - snippetEllipsisText?: string; - /** - * If set to true, restrict arrays in highlights and snippets to items that matched the query at least partially else return all array items in highlights and snippets - * default: false - * https://github.com/algolia/algoliasearch-client-js#restricthighlightandsnippetarrays - */ - restrictHighlightAndSnippetArrays?: boolean; - /** - * Pagination parameter used to select the number of hits per page - * default: 20 - * https://github.com/algolia/algoliasearch-client-js#hitsperpage - */ - hitsPerPage?: number; - /** - * The minimum number of characters needed to accept one typo - * default: 4 - * https://github.com/algolia/algoliasearch-client-js#minwordsizefor1typo - */ - minWordSizefor1Typo?: number; - /** - * The minimum number of characters needed to accept two typos. - * default: 8 - * https://github.com/algolia/algoliasearch-client-js#highlightposttag - */ - minWordSizefor2Typos?: number; - /** - * This option allows you to control the number of typos allowed in the result set - * default: true - * 'true' The typo tolerance is enabled and all matching hits are retrieved (default behavior). - * 'false' The typo tolerance is disabled. All results with typos will be hidden. - * 'min' Only keep results with the minimum number of typos. For example, if one result matches without typos, then all results with typos will be hidden. - * '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; - /** - * If set to false, disables typo tolerance on numeric tokens (numbers). - * default: true - * https://github.com/algolia/algoliasearch-client-js#allowtyposonnumerictokens - */ - allowTyposOnNumericTokens?: boolean; - /** - * If set to true, plural won't be considered as a typo - * default: false - * https://github.com/algolia/algoliasearch-client-js#ignoreplurals - */ - ignorePlurals?: boolean; - /** - * List of attributes on which you want to disable typo tolerance - * default: "" - * https://github.com/algolia/algoliasearch-client-js#disabletypotoleranceonattributes - */ - disableTypoToleranceOnAttributes?: string; - /** - * Specify the separators (punctuation characters) to index. - * default: "" - * https://github.com/algolia/algoliasearch-client-js#separatorstoindex - */ - separatorsToIndex?: string; - /** - * Selects how the query words are interpreted - * default: 'prefixLast' - * 'prefixAll' All query words are interpreted as prefixes. This option is not recommended. - * 'prefixLast' Only the last word is interpreted as a prefix (default behavior). - * 'prefixNone' No query word is interpreted as a prefix. This option is not recommended. - * https://github.com/algolia/algoliasearch-client-js#querytype - */ - queryType?: any; - /** - * This option is used to select a strategy in order to avoid having an empty result page - * default: 'none' - * 'lastWords' When a query does not return any results, the last word will be added as optional - * 'firstWords' When a query does not return any results, the first word will be added as optional - * 'allOptional' When a query does not return any results, a second trial will be made with all words as optional - * 'none' No specific processing is done when a query does not return any results - * https://github.com/algolia/algoliasearch-client-js#removewordsifnoresults - */ - removeWordsIfNoResults?: string; - /** - * Enables the advanced query syntax - * default: false - * https://github.com/algolia/algoliasearch-client-js#advancedsyntax - */ - advancedSyntax?: boolean; - /** - * A string that contains the comma separated list of words that should be considered as optional when found in the query - * default: [] - * https://github.com/algolia/algoliasearch-client-js#optionalwords - */ - optionalWords?: string[]; - /** - * Remove stop words from the query before executing it - * default: false - * true|false: enable or disable stop words for all 41 supported languages; or - * a list of language ISO codes (as a comma-separated string) for which stop words should be enable - * https://github.com/algolia/algoliasearch-client-js#removestopwords - */ - removeStopWords?: string[]; - /** - * List of attributes on which you want to disable prefix matching - * default: [] - * https://github.com/algolia/algoliasearch-client-js#disableprefixonattributes - */ - disablePrefixOnAttributes?: string[]; - /** - * List of attributes on which you want to disable the computation of exact criteria - * default: [] - * https://github.com/algolia/algoliasearch-client-js#disableexactonattributes - */ - disableExactOnAttributes?: string[]; - /** - * This parameter control how the exact ranking criterion is computed when the query contains one word - * default: attribute - * 'none': no exact on single word query - * 'word': exact set to 1 if the query word is found in the record - * 'attribute': exact set to 1 if there is an attribute containing a string equals to the query - * https://github.com/algolia/algoliasearch-client-js#exactonsinglewordquery - */ - exactOnSingleWordQuery?: string; - /** - * Specify the list of approximation that should be considered as an exact match in the ranking formula - * default: ['ignorePlurals', 'singleWordSynonym'] - * 'ignorePlurals': alternative words added by the ignorePlurals feature - * 'singleWordSynonym': single-word synonym (For example "NY" = "NYC") - * 'multiWordsSynonym': multiple-words synonym - * https://github.com/algolia/algoliasearch-client-js#alternativesasexact - */ - alternativesAsExact?: any; - /** - * The name of the attribute used for the Distinct feature - * default: null - * https://github.com/algolia/algoliasearch-client-js#attributefordistinct - */ - attributeForDistinct?: string; - /** - * 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; - /** - * All numerical attributes are automatically indexed as numerical filters - * default '' - * https://github.com/algolia/algoliasearch-client-js#numericattributestoindex - */ - numericAttributesToIndex?: string[]; - /** - * Allows compression of big integer arrays. - * default: false - * https://github.com/algolia/algoliasearch-client-js#allowcompressionofintegerarray - */ - allowCompressionOfIntegerArray?: boolean; - /** - * Specify alternative corrections that you want to consider. - * default: [] - * https://github.com/algolia/algoliasearch-client-js#altcorrections - */ - altCorrections?: [{}]; - /** - * Configure the precision of the proximity ranking criterion - * default: 1 - * https://github.com/algolia/algoliasearch-client-js#minproximity - */ - 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: '' - * https://github.com/algolia/algoliasearch-client-js#placeholders - */ - placeholders?: any; - } + filters?: string; + /** + * Defines the expiration date of the API key + * https://github.com/algolia/algoliasearch-client-js#valid-until + */ + validUntil?: number; + /** + * Restricts the key to a list of index names allowed for the secured API key + * https://github.com/algolia/algoliasearch-client-js#index-restriction + */ + restrictIndices?: string; + /** + * Allows you to restrict a single user to performing a maximum of N API calls per hour + * https://github.com/algolia/algoliasearch-client-js#user-rate-limiting + */ + userToken?: string; + } - interface AlgoliaQueryParameters { - /** - * Query string used to perform the search - * default: '' - * https://github.com/algolia/algoliasearch-client-js#query - */ - query?: string; - /** - * Filter the query with numeric, facet or/and tag filters - * default: "" - * https://github.com/algolia/algoliasearch-client-js#filters - */ - filters?: string; - /** - * A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer. - * default: * - * https://github.com/algolia/algoliasearch-client-js#attributestoretrieve - */ - attributesToRetrieve?: string[]; - /** - * List of attributes you want to use for textual search - * default: attributeToIndex - * https://github.com/algolia/algoliasearch-client-js#restrictsearchableattributes - */ - restrictSearchableAttributes?: string[]; - /** - * You can use facets to retrieve only a part of your attributes declared in attributesForFaceting attributes - * default: "" - * https://github.com/algolia/algoliasearch-client-js#facets - */ - facets?: string; - /** - * Limit the number of facet values returned for each facet. - * default: "" - * https://github.com/algolia/algoliasearch-client-js#maxvaluesperfacet - */ - maxValuesPerFacet?: string; - /** - * Default list of attributes to highlight. If set to null, all indexed attributes are highlighted. - * default: null - * https://github.com/algolia/algoliasearch-client-js#attributestohighlight - */ - attributesToHighlight?: string[]; - /** - * Default list of attributes to snippet alongside the number of words to return - * default: null - * https://github.com/algolia/algoliasearch-client-js#attributestosnippet - */ - attributesToSnippet?: string[]; - /** - * Specify the string that is inserted before the highlighted parts in the query result - * default: - * https://github.com/algolia/algoliasearch-client-js#highlightpretag - */ - highlightPreTag?: string; - /** - * Specify the string that is inserted after the highlighted parts in the query result - * default: - * https://github.com/algolia/algoliasearch-client-js#highlightposttag - */ - highlightPostTag?: string; - /** - * String used as an ellipsis indicator when a snippet is truncated. - * default: … - * https://github.com/algolia/algoliasearch-client-js#snippetellipsistext - */ - snippetEllipsisText?: string; - /** - * If set to true, restrict arrays in highlights and snippets to items that matched the query at least partially else return all array items in highlights and snippets - * default: false - * https://github.com/algolia/algoliasearch-client-js#restricthighlightandsnippetarrays - */ - restrictHighlightAndSnippetArrays?: boolean; - /** - * Pagination parameter used to select the number of hits per page - * default: 20 - * https://github.com/algolia/algoliasearch-client-js#hitsperpage - */ - hitsPerPage?: number; - /** - * Pagination parameter used to select the page to retrieve. - * default: 0 - * https://github.com/algolia/algoliasearch-client-js#page - */ - page?: number; - /** - * Offset of the first hit to return - * default: null - * https://github.com/algolia/algoliasearch-client-js#offset - */ - offset?: number; - /** - * Number of hits to return. - * default: null - * https://github.com/algolia/algoliasearch-client-js#length - */ - length?: number; - /** - * The minimum number of characters needed to accept one typo. - * default: 4 - * https://github.com/algolia/algoliasearch-client-js#minwordsizefor1typo - */ - minWordSizefor1Typo?: number; - /** - * The minimum number of characters needed to accept two typo. - * fault: 8 - * https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos - */ - minWordSizefor2Typos?: number; - /** - * This option allows you to control the number of typos allowed in the result set: - * default: true - * 'true' The typo tolerance is enabled and all matching hits are retrieved - * 'false' The typo tolerance is disabled. All results with typos will be hidden. - * 'min' Only keep results with the minimum number of typos - * 'strict' Hits matching with 2 typos are not retrieved if there are some matching without typos. - * https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos - */ - typoTolerance?: boolean; - /** - * If set to false, disables typo tolerance on numeric tokens (numbers). - * default: - * https://github.com/algolia/algoliasearch-client-js#allowtyposonnumerictokens - */ - allowTyposOnNumericTokens?: boolean; - /** - * If set to true, plural won't be considered as a typo - * default: false - * https://github.com/algolia/algoliasearch-client-js#ignoreplurals - */ - ignorePlurals?: boolean; - /** - * List of attributes on which you want to disable typo tolerance - * default: "" - * https://github.com/algolia/algoliasearch-client-js#disabletypotoleranceonattributes - */ - disableTypoToleranceOnAttributes?: string; - /** - * Search for entries around a given location - * default: "" - * https://github.com/algolia/algoliasearch-client-js#aroundlatlng - */ - aroundLatLng?: string; - /** - * Search for entries around a given latitude/longitude automatically computed from user IP address. - * default: "" - * https://github.com/algolia/algoliasearch-client-js#aroundlatlngviaip - */ - aroundLatLngViaIP?: string; - /** - * Control the radius associated with a geo search. Defined in meters. - * default: null - * You can specify aroundRadius=all if you want to compute the geo distance without filtering in a geo area - * https://github.com/algolia/algoliasearch-client-js#aroundradius - */ - aroundRadius?: any; - /** - * Control the precision of a geo search - * default: null - * https://github.com/algolia/algoliasearch-client-js#aroundprecision - */ - aroundPrecision?: number; - /** - * Define the minimum radius used for a geo search when aroundRadius is not set. - * default: null - * https://github.com/algolia/algoliasearch-client-js#minimumaroundradius - */ - minimumAroundRadius?: number; - /** - * Search entries inside a given area defined by the two extreme points of a rectangle - * default: null - * https://github.com/algolia/algoliasearch-client-js#insideboundingbox - */ - insideBoundingBox?: string; - /** - * Selects how the query words are interpreted - * default: 'prefixLast' - * 'prefixAll' All query words are interpreted as prefixes. This option is not recommended. - * 'prefixLast' Only the last word is interpreted as a prefix (default behavior). - * 'prefixNone' No query word is interpreted as a prefix. This option is not recommended. - * https://github.com/algolia/algoliasearch-client-js#querytype - */ - queryType?: any; - /** - * Search entries inside a given area defined by a set of points - * defauly: '' - * https://github.com/algolia/algoliasearch-client-js#insidepolygon - */ - insidePolygon?: string; - /** - * This option is used to select a strategy in order to avoid having an empty result page - * default: 'none' - * 'lastWords' When a query does not return any results, the last word will be added as optional - * 'firstWords' When a query does not return any results, the first word will be added as optional - * 'allOptional' When a query does not return any results, a second trial will be made with all words as optional - * 'none' No specific processing is done when a query does not return any results - * https://github.com/algolia/algoliasearch-client-js#removewordsifnoresults - */ - removeWordsIfNoResults?: string; - /** - * Enables the advanced query syntax - * default: false - * https://github.com/algolia/algoliasearch-client-js#advancedsyntax - */ - advancedSyntax?: boolean; - /** - * A string that contains the comma separated list of words that should be considered as optional when found in the query - * default: [] - * https://github.com/algolia/algoliasearch-client-js#optionalwords - */ - optionalWords?: string[]; - /** - * Remove stop words from the query before executing it - * default: false - * true|false: enable or disable stop words for all 41 supported languages; or - * a list of language ISO codes (as a comma-separated string) for which stop words should be enable - * https://github.com/algolia/algoliasearch-client-js#removestopwords - */ - removeStopWords?: string[]; - /** - * List of attributes on which you want to disable the computation of exact criteria - * default: [] - * https://github.com/algolia/algoliasearch-client-js#disableexactonattributes - */ - disableExactOnAttributes?: string[]; - /** - * This parameter control how the exact ranking criterion is computed when the query contains one word - * default: attribute - * 'none': no exact on single word query - * 'word': exact set to 1 if the query word is found in the record - * 'attribute': exact set to 1 if there is an attribute containing a string equals to the query - * https://github.com/algolia/algoliasearch-client-js#exactonsinglewordquery - */ - exactOnSingleWordQuery?: string; - /** - * Specify the list of approximation that should be considered as an exact match in the ranking formula - * default: ['ignorePlurals', 'singleWordSynonym'] - * 'ignorePlurals': alternative words added by the ignorePlurals feature - * 'singleWordSynonym': single-word synonym (For example "NY" = "NYC") - * 'multiWordsSynonym': multiple-words synonym - * https://github.com/algolia/algoliasearch-client-js#alternativesasexact - */ - alternativesAsExact?: any; - /** - * 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; - /** - * If set to true, the result hits will contain ranking information in the _rankingInfo attribute. - * default: false - * https://github.com/algolia/algoliasearch-client-js#getrankinginfo - */ - getRankingInfo?: boolean; - /** - * All numerical attributes are automatically indexed as numerical filters - * default: '' - * https://github.com/algolia/algoliasearch-client-js#numericattributestoindex - */ - numericAttributesToIndex?: string[]; - /** - * @deprecated please use filters instead - * A string that contains the comma separated list of numeric filters you want to apply. - * https://github.com/algolia/algoliasearch-client-js#numericfilters-deprecated - */ - numericFilters?: string[]; - /** - * @deprecated - * Filter the query by a set of tags. - * https://github.com/algolia/algoliasearch-client-js#tagfilters-deprecated - */ - tagFilters?: string; - /** - * @deprecated - * Filter the query by a set of facets. - * https://github.com/algolia/algoliasearch-client-js#facetfilters-deprecated - */ - facetFilters?: string; - /** - * If set to false, this query will not be taken into account in the analytics feature. - * default true - * https://github.com/algolia/algoliasearch-client-js#analytics - */ - analytics?: boolean; - /** - * If set, tag your query with the specified identifiers - * default: null - * https://github.com/algolia/algoliasearch-client-js#analyticstags - */ - analyticsTags?: string[]; - /** - * If set to false, the search will not use the synonyms defined for the targeted index. - * default: true - * https://github.com/algolia/algoliasearch-client-js#synonyms - */ - synonyms?: boolean; - /** - * If set to false, words matched via synonym expansion will not be replaced by the matched synonym in the highlighted result. - * default: true - * https://github.com/algolia/algoliasearch-client-js#replacesynonymsinhighlight - */ - replaceSynonymsInHighlight?: boolean; - /** - * Configure the precision of the proximity ranking criterion - * default: 1 - * https://github.com/algolia/algoliasearch-client-js#minproximity - */ - minProximity?: number; - } + /** + * Describes the settings available for configure your index + */ + interface AlgoliaIndexSettings { + /** + * The list of attributes you want index + * default: * + * https://github.com/algolia/algoliasearch-client-js#attributestoindex + */ + attributesToIndex?: string[]; + /** + * The list of attributes you want to use for faceting + * default: null + * https://github.com/algolia/algoliasearch-client-js#attributesforfaceting + */ + attributesForFaceting?: string[]; + /** + * The list of attributes that cannot be retrieved at query time + * default: null + * https://github.com/algolia/algoliasearch-client-js#unretrievableattributes + */ + unretrievableAttributes?: string[]; + /** + * A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer + * default: * + * https://github.com/algolia/algoliasearch-client-js#attributestoretrieve + */ + attributesToRetrieve?: string[]; + /** + * Controls the way results are sorted + * default: ['typo', 'geo', 'words', 'filters', 'proximity', 'attribute', 'exact', 'custom'] + * https://github.com/algolia/algoliasearch-client-js#ranking + */ + ranking?: string[]; + /** + * Lets you specify part of the ranking + * default: [] + * https://github.com/algolia/algoliasearch-client-js#customranking + */ + customRanking?: string[]; + /** + * The list of indices on which you want to replicate all write operations + * default: [] + * https://github.com/algolia/algoliasearch-client-js#replicas + */ + replicas?: string[]; + /** + * Limit the number of facet values returned for each facet + * default: "" + * https://github.com/algolia/algoliasearch-client-js#maxvaluesperfacet + */ + maxValuesPerFacet?: string; + /** + * Default list of attributes to highlight. If set to null, all indexed attributes are highlighted. + * default: null + * https://github.com/algolia/algoliasearch-client-js#attributestohighlight + */ + attributesToHighlight?: string[]; + /** + * Default list of attributes to snippet alongside the number of words to return + * default: null + * https://github.com/algolia/algoliasearch-client-js#attributestosnippet + */ + attributesToSnippet?: string[]; + /** + * Specify the string that is inserted before the highlighted parts in the query result + * default: + * https://github.com/algolia/algoliasearch-client-js#highlightpretag + */ + highlightPreTag?: string; + /** + * Specify the string that is inserted after the highlighted parts in the query result + * default: + * https://github.com/algolia/algoliasearch-client-js#highlightposttag + */ + highlightPostTag?: string; + /** + * String used as an ellipsis indicator when a snippet is truncated. + * default: … + * https://github.com/algolia/algoliasearch-client-js#snippetellipsistext + */ + snippetEllipsisText?: string; + /** + * If set to true, restrict arrays in highlights and snippets to items that matched the query at least partially else return all array items in highlights and snippets + * default: false + * https://github.com/algolia/algoliasearch-client-js#restricthighlightandsnippetarrays + */ + restrictHighlightAndSnippetArrays?: boolean; + /** + * Pagination parameter used to select the number of hits per page + * default: 20 + * https://github.com/algolia/algoliasearch-client-js#hitsperpage + */ + hitsPerPage?: number; + /** + * The minimum number of characters needed to accept one typo + * default: 4 + * https://github.com/algolia/algoliasearch-client-js#minwordsizefor1typo + */ + minWordSizefor1Typo?: number; + /** + * The minimum number of characters needed to accept two typos. + * default: 8 + * https://github.com/algolia/algoliasearch-client-js#highlightposttag + */ + minWordSizefor2Typos?: number; + /** + * This option allows you to control the number of typos allowed in the result set + * default: true + * 'true' The typo tolerance is enabled and all matching hits are retrieved (default behavior). + * 'false' The typo tolerance is disabled. All results with typos will be hidden. + * 'min' Only keep results with the minimum number of typos. For example, if one result matches without typos, then all results with typos will be hidden. + * '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; + /** + * If set to false, disables typo tolerance on numeric tokens (numbers). + * default: true + * https://github.com/algolia/algoliasearch-client-js#allowtyposonnumerictokens + */ + allowTyposOnNumericTokens?: boolean; + /** + * If set to true, plural won't be considered as a typo + * default: false + * https://github.com/algolia/algoliasearch-client-js#ignoreplurals + */ + ignorePlurals?: boolean; + /** + * List of attributes on which you want to disable typo tolerance + * default: "" + * https://github.com/algolia/algoliasearch-client-js#disabletypotoleranceonattributes + */ + disableTypoToleranceOnAttributes?: string; + /** + * Specify the separators (punctuation characters) to index. + * default: "" + * https://github.com/algolia/algoliasearch-client-js#separatorstoindex + */ + separatorsToIndex?: string; + /** + * Selects how the query words are interpreted + * default: 'prefixLast' + * 'prefixAll' All query words are interpreted as prefixes. This option is not recommended. + * 'prefixLast' Only the last word is interpreted as a prefix (default behavior). + * 'prefixNone' No query word is interpreted as a prefix. This option is not recommended. + * https://github.com/algolia/algoliasearch-client-js#querytype + */ + queryType?: any; + /** + * This option is used to select a strategy in order to avoid having an empty result page + * default: 'none' + * 'lastWords' When a query does not return any results, the last word will be added as optional + * 'firstWords' When a query does not return any results, the first word will be added as optional + * 'allOptional' When a query does not return any results, a second trial will be made with all words as optional + * 'none' No specific processing is done when a query does not return any results + * https://github.com/algolia/algoliasearch-client-js#removewordsifnoresults + */ + removeWordsIfNoResults?: string; + /** + * Enables the advanced query syntax + * default: false + * https://github.com/algolia/algoliasearch-client-js#advancedsyntax + */ + advancedSyntax?: boolean; + /** + * A string that contains the comma separated list of words that should be considered as optional when found in the query + * default: [] + * https://github.com/algolia/algoliasearch-client-js#optionalwords + */ + optionalWords?: string[]; + /** + * Remove stop words from the query before executing it + * default: false + * true|false: enable or disable stop words for all 41 supported languages; or + * a list of language ISO codes (as a comma-separated string) for which stop words should be enable + * https://github.com/algolia/algoliasearch-client-js#removestopwords + */ + removeStopWords?: string[]; + /** + * List of attributes on which you want to disable prefix matching + * default: [] + * https://github.com/algolia/algoliasearch-client-js#disableprefixonattributes + */ + disablePrefixOnAttributes?: string[]; + /** + * List of attributes on which you want to disable the computation of exact criteria + * default: [] + * https://github.com/algolia/algoliasearch-client-js#disableexactonattributes + */ + disableExactOnAttributes?: string[]; + /** + * This parameter control how the exact ranking criterion is computed when the query contains one word + * default: attribute + * 'none': no exact on single word query + * 'word': exact set to 1 if the query word is found in the record + * 'attribute': exact set to 1 if there is an attribute containing a string equals to the query + * https://github.com/algolia/algoliasearch-client-js#exactonsinglewordquery + */ + exactOnSingleWordQuery?: string; + /** + * Specify the list of approximation that should be considered as an exact match in the ranking formula + * default: ['ignorePlurals', 'singleWordSynonym'] + * 'ignorePlurals': alternative words added by the ignorePlurals feature + * 'singleWordSynonym': single-word synonym (For example "NY" = "NYC") + * 'multiWordsSynonym': multiple-words synonym + * https://github.com/algolia/algoliasearch-client-js#alternativesasexact + */ + alternativesAsExact?: any; + /** + * The name of the attribute used for the Distinct feature + * default: null + * https://github.com/algolia/algoliasearch-client-js#attributefordistinct + */ + attributeForDistinct?: string; + /** + * 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; + /** + * All numerical attributes are automatically indexed as numerical filters + * default '' + * https://github.com/algolia/algoliasearch-client-js#numericattributestoindex + */ + numericAttributesToIndex?: string[]; + /** + * Allows compression of big integer arrays. + * default: false + * https://github.com/algolia/algoliasearch-client-js#allowcompressionofintegerarray + */ + allowCompressionOfIntegerArray?: boolean; + /** + * Specify alternative corrections that you want to consider. + * default: [] + * https://github.com/algolia/algoliasearch-client-js#altcorrections + */ + altCorrections?: [{}]; + /** + * Configure the precision of the proximity ranking criterion + * default: 1 + * https://github.com/algolia/algoliasearch-client-js#minproximity + */ + 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: '' + * https://github.com/algolia/algoliasearch-client-js#placeholders + */ + placeholders?: any; + } + + interface AlgoliaQueryParameters { + /** + * Query string used to perform the search + * default: '' + * https://github.com/algolia/algoliasearch-client-js#query + */ + query?: string; + /** + * Filter the query with numeric, facet or/and tag filters + * default: "" + * https://github.com/algolia/algoliasearch-client-js#filters + */ + filters?: string; + /** + * A string that contains the list of attributes you want to retrieve in order to minimize the size of the JSON answer. + * default: * + * https://github.com/algolia/algoliasearch-client-js#attributestoretrieve + */ + attributesToRetrieve?: string[]; + /** + * List of attributes you want to use for textual search + * default: attributeToIndex + * https://github.com/algolia/algoliasearch-client-js#restrictsearchableattributes + */ + restrictSearchableAttributes?: string[]; + /** + * You can use facets to retrieve only a part of your attributes declared in attributesForFaceting attributes + * default: "" + * https://github.com/algolia/algoliasearch-client-js#facets + */ + facets?: string; + /** + * Limit the number of facet values returned for each facet. + * default: "" + * https://github.com/algolia/algoliasearch-client-js#maxvaluesperfacet + */ + maxValuesPerFacet?: string; + /** + * Default list of attributes to highlight. If set to null, all indexed attributes are highlighted. + * default: null + * https://github.com/algolia/algoliasearch-client-js#attributestohighlight + */ + attributesToHighlight?: string[]; + /** + * Default list of attributes to snippet alongside the number of words to return + * default: null + * https://github.com/algolia/algoliasearch-client-js#attributestosnippet + */ + attributesToSnippet?: string[]; + /** + * Specify the string that is inserted before the highlighted parts in the query result + * default: + * https://github.com/algolia/algoliasearch-client-js#highlightpretag + */ + highlightPreTag?: string; + /** + * Specify the string that is inserted after the highlighted parts in the query result + * default: + * https://github.com/algolia/algoliasearch-client-js#highlightposttag + */ + highlightPostTag?: string; + /** + * String used as an ellipsis indicator when a snippet is truncated. + * default: … + * https://github.com/algolia/algoliasearch-client-js#snippetellipsistext + */ + snippetEllipsisText?: string; + /** + * If set to true, restrict arrays in highlights and snippets to items that matched the query at least partially else return all array items in highlights and snippets + * default: false + * https://github.com/algolia/algoliasearch-client-js#restricthighlightandsnippetarrays + */ + restrictHighlightAndSnippetArrays?: boolean; + /** + * Pagination parameter used to select the number of hits per page + * default: 20 + * https://github.com/algolia/algoliasearch-client-js#hitsperpage + */ + hitsPerPage?: number; + /** + * Pagination parameter used to select the page to retrieve. + * default: 0 + * https://github.com/algolia/algoliasearch-client-js#page + */ + page?: number; + /** + * Offset of the first hit to return + * default: null + * https://github.com/algolia/algoliasearch-client-js#offset + */ + offset?: number; + /** + * Number of hits to return. + * default: null + * https://github.com/algolia/algoliasearch-client-js#length + */ + length?: number; + /** + * The minimum number of characters needed to accept one typo. + * default: 4 + * https://github.com/algolia/algoliasearch-client-js#minwordsizefor1typo + */ + minWordSizefor1Typo?: number; + /** + * The minimum number of characters needed to accept two typo. + * fault: 8 + * https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos + */ + minWordSizefor2Typos?: number; + /** + * This option allows you to control the number of typos allowed in the result set: + * default: true + * 'true' The typo tolerance is enabled and all matching hits are retrieved + * 'false' The typo tolerance is disabled. All results with typos will be hidden. + * 'min' Only keep results with the minimum number of typos + * 'strict' Hits matching with 2 typos are not retrieved if there are some matching without typos. + * https://github.com/algolia/algoliasearch-client-js#minwordsizefor2typos + */ + typoTolerance?: boolean; + /** + * If set to false, disables typo tolerance on numeric tokens (numbers). + * default: + * https://github.com/algolia/algoliasearch-client-js#allowtyposonnumerictokens + */ + allowTyposOnNumericTokens?: boolean; + /** + * If set to true, plural won't be considered as a typo + * default: false + * https://github.com/algolia/algoliasearch-client-js#ignoreplurals + */ + ignorePlurals?: boolean; + /** + * List of attributes on which you want to disable typo tolerance + * default: "" + * https://github.com/algolia/algoliasearch-client-js#disabletypotoleranceonattributes + */ + disableTypoToleranceOnAttributes?: string; + /** + * Search for entries around a given location + * default: "" + * https://github.com/algolia/algoliasearch-client-js#aroundlatlng + */ + aroundLatLng?: string; + /** + * Search for entries around a given latitude/longitude automatically computed from user IP address. + * default: "" + * https://github.com/algolia/algoliasearch-client-js#aroundlatlngviaip + */ + aroundLatLngViaIP?: string; + /** + * Control the radius associated with a geo search. Defined in meters. + * default: null + * You can specify aroundRadius=all if you want to compute the geo distance without filtering in a geo area + * https://github.com/algolia/algoliasearch-client-js#aroundradius + */ + aroundRadius?: any; + /** + * Control the precision of a geo search + * default: null + * https://github.com/algolia/algoliasearch-client-js#aroundprecision + */ + aroundPrecision?: number; + /** + * Define the minimum radius used for a geo search when aroundRadius is not set. + * default: null + * https://github.com/algolia/algoliasearch-client-js#minimumaroundradius + */ + minimumAroundRadius?: number; + /** + * Search entries inside a given area defined by the two extreme points of a rectangle + * default: null + * https://github.com/algolia/algoliasearch-client-js#insideboundingbox + */ + insideBoundingBox?: string; + /** + * Selects how the query words are interpreted + * default: 'prefixLast' + * 'prefixAll' All query words are interpreted as prefixes. This option is not recommended. + * 'prefixLast' Only the last word is interpreted as a prefix (default behavior). + * 'prefixNone' No query word is interpreted as a prefix. This option is not recommended. + * https://github.com/algolia/algoliasearch-client-js#querytype + */ + queryType?: any; + /** + * Search entries inside a given area defined by a set of points + * defauly: '' + * https://github.com/algolia/algoliasearch-client-js#insidepolygon + */ + insidePolygon?: string; + /** + * This option is used to select a strategy in order to avoid having an empty result page + * default: 'none' + * 'lastWords' When a query does not return any results, the last word will be added as optional + * 'firstWords' When a query does not return any results, the first word will be added as optional + * 'allOptional' When a query does not return any results, a second trial will be made with all words as optional + * 'none' No specific processing is done when a query does not return any results + * https://github.com/algolia/algoliasearch-client-js#removewordsifnoresults + */ + removeWordsIfNoResults?: string; + /** + * Enables the advanced query syntax + * default: false + * https://github.com/algolia/algoliasearch-client-js#advancedsyntax + */ + advancedSyntax?: boolean; + /** + * A string that contains the comma separated list of words that should be considered as optional when found in the query + * default: [] + * https://github.com/algolia/algoliasearch-client-js#optionalwords + */ + optionalWords?: string[]; + /** + * Remove stop words from the query before executing it + * default: false + * true|false: enable or disable stop words for all 41 supported languages; or + * a list of language ISO codes (as a comma-separated string) for which stop words should be enable + * https://github.com/algolia/algoliasearch-client-js#removestopwords + */ + removeStopWords?: string[]; + /** + * List of attributes on which you want to disable the computation of exact criteria + * default: [] + * https://github.com/algolia/algoliasearch-client-js#disableexactonattributes + */ + disableExactOnAttributes?: string[]; + /** + * This parameter control how the exact ranking criterion is computed when the query contains one word + * default: attribute + * 'none': no exact on single word query + * 'word': exact set to 1 if the query word is found in the record + * 'attribute': exact set to 1 if there is an attribute containing a string equals to the query + * https://github.com/algolia/algoliasearch-client-js#exactonsinglewordquery + */ + exactOnSingleWordQuery?: string; + /** + * Specify the list of approximation that should be considered as an exact match in the ranking formula + * default: ['ignorePlurals', 'singleWordSynonym'] + * 'ignorePlurals': alternative words added by the ignorePlurals feature + * 'singleWordSynonym': single-word synonym (For example "NY" = "NYC") + * 'multiWordsSynonym': multiple-words synonym + * https://github.com/algolia/algoliasearch-client-js#alternativesasexact + */ + alternativesAsExact?: any; + /** + * 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; + /** + * If set to true, the result hits will contain ranking information in the _rankingInfo attribute. + * default: false + * https://github.com/algolia/algoliasearch-client-js#getrankinginfo + */ + getRankingInfo?: boolean; + /** + * All numerical attributes are automatically indexed as numerical filters + * default: '' + * https://github.com/algolia/algoliasearch-client-js#numericattributestoindex + */ + numericAttributesToIndex?: string[]; + /** + * @deprecated please use filters instead + * A string that contains the comma separated list of numeric filters you want to apply. + * https://github.com/algolia/algoliasearch-client-js#numericfilters-deprecated + */ + numericFilters?: string[]; + /** + * @deprecated + * Filter the query by a set of tags. + * https://github.com/algolia/algoliasearch-client-js#tagfilters-deprecated + */ + tagFilters?: string; + /** + * @deprecated + * Filter the query by a set of facets. + * https://github.com/algolia/algoliasearch-client-js#facetfilters-deprecated + */ + facetFilters?: string; + /** + * If set to false, this query will not be taken into account in the analytics feature. + * default true + * https://github.com/algolia/algoliasearch-client-js#analytics + */ + analytics?: boolean; + /** + * If set, tag your query with the specified identifiers + * default: null + * https://github.com/algolia/algoliasearch-client-js#analyticstags + */ + analyticsTags?: string[]; + /** + * If set to false, the search will not use the synonyms defined for the targeted index. + * default: true + * https://github.com/algolia/algoliasearch-client-js#synonyms + */ + synonyms?: boolean; + /** + * If set to false, words matched via synonym expansion will not be replaced by the matched synonym in the highlighted result. + * default: true + * https://github.com/algolia/algoliasearch-client-js#replacesynonymsinhighlight + */ + replaceSynonymsInHighlight?: boolean; + /** + * Configure the precision of the proximity ranking criterion + * default: 1 + * https://github.com/algolia/algoliasearch-client-js#minproximity + */ + minProximity?: number; + } } -declare function algoliasearch(applicationId: string, apiKey: string, options?: algoliasearch.ClientOptions): algoliasearch.AlgoliaClient; +declare function algoliasearch( + applicationId: string, + apiKey: string, + options?: algoliasearch.ClientOptions +): algoliasearch.AlgoliaClient; export = algoliasearch; diff --git a/types/algoliasearch/tsconfig.json b/types/algoliasearch/tsconfig.json index 3358732ba3..4d7e52dd8b 100644 --- a/types/algoliasearch/tsconfig.json +++ b/types/algoliasearch/tsconfig.json @@ -1,23 +1,16 @@ { - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "algoliasearch-tests.ts" - ] -} \ No newline at end of file + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "algoliasearch-tests.ts"] +} diff --git a/types/algoliasearch/tslint.json b/types/algoliasearch/tslint.json new file mode 100644 index 0000000000..886f1a8b6c --- /dev/null +++ b/types/algoliasearch/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/alt/tslint.json b/types/alt/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/alt/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/amazon-product-api/amazon-product-api-tests.ts b/types/amazon-product-api/amazon-product-api-tests.ts index 0a02153236..37682a11aa 100644 --- a/types/amazon-product-api/amazon-product-api-tests.ts +++ b/types/amazon-product-api/amazon-product-api-tests.ts @@ -3,7 +3,7 @@ declare var process: { env: any }; import amazon = require('amazon-product-api'); -var client = amazon.createClient({ +let client = amazon.createClient({ awsId: process.env.AWS_ACCESS_KEY_ID, awsSecret: process.env.AWS_SECRET, awsTag: process.env.AWS_ASSOCIATE_TAG @@ -12,7 +12,7 @@ var client = amazon.createClient({ // Item Search -var searchQuery = { +let searchQuery = { director: 'Quentin Tarantino', actor: 'Samuel L. Jackson', searchIndex: 'DVD', @@ -37,11 +37,11 @@ client.itemSearch(searchQuery, (err, results) => { // Item Lookup -var lookupQuery = { +let lookupQuery = { itemId: 'B00008OE6I', idType: 'ASIN', responseGroup: 'OfferFull', - Condition: 'All' + condition: 'All' }; client.itemLookup(lookupQuery).then((results) => { @@ -58,9 +58,22 @@ client.itemLookup(lookupQuery, (err, results) => { console.log(getResultCount(results) + " lookup results"); }); +let lookupQueryWithItemIdArray = { + itemId: ['B00008OE6I', 'B00008OE6E'], + idType: 'ASIN', + responseGroup: 'OfferFull', + condition: 'All' +}; + +client.itemLookup(lookupQueryWithItemIdArray).then((results) => { + console.log(getResultCount(results) + " lookup results"); +}).catch(function(err){ + console.log(err); +}); + // Browse Node Lookup -var nodeLookupQuery = { +let nodeLookupQuery = { browseNodeId: '2625373011' }; @@ -81,4 +94,4 @@ client.browseNodeLookup(nodeLookupQuery, (err, results) => { function getResultCount(results: Object[]) { return results != undefined ? results.length : 0; -} \ No newline at end of file +} diff --git a/types/amazon-product-api/index.d.ts b/types/amazon-product-api/index.d.ts index 797adf45f4..34bafd04f4 100644 --- a/types/amazon-product-api/index.d.ts +++ b/types/amazon-product-api/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for amazon-product-api // Project: https://github.com/t3chnoboy/amazon-product-api -// Definitions by: Matti Lehtinen +// Definitions by: Matti Lehtinen , Alex Leon // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -15,10 +15,35 @@ interface IAmazonProductQueryCallback { (err: string, results: Object[]): void; } +interface IItemSearchOptions { + condition?: string; + keywords?: string; + responseGroup?: string; + searchIndex?: string; + itemPage?: number; + sort?: string; +} + +interface IItemLookupOptions { + condition?: string; + idType?: string; + includeReviewsSummary?: boolean; + itemId?: string | string[]; + responseGroup?: string; + searchIndex?: string; + truncateReviewsAt?: number; + variationPage?: string; +} + +interface IBrowseNodeLookupOptions { + browseNodeId?: string; + responseGroup?: string; +} + interface IAmazonProductClient { - itemSearch(query: any, callback?: IAmazonProductQueryCallback): Promise; - itemLookup(query: any, callback?: IAmazonProductQueryCallback): Promise; - browseNodeLookup(query: any, callback?: IAmazonProductQueryCallback): Promise; + itemSearch(query: IItemSearchOptions, callback?: IAmazonProductQueryCallback): Promise; + itemLookup(query: IItemLookupOptions, callback?: IAmazonProductQueryCallback): Promise; + browseNodeLookup(query: IBrowseNodeLookupOptions, callback?: IAmazonProductQueryCallback): Promise; } export declare function createClient(credentials: ICredentials): IAmazonProductClient; diff --git a/types/amazon-product-api/tslint.json b/types/amazon-product-api/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/amazon-product-api/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/amcharts/index.d.ts b/types/amcharts/index.d.ts index 98fae5adeb..85abd11f5c 100644 --- a/types/amcharts/index.d.ts +++ b/types/amcharts/index.d.ts @@ -2323,7 +2323,11 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val negativeLineColor: string; /** Example: {precision:-1, decimalSeparator:'.', thousandsSeparator:','}. The graph uses this object's values to format the numbers. Uses chart's numberFormatter if not defined. */ numberFormatter: Object; - /** Name of the open field (used by floating columns, candlesticks and ohlc) in your dataProvider. */ + /** If you set it to true, column chart will begin new stack. This allows having Clustered and Stacked column/bar chart. */ + newStack: boolean; + /** Name of the open field (used by floating columns, candlesticks and ohlc) in your dataProvider. + @default 50 + */ openField: string; /**Precision of values. Will use chart's precision if not set any.*/ precision: number; diff --git a/types/amcharts/tslint.json b/types/amcharts/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/amcharts/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/amplitude-js/tslint.json b/types/amplitude-js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/amplitude-js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/amqp-rpc/tslint.json b/types/amqp-rpc/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/amqp-rpc/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/analytics-node/tslint.json b/types/analytics-node/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/analytics-node/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-agility/tslint.json b/types/angular-agility/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-agility/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-animate/index.d.ts b/types/angular-animate/index.d.ts index 0ce96a2f2f..6a51b368c8 100644 --- a/types/angular-animate/index.d.ts +++ b/types/angular-animate/index.d.ts @@ -2,7 +2,7 @@ // Project: http://angularjs.org // Definitions by: Michel Salib , Adi Dahiya , Raphael Schweizer , Cody Schaaf // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.3 declare var _: string; export = _; diff --git a/types/angular-animate/tslint.json b/types/angular-animate/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-animate/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-block-ui/index.d.ts b/types/angular-block-ui/index.d.ts index 47ba9902b9..f415d386e9 100644 --- a/types/angular-block-ui/index.d.ts +++ b/types/angular-block-ui/index.d.ts @@ -67,7 +67,7 @@ declare module 'angular' { * If the filter function returns a string it will be passed as the message * argument to the start method of the service. * - * @param {angular.IRequestConfig} config - the Angular request config object. + * @param config the Angular request config object. * */ requestFilter?(config: IRequestConfig): (string | boolean); @@ -123,7 +123,7 @@ declare module 'angular' { * * This behaviour can be modified in the configuration. * - * @param {string|IBlockUIConfig} messageOrOptions - + * @param messageOrOptions * Either supply the message (string) to be show in the * overlay or specify an IBlockUIConfig object that will be * merged/extended into the block ui instance state. @@ -156,7 +156,7 @@ declare module 'angular' { * Allows the message shown in the overlay to be updated * while to block is active. * - * @param {string} message - The message to show in the overlay. + * @param message The message to show in the overlay. */ message(message: string): void; diff --git a/types/angular-bootstrap-calendar/package.json b/types/angular-bootstrap-calendar/package.json index fce08a048d..19e5fb0d14 100644 --- a/types/angular-bootstrap-calendar/package.json +++ b/types/angular-bootstrap-calendar/package.json @@ -3,4 +3,4 @@ "dependencies": { "moment": ">=2.14.0" } -} \ No newline at end of file +} diff --git a/types/angular-bootstrap-calendar/tslint.json b/types/angular-bootstrap-calendar/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-bootstrap-calendar/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-bootstrap-lightbox/tslint.json b/types/angular-bootstrap-lightbox/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-bootstrap-lightbox/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-breadcrumb/tslint.json b/types/angular-breadcrumb/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-breadcrumb/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-clipboard/tslint.json b/types/angular-clipboard/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-clipboard/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-cookie/tslint.json b/types/angular-cookie/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-cookie/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-cookies/tslint.json b/types/angular-cookies/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-cookies/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-deferred-bootstrap/tslint.json b/types/angular-deferred-bootstrap/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-deferred-bootstrap/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-dialog-service/tslint.json b/types/angular-dialog-service/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-dialog-service/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-dynamic-locale/tslint.json b/types/angular-dynamic-locale/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-dynamic-locale/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-environment/tslint.json b/types/angular-environment/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-environment/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-es/tslint.json b/types/angular-es/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-es/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-feature-flags/tslint.json b/types/angular-feature-flags/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-feature-flags/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-file-saver/tslint.json b/types/angular-file-saver/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-file-saver/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-file-upload/index.d.ts b/types/angular-file-upload/index.d.ts index ee1982123a..edac0ce2ad 100644 --- a/types/angular-file-upload/index.d.ts +++ b/types/angular-file-upload/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/nervgh/angular-file-upload // Definitions by: Cyril Gandon // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 import * as angular from 'angular'; diff --git a/types/angular-formly/angular-formly-tests.ts b/types/angular-formly/angular-formly-tests.ts index b78c8a1257..d053660362 100644 --- a/types/angular-formly/angular-formly-tests.ts +++ b/types/angular-formly/angular-formly-tests.ts @@ -14,6 +14,19 @@ class FormConfig { templateUrl: 'my-messages.html' }); + formlyConfig.setWrapper([ + { + name: 'validation-0', + types: ['input-0', 'customInput-0'], + templateUrl: 'my-messages-0.html' + }, + { + name: 'validation-1', + types: ['input-1', 'customInput-1'], + templateUrl: 'my-messages-1.html' + } + ]); + formlyValidationMessages.addStringMessage('required', 'This field is required'); formlyConfig.setType({ @@ -21,14 +34,14 @@ class FormConfig { extends: 'input' }); - formlyConfig.disableWarnings = true; + formlyConfig.disableWarnings = true; formlyConfig.templateManipulators = undefined; formlyConfig.extras.apiCheckInstance = null; formlyConfig.extras.defaultHideDirective = 'ng-if'; formlyConfig.extras.disableNgModelAttrsManipulator = true; formlyConfig.extras.errorExistsAndShouldBeVisibleExpression = angular.noop; - formlyConfig.extras.explicitAsync = true; + formlyConfig.extras.explicitAsync = true; formlyConfig.extras.fieldTransform = angular.noop; formlyConfig.extras.fieldTransform = [angular.noop]; formlyConfig.extras.getFieldId = angular.noop; diff --git a/types/angular-formly/index.d.ts b/types/angular-formly/index.d.ts index 8bcab28800..55c4743fc9 100644 --- a/types/angular-formly/index.d.ts +++ b/types/angular-formly/index.d.ts @@ -589,7 +589,7 @@ declare namespace AngularFormly { disableWarnings: boolean; extras: IFormlyConfigExtras; setType(typeOptions: ITypeOptions): void; - setWrapper(wrapperOptions: IWrapperOptions): void; + setWrapper(wrapperOptions: IWrapperOptions | Array): void; templateManipulators: ITemplateManipulators; } diff --git a/types/angular-formly/tslint.json b/types/angular-formly/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-formly/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-fullscreen/tslint.json b/types/angular-fullscreen/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-fullscreen/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-gettext/tslint.json b/types/angular-gettext/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-gettext/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-google-analytics/tslint.json b/types/angular-google-analytics/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-google-analytics/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-growl-v2/tslint.json b/types/angular-growl-v2/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-growl-v2/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-hotkeys/README.md b/types/angular-hotkeys/README.md deleted file mode 100644 index a31ed8a936..0000000000 --- a/types/angular-hotkeys/README.md +++ /dev/null @@ -1,55 +0,0 @@ -## What is it? - -This is a typescript interface to be used with [angular-hotkeys](https://github.com/chieffancypants/angular-hotkeys/). - -## What are declaration files? - -See the [TypeScript handbook](http://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html). - - -## How do I get them? - -### npm - -This is the preferred method. This is only available for TypeScript 2.0+ users. For these typings: - -```sh -npm install --save-dev @types/angular-hotkeys -``` - -The types should then be automatically included by the compiler. -See more in the [handbook](http://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html). - - -### Other methods - -These can be used by TypeScript 1.0. - -* [Typings](https://github.com/typings/typings) -* ~~[NuGet](http://nuget.org/Tpackages?q=DefinitelyTyped)~~ (use preferred alternatives, nuget DT type publishing has been turned off) -* Manually download from the `master` branch of this repository - -You may need to add manual [references](http://www.typescriptlang.org/docs/handbook/triple-slash-directives.html). - -## How to use - -After installing a package you can import the definition file and begin using it as so: - -```ts - -import * as hotkeys from '../../node_modules/@types/angular-hotkeys' - -class FooController { - static $inject = [ - 'hotkeys' - ]; - - constructor( - private hotkeys: ng.hotkeys.HotkeysProvider - ) { } -} - -``` - -for a detailed explanation of the behavior of angular-hotkeys please refer to [its documentation](https://github.com/chieffancypants/angular-hotkeys/) - diff --git a/types/angular-hotkeys/angular-hotkeys-tests.ts b/types/angular-hotkeys/angular-hotkeys-tests.ts index c0bd9b974d..503080e9d8 100644 --- a/types/angular-hotkeys/angular-hotkeys-tests.ts +++ b/types/angular-hotkeys/angular-hotkeys-tests.ts @@ -1,30 +1,67 @@ -var scope: ng.IScope; -var hotkeyProvider: ng.hotkeys.HotkeysProvider; -var hotkeyObj: ng.hotkeys.Hotkey; +import { HotkeysProvider, Hotkey } from 'angular-hotkeys'; +import { module } from 'angular'; -hotkeyProvider.add("mod+s", "saves a file", (event: Event, hotkey: ng.hotkeys.Hotkey) => {} ); -hotkeyProvider.add(["mod+s"], "saves a file", (event: Event, hotkey: ng.hotkeys.Hotkey) => {} ); -hotkeyProvider.add(hotkeyObj); -hotkeyProvider.bindTo(scope); -hotkeyProvider.del("mod+s"); -hotkeyProvider.del(["mod+s"]); -hotkeyProvider.get("mod+s"); -hotkeyProvider.get(["mod+s"]); -hotkeyProvider.toggleCheatSheet(); - -hotkeyProvider.add(hotkeyObj.combo, hotkeyObj.description ,hotkeyObj.callback); - -hotkeyProvider.bindTo(scope) - .add(hotkeyObj) - .add(hotkeyObj) - .add({ - combo: 'w', - description: 'blah blah', - callback: function() {} - }) - .add({ - combo: ['w', 'mod+w'], - description: 'blah blah', - callback: function() {} +module('myApp', ['cfp.hotkeys']) + .config((hotkeysProvider: HotkeysProvider) => { + hotkeysProvider.includeCheatSheet = false; + const somehotKeyObj: Hotkey = { + combo: '', + callback: () => { } + }; }); +function someInjectionService( + scope: ng.IScope, + hotkeyProvider: ng.hotkeys.HotkeysProvider, + hotkeyObj: ng.hotkeys.Hotkey +) { + hotkeyProvider.add("mod+s", "saves a file", (event: Event, hotkey: ng.hotkeys.Hotkey) => { }); + hotkeyProvider.add(["mod+s"], "saves a file", (event: Event, hotkey: ng.hotkeys.Hotkey) => { }); + hotkeyProvider.add(hotkeyObj); + hotkeyProvider.bindTo(scope); + hotkeyProvider.del("mod+s"); + hotkeyProvider.del(["mod+s"]); + hotkeyProvider.get("mod+s"); + hotkeyProvider.get(["mod+s"]); + hotkeyProvider.toggleCheatSheet(); + + hotkeyProvider.add(hotkeyObj.combo, hotkeyObj.description, hotkeyObj.callback); + + hotkeyProvider.bindTo(scope) + .add(hotkeyObj) + .add(hotkeyObj) + .add({ + combo: 'w', + description: 'blah blah', + callback: () => { } + }) + .add({ + combo: ['w', 'mod+w'], + description: 'blah blah', + callback: () => { } + }); + + hotkeyProvider.add({ + combo: 'ctrl+w', + description: 'Description goes here', + callback: (event, hotkey) => { + event.preventDefault(); + } + }); + + hotkeyProvider.add({ + combo: 'ctrl+x', + callback: (event, hotkey) => { + // + } + }); + + hotkeyProvider.add({ + combo: 'ctrl+w', + description: 'Description goes here', + allowIn: ['INPUT', 'SELECT', 'TEXTAREA'], + callback(event, hotkey) { + event.preventDefault(); + } + }); +} diff --git a/types/angular-hotkeys/index.d.ts b/types/angular-hotkeys/index.d.ts index 38ff06a969..360e2cefbe 100644 --- a/types/angular-hotkeys/index.d.ts +++ b/types/angular-hotkeys/index.d.ts @@ -1,56 +1,135 @@ -// Type definitions for angular-hotkeys +// Type definitions for angular-hotkeys 1.7 // Project: https://github.com/chieffancypants/angular-hotkeys -// Definitions by: Jason Zhao , Stefan Steinhart +// Definitions by: Jason Zhao +// Stefan Steinhart +// Cyril Gandon // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -//readme written by David Valentine - - -/// import * as ng from 'angular'; -declare module 'angular' { - export namespace hotkeys { +export type HotkeysProvider = ng.hotkeys.HotkeysProvider; +export type HotkeysProviderChained = ng.hotkeys.HotkeysProviderChained; +export type Hotkey = ng.hotkeys.Hotkey; +declare module 'angular' { + namespace hotkeys { interface HotkeysProvider { - template: string; - templateTitle: string; + /** + * Configurable setting to disable the cheatsheet entirely. + * @default true + */ includeCheatSheet: boolean; + /** + * Configurable setting to disable ngRoute hooks. + */ + useNgRoute: boolean; + /** + * Configurable setting for the cheat sheet title + * @default 'Keyboard Shortcuts' + */ + templateTitle: string; + /** + * Configurable settings for the cheat sheet header in HTML. + * This overrides the normal title if specified. + * @default null + */ + templateHeader: string | null; + /** + * Configurable settings for the cheat sheet footer in HTML. + * @default null + */ + templateFooter: string | null; + /** + * Cheat sheet template in the event you want to totally customize it. + */ + template: string; + /** + * Configurable setting for the cheat sheet hotkey. + * @default '?' + */ cheatSheetHotkey: string; + /** + * Configurable setting for the cheat sheet description. + * @default 'Show / hide this help menu' + */ cheatSheetDescription: string; - add(combo: string | string[], callback: (event: Event, hotkey?: Hotkey) => void, action?: string, allowIn?: Array, persistent?: boolean): ng.hotkeys.Hotkey; + /** + * Creates a new Hotkey and creates the Mousetrap binding. + */ + add(combo: string | string[], description?: string, callback?: (event: Event, hotkey: Hotkey) => void, action?: string, allowIn?: string[], persistent?: boolean): Hotkey; - add(combo: string | string[], description: string, callback: (event: Event, hotkey?: Hotkey) => void, action?: string, allowIn?: Array, persistent?: boolean): ng.hotkeys.Hotkey; + /** + * Creates a new Hotkey and creates the Mousetrap binding. + */ + add(hotkeyObj: Hotkey): Hotkey; - add(hotkeyObj: ng.hotkeys.Hotkey): ng.hotkeys.Hotkey; + /** + * Binds the hotkey to a particular scope. + * Useful if the scope is destroyed, we can automatically destroy the hotkey binding. + * @param scope The scope to bind to + */ + bindTo(scope: IScope): HotkeysProviderChained; - bindTo(scope: ng.IScope): ng.hotkeys.HotkeysProviderChained; + /** + * Removes and unbinds a hotkey + * @param combo The keyboard combo (shortcut) or the HotKey object + */ + del(combo: string | string[] | Hotkey): void; - del(combo: string | string[]): void; - - del(hotkeyObj: ng.hotkeys.Hotkey): void; - - get(combo: string | string[]): ng.hotkeys.Hotkey; + /** + * Returns the Hotkey object + * @param combo The keyboard combo (shortcut) + */ + get(combo: string | string[]): Hotkey; + /** + * Toggles the help menu element's visiblity + */ toggleCheatSheet(): void; - + /** + * Purges all non-persistent hotkeys (such as those defined in routes) + * + * Without this, the same hotkey would get recreated everytime + * the route is accessed. + */ purgeHotkeys(): void; } interface HotkeysProviderChained { - add(combo: string | string[], description: string, callback: (event: Event, hotkeys: ng.hotkeys.Hotkey) => void): HotkeysProviderChained; + add(combo: string | string[], description: string, callback: (event: Event, hotkeys: Hotkey) => void): HotkeysProviderChained; - add(hotkeyObj: ng.hotkeys.Hotkey): HotkeysProviderChained; + add(hotkeyObj: Hotkey): HotkeysProviderChained; } interface Hotkey { + /** + * They keyboard combo (shortcut) you want to bind to. + */ combo: string | string[]; + /** + * The description for what the combo does and is only used for the Cheat Sheet. + * If it is not supplied, it will not show up, and in effect, allows you to have unlisted hotkeys. + */ description?: string; - callback: (event: Event, hotkey: ng.hotkeys.Hotkey) => void; + /** + * The function to execute when the key(s) are pressed. Passes along two arguments, event and hotkey + */ + callback(event: Event, hotkey: Hotkey): void; + /** + * The type of event to listen for, such as keypress, keydown or keyup. + * Usage of this parameter is discouraged as the underlying library will pick the most suitable option automatically. + * This should only be necessary in advanced situations. + */ action?: string; - allowIn?: Array; + /** + * An array of tag names to allow this combo in ('INPUT', 'SELECT', and/or 'TEXTAREA') + */ + allowIn?: Array<'INPUT' | 'SELECT' | 'TEXTAREA'>; + /** + * Whether the hotkey persists navigation events + */ persistent?: boolean; } } diff --git a/types/angular-hotkeys/tsconfig.json b/types/angular-hotkeys/tsconfig.json index f277241888..acb11ff247 100644 --- a/types/angular-hotkeys/tsconfig.json +++ b/types/angular-hotkeys/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -21,4 +21,4 @@ "index.d.ts", "angular-hotkeys-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/flatpickr/tslint.json b/types/angular-hotkeys/tslint.json similarity index 100% rename from types/flatpickr/tslint.json rename to types/angular-hotkeys/tslint.json diff --git a/types/angular-http-auth/tslint.json b/types/angular-http-auth/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-http-auth/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-httpi/tslint.json b/types/angular-httpi/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-httpi/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-idle/tslint.json b/types/angular-idle/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-idle/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-jwt/tslint.json b/types/angular-jwt/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-jwt/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-load/tslint.json b/types/angular-load/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-load/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-loading-bar/tslint.json b/types/angular-loading-bar/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-loading-bar/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-local-storage/tslint.json b/types/angular-local-storage/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-local-storage/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-localforage/package.json b/types/angular-localforage/package.json index 22ff6e6118..9ef28aa765 100644 --- a/types/angular-localforage/package.json +++ b/types/angular-localforage/package.json @@ -3,4 +3,4 @@ "dependencies": { "localforage": "^1.5.0" } -} \ No newline at end of file +} diff --git a/types/angular-localforage/tslint.json b/types/angular-localforage/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-localforage/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-locker/tslint.json b/types/angular-locker/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-locker/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-material/angular-material-tests.ts b/types/angular-material/angular-material-tests.ts index 79f72f0b5d..ac4a1386cd 100644 --- a/types/angular-material/angular-material-tests.ts +++ b/types/angular-material/angular-material-tests.ts @@ -5,6 +5,7 @@ interface TestScope extends ng.IScope { } myApp.config(( + $mdAriaProvider: ng.material.IAriaProvider, $mdThemingProvider: ng.material.IThemingProvider, $mdIconProvider: ng.material.IIconProvider, $mdProgressCircularProvider: ng.material.IProgressCircularProvider) => { @@ -52,6 +53,9 @@ myApp.config(( return c * Math.pow(2, (t / d - 1) * 10) + b; } }); + + // Globally disables all ARIA warnings. + $mdAriaProvider.disableWarnings(); }); myApp.controller('BottomSheetController', ($scope: TestScope, $mdBottomSheet: ng.material.IBottomSheetService, $q: ng.IQService) => { @@ -136,6 +140,9 @@ myApp.controller('DialogController', ($scope: TestScope, $mdDialog: ng.material. $scope['promptDialog'] = () => { $mdDialog.show($mdDialog.prompt().initialValue('Buddy')); }; + $scope['promptDialog'] = () => { + $mdDialog.show($mdDialog.prompt().required(true)); + }; $scope['prerenderedDialog'] = () => { $mdDialog.show({ template: 'Hello!', @@ -264,6 +271,48 @@ myApp.controller('ToastController', ($scope: TestScope, $mdToast: ng.material.IT }; }); +myApp.controller('ThemeController', ($element: JQuery, $scope: TestScope, $mdTheming: ng.material.IThemingService) => { + $mdTheming($element); + + const PALETTES: ng.material.IConfiguredColorPalette = $mdTheming.PALETTES; + const redPalette: ng.material.IPalette = PALETTES.red; + const myPalette: ng.material.IPalette = PALETTES.myPalette; + const THEMES: ng.material.IConfiguredThemes = $mdTheming.THEMES; + const defaultTheme: ng.material.ITheme = THEMES.default; + const myTheme: ng.material.ITheme = THEMES.myTheme; + + $scope['registered'] = () => { + let registered: boolean = $mdTheming.registered('default'); + registered = $mdTheming.registered('myTheme'); + }; + + $scope['defaultTheme'] = () => { + const themeName: string = $mdTheming.defaultTheme(); + }; + + $scope['generateTheme'] = () => { + $mdTheming.generateTheme('myTheme'); + }; + + $scope['setBrowserColors'] = () => { + const browserColors: ng.material.IBrowserColors = { + theme: 'default', + palette: 'neonRed', + hue: '500' + }; + const remove: () => void = $mdTheming.setBrowserColor(browserColors); + }; + + $scope['defineTheme'] = () => { + const newTheme: ng.material.IDefineThemeOptions = { + primary: 'blue', + accent: 'orange', + dark: true + }; + $mdTheming.defineTheme('newTheme', newTheme); + }; +}); + myApp.controller('PanelController', ($scope: TestScope, $mdPanel: ng.material.IPanelService, $q: ng.IQService) => { $scope['createPanel'] = () => { const config: ng.material.IPanelConfig = { diff --git a/types/angular-material/index.d.ts b/types/angular-material/index.d.ts index a8808f92ff..92f6d46751 100644 --- a/types/angular-material/index.d.ts +++ b/types/angular-material/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for angular-material 1.1 // Project: https://github.com/angular/material -// Definitions by: Blake Bigelow , Peter Hajdu , Davide Donadello , Geert Jansen +// Definitions by: Blake Bigelow , Peter Hajdu , Davide Donadello , Geert Jansen , Edward Knowles // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -11,6 +11,10 @@ export = _; declare module 'angular' { namespace material { + interface IAriaProvider { + disableWarnings(): void; + } + interface ResolveObject { [name: string]: Injectable<(...args: any[]) => PromiseLike>; } @@ -76,6 +80,7 @@ declare module 'angular' { interface IPromptDialog extends IPresetDialog { cancel(cancel: string): IPromptDialog; + required(required: boolean): IPromptDialog; // default: false placeholder(placeholder: string): IPromptDialog; initialValue(initialValue: string): IPromptDialog; } @@ -290,6 +295,25 @@ declare module 'angular' { configuration(): IThemeConfig; } + interface IDefineThemeOptions { + primary?: string; + accent?: string; + warn?: string; + background?: string; + dark?: boolean; + } + + interface IThemingService { + PALETTES: IConfiguredColorPalette; // get only + THEMES: IConfiguredThemes; // get only + (element: JQuery): void; + registered(themeName: string): boolean; + defaultTheme(): string; + generateTheme(name: string): void; + setBrowserColor(options: IBrowserColors): () => void; + defineTheme(name: string, options: IDefineThemeOptions): IPromise; + } + interface IDateLocaleProvider { months: string[]; shortMonths: string[]; @@ -330,6 +354,18 @@ declare module 'angular' { 'blue-grey': IPalette; } + interface IConfiguredColorPalette extends IColorPalette { + [name: string]: IPalette; + } + + interface IThemes { + default: ITheme; + } + + interface IConfiguredThemes extends IThemes { + [name: string]: ITheme; + } + interface IPanelConfig { id?: string; template?: string; diff --git a/types/angular-media-queries/tslint.json b/types/angular-media-queries/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-media-queries/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-meteor/tslint.json b/types/angular-meteor/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-meteor/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-mocks/tslint.json b/types/angular-mocks/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-mocks/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-modal/angular-modal-tests.ts b/types/angular-modal/angular-modal-tests.ts index edb4d7e6ef..1f55403490 100644 --- a/types/angular-modal/angular-modal-tests.ts +++ b/types/angular-modal/angular-modal-tests.ts @@ -45,9 +45,9 @@ function withContainerAsString() { }); } -// With container as jQuery element +// With container as jQuery/JQLite element function withContainerAsJquery() { - var container: JQuery = $('body'); + var container: JQuery = angular.element('body'); btfModal({ template: '
', container: container @@ -94,6 +94,10 @@ function callingValues() { template: '
' }); modal.activate().then(() => {}, () => {}); + // activating with random locals + modal.activate({name: 'TestName'}).then(() => {}, () => {}); + // activating with genericly typed locals + modal.activate<{name: string}>({name: 'TestName'}).then(() => {}, () => {}); modal.deactivate().then(() => {}, () => {}); var isActive: boolean = modal.active(); } diff --git a/types/angular-modal/index.d.ts b/types/angular-modal/index.d.ts index 40106e955e..e817157adb 100644 --- a/types/angular-modal/index.d.ts +++ b/types/angular-modal/index.d.ts @@ -5,7 +5,6 @@ // TypeScript Version: 2.3 /// -/// declare namespace angularModal { @@ -28,7 +27,8 @@ declare namespace angularModal { } export interface AngularModal { - activate(): angular.IPromise; + activate(locals?: {}): angular.IPromise; + activate(locals: T): angular.IPromise; deactivate(): angular.IPromise; active(): boolean; } diff --git a/types/angular-modal/tslint.json b/types/angular-modal/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-modal/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-notifications/tslint.json b/types/angular-notifications/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-notifications/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-notify/tslint.json b/types/angular-notify/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-notify/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-odata-resources/tslint.json b/types/angular-odata-resources/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-odata-resources/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-permission/tslint.json b/types/angular-permission/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-permission/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-promise-tracker/tslint.json b/types/angular-promise-tracker/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-promise-tracker/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-q-spread/tslint.json b/types/angular-q-spread/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-q-spread/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-route/tslint.json b/types/angular-route/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-route/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-sanitize/tslint.json b/types/angular-sanitize/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-sanitize/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-scenario/tslint.json b/types/angular-scenario/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-scenario/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-scroll/tslint.json b/types/angular-scroll/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-scroll/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-signalr-hub/tslint.json b/types/angular-signalr-hub/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-signalr-hub/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-spinner/tslint.json b/types/angular-spinner/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-spinner/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-storage/index.d.ts b/types/angular-storage/index.d.ts index 8021ba2f5e..a5f65955f5 100644 --- a/types/angular-storage/index.d.ts +++ b/types/angular-storage/index.d.ts @@ -6,10 +6,13 @@ /// +declare var _: string; +export = _; + import * as angular from 'angular'; declare module 'angular' { - export namespace a0.storage { + namespace a0.storage { interface IStoreService extends INamespacedStoreService { /** * Returns a namespaced store diff --git a/types/angular-storage/tslint.json b/types/angular-storage/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-storage/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-toastr/tslint.json b/types/angular-toastr/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-toastr/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-toasty/tslint.json b/types/angular-toasty/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-toasty/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-tooltips/index.d.ts b/types/angular-tooltips/index.d.ts index d3cf83c1ec..682737756f 100644 --- a/types/angular-tooltips/index.d.ts +++ b/types/angular-tooltips/index.d.ts @@ -2,6 +2,7 @@ // Project: http://720kb.github.io/angular-tooltips // Definitions by: Leonard Thieu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 declare const AngularTooltips: '720kb.tooltips'; export = AngularTooltips; diff --git a/types/angular-touchspin/tslint.json b/types/angular-touchspin/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-touchspin/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-translate/tslint.json b/types/angular-translate/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-translate/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-ui-bootstrap/tslint.json b/types/angular-ui-bootstrap/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-ui-bootstrap/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-ui-notification/tslint.json b/types/angular-ui-notification/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-ui-notification/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-ui-router/index.d.ts b/types/angular-ui-router/index.d.ts index d1f2c43b48..04e3c9341a 100644 --- a/types/angular-ui-router/index.d.ts +++ b/types/angular-ui-router/index.d.ts @@ -281,7 +281,7 @@ declare module 'angular' { current: IState; /** A param object, e.g. {sectionId: section.id)}, that you'd like to test against the current active state. */ params: IStateParamsService; - reload(): angular.IPromise; + reload(reloadState?: string | IState): angular.IPromise; /** Currently pending transition. A promise that'll resolve or reject. */ transition: angular.IPromise<{}>; diff --git a/types/angular-ui-router/tslint.json b/types/angular-ui-router/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-ui-router/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-ui-scroll/tslint.json b/types/angular-ui-scroll/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-ui-scroll/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-ui-sortable/tslint.json b/types/angular-ui-sortable/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-ui-sortable/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-ui-tree/tslint.json b/types/angular-ui-tree/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-ui-tree/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-websocket/tslint.json b/types/angular-websocket/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-websocket/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-wizard/tslint.json b/types/angular-wizard/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-wizard/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular-xeditable/tslint.json b/types/angular-xeditable/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular-xeditable/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular.throttle/tslint.json b/types/angular.throttle/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angular.throttle/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angular/angular-tests.ts b/types/angular/angular-tests.ts index c60da29504..88a59bdd2a 100644 --- a/types/angular/angular-tests.ts +++ b/types/angular/angular-tests.ts @@ -178,7 +178,7 @@ mod.controller('name', class { // $onChanges(x: number) { } }); mod.controller({ - MyCtrl: class{}, + MyCtrl: class {}, MyCtrl2() {}, MyCtrl3: ['$fooService', ($fooService: any) => { }] }); @@ -229,7 +229,7 @@ mod.provider(My.Namespace); mod.service('name', ($scope: ng.IScope) => {}); mod.service('name', ['$scope', ($scope: ng.IScope) => {}]); mod.service({ - MyCtrl: class{}, + MyCtrl: class {}, MyCtrl2: () => {}, // tslint:disable-line:object-literal-shorthand MyCtrl3: ['$fooService', ($fooService: any) => {}] }); @@ -491,9 +491,7 @@ namespace TestInjector { // $injector.instantiate { - class Foobar { - constructor($q) {} - } + class Foobar {} const result: Foobar = $injector.instantiate(Foobar); } @@ -509,7 +507,13 @@ namespace TestInjector { } const anyFunction: Function = foobar; - const anyResult: string = $injector.invoke(anyFunction); + let anyResult: string = $injector.invoke(anyFunction); + + const inlineAnnotatedFunction: any[] = [false, foobar]; + anyResult = $injector.invoke(inlineAnnotatedFunction); + anyResult = $injector.invoke(inlineAnnotatedFunction, 'anyContext', 'anyLocals'); + anyResult = $injector.invoke(inlineAnnotatedFunction, 'anyContext'); + anyResult = $injector.invoke(inlineAnnotatedFunction, undefined, 'anyLocals'); } } @@ -640,6 +644,9 @@ isolateScope = element.find('div').isolateScope(); isolateScope = element.children().isolateScope(); let element2 = angular.element(element); let elementArray = angular.element(document.querySelectorAll('div')); +let elementReadyFn = angular.element(() => { + console.log('ready'); +}); // $timeout signature tests namespace TestTimeout { @@ -700,7 +707,7 @@ class SampleDirective implements ng.IDirective { restrict = 'A'; name = 'doh'; - compile(templateElement: ng.IAugmentedJQuery) { + compile(templateElement: JQLite) { return { post: this.link }; @@ -716,7 +723,7 @@ class SampleDirective implements ng.IDirective { class SampleDirective2 implements ng.IDirective { restrict = 'EAC'; - compile(templateElement: ng.IAugmentedJQuery) { + compile(templateElement: JQLite) { return { pre: this.link }; @@ -734,7 +741,7 @@ angular.module('SameplDirective', []).directive('sampleDirective', SampleDirecti angular.module('AnotherSampleDirective', []).directive('myDirective', ['$interpolate', '$q', ($interpolate: ng.IInterpolateService, $q: ng.IQService) => { return { restrict: 'A', - link: (scope: ng.IScope, el: ng.IAugmentedJQuery, attr: ng.IAttributes) => { + link: (scope: ng.IScope, el: JQLite, attr: ng.IAttributes) => { $interpolate(attr['test'])(scope); $interpolate('', true)(scope); $interpolate('', true, 'html')(scope); @@ -862,7 +869,7 @@ angular.module('docsTimeDirective', []) }]) .directive('myCurrentTime', ['$interval', 'dateFilter', ($interval: any, dateFilter: any) => { return { - link(scope: ng.IScope, element: ng.IAugmentedJQuery, attrs: ng.IAttributes) { + link(scope: ng.IScope, element: JQLite, attrs: ng.IAttributes) { let format: any; let timeoutId: any; @@ -909,7 +916,7 @@ angular.module('docsTransclusionExample', []) transclude: true, scope: {}, templateUrl: 'my-dialog.html', - link(scope: ng.IScope, element: ng.IAugmentedJQuery) { + link(scope: ng.IScope, element: JQLite) { scope['name'] = 'Jeff'; } }; @@ -1010,7 +1017,7 @@ angular.module('docsTabsExample', []) scope: { title: '@' }, - link(scope: ng.IScope, element: ng.IAugmentedJQuery, attrs: ng.IAttributes, tabsCtrl: any) { + link(scope: ng.IScope, element: JQLite, attrs: ng.IAttributes, tabsCtrl: any) { tabsCtrl.addPane(scope); }, templateUrl: 'my-pane.html' @@ -1091,6 +1098,18 @@ angular.module('copyExample', []) $scope.reset(); }]); +// Extending IScope for a directive, see https://github.com/DefinitelyTyped/DefinitelyTyped/issues/21160 +interface IMyScope extends angular.IScope { + myScopeProperty: boolean; +} + +angular.module('aaa').directive('directive', () => ({ + link(scope: IMyScope) { + console.log(scope.myScopeProperty); + return; + } +})); + namespace locationTests { const $location: ng.ILocationService = null; @@ -1305,3 +1324,35 @@ function toPromise(val: T): ng.IPromise { const p: ng.IPromise = null; return p; } + +const directiveCompileFn: ng.IDirectiveCompileFn = ( + templateElement: JQLite, + templateAttributes: ng.IAttributes, + transclude: ng.ITranscludeFunction + ): ng.IDirectiveLinkFn => { + return ( + scope: ng.IScope, + instanceElement: JQLite, + instanceAttributes: ng.IAttributes + ) => { + return null; + }; +}; + +interface MyScope extends ng.IScope { + foo: string; +} + +const directiveCompileFnWithGeneric: ng.IDirectiveCompileFn = ( + templateElement: JQLite, + templateAttributes: ng.IAttributes, + transclude: ng.ITranscludeFunction + ): ng.IDirectiveLinkFn => { + return ( + scope: MyScope, + instanceElement: JQLite, + instanceAttributes: ng.IAttributes + ) => { + return null; + }; +}; diff --git a/types/angular/index.d.ts b/types/angular/index.d.ts index 8415c6e6b7..f3b64e2136 100644 --- a/types/angular/index.d.ts +++ b/types/angular/index.d.ts @@ -9,9 +9,6 @@ /// -// NOTE: @types/angular technically doesn't require TypeScript 2.3, only TypeScript 2.1. -// It has a TypeScript 2.3 header so that merging tests with @types/jquery v3 will work. - declare var angular: angular.IAngularStatic; // Support for painless dependency injection @@ -232,8 +229,8 @@ declare namespace angular { * @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind) * @param directiveFactory An injectable directive factory function. */ - directive(name: string, directiveFactory: Injectable): IModule; - directive(object: {[directiveName: string]: Injectable}): IModule; + directive(name: string, directiveFactory: Injectable>): IModule; + directive(object: {[directiveName: string]: Injectable>}): IModule; /** * Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider. * @@ -392,6 +389,7 @@ declare namespace angular { $rollbackViewValue(): void; $commitViewValue(): void; $isEmpty(value: any): boolean; + $overrideModelOptions(options: INgModelOptions): void; $viewValue: any; @@ -1088,7 +1086,7 @@ declare namespace angular { * Retrieves or overrides whether to generate an error when a rejected promise is not handled. * This feature is enabled by default. * - * @returns {boolean} Current value + * @returns Current value */ errorOnUnhandledRejections(): boolean; @@ -1096,8 +1094,8 @@ declare namespace angular { * Retrieves or overrides whether to generate an error when a rejected promise is not handled. * This feature is enabled by default. * - * @param {boolean} value Whether to generate an error when a rejected promise is not handled. - * @returns {ng.IQProvider} Self for chaining otherwise. + * @param value Whether to generate an error when a rejected promise is not handled. + * @returns Self for chaining otherwise. */ errorOnUnhandledRejections(value: boolean): IQProvider; } @@ -1108,8 +1106,8 @@ declare namespace angular { * The successCallBack may return IPromise for when a $q.reject() needs to be returned * This method returns a new promise which is resolved or rejected via the return value of the successCallback, errorCallback. It also notifies via the return value of the notifyCallback method. The promise can not be resolved or rejected from the notifyCallback method. */ - then(successCallback: (promiseValue: T) => IPromise|TResult, errorCallback?: null | undefined, notifyCallback?: (state: any) => any): IPromise; - then(successCallback: (promiseValue: T) => IPromise|TResult2, errorCallback?: null | undefined, notifyCallback?: (state: any) => any): IPromise; + then(successCallback: (promiseValue: T) => IPromise|TResult, errorCallback?: null, notifyCallback?: (state: any) => any): IPromise; + then(successCallback: (promiseValue: T) => IPromise|TResult2, errorCallback?: null, notifyCallback?: (state: any) => any): IPromise; then(successCallback: (promiseValue: T) => IPromise|TResult, errorCallback: (reason: any) => IPromise|TCatch, notifyCallback?: (state: any) => any): IPromise; then(successCallback: (promiseValue: T) => IPromise|TResult2, errorCallback: (reason: any) => IPromise|TCatch2, notifyCallback?: (state: any) => any): IPromise; @@ -1251,8 +1249,8 @@ declare namespace angular { } interface ICompileProvider extends IServiceProvider { - directive(name: string, directiveFactory: Injectable): ICompileProvider; - directive(object: {[directiveName: string]: Injectable}): ICompileProvider; + directive(name: string, directiveFactory: Injectable>): ICompileProvider; + directive(object: {[directiveName: string]: Injectable>}): ICompileProvider; component(name: string, options: IComponentOptions): ICompileProvider; @@ -1301,6 +1299,17 @@ declare namespace angular { */ cssClassDirectivesEnabled(): boolean; cssClassDirectivesEnabled(enabled: boolean): ICompileProvider; + + /** + * Call this method to enable/disable strict component bindings check. + * If enabled, the compiler will enforce that for all bindings of a + * component that are not set as optional with ?, an attribute needs + * to be provided on the component's HTML tag. + * Defaults to false. + * See: https://docs.angularjs.org/api/ng/provider/$compileProvider#strictComponentBindingsEnabled + */ + strictComponentBindingsEnabled(): boolean; + strictComponentBindingsEnabled(enabled: boolean): ICompileProvider; } interface ICloneAttachFunction { @@ -1638,9 +1647,8 @@ declare namespace angular { useApplyAsync(value: boolean): IHttpProvider; /** - * - * @param {boolean=} value If true, `$http` will return a normal promise without the `success` and `error` methods. - * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining. + * @param value If true, `$http` will return a normal promise without the `success` and `error` methods. + * @returns If a value is specified, returns the $httpProvider for chaining. * otherwise, returns the current configured value. */ useLegacyPromiseExtensions(value: boolean): boolean | IHttpProvider; @@ -1761,7 +1769,6 @@ declare namespace angular { (tpl: string, ignoreRequestError?: boolean): IPromise; /** * total amount of pending template requests being downloaded. - * @type {number} */ totalPendingRequests: number; } @@ -1962,13 +1969,13 @@ declare namespace angular { // and http://docs.angularjs.org/guide/directive /////////////////////////////////////////////////////////////////////////// - interface IDirectiveFactory { - (...args: any[]): IDirective | IDirectiveLinkFn; + interface IDirectiveFactory { + (...args: any[]): IDirective | IDirectiveLinkFn; } - interface IDirectiveLinkFn { + interface IDirectiveLinkFn { ( - scope: IScope, + scope: TScope, instanceElement: JQLite, instanceAttributes: IAttributes, controller?: IController | IController[] | {[key: string]: IController}, @@ -1976,12 +1983,12 @@ declare namespace angular { ): void; } - interface IDirectivePrePost { - pre?: IDirectiveLinkFn; - post?: IDirectiveLinkFn; + interface IDirectivePrePost { + pre?: IDirectiveLinkFn; + post?: IDirectiveLinkFn; } - interface IDirectiveCompileFn { + interface IDirectiveCompileFn { ( templateElement: JQLite, templateAttributes: IAttributes, @@ -1992,11 +1999,11 @@ declare namespace angular { * that is passed to the link function instead. */ transclude: ITranscludeFunction - ): void | IDirectiveLinkFn | IDirectivePrePost; + ): void | IDirectiveLinkFn | IDirectivePrePost; } - interface IDirective { - compile?: IDirectiveCompileFn; + interface IDirective { + compile?: IDirectiveCompileFn; controller?: string | Injectable; controllerAs?: string; /** @@ -2005,7 +2012,7 @@ declare namespace angular { * relies upon bindings inside a $onInit method on the controller, instead. */ bindToController?: boolean | {[boundProperty: string]: string}; - link?: IDirectiveLinkFn | IDirectivePrePost; + link?: IDirectiveLinkFn | IDirectivePrePost; multiElement?: boolean; priority?: number; /** @@ -2078,9 +2085,7 @@ declare namespace angular { get(name: '$xhrFactory'): IXhrFactory; has(name: string): boolean; instantiate(typeConstructor: {new(...args: any[]): T}, locals?: any): T; - invoke(inlineAnnotatedFunction: any[]): any; - invoke(func: (...args: any[]) => T, context?: any, locals?: any): T; - invoke(func: Function, context?: any, locals?: any): any; + invoke(func: Injectable T)>, context?: any, locals?: any): T; strictDi: boolean; } diff --git a/types/angular/jqlite.d.ts b/types/angular/jqlite.d.ts index 858201fb18..a9da89cf65 100644 --- a/types/angular/jqlite.d.ts +++ b/types/angular/jqlite.d.ts @@ -684,7 +684,7 @@ interface JQuery { } interface JQueryStatic { - (element: string | Element | Document | JQuery | ArrayLike): JQLite; + (element: string | Element | Document | JQuery | ArrayLike | (() => void)): JQLite; } /** diff --git a/types/angular/tsconfig.json b/types/angular/tsconfig.json index 92d1e026c3..5ce810f938 100644 --- a/types/angular/tsconfig.json +++ b/types/angular/tsconfig.json @@ -16,7 +16,7 @@ "noImplicitAny": false, "noImplicitThis": false, "strictNullChecks": false, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -25,4 +25,4 @@ "noEmit": true, "forceConsistentCasingInFileNames": true } -} \ No newline at end of file +} diff --git a/types/angularfire/tslint.json b/types/angularfire/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angularfire/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angularlocalstorage/tslint.json b/types/angularlocalstorage/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angularlocalstorage/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/angulartics/angulartics-tests.ts b/types/angulartics/angulartics-tests.ts index 5a5660a3f8..a130ec64b2 100644 --- a/types/angulartics/angulartics-tests.ts +++ b/types/angulartics/angulartics-tests.ts @@ -1,5 +1,5 @@ import * as angular from 'angular'; -import { angulartics } from 'angulartics'; +import * as angulartics from 'angulartics'; namespace Analytics { angular.module("angulartics.app", ["angulartics"]) diff --git a/types/angulartics/index.d.ts b/types/angulartics/index.d.ts index 0d9ba1f17f..40ff202329 100644 --- a/types/angulartics/index.d.ts +++ b/types/angulartics/index.d.ts @@ -1,11 +1,13 @@ -// Type definitions for Angulartics 1.3 +// Type definitions for Angulartics 1.4 // Project: http://luisfarzati.github.io/angulartics/ -// Definitions by: Steven Fan +// Definitions by: Bateast2 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 import * as angular from 'angular'; +export = angulartics;//AMD/Require module support +export as namespace angulartics;//UMD module support declare namespace angulartics { interface IAngularticsStatic { @@ -13,41 +15,67 @@ declare namespace angulartics { } interface IAnalyticsService { - eventTrack(eventName: string, properties?: any): any; - getOptOut(): boolean; pageTrack(path: string, location?: angular.ILocationService): any; + eventTrack(eventName: string, properties?: any): any; + exceptionTrack(error: any, cause: string): any; + transactionTrack: any; setAlias(alias: string): any; - setOptOut(value: boolean): void; setUsername(username: string): any; - setUserProperties(properties: any): any; - setSuperProperties(properties: any): any; + setUserProperties(userProperties: any): any; + setUserPropertiesOnce(userProperties: any): any; + setSuperProperties(superProperties: any): any; + setSuperPropertiesOnce(superProperties: any): any; + incrementProperty(property: string, value?: any): any; + userTimings(properties: any): any; + clearCookies: any; + + getOptOut(): boolean; + setOptOut(value: boolean): void; } interface IAnalyticsServiceProvider extends angular.IServiceProvider { virtualPageviews(value: boolean): void; + trackStates(value: boolean): void; + trackRoutes(value: boolean): void; excludeRoutes(value: string[]): void; + queryKeysWhitelist(keys: string[]): void + queryKeysBlacklist(keys: string[]): void firstPageview(value: boolean): void; withBase(value: boolean): void; withAutoBase(value: boolean): void; - developerMode(value: boolean): void; trackExceptions(value: boolean): void; - trackRoutes(value: boolean): void; - trackStates(value: boolean): void; + developerMode(value: boolean): void; registerPageTrack(callback: (path: string, location?: angular.ILocationService) => any): void; registerEventTrack(callback: (eventName: string, properties?: any) => any): void; + registerTransactionTrack(callback: any): void; registerSetAlias(callback: (alias: string) => any): void; registerSetUsername(callback: (username: string) => any): void; registerSetUserProperties(callback: (userProperties: any) => any): void; + registerSetUserPropertiesOnce(callback: (userProperties: any) => any): void; registerSetSuperProperties(callback: (superProperties: any) => any): void; + registerSetSuperPropertiesOnce(callback: (superProperties: any) => any): void; + registerIncrementProperty(callback: (property: string, value?: any) => any): void; + registerUserTimings(callback: (properties: any) => any): void; + registerClearCookies(callback: any): void; settings: { pageTracking: { autoTrackingVirtualPages: boolean, autoTrackingFirstPage: boolean, + trackRelativePath: boolean, + trackRoutes: boolean, + trackStates: boolean, + autoBasePath: boolean, basePath: string, - autoBasePath: boolean + excludedRoutes: string[], + queryKeysWhitelisted: string[], + queryKeysBlacklisted: string[] }, + eventTracking: {}, + bufferFlushDelay: number, + trackExceptions: boolean, + optOut: boolean, developerMode: boolean }; } diff --git a/types/angulartics/tslint.json b/types/angulartics/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/angulartics/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/animation-frame/tslint.json b/types/animation-frame/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/animation-frame/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/annyang/index.d.ts b/types/annyang/index.d.ts index fee0cb9acb..76f2bdb455 100644 --- a/types/annyang/index.d.ts +++ b/types/annyang/index.d.ts @@ -6,39 +6,23 @@ /** * Options for function `start` - * - * @export - * @interface StartOptions */ export interface StartOptions { /** * Should annyang restart itself if it is closed indirectly, because of silence or window conflicts? - * - * @type {boolean} */ autoRestart?: boolean; /** * Allow forcing continuous mode on or off. Annyang is pretty smart about this, so only set this if you know what you're doing. - * - * @type {boolean} */ continuous?: boolean; } /** * A command option that supports custom regular expressions - * - * @export - * @interface CommandOptionRegex */ export interface CommandOptionRegex { - /** - * @type {RegExp} - */ regexp: RegExp; - /** - * @type {() => any} - */ callback(): void; } @@ -50,8 +34,6 @@ export interface CommandOptionRegex { * {'hello :name': helloFunction, 'howdy': helloFunction}; * {'hi': helloFunction}; * ```` - * @export - * @interface CommandOption */ export interface CommandOption { [command: string]: CommandOptionRegex | (() => void); @@ -92,8 +74,6 @@ export interface Annyang { /** * Start listening. * It's a good idea to call this after adding some commands first, but not mandatory. - * - * @param {StartOptions} options */ start(options?: StartOptions): void; @@ -119,15 +99,13 @@ export interface Annyang { /** * Turn on output of debug messages to the console. Ugly, but super-handy! * - * @export - * @param {boolean} [newState=true] Turn on/off debug messages + * @param [newState=true] Turn on/off debug messages */ debug(newState?: boolean): void; /** * Set the language the user will speak in. If this method is not called, defaults to 'en-US'. * - * @param {string} lang * @see [Languages](https://github.com/TalAter/annyang/blob/master/docs/FAQ.md#what-languages-are-supported) */ setLanguage(lang: string): void; @@ -144,8 +122,6 @@ export interface Annyang { * annyang.addCommands(commands2); * // annyang will now listen to all three commands * ```` - * - * @param {CommandOption} commands */ addCommands(commands: CommandOption): void; @@ -161,7 +137,6 @@ export interface Annyang { * // Remove all existing commands * annyang.removeCommands(); * ```` - * @param {string} command */ removeCommands(command?: string): void; @@ -175,37 +150,22 @@ export interface Annyang { * // Don't respond to howdy or hi * annyang.removeCommands(['howdy', 'hi']); * ```` - * - * @param {string[]} command */ removeCommands(command: string[]): void; - /** - * @param {Events} event - * @param {(userSaid : string, commandText : string, results : string[]) => void} callback - * @param {*} [context] - */ addCallback(event: Events, callback: (userSaid?: string, commandText?: string, results?: string[]) => void, context?: any): void; - /** - * @param {Events} [event] - * @param {Function} [callback] - */ removeCallback(event?: Events, callback?: (userSaid: string, commandText: string, results: string[]) => void): void; /** * Returns true if speech recognition is currently on. * Returns false if speech recognition is off or annyang is paused. - * - * @returns {boolean} */ isListening(): boolean; /** * Returns the instance of the browser's SpeechRecognition object used by annyang. * Useful in case you want direct access to the browser's Speech Recognition engine. - * - * @returns {*} */ getSpeechRecognizer(): any; @@ -223,8 +183,6 @@ export interface Annyang { * ['Time for some thrilling heroics', 'Time for some thrilling aerobics'] * ); * ```` - * - * @param {string} command */ trigger(command: string | string[]): void; } diff --git a/types/ansi-styles/tslint.json b/types/ansi-styles/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/ansi-styles/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/ansicolors/tslint.json b/types/ansicolors/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/ansicolors/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/any-db-transaction/tslint.json b/types/any-db-transaction/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/any-db-transaction/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/any-db/tslint.json b/types/any-db/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/any-db/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/anybar/tslint.json b/types/anybar/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/anybar/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/anydb-sql-migrations/package.json b/types/anydb-sql-migrations/package.json index 7ce063c332..9b88fd6822 100644 --- a/types/anydb-sql-migrations/package.json +++ b/types/anydb-sql-migrations/package.json @@ -3,4 +3,4 @@ "dependencies": { "anydb-sql": "^0.6.53" } -} \ No newline at end of file +} diff --git a/types/anydb-sql-migrations/tslint.json b/types/anydb-sql-migrations/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/anydb-sql-migrations/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/apex.js/index.d.ts b/types/apex.js/index.d.ts index 20178369dc..0998ce794c 100644 --- a/types/apex.js/index.d.ts +++ b/types/apex.js/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/apex/node-apex // Definitions by: Yoriki Yamaguchi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /// diff --git a/types/aphrodite/tslint.json b/types/aphrodite/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/aphrodite/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/api-error-handler/api-error-handler-tests.ts b/types/api-error-handler/api-error-handler-tests.ts index 3bc39c4a7b..67afbb0fce 100644 --- a/types/api-error-handler/api-error-handler-tests.ts +++ b/types/api-error-handler/api-error-handler-tests.ts @@ -1,4 +1,3 @@ - import * as errorHandler from 'api-error-handler'; import * as express from 'express'; diff --git a/types/api-error-handler/index.d.ts b/types/api-error-handler/index.d.ts index e9337cc448..41e91a35ea 100644 --- a/types/api-error-handler/index.d.ts +++ b/types/api-error-handler/index.d.ts @@ -2,9 +2,7 @@ // Project: https://github.com/expressjs/api-error-handler // Definitions by: Tanguy Krotoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - - +// TypeScript Version: 2.2 import * as express from 'express'; diff --git a/types/api-error-handler/tslint.json b/types/api-error-handler/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/api-error-handler/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/apigee-access/tslint.json b/types/apigee-access/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/apigee-access/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/app-root-path/tslint.json b/types/app-root-path/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/app-root-path/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/appframework/tslint.json b/types/appframework/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/appframework/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/appletvjs/tslint.json b/types/appletvjs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/appletvjs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/applicationinsights-js/tslint.json b/types/applicationinsights-js/tslint.json index e4be61c456..29f4a79556 100644 --- a/types/applicationinsights-js/tslint.json +++ b/types/applicationinsights-js/tslint.json @@ -6,7 +6,10 @@ "no-declare-current-package": false, "no-internal-module": false, "no-mergeable-namespace": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, "no-single-declare-module": false, + "no-unnecessary-class": false, "no-unnecessary-qualifier": false } } diff --git a/types/applicationinsights/tslint.json b/types/applicationinsights/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/applicationinsights/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/arbiter/tslint.json b/types/arbiter/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/arbiter/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/arcgis-js-api/index.d.ts b/types/arcgis-js-api/index.d.ts index 5098cf63ad..9202525e55 100644 --- a/types/arcgis-js-api/index.d.ts +++ b/types/arcgis-js-api/index.d.ts @@ -8236,6 +8236,11 @@ declare namespace __esri { view: MapView; complete(): void; + + on(name: "cursor-update", eventHandler: PointDrawActionCursorUpdateEventHandler): IHandle; + on(name: "cursor-update", modifiers: string[], eventHandler: PointDrawActionCursorUpdateEventHandler): IHandle; + on(name: "draw-complete", eventHandler: PointDrawActionDrawCompleteEventHandler): IHandle; + on(name: "draw-complete", modifiers: string[], eventHandler: PointDrawActionDrawCompleteEventHandler): IHandle; } interface PointDrawActionConstructor { @@ -8248,6 +8253,20 @@ declare namespace __esri { view?: MapViewProperties; } + export interface PointDrawActionCursorUpdateEvent { + coordinates: number[]; + defaultPrevented: boolean; + preventDefault: Function; + type: string; + } + + export interface PointDrawActionDrawCompleteEvent { + coordinates: number[]; + defaultPrevented: boolean; + preventDefault: Function; + type: string; + } + interface PolygonDrawAction extends Accessor, Evented { vertices: number[][]; view: MapView; @@ -11033,6 +11052,10 @@ declare namespace __esri { export type PointCloudLayerLayerviewDestroyEventHandler = (event: PointCloudLayerLayerviewDestroyEvent) => void; + export type PointDrawActionCursorUpdateEventHandler = (event: PointDrawActionCursorUpdateEvent) => void; + + export type PointDrawActionDrawCompleteEventHandler = (event: PointDrawActionDrawCompleteEvent) => void; + export type PolygonDrawActionCursorUpdateEventHandler = (event: PolygonDrawActionCursorUpdateEvent) => void; export type PolygonDrawActionDrawCompleteEventHandler = (event: PolygonDrawActionDrawCompleteEvent) => void; diff --git a/types/arcgis-js-api/tslint.json b/types/arcgis-js-api/tslint.json new file mode 100644 index 0000000000..e3610fefae --- /dev/null +++ b/types/arcgis-js-api/tslint.json @@ -0,0 +1,80 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "use-default-type-parameter": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/arcgis-js-api/v3/tslint.json b/types/arcgis-js-api/v3/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/arcgis-js-api/v3/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/arcgis-to-geojson-utils/index.d.ts b/types/arcgis-to-geojson-utils/index.d.ts index 65c78a4230..95ba8db949 100644 --- a/types/arcgis-to-geojson-utils/index.d.ts +++ b/types/arcgis-to-geojson-utils/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/Esri/arcgis-to-geojson-utils // Definitions by: Jeff Jacobson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/archiver/archiver-tests.ts b/types/archiver/archiver-tests.ts index bbbc7c7abf..536afd68c9 100644 --- a/types/archiver/archiver-tests.ts +++ b/types/archiver/archiver-tests.ts @@ -35,9 +35,13 @@ archiver.append(readStream, {name: 'archiver.d.ts'}) .append(readStream, {name: 'archiver.d.ts'}); archiver.directory('./path', './someOtherPath'); -archiver.directory('./path', { name: "testName" }); archiver.directory('./', "", {}); -archiver.directory('./', { name: 'test' }, {}); +archiver.directory('./', false, { name: 'test' }); +archiver.directory('./', false, (entry: Archiver.EntryData) => { + entry.name = "foobar"; + return entry; +}); +archiver.directory('./', false, (entry: Archiver.EntryData) => false); archiver.append(readStream, { name: "sub/folder.xml" diff --git a/types/archiver/index.d.ts b/types/archiver/index.d.ts index a8c7de0502..8cf6eb1e92 100644 --- a/types/archiver/index.d.ts +++ b/types/archiver/index.d.ts @@ -21,12 +21,15 @@ declare namespace archiver { stats?: string; } + /** A function that lets you either opt out of including an entry (by returning false), or modify the contents of an entry as it is added (by returning an EntryData) */ + type EntryDataFunction = (entry: EntryData) => false | EntryData; + interface Archiver extends stream.Transform { abort(): this; append(source: stream.Readable | Buffer | string, name?: EntryData): this; - directory(dirpath: string, options: EntryData | string, data?: EntryData): this; - + /** if false is passed for destpath, the path of a chunk of data in the archive is set to the root */ + directory(dirpath: string, destpath: false | string, data?: EntryData | EntryDataFunction): this; file(filename: string, data: EntryData): this; glob(pattern: string, options?: glob.IOptions, data?: EntryData): this; finalize(): Promise; diff --git a/types/archy/tslint.json b/types/archy/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/archy/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/argon2-browser/argon2-browser-tests.ts b/types/argon2-browser/argon2-browser-tests.ts new file mode 100644 index 0000000000..1c1d77032c --- /dev/null +++ b/types/argon2-browser/argon2-browser-tests.ts @@ -0,0 +1,20 @@ +import { argon2 } from 'argon2-browser'; + +const mandatoryOptions = { + pass: 'Qwerty12?', + salt: 'Salty' +}; + +(async () => { + (await argon2.hash(mandatoryOptions)).encoded; // string + (await argon2.hash(mandatoryOptions)).hash; // Uint8Array + (await argon2.hash(mandatoryOptions)).hashHex; // string + + (await argon2.hash({ ...mandatoryOptions, distPath: 'path' })).encoded; // string + (await argon2.hash({ ...mandatoryOptions, hashLen: 24 })).encoded; // string + (await argon2.hash({ ...mandatoryOptions, mem: 1024 })).encoded; // string + (await argon2.hash({ ...mandatoryOptions, parallelism: 1 })).encoded; // string + (await argon2.hash({ ...mandatoryOptions, time: 1 })).encoded; // string + (await argon2.hash({ ...mandatoryOptions, type: argon2.ArgonType.Argon2d })).encoded; // string + (await argon2.hash({ ...mandatoryOptions, type: argon2.ArgonType.Argon2i })).encoded; // string +})(); diff --git a/types/argon2-browser/index.d.ts b/types/argon2-browser/index.d.ts new file mode 100644 index 0000000000..5e7a5b571b --- /dev/null +++ b/types/argon2-browser/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for argon2-browser 1.1 +// Project: https://github.com/antelle/argon2-browser#readme +// Definitions by: Ivan Gabriele +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +export namespace argon2 { + function hash(options: Argon2BrowserHashOptions): Promise; + + interface Argon2BrowserHashOptions { + distPath?: string; + hashLen?: number; + mem?: number; + parallelism?: number; + pass: string; + salt: string; + time?: number; + type?: ArgonType; + } + + interface Argon2BrowserHashResult { + encoded: string; + hash: Uint8Array; + hashHex: string; + } + + enum ArgonType { + Argon2d = 0, + Argon2i = 1 + } +} diff --git a/types/argon2-browser/tsconfig.json b/types/argon2-browser/tsconfig.json new file mode 100644 index 0000000000..a380778b29 --- /dev/null +++ b/types/argon2-browser/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", + "argon2-browser-tests.ts" + ] +} diff --git a/types/flatpickr/v2/tslint.json b/types/argon2-browser/tslint.json similarity index 100% rename from types/flatpickr/v2/tslint.json rename to types/argon2-browser/tslint.json diff --git a/types/args/args-tests.ts b/types/args/args-tests.ts new file mode 100644 index 0000000000..3430288cd3 --- /dev/null +++ b/types/args/args-tests.ts @@ -0,0 +1,67 @@ +import * as args from "args"; + +args + .option("opt1", "desc") + .option("opt2", "desc", false, (value: any): any => value) + .options([ + { + name: 'opt3', + description: 'desc', + defaultValue: 1, + init: (value: any) => { }, + }, + { + name: 'opt4', + description: 'desc', + }, + ]) + .command("cm1", "desc") + .command("cm2", "desc", (value: any): void => { }, ['a']) + .example("ex1", "desc") + .examples([ + { + usage: "ex2", + description: "desc", + }, + ]); + +args.parse(['~/bin/node', '~/dir', 'arg', '--param'], { + help: true, + name: "name", + version: true, + usageFilter: (a: any): any => a, + value: "value", + mri: { + args: ['a'], + alias: { + a: "b", + c: ['d'], + }, + boolean: ['wat'], + default: { + foo: 'bar', + }, + string: ['zulu'], + unknown: (param: string): boolean => true, + }, + minimist: { + string: ['string'], + boolean: ['string'], + alias: { + bar: 'foo', + foo: ['bar1', 'bar2'], + }, + default: { + foo: 'bar', + }, + stopEarly: true, + "--": false, + unknown: (param: string): boolean => true, + }, + mainColor: "yellow", + subColor: "dim" +}); + +args.showHelp(); + +const x: string = args.sub[0]; diff --git a/types/args/index.d.ts b/types/args/index.d.ts new file mode 100644 index 0000000000..70b784564d --- /dev/null +++ b/types/args/index.d.ts @@ -0,0 +1,72 @@ +// Type definitions for args 3.0 +// Project: https://github.com/leo/args#readme +// Definitions by: Slessi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare const c: args; +export = c; + +interface args { + sub: string[]; + + option(name: string | [string, string], description: string, defaultValue?: any, init?: OptionInitFunction): args; + options(list: Option[]): args; + command(name: string, description: string, init?: (name: string, sub: string[], options: ConfigurationOptions) => void, aliases?: string[]): args; + example(usage: string, description: string): args; + examples(list: Example[]): args; + parse(argv: string[], options?: ConfigurationOptions): { [key: string]: any }; + showHelp(): void; +} + +type OptionInitFunction = (value: any) => any; + +interface MriOptions { + args?: string[]; + alias?: { + [key: string]: string | string[] + }; + boolean?: string | string[]; + default?: { + [key: string]: any + }; + string?: string | string[]; + unknown?: (param: string) => boolean; +} + +interface MinimistOptions { + string?: string | string[]; + boolean?: boolean | string | string[]; + alias?: { + [key: string]: string | string[] + }; + default?: { + [key: string]: any + }; + stopEarly?: boolean; + "--"?: boolean; + unknown?: (param: string) => boolean; +} + +interface ConfigurationOptions { + help?: boolean; + name?: string; + version?: boolean; + usageFilter?: (output: any) => any; + value?: string; + mri: MriOptions; + minimist?: MinimistOptions; + mainColor: string | string[]; + subColor: string | string[]; +} + +interface Option { + name: string | [string, string]; + description: string; + init?: OptionInitFunction; + defaultValue?: any; +} + +interface Example { + usage: string; + description: string; +} diff --git a/types/node-feedparser/tsconfig.json b/types/args/tsconfig.json similarity index 92% rename from types/node-feedparser/tsconfig.json rename to types/args/tsconfig.json index ed769c299b..d287417769 100644 --- a/types/node-feedparser/tsconfig.json +++ b/types/args/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "node-feedparser-tests.ts" + "args-tests.ts" ] } \ No newline at end of file diff --git a/types/args/tslint.json b/types/args/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/args/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/argv/tslint.json b/types/argv/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/argv/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/arr-union/arr-union-tests.ts b/types/arr-union/arr-union-tests.ts new file mode 100644 index 0000000000..7e46a3787e --- /dev/null +++ b/types/arr-union/arr-union-tests.ts @@ -0,0 +1,7 @@ +import union = require('arr-union'); + +// $ExpectType string[] +union(['a'], ['b', 'c'], ['d', 'e', 'f']); + +// $ExpectType number[] +union([1, 1], [2, 3]); diff --git a/types/arr-union/index.d.ts b/types/arr-union/index.d.ts new file mode 100644 index 0000000000..5893a55361 --- /dev/null +++ b/types/arr-union/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for arr-union 3.1 +// Project: https://github.com/jonschlinkert/arr-union +// Definitions by: mrmlnc +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function union(...arrays: Array>): T[]; + +export = union; diff --git a/types/arr-union/tsconfig.json b/types/arr-union/tsconfig.json new file mode 100644 index 0000000000..64a3b1efed --- /dev/null +++ b/types/arr-union/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", + "arr-union-tests.ts" + ] +} diff --git a/types/arr-union/tslint.json b/types/arr-union/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/arr-union/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/array-foreach/tslint.json b/types/array-foreach/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/array-foreach/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/arrify/index.d.ts b/types/arrify/index.d.ts index 896ee23224..a1dda1b9ec 100644 --- a/types/arrify/index.d.ts +++ b/types/arrify/index.d.ts @@ -12,7 +12,6 @@ * arrify(1) // returns [1] * @example * arrify([2, 3]) // returns [2, 3] - * @param val */ declare function arrify(val: undefined | null | T | T[]): T[]; export = arrify; diff --git a/types/artillery/artillery-tests.ts b/types/artillery/artillery-tests.ts new file mode 100644 index 0000000000..b79c3f1c52 --- /dev/null +++ b/types/artillery/artillery-tests.ts @@ -0,0 +1,13 @@ +import { ScenarioContext, Next } from 'artillery'; + +const scenarioContext: ScenarioContext = {vars: {}}; +scenarioContext.vars = {}; +scenarioContext.vars.testing = "value"; +scenarioContext.vars.testing2 = 1; + +const next: Next = (error?: Error) => { + // do nothing. +}; + +next(); +next(new Error()); diff --git a/types/artillery/index.d.ts b/types/artillery/index.d.ts new file mode 100644 index 0000000000..fbc5d41917 --- /dev/null +++ b/types/artillery/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for artillery 1.6 +// Project: https://github.com/shoreditch-ops/artillery#readme +// Definitions by: Kira McCoan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 +import * as request from 'request'; +import * as events from 'events'; + +export interface ScenarioContext { vars: {[key: string]: any}; } +export type Next = (err?: Error) => void; +export type ResponseRequest = request.ResponseRequest; +export type RequestResponse = request.RequestResponse; +export type EventEmitter = events.EventEmitter; diff --git a/types/artillery/tsconfig.json b/types/artillery/tsconfig.json new file mode 100644 index 0000000000..0ad4bae0ee --- /dev/null +++ b/types/artillery/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", + "artillery-tests.ts" + ] +} diff --git a/types/artillery/tslint.json b/types/artillery/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/artillery/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/artyom.js/index.d.ts b/types/artyom.js/index.d.ts index b4f85781c6..76479b9631 100644 --- a/types/artyom.js/index.d.ts +++ b/types/artyom.js/index.d.ts @@ -249,14 +249,12 @@ declare namespace Artyom { /** * Artyom can return inmediately the voices available in your browser. * @see http://ourcodeworld.com/projects/projects-documentation/14/read-doc/artyom-getvoices/artyom-js - * @returns {Array} */ getVoices(): SpeechSynthesisVoice[]; /** * Returns an array with all the available commands for artyom. * @see http://ourcodeworld.com/projects/projects-documentation/10/read-doc/artyom-getavailablecommands/artyom-js - * @returns {Array} */ getAvailableCommands(): ArtyomCommand[]; @@ -264,38 +262,30 @@ declare namespace Artyom { * Set up artyom for the application. This function will set the default language used by artyom * or notice the user if artyom is not supported in the actual browser. * @see http://ourcodeworld.com/projects/projects-documentation/15/read-doc/artyom-initialize/artyom-js - * @param {ArtyomConfigProperties} config - * @returns {Boolean} */ initialize(config: ArtyomConfigProperties): boolean; /** * Force artyom to stop listen even if is in continuos mode. * @see http://ourcodeworld.com/projects/projects-documentation/9/read-doc/artyom-fatality/artyom-js - * @returns {Boolean} */ fatality(): boolean; /** * Add dinamically commands to artyom using. You can even add commands while artyom is active. * @see http://ourcodeworld.com/projects/projects-documentation/4/read-doc/artyom-addcommands/artyom-js - * @param {ArtyomCommand | Array[ArtyomCommand]} newCommand - * @returns {Boolean} */ addCommands(newCommand: ArtyomCommand | ArtyomCommand[]): boolean; /** * Remove the commands of artyom with indexes that matches with the given text. * @see http://ourcodeworld.com/projects/projects-documentation/19/read-doc/artyom-removecommands/artyom-js - * @param {string} identifier - * @returns {Array} */ removeCommands(identifier: string): number[]; /** * Removes all the added commands of artyom. * @see http://ourcodeworld.com/projects/projects-documentation/7/read-doc/artyom-emptycommands/artyom-js - * @returns {Array} */ emptyCommands(): ArtyomCommand[]; @@ -308,7 +298,6 @@ declare namespace Artyom { /** * Returns an object with the actual properties of artyom. * @see http://ourcodeworld.com/projects/projects-documentation/12/read-doc/artyom-getproperties/artyom-js - * @returns {ArtyomConfigProperties} */ getProperties(): ArtyomConfigProperties; @@ -321,37 +310,34 @@ declare namespace Artyom { /** * Returns the code language of artyom according to initialize function. * @see http://ourcodeworld.com/projects/projects-documentation/11/read-doc/artyom-getlanguage/artyom-js - * @returns {String} Language + * @returns Language */ getLanguage(): string; /** * Talks a text according to the given parameters (private function). - * @param {String} text Text to be spoken - * @param {Int} actualChunk Number of chunk of the - * @param {Int} totalChunks - * @param {any} callbacks + * @param text Text to be spoken + * @param actualChunk Number of chunk of the */ artyomTalk(text: any, actualChunk: any, totalChunks: any, callbacks: any): any; /** * Splits a string into an array of strings with a limited size (chunk_length). - * @param {String} input text to split into chunks - * @param {Integer} chunk_length limit of characters in every chunk + * @param input text to split into chunks + * @param chunk_length limit of characters in every chunk */ splitStringByChunks(input: any, chunk_length: any): string[]; /** * Process the given text into chunks and execute the private function artyom_talk. - * @param {String} message Text to be spoken - * @param {Object} callbacks { onStart, onEnd } + * @param message Text to be spoken * @see http://ourcodeworld.com/projects/projects-documentation/20/read-doc/artyom-say/artyom-js */ say(message: any, callbacks: any): void; /** * Repeats the last sentence that artyom said. Useful in noisy environments. - * @param {Boolean} returnObject If set to true, an object with the text and the timestamp when was executed will be returned. + * @param returnObject If set to true, an object with the text and the timestamp when was executed will be returned. * @see http://ourcodeworld.com/projects/projects-documentation/25/read-doc/artyom-repeatlastsay/artyom-js */ repeatLastSay(returnObject: any): void; @@ -359,50 +345,42 @@ declare namespace Artyom { /** * Verify if the browser supports speechSynthesis. * @see http://ourcodeworld.com/projects/projects-documentation/40/read-doc/artyom-speechsupported/artyom-js - * @returns {Boolean} */ speechSupported(): boolean; /** * Verify if the browser supports webkitSpeechRecognition. * @see http://ourcodeworld.com/projects/projects-documentation/39/read-doc/artyom-recognizingsupported/artyom-js - * @returns {Boolean} */ recognizingSupported(): boolean; /** * Simulate a voice command via JS. * @see http://ourcodeworld.com/projects/projects-documentation/22/read-doc/artyom-simulateinstruction/artyom-js - * @param {string} sentence - * @returns {Boolean} */ simulateInstruction(sentence: string): boolean; /** * Returns an object with data of the matched element. - * @param {string} voiceCommand - * @returns {Object | Function}. There is a result field when the function should return a boolean value. + * @returns . There is a result field when the function should return a boolean value. */ artyomExecute(voiceCommand: string): any; /** * Displays a message in the console if the artyom propery DEBUG is set to true. - * @param {string} error The error to be debugged - * @param {string} traceLevel Error level: { error | warn | info } + * @param error The error to be debugged + * @param traceLevel Error level: { error | warn | info } * @see http://ourcodeworld.com/projects/projects-documentation/38/read-doc/artyom-debug/artyom-js */ debug(stringEvent: string, traceLevel: string): void; /** * Allows to retrieve the recognized spoken text of artyom and do something with it everytime something is recognized. - * @param {Function} action - * @returns {Boolean} */ redirectRecognizedTextOutput(action: () => void): boolean; /** * Says a random quote and returns it's object. - * @param data */ sayRandom(data: any): any; @@ -431,7 +409,6 @@ declare namespace Artyom { * This function returns a boolean according to the SpeechRecognition status if artyom is listening, will return true. * Note: This is not a feature of SpeechRecognition, therefore this value hangs on the fiability of the onStart and onEnd * events of the SpeechRecognition - * @returns {Boolean} */ isRecognizing(): boolean; @@ -439,14 +416,12 @@ declare namespace Artyom { * This function returns a boolean according to the speechSynthesis status if artyom is speaking, will return true. * Note: This is not a feature of speechSynthesis, therefore this value hangs on the fiability of the onStart and onEnd * events of the speechSynthesis. - * @returns {Boolean} */ isSpeaking(): boolean; /** * The SpeechSynthesisUtterance objects are stored in the artyom_garbage_collector variable to prevent the wrong behaviour * of artyom.say. Use this method to clear all spoken SpeechSynthesisUtterance unused objects. - * @returns {Boolean} */ clearGarbageCollection(): any; @@ -457,31 +432,26 @@ declare namespace Artyom { /** * Pause the processing of commands. Artyom still listening in the background and it can be resumed after a couple of seconds. - * @returns {Boolean} */ dontObey(): any; /** * Allow artyom to obey commands again. - * @returns {Boolean} */ obey(): any; /** * A boolean to check if artyom is obeying commands or not. - * @returns {Boolean} */ isObeying(): boolean; /** * Process the recognized text if artyom is active in remote mode. - * @returns {Boolean} */ remoteProcessorService(action: any): any; /** * Returns a string with the actual version of Artyom script. - * @returns {String} */ getVersion(): string; @@ -490,22 +460,14 @@ declare namespace Artyom { * tasks then probably you don't like to write a lot to achieve it. * Use the artisan syntax to write less, but with the same accuracy. * @disclaimer Not a promise-based implementation, just syntax. - * @returns {Object} */ on(indexes: any, smart: any): any; } - /** - * ArtyomBuilder bla, bla... - */ class ArtyomBuilder { - /** - * Method to bla, bla, bla... - */ static getInstance(): ArtyomJS; } } -// tslint:disable-next-line:export-just-namespace export = Artyom; export as namespace Artyom; diff --git a/types/artyom.js/tslint.json b/types/artyom.js/tslint.json index 3db14f85ea..5d72d122bf 100644 --- a/types/artyom.js/tslint.json +++ b/types/artyom.js/tslint.json @@ -1 +1,8 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + // TODOs + "export-just-namespace": false, + "no-unnecessary-class": false + } +} diff --git a/types/asana/index.d.ts b/types/asana/index.d.ts index ede3bc99f9..9bbfb62508 100644 --- a/types/asana/index.d.ts +++ b/types/asana/index.d.ts @@ -787,12 +787,13 @@ declare namespace asana { namespace Attachments { interface Type extends Resource { - created_at: string; - permanent_url: string; - download_url: string; - view_url: string; - host: string; - parent: Resource; + readonly id: number; + readonly created_at: string; + readonly download_url: string; + readonly view_url: string; + readonly name: string; + readonly host: string; + readonly parent: Resource; } } diff --git a/types/asana/tslint.json b/types/asana/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/asana/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/ascii2mathml/index.d.ts b/types/ascii2mathml/index.d.ts index 2b02dfea15..dcb9f7bb98 100644 --- a/types/ascii2mathml/index.d.ts +++ b/types/ascii2mathml/index.d.ts @@ -28,7 +28,7 @@ interface ascii2mathml { /** * Converts ASCIIMath expression to MathML markup. - * @param asciimath {string} ASCIIMath expression + * @param asciimath ASCIIMath expression * @param options Options */ (asciimath: string, options?: Options): string; diff --git a/types/asciify/tslint.json b/types/asciify/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/asciify/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/askmethat-rating/askmethat-rating-tests.ts b/types/askmethat-rating/askmethat-rating-tests.ts deleted file mode 100644 index af985d6358..0000000000 --- a/types/askmethat-rating/askmethat-rating-tests.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { AskmethatRating, AskmethatRatingSteps } from "askmethat-rating"; - -const options = { - backgroundColor: "#e5e500", - hoverColor: "#ffff66", - fontClass: "fa fa-star", - minRating: 1, - maxRating: 5, - readonly: false, - step: AskmethatRatingSteps["OnePerOneStep"], - inputName: "AskmethatRating" -}; - -const div = document.createElement("div"); -const amcRating = new AskmethatRating(div, 2 , options); - -options.readonly = true; -amcRating.defaultOptions = options; diff --git a/types/askmethat-rating/index.d.ts b/types/askmethat-rating/index.d.ts deleted file mode 100644 index a183ecdc30..0000000000 --- a/types/askmethat-rating/index.d.ts +++ /dev/null @@ -1,142 +0,0 @@ -// Type definitions for askmethat-rating 0.3 -// Project: https://alexteixeira.github.io/Askmethat-Rating/ -// Definitions by: Alexandre Teixeira -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -export enum AskmethatRatingSteps { - /** - * Step 0.1 per 0.1 - */ - DecimalStep = 0, - /** - * Step 0.5 per 0.5 - */ - HalfStep = 1, - /** - * Step 1 per 1 - */ - OnePerOneStep = 2, -} -export interface AskmethatRatingOptions { - hoverColor?: string; - /** - * Color when the rating is not hovered - */ - backgroundColor?: string; - /** - * Mininmum rating that the user can set - */ - minRating?: number; - /** - * Maximum rating that the plugin display - */ - maxRating?: number; - /** - * Class to display as rating (FontAwesome or Rating for exemple) - */ - fontClass: string; - /** - * Set the rating to readonly - */ - readonly: boolean; - /** - * The stepping for the rating - */ - step: AskmethatRatingSteps; - /** - * Input name (Default is AskmethatRating) - */ - inputName: string; -} -export class AskmethatRating { - private parentElement; - private pValue; - private styleSheet; - private changeEvent; - private ratingClick; - private mouseMove; - /** - * @function get the current value for the rating - */ - /** - * @function set a new value for the rating - * - * @param _value this is the new value you want to set to the rating - * @returns the current number - */ - value: number; - /** - * Default option base on @type IAskmethatRatingOptions - */ - private _defaultOptions; - /** - * @function get the default option for the rating - * - * @return options based on @type AskmethatRatingOptions - */ - /** - * @function set the default option for the rating - * - * @return options based on @type AskmethatRatingOptions - */ - defaultOptions: AskmethatRatingOptions; - /** - * constructor with div element, default rating value & default options - * - * @param element This is the html container for the rating elements - * @param defaultValue Default value set when the plugin render the rating - * @param options Default option base on AskmethatRatingOptions type - */ - constructor(element: HTMLDivElement, defaultValue?: number, options?: any); - /** - * render a new rating, by default value is the minRating - * - * @param value this is the default value set when the plugin is rendered, by default IAskmethatRatingOptions.minRating - */ - render(value?: number): void; - /** - * @function when a rating is clicked - * @param {type} event : Event {event object} - */ - private onRatingClick(event?); - /** - * @function Calculate the value according to the step provided in options - * @param {Number} value:number the current value - * @return {Number} the new value according to step - */ - protected getValueAccordingToStep(value: number): number; - /** - * @function mouse event enter in rating - * @param {type} event?: Event {event} - */ - private onMouseMove(event?); - /** - * @function mouse out event in rating - * @param {type} event?: Event {event} - */ - private onMouseLeave(event?); - /** - * @function set or unset the active class and color - * @param {HTMLSpanElement} current : current span element - * @param {number} current : value needed for the if - */ - protected setOrUnsetActive(value: number): void; - /** - * Check if disabled attribute is added or removed from the input - * Update readonly status if needed for the rating - */ - private mutationEvent(); - /** - * This is fired by mutation observer when an attribute changed in the hidden input - * Is protected to have some unit tests - * @param {MutationRecord[]} mutations list of mutations record - */ - protected mutationDisableEvent(mutations: MutationRecord[]): void; - /** - * @function static method to retrieve with identifier the value - * @param {string} identifier: string container identifier - * @return {number} current rating - */ - static value(identifier: string): number; -} diff --git a/types/asn1js/tslint.json b/types/asn1js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/asn1js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/aspnet-identity-pw/tslint.json b/types/aspnet-identity-pw/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/aspnet-identity-pw/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/assertion-error/tslint.json b/types/assertion-error/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/assertion-error/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/assertsharp/tslint.json b/types/assertsharp/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/assertsharp/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/async-lock/tslint.json b/types/async-lock/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/async-lock/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/async-polling/tslint.json b/types/async-polling/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/async-polling/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/async-writer/tslint.json b/types/async-writer/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/async-writer/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/async/index.d.ts b/types/async/index.d.ts index 80f2888a8b..f1b38e8130 100644 --- a/types/async/index.d.ts +++ b/types/async/index.d.ts @@ -15,6 +15,7 @@ export interface AsyncResultArrayCallback { (err?: E, results?: (T | undef export interface AsyncResultObjectCallback { (err: E | undefined, results: Dictionary): void; } export interface AsyncFunction { (callback: (err?: E, result?: T) => void): void; } +export interface AsyncFunctionEx { (callback: (err?: E, ...results: T[]) => void): void; } export interface AsyncIterator { (item: T, callback: ErrorCallback): void; } export interface AsyncForEachOfIterator { (item: T, key: number|string, callback: ErrorCallback): void; } export interface AsyncResultIterator { (item: T, callback: AsyncResultCallback): void; } @@ -174,9 +175,9 @@ export function parallel(tasks: Dictionary>, callback? export function parallelLimit(tasks: Array>, limit: number, callback?: AsyncResultArrayCallback): void; export function parallelLimit(tasks: Dictionary>, limit: number, callback?: AsyncResultObjectCallback): void; export function whilst(test: () => boolean, fn: AsyncVoidFunction, callback: ErrorCallback): void; -export function doWhilst(fn: AsyncVoidFunction, test: () => boolean, callback: ErrorCallback): void; +export function doWhilst(fn: AsyncFunctionEx, test: (...results: T[]) => boolean, callback: ErrorCallback): void; export function until(test: () => boolean, fn: AsyncVoidFunction, callback: ErrorCallback): void; -export function doUntil(fn: AsyncVoidFunction, test: () => boolean, callback: ErrorCallback): void; +export function doUntil(fn: AsyncFunctionEx, test: (...results: T[]) => boolean, callback: ErrorCallback): void; export function during(test: (testCallback : AsyncBooleanResultCallback) => void, fn: AsyncVoidFunction, callback: ErrorCallback): void; export function doDuring(fn: AsyncVoidFunction, test: (testCallback: AsyncBooleanResultCallback) => void, callback: ErrorCallback): void; export function forever(next: (next : ErrorCallback) => void, errBack: ErrorCallback) : void; diff --git a/types/async/test/explicit.ts b/types/async/test/explicit.ts index b9ea9c84ed..0c0e1a44ee 100644 --- a/types/async/test/explicit.ts +++ b/types/async/test/explicit.ts @@ -47,13 +47,13 @@ interface NumberCallback { (err?: Error, result?: number): void; } interface AsyncNumberGetter { (callback: NumberCallback): void; } var taskDict: Lookup = { - one: function(callback){ - setTimeout(function(){ + one: function(callback) { + setTimeout(function() { callback(undefined, 1); }, 200); }, - two: function(callback){ - setTimeout(function(){ + two: function(callback) { + setTimeout(function() { callback(undefined, 2); }, 100); } diff --git a/types/async/test/index.ts b/types/async/test/index.ts index 821ccd0650..3c6c2f5dfe 100644 --- a/types/async/test/index.ts +++ b/types/async/test/index.ts @@ -239,16 +239,16 @@ async.parallelLimit({ function whileFn(callback: any) { - count++; - setTimeout(callback, 1000); + setTimeout(() => callback(null, ++count), 1000); } function whileTest() { return count < 5; } +function doWhileTest(count: number) { return count < 5; } var count = 0; async.whilst(whileTest, whileFn, function (err) { }); async.until(whileTest, whileFn, function (err) { }); -async.doWhilst(whileFn, whileTest, function (err) { }); -async.doUntil(whileFn, whileTest, function (err) { }); +async.doWhilst(whileFn, doWhileTest, function (err) { }); +async.doUntil(whileFn, doWhileTest, function (err) { }); async.during(function (testCallback) { testCallback(new Error(), false); }, function (callback) { callback() }, function (error) { console.log(error) }); async.doDuring(function (callback) { callback() }, function (testCallback) { testCallback(new Error(), false); }, function (error) { console.log(error) }); diff --git a/types/async/tslint.json b/types/async/tslint.json index b1ab4a96cc..9380375afa 100644 --- a/types/async/tslint.json +++ b/types/async/tslint.json @@ -16,6 +16,7 @@ "no-void-expression": false, "object-literal-key-quotes": false, "object-literal-shorthand": false, + "one-line": false, "one-variable-per-declaration": false, "only-arrow-functions": false, "prefer-const": false, diff --git a/types/asyncblock/tslint.json b/types/asyncblock/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/asyncblock/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/asynciterator/asynciterator-tests.ts b/types/asynciterator/asynciterator-tests.ts new file mode 100644 index 0000000000..bd4b62c0fe --- /dev/null +++ b/types/asynciterator/asynciterator-tests.ts @@ -0,0 +1,135 @@ +import { ArrayIterator, AsyncIterator, BufferedIterator, ClonedIterator, EmptyIterator, IntegerIterator, + MultiTransformIterator, SingletonIterator, SimpleTransformIterator, TransformIterator } from "asynciterator"; + +function test_asynciterator() { + // We can't instantiate an abstract class. + const it1: AsyncIterator = {}; + const read1: number = it1.read(); + it1.each((data: number) => console.log(data)); + it1.each((data: number) => console.log(data), {}); + it1.close(); + + const it2: AsyncIterator = {}; + const read2: string = it2.read(); + it2.each((data: string) => console.log(data)); + it2.each((data: string) => console.log(data), {}); + it2.close(); + + const it3: AsyncIterator> = {}; + const read3: AsyncIterator = it3.read(); + it3.each((data: AsyncIterator) => data.each((data: string) => console.log(data))); + it3.each((data: AsyncIterator) => data.each((data: string) => console.log(data), {}), {}); + it3.close(); + + const readable2: boolean = it1.readable; + const closed2: boolean = it1.closed; + const ended2: boolean = it1.ended; + + it1.setProperty('name1', 123); + it2.setProperty('name2', 'someValue'); + const p1: number = it1.getProperty('name1'); + const p2: string = it1.getProperty('name2'); + it1.getProperty('name1', (value: number) => console.log(value)); + it1.getProperty('name2', (value: string) => console.log(value)); + const ps1: {[id: string]: any} = it1.getProperties(); + it1.setProperties({ name1: 1234, name2: 'someOtherValue' }); + it1.copyProperties(it2, [ 'name1', 'name2' ]); + + const str: string = it1.toString(); + + const stit1: SimpleTransformIterator = it1.transform(); + const stit2: SimpleTransformIterator = it1.map((number: number) => 'i' + number); + const stit3: AsyncIterator = it1.map((number: number) => 'i' + number); + const stit4: AsyncIterator = it2.map(parseInt); + const stit5: AsyncIterator = it1.map((number: number) => number + 1); + const stit6: AsyncIterator = it1.filter((number: number) => number < 10); + const stit7: AsyncIterator = it1.prepend([0, 1, 2]); + const stit8: AsyncIterator = it1.append([0, 1, 2]); + const stit9: AsyncIterator = it1.surround([0, 1, 2], [0, 1, 2]); + const stit10: AsyncIterator = it1.skip(2); + const stit11: AsyncIterator = it1.take(2); + const stit12: AsyncIterator = it1.range(2, 20); + const stit13: AsyncIterator = it1.clone(); + + const intit1: IntegerIterator = AsyncIterator.range(10, 100, 1); + const intit2: IntegerIterator = AsyncIterator.range(10, 100); + const intit3: IntegerIterator = AsyncIterator.range(10); + const intit4: IntegerIterator = AsyncIterator.range(); +} + +function test_emptyiterator() { + const it1: AsyncIterator = new EmptyIterator(); + const it2: AsyncIterator = new EmptyIterator(); +} + +function test_singletoniterator() { + const it1: AsyncIterator = new SingletonIterator(3); + const it2: AsyncIterator = new SingletonIterator('a'); +} + +function test_arrayiterator() { + const it1: AsyncIterator = new ArrayIterator([1, 2, 3]); + const it2: AsyncIterator = new ArrayIterator(['a', 'b', 'c']); +} + +function test_integeriterator() { + const it1: IntegerIterator = new IntegerIterator(); + const it2: AsyncIterator = new IntegerIterator({}); + const it3: AsyncIterator = new IntegerIterator({ start: 0 }); + const it4: AsyncIterator = new IntegerIterator({ end: 100 }); + const it5: AsyncIterator = new IntegerIterator({ step: 10 }); +} + +function test_bufferediterator() { + const it1: BufferedIterator = new BufferedIterator(); + const it2: AsyncIterator = new BufferedIterator({}); + const it3: AsyncIterator = new BufferedIterator({ maxBufferSize: 10 }); + const it4: AsyncIterator = new BufferedIterator({ autoStart: true }); +} + +function test_transformiterator() { + const it1: TransformIterator = new TransformIterator(); + const it2: AsyncIterator = new TransformIterator(); + const it3: AsyncIterator = new TransformIterator(it1); + const it4: AsyncIterator = new TransformIterator(it1, {}); + const it5: AsyncIterator = new TransformIterator(it1, { optional: true }); + const it6: AsyncIterator = new TransformIterator({ source: it1 }); + + const source: AsyncIterator = it1.source; +} + +function test_simpletransformiterator() { + const it1: SimpleTransformIterator = new SimpleTransformIterator(); + const it2: TransformIterator = new SimpleTransformIterator(); + const it3: AsyncIterator = new SimpleTransformIterator(); + const it4: AsyncIterator = new SimpleTransformIterator(it1); + const it5: AsyncIterator = new SimpleTransformIterator(it1, {}); + const it6: AsyncIterator = new SimpleTransformIterator({}); + const it7: AsyncIterator = new SimpleTransformIterator({ optional: true }); + const it8: AsyncIterator = new SimpleTransformIterator({ source: it1 }); + const it9: AsyncIterator = new SimpleTransformIterator({ offset: 2 }); + const it10: AsyncIterator = new SimpleTransformIterator({ limit: 2 }); + const it11: AsyncIterator = new SimpleTransformIterator({ prepend: [0, 1, 2] }); + const it12: AsyncIterator = new SimpleTransformIterator({ append: [0, 1, 2] }); + const it13: AsyncIterator = new SimpleTransformIterator( + { filter: (val: number) => val > 10 }); + const it14: AsyncIterator = new SimpleTransformIterator({ map: (val: number) => val + 1 }); + const it15: AsyncIterator = new SimpleTransformIterator( + { transform: (val: number, cb: (result: number) => void) => cb(val + 1) }); +} + +function test_multitransformiterator() { + const it1: MultiTransformIterator = new MultiTransformIterator(); + const it2: TransformIterator = new MultiTransformIterator(); + const it3: AsyncIterator = new MultiTransformIterator(); + const it4: AsyncIterator = new MultiTransformIterator(it1); + const it5: AsyncIterator = new MultiTransformIterator(it1, {}); + const it6: AsyncIterator = new MultiTransformIterator({}); + const it7: AsyncIterator = new MultiTransformIterator({ optional: true }); + const it8: AsyncIterator = new MultiTransformIterator({ source: it1 }); +} + +function test_clonediterator() { + const it1: ClonedIterator = new ClonedIterator(); + const it2: ClonedIterator = new ClonedIterator(it1); +} diff --git a/types/asynciterator/index.d.ts b/types/asynciterator/index.d.ts new file mode 100644 index 0000000000..a7be809137 --- /dev/null +++ b/types/asynciterator/index.d.ts @@ -0,0 +1,164 @@ +// Type definitions for asynciterator 1.1 +// Project: https://github.com/rubenverborgh/AsyncIterator#readme +// Definitions by: Ruben Taelman +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// + +import { EventEmitter } from "events"; + +export abstract class AsyncIterator extends NodeJS.EventEmitter { + protected static STATES: ['INIT', 'OPEN', 'CLOSING', 'CLOSED', 'ENDED']; + protected static INIT: 0; + protected static OPEN: 1; + protected static CLOSING: 2; + protected static CLOSED: 3; + protected static ENDED: 4; + + protected _state: number; + protected _readable: boolean; + protected _destination?: AsyncIterator; + + readable: boolean; + closed: boolean; + ended: boolean; + + constructor(); + + read(): T; + each(callback: (data: T) => void, self?: any): void; + close(): void; + + protected _changeState(newState: number, eventAsync?: boolean): void; + private _hasListeners(eventName: string | symbol): boolean; + // tslint:disable-next-line ban-types + private _addSingleListener(eventName: string | symbol, listener: Function): void; + protected _end(): void; + + getProperty(propertyName: string, callback?: (value: any) => void): any; + setProperty(propertyName: string, value: any): void; + getProperties(): {[id: string]: any}; + setProperties(properties: {[id: string]: any}): void; + copyProperties(source: AsyncIterator, propertyNames: string[]): void; + + toString(): string; + protected _toStringDetails(): string; + + transform(options?: SimpleTransformIteratorOptions): SimpleTransformIterator; + map(mapper: (item: T) => T2, self?: object): SimpleTransformIterator; + filter(filter: (item: T) => boolean, self?: object): SimpleTransformIterator; + prepend(items: T[]): SimpleTransformIterator; + append(items: T[]): SimpleTransformIterator; + surround(prepend: T[], append: T[]): SimpleTransformIterator; + skip(offset: number): SimpleTransformIterator; + take(limit: number): SimpleTransformIterator; + range(start: number, end: number): SimpleTransformIterator; + clone(): ClonedIterator; + + static range(start?: number, end?: number, step?: number): IntegerIterator; +} + +export class EmptyIterator extends AsyncIterator { + _state: 4; +} + +export class SingletonIterator extends AsyncIterator { + constructor(item?: T); +} + +export class ArrayIterator extends AsyncIterator { + constructor(items?: T[]); +} + +export interface IntegerIteratorOptions { + step?: number; + end?: number; + start?: number; +} + +export class IntegerIterator extends AsyncIterator { + protected _step: number; + protected _last: number; + protected _next: number; + + constructor(options?: IntegerIteratorOptions); +} + +export interface BufferedIteratorOptions { + maxBufferSize?: number; + autoStart?: boolean; +} + +export class BufferedIterator extends AsyncIterator { + maxBufferSize: number; + protected _pushedCount: number; + protected _buffer: T[]; + + protected _init(autoStart: boolean): void; + protected _begin(done: () => void): void; + protected _read(count: number, done: () => void): void; + protected _push(item: T): void; + protected _fillBuffer(): void; + protected _completeClose(): void; + protected _flush(done: () => void): void; + + constructor(options?: BufferedIteratorOptions); +} + +export interface TransformIteratorOptions extends BufferedIteratorOptions { + optional?: boolean; + source?: AsyncIterator; +} + +export class TransformIterator extends BufferedIterator { + protected _optional: boolean; + source: AsyncIterator; + + protected _validateSource(source: AsyncIterator, allowDestination?: boolean): void; + protected _transform(item: S, done: (result: T) => void): void; + protected _closeWhenDone(): void; + + constructor(source?: AsyncIterator | TransformIteratorOptions, options?: TransformIteratorOptions); +} + +export interface SimpleTransformIteratorOptions extends TransformIteratorOptions { + offset?: number; + limit?: number; + prepend?: T[]; + append?: T[]; + + filter?(item: S): boolean; + map?(item: S): T; + transform?(item: S, callback: (result: T) => void): void; +} + +export class SimpleTransformIterator extends TransformIterator { + protected _offset: number; + protected _limit: number; + protected _prepender?: ArrayIterator; + protected _appender?: ArrayIterator; + + protected _filter?(item: S): boolean; + protected _map?(item: S): T; + protected _transform(item: S, done: (result: T) => void): void; + + protected _insert(inserter: AsyncIterator, done: () => void): void; + + constructor(source?: AsyncIterator | SimpleTransformIteratorOptions, + options?: SimpleTransformIteratorOptions); +} + +export class MultiTransformIterator extends TransformIterator { + _transformerQueue: S[]; + + protected _createTransformer(): AsyncIterator; + + constructor(source?: AsyncIterator | TransformIteratorOptions, options?: TransformIteratorOptions); +} + +export class ClonedIterator extends TransformIterator { + _readPosition: number; + + constructor(source?: AsyncIterator); +} diff --git a/types/asynciterator/tsconfig.json b/types/asynciterator/tsconfig.json new file mode 100644 index 0000000000..8b8b919abc --- /dev/null +++ b/types/asynciterator/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", + "asynciterator-tests.ts" + ] +} diff --git a/types/asynciterator/tslint.json b/types/asynciterator/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/asynciterator/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/atmosphere.js/tslint.json b/types/atmosphere.js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/atmosphere.js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/atmosphere/tslint.json b/types/atmosphere/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/atmosphere/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/atom-keymap/.editorconfig b/types/atom-keymap/.editorconfig deleted file mode 100644 index 2b997514d2..0000000000 --- a/types/atom-keymap/.editorconfig +++ /dev/null @@ -1,3 +0,0 @@ -[*.ts] -indent_style = tab -indent_size = 2 diff --git a/types/atom-keymap/README.md b/types/atom-keymap/README.md index f900dc1a4c..4c58abab17 100644 --- a/types/atom-keymap/README.md +++ b/types/atom-keymap/README.md @@ -19,3 +19,19 @@ Many of the types used by Atom Keymap can be referenced from the AtomKeymap name ```ts function example(keybind: AtomKeymap.KeyBinding) {} ``` + +### Exposing Private Methods and Properties + +[Declaration Merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html) can be used to augment any of the types used within Atom Keymap. As an example, if we wanted to reveal the private ```partialMatchTimeout``` property within the KeymapManager class, then we would create a file with the following contents: + +```ts +// <>.d.ts + +declare namespace AtomKeymap { + interface KeymapManager { + partialMatchTimeout: number; + } +} +``` + +Once this file is either referenced or included within your project, then this new property would be freely usable on instances of the KeymapManager class without TypeScript reporting errors. diff --git a/types/atom-keymap/atom-keymap-tests.ts b/types/atom-keymap/atom-keymap-tests.ts index 6c8871c737..ac013b07eb 100644 --- a/types/atom-keymap/atom-keymap-tests.ts +++ b/types/atom-keymap/atom-keymap-tests.ts @@ -1,8 +1,9 @@ +import { Disposable } from "event-kit"; import KeymapManager = require("atom-keymap"); import * as ImportTest from "atom-keymap"; declare const element: HTMLElement; -declare let sub: EventKit.Disposable; +declare let sub: Disposable; declare const event: KeyboardEvent; // NPM Examples =============================================================== @@ -11,17 +12,17 @@ keymaps.defaultTarget = document.body; // Pass all the window's keydown events to the KeymapManager document.addEventListener("keydown", (event): void => { - keymaps.handleKeyboardEvent(event); + keymaps.handleKeyboardEvent(event); }); // Add some keymaps. It can also be a directory of json / cson files. keymaps.loadKeymap("/path/to/keymap-file.json"); // OR keymaps.add("/key/for/these/keymaps", { - body: { - up: "core:move-up", - down: "core:move-down", - }, + body: { + up: "core:move-up", + down: "core:move-down", + }, }); // When a keybinding is triggered, it will dispatch it on the node that was focused @@ -31,17 +32,17 @@ window.addEventListener("core:move-down", (event) => console.log("down", event)) // General Usage ============================================================== const manager = new KeymapManager(); manager.add("some/unique/path", { - ".workspace": { - "ctrl-x": "package:do-something", - "ctrl-y": "package:do-something-else", - }, - ".test": { - enter: "core:confirm", - }, + ".workspace": { + "ctrl-x": "package:do-something", + "ctrl-y": "package:do-something-else", + }, + ".test": { + enter: "core:confirm", + }, }); manager.onDidMatchBinding((event): void => { - console.log(event.binding.command); + console.log(event.binding.command); }); manager.destroy(); @@ -84,8 +85,8 @@ manager.handleKeyboardEvent(event); manager.keystrokeForKeyboardEvent(event); sub = manager.addKeystrokeResolver((event): string => { - event.layoutName; - return "Test"; + event.layoutName; + return "Test"; }); const num: number = manager.getPartialMatchTimeout(); diff --git a/types/atom-keymap/index.d.ts b/types/atom-keymap/index.d.ts index 9472e75215..1d67a20ba2 100644 --- a/types/atom-keymap/index.d.ts +++ b/types/atom-keymap/index.d.ts @@ -4,233 +4,243 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -/// +import { Disposable } from "event-kit"; declare global { - namespace AtomKeymap { - /** Objects that appear as parameters to callbacks. */ - namespace Events { - interface FullKeybindingMatch { - /** The string of keystrokes that matched the binding. */ - keystrokes: string; + namespace AtomKeymap { + /** + * The event objects that are passed into the callbacks which the user provides to + * specific API calls. + */ + namespace Events { + /** + * This custom subclass of CustomEvent exists to provide the ::abortKeyBinding + * method, as well as versions of the ::stopPropagation methods that record the + * intent to stop propagation so event bubbling can be properly simulated for + * detached elements. + */ + interface CommandEvent extends CustomEvent { + keyBindingAborted: boolean; + propagationStopped: boolean; - /** The KeyBinding that the keystrokes matched. */ - binding: KeyBinding; + abortKeyBinding(): void; + stopPropagation(): CustomEvent; + stopImmediatePropagation(): CustomEvent; + } - /** The DOM element that was the target of the most recent keyboard event. */ - keyboardEventTarget: Element; - } + interface FullKeybindingMatch { + /** The string of keystrokes that matched the binding. */ + keystrokes: string; - interface PartialKeybindingMatch { - /** The string of keystrokes that matched the binding. */ - keystrokes: string; + /** The KeyBinding that the keystrokes matched. */ + binding: KeyBinding; - /** The KeyBindings that the keystrokes partially matched. */ - partiallyMatchedBindings: KeyBinding[]; + /** The DOM element that was the target of the most recent keyboard event. */ + keyboardEventTarget: Element; + } - /** DOM element that was the target of the most recent keyboard event. */ - keyboardEventTarget: Element; - } + interface PartialKeybindingMatch { + /** The string of keystrokes that matched the binding. */ + keystrokes: string; - interface FailedKeybindingMatch { - /** The string of keystrokes that failed to match the binding. */ - keystrokes: string; + /** The KeyBindings that the keystrokes partially matched. */ + partiallyMatchedBindings: KeyBinding[]; - /** The DOM element that was the target of the most recent keyboard event. */ - keyboardEventTarget: Element; - } + /** DOM element that was the target of the most recent keyboard event. */ + keyboardEventTarget: Element; + } - interface FailedKeymapFileRead { - /** The error message. */ - message: string; + interface FailedKeybindingMatch { + /** The string of keystrokes that failed to match the binding. */ + keystrokes: string; - /** The error stack trace. */ - stack: string; - } + /** The DOM element that was the target of the most recent keyboard event. */ + keyboardEventTarget: Element; + } - interface KeymapLoaded { - /** The path of the keymap file. */ - path: string; - } + interface FailedKeymapFileRead { + /** The error message. */ + message: string; - interface AddedKeystrokeResolver { - /** The currently resolved keystroke string. If your function returns a falsy - * value, this is how Atom will resolve your keystroke. - */ - keystroke: string; + /** The error stack trace. */ + stack: string; + } - /** The raw DOM 3 `KeyboardEvent` being resolved. See the DOM API documentation - * for more details. - */ - event: KeyboardEvent; + interface KeymapLoaded { + /** The path of the keymap file. */ + path: string; + } - /** The OS-specific name of the current keyboard layout. */ - layoutName: string; + interface AddedKeystrokeResolver { + /** + * The currently resolved keystroke string. If your function returns a falsy + * value, this is how Atom will resolve your keystroke. + */ + keystroke: string; - /** An object mapping DOM 3 `KeyboardEvent.code` values to objects with the - * typed character for that key in each modifier state, based on the current - * operating system layout. - */ - keymap: object; - } - } + /** + * The raw DOM 3 `KeyboardEvent` being resolved. See the DOM API documentation + * for more details. + */ + event: KeyboardEvent; - /** Objects that appear as parameters to functions. */ - namespace Options { - interface BuildKeyEvent { - ctrl?: boolean; - alt?: boolean; - shift?: boolean; - cmd?: boolean; - which?: number; - target?: Element; - } - } + /** The OS-specific name of the current keyboard layout. */ + layoutName: string; - /** The static side to each exported class. Should generally only be used internally. */ - namespace Statics { - /* tslint:disable:no-unnecessary-qualifier */ - /** The static side to the KeymapManager class. */ - interface KeymapManager { - /** Create a keydown DOM event. */ - buildKeydownEvent(key: string, options?: AtomKeymap.Options.BuildKeyEvent): void; + /** + * An object mapping DOM 3 `KeyboardEvent.code` values to objects with the + * typed character for that key in each modifier state, based on the current + * operating system layout. + */ + keymap: object; + } + } - /** Create a keyup DOM event. */ - buildKeyupEvent(key: string, options?: AtomKeymap.Options.BuildKeyEvent): void; + /** + * The option objects that the user is expected to fill out and provide to + * specific API calls. + */ + namespace Options { + interface BuildKeyEvent { + ctrl?: boolean; + alt?: boolean; + shift?: boolean; + cmd?: boolean; + which?: number; + target?: Element; + } + } - /** Create a new KeymapManager. */ - new (options?: { defaultTarget?: HTMLElement }): AtomKeymap.KeymapManager; - } - /* tslint:enable:no-unnecessary-qualifier */ - } + interface KeyBinding { + // Properties + enabled: boolean; + source: string; + command: string; + keystrokes: string; + keystrokeArray: string[]; + keystrokeCount: number; + selector: string; + specificity: number; - /** This custom subclass of CustomEvent exists to provide the ::abortKeyBinding - * method, as well as versions of the ::stopPropagation methods that record the - * intent to stop propagation so event bubbling can be properly simulated for - * detached elements. - */ - interface CommandEvent extends CustomEvent { - keyBindingAborted: boolean; - propagationStopped: boolean; + // Comparison + /** Determines whether the given keystroke matches any contained within this binding. */ + matches(keystroke: string): boolean; - abortKeyBinding(): void; - stopPropagation(): CustomEvent; - stopImmediatePropagation(): CustomEvent; - } + /** + * Compare another KeyBinding to this instance. + * Returns <= -1 if the argument is considered lesser or of lower priority. + * Returns 0 if this binding is equivalent to the argument. + * Returns >= 1 if the argument is considered greater or of higher priority. + */ + compare(other: KeyBinding): number; + } - interface KeyBinding { - // Properties - enabled: boolean; - source: string; - command: string; - keystrokes: string; - keystrokeArray: string[]; - keystrokeCount: number; - selector: string; - specificity: number; + /** + * Allows commands to be associated with keystrokes in a context-sensitive way. + * In Atom, you can access a global instance of this object via `atom.keymaps`. + */ + interface KeymapManager { + defaultTarget: HTMLElement; - // Comparison - /** Determines whether the given keystroke matches any contained within this binding. */ - matches(keystroke: string): boolean; + partialMatchTimeout: number; - /** Compare another KeyBinding to this instance. - * Returns <= -1 if the argument is considered lesser or of lower priority. - * Returns 0 if this binding is equivalent to the argument. - * Returns >= 1 if the argument is considered greater or of higher priority. - */ - compare(other: KeyBinding): number; - } + /** Clear all registered key bindings and enqueued keystrokes. For use in tests. */ + clear(): void; - /** Allows commands to be associated with keystrokes in a context-sensitive way. - * In Atom, you can access a global instance of this object via `atom.keymaps`. - */ - /** Instance side of KeymapManager class. */ - interface KeymapManager { - defaultTarget: HTMLElement; + /** Unwatch all watched paths. */ + destroy(): void; - partialMatchTimeout: number; + // Event Subscription + /** + * Invoke the given callback when one or more keystrokes completely match a + * key binding. + */ + onDidMatchBinding(callback: (event: Events.FullKeybindingMatch) => void): + Disposable; - /** Clear all registered key bindings and enqueued keystrokes. For use in tests. */ - clear(): void; + /** Invoke the given callback when one or more keystrokes partially match a binding. */ + onDidPartiallyMatchBindings(callback: (event: Events.PartialKeybindingMatch) => + void): Disposable; - /** Unwatch all watched paths. */ - destroy(): void; + /** Invoke the given callback when one or more keystrokes fail to match any bindings. */ + onDidFailToMatchBinding(callback: (event: Events.FailedKeybindingMatch) => + void): Disposable; - // Event Subscription - /** Invoke the given callback when one or more keystrokes completely match a key binding. */ - onDidMatchBinding(callback: (event: Events.FullKeybindingMatch) => void): - EventKit.Disposable; + /** Invoke the given callback when a keymap file is reloaded. */ + onDidReloadKeymap(callback: (event: Events.KeymapLoaded) => void): Disposable; - /** Invoke the given callback when one or more keystrokes partially match a binding. */ - onDidPartiallyMatchBindings(callback: (event: Events.PartialKeybindingMatch) => - void): EventKit.Disposable; + /** Invoke the given callback when a keymap file is unloaded. */ + onDidUnloadKeymap(callback: (event: Events.KeymapLoaded) => void): Disposable; - /** Invoke the given callback when one or more keystrokes fail to match any bindings. */ - onDidFailToMatchBinding(callback: (event: Events.FailedKeybindingMatch) => - void): EventKit.Disposable; + /** Invoke the given callback when a keymap file not able to be loaded. */ + onDidFailToReadFile(callback: (error: Events.FailedKeymapFileRead) => void): + Disposable; - /** Invoke the given callback when a keymap file is reloaded. */ - onDidReloadKeymap(callback: (event: Events.KeymapLoaded) => void): - EventKit.Disposable; + // Adding and Removing Bindings + /** Construct KeyBindings from an object grouping them by CSS selector. */ + build(source: string, bindings: { [key: string]: { [key: string]: string }}, + priority?: number): KeyBinding[]; - /** Invoke the given callback when a keymap file is unloaded. */ - onDidUnloadKeymap(callback: (event: Events.KeymapLoaded) => void): - EventKit.Disposable; + /** Add sets of key bindings grouped by CSS selector. */ + add(source: string, bindings: { [key: string]: { [key: string]: string }}, + priority?: number): Disposable; - /** Invoke the given callback when a keymap file not able to be loaded. */ - onDidFailToReadFile(callback: (error: Events.FailedKeymapFileRead) => void): - EventKit.Disposable; + // Accessing Bindings + /** Get all current key bindings. */ + getKeyBindings(): KeyBinding[]; - // Adding and Removing Bindings - /** Construct KeyBindings from an object grouping them by CSS selector. */ - build(source: string, bindings: { [key: string]: { [key: string]: string }}, - priority?: number): KeyBinding[]; + /** Get the key bindings for a given command and optional target. */ + findKeyBindings(params?: { + keystrokes?: string, // e.g. 'ctrl-x ctrl-s' + command?: string, // e.g. 'editor:backspace' + target?: Element, + }): KeyBinding[]; - /** Add sets of key bindings grouped by CSS selector. */ - add(source: string, bindings: { [key: string]: { [key: string]: string }}, - priority?: number): EventKit.Disposable; + // Managing Keymap Files + /** Load the key bindings from the given path. */ + loadKeymap(bindingsPath: string, options?: { watch?: boolean, priority?: number }): + void; - // Accessing Bindings - /** Get all current key bindings. */ - getKeyBindings(): KeyBinding[]; + /** + * Cause the keymap to reload the key bindings file at the given path whenever + * it changes. + */ + watchKeymap(filePath: string, options?: { priority: number }): void; - /** Get the key bindings for a given command and optional target. */ - findKeyBindings(params?: { - keystrokes?: string, // e.g. 'ctrl-x ctrl-s' - command?: string, // e.g. 'editor:backspace' - target?: Element, - }): KeyBinding[]; + // Managing Keyboard Events + /** + * Dispatch a custom event associated with the matching key binding for the + * given `KeyboardEvent` if one can be found. + */ + handleKeyboardEvent(event: KeyboardEvent): void; - // Managing Keymap Files - /** Load the key bindings from the given path. */ - loadKeymap(bindingsPath: string, options?: { watch?: boolean, priority?: number }): - void; + /** Translates a keydown event to a keystroke string. */ + keystrokeForKeyboardEvent(event: KeyboardEvent): string; - /** Cause the keymap to reload the key bindings file at the given path whenever - * it changes. - */ - watchKeymap(filePath: string, options?: { priority: number }): void; + /** Customize translation of raw keyboard events to keystroke strings. */ + addKeystrokeResolver(resolver: (event: Events.AddedKeystrokeResolver) => string): + Disposable; - // Managing Keyboard Events - /** Dispatch a custom event associated with the matching key binding for the - * given `KeyboardEvent` if one can be found. - */ - handleKeyboardEvent(event: KeyboardEvent): void; + /** + * Get the number of milliseconds allowed before pending states caused by + * partial matches of multi-keystroke bindings are terminated. + */ + getPartialMatchTimeout(): number; + } - /** Translates a keydown event to a keystroke string. */ - keystrokeForKeyboardEvent(event: KeyboardEvent): string; + /** The static side to the KeymapManager class. */ + interface KeymapManagerStatic { + /** Create a keydown DOM event. */ + buildKeydownEvent(key: string, options?: Options.BuildKeyEvent): void; - /** Customize translation of raw keyboard events to keystroke strings. */ - addKeystrokeResolver(resolver: (event: Events.AddedKeystrokeResolver) => string): - EventKit.Disposable; + /** Create a keyup DOM event. */ + buildKeyupEvent(key: string, options?: Options.BuildKeyEvent): void; - /** Get the number of milliseconds allowed before pending states caused by - * partial matches of multi-keystroke bindings are terminated. - */ - getPartialMatchTimeout(): number; - } - } + /** Create a new KeymapManager. */ + new (options?: { defaultTarget?: HTMLElement }): KeymapManager; + } + } } -declare const KeymapManager: AtomKeymap.Statics.KeymapManager; +declare const KeymapManager: AtomKeymap.KeymapManagerStatic; export = KeymapManager; diff --git a/types/atom-keymap/tsconfig.json b/types/atom-keymap/tsconfig.json index 1ef87fb730..8a17cc061c 100644 --- a/types/atom-keymap/tsconfig.json +++ b/types/atom-keymap/tsconfig.json @@ -8,7 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -21,4 +21,4 @@ "index.d.ts", "atom-keymap-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/atom-keymap/tslint.json b/types/atom-keymap/tslint.json index cd8f17056a..e0508241c7 100644 --- a/types/atom-keymap/tslint.json +++ b/types/atom-keymap/tslint.json @@ -1,38 +1,8 @@ { "extends": "dtslint/dt.json", "rules": { - // Custom rules. - "class-name": true, - "indent": [true, "tabs"], - "jsdoc-format": true, - "linebreak-style": [true, "LF"], + "indent": [true, "spaces", 4], "max-line-length": [true, 100], - "quotemark": [true, "double", "avoid-escape"], - "trailing-comma": [true, { - "multiline": { "objects": "always", "arrays": "always", "functions": "never" }, - "singleline": { "objects": "never", "arrays": "never", "functions": "never" } - }], - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-module", - "check-separator", - "check-type", - "check-typecast", - "check-rest-spread", - "check-preblock" - ], - // Soon to be defaults. - "arrow-return-shorthand": [true, "multiline"], - "no-any": true, - "no-floating-promises": true, - "no-unbound-method": true, - "no-unsafe-any": true, - "number-literal-format": true, - "restrict-plus-operands": true, - "return-undefined": true, - "switch-final-break": true + "no-any": true } } diff --git a/types/atom-keymap/v5/.editorconfig b/types/atom-keymap/v5/.editorconfig deleted file mode 100644 index 570211f898..0000000000 --- a/types/atom-keymap/v5/.editorconfig +++ /dev/null @@ -1,3 +0,0 @@ -[*.ts] -indent_style = tab -indent_size = 4 diff --git a/types/atom-keymap/v5/atom-keymap-tests.ts b/types/atom-keymap/v5/atom-keymap-tests.ts deleted file mode 100644 index 1c92bff5c9..0000000000 --- a/types/atom-keymap/v5/atom-keymap-tests.ts +++ /dev/null @@ -1,20 +0,0 @@ - - -import { KeymapManager, ICompleteMatchEvent } from "atom-keymap"; - -var manager = new KeymapManager(); -manager.add('some/unique/path', { - '.workspace': { - 'ctrl-x': 'package:do-something', - 'ctrl-y': 'package:do-something-else' - }, - '.mini.editor': { - 'enter': 'core:confirm' - } -}); - -manager.onDidMatchBinding((event: ICompleteMatchEvent): void => { - console.log(event.binding.command); -}) - -manager.destroy(); diff --git a/types/atom-keymap/v5/index.d.ts b/types/atom-keymap/v5/index.d.ts deleted file mode 100644 index 9ffa0a41d3..0000000000 --- a/types/atom-keymap/v5/index.d.ts +++ /dev/null @@ -1,133 +0,0 @@ -// Type definitions for atom-keymap v5.1.5 -// Project: https://github.com/atom/atom-keymap/ -// Definitions by: Vadim Macagon -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import * as AtomEventKit from 'event-kit'; - -export = AtomKeymap; - -declare namespace AtomKeymap { - type Disposable = AtomEventKit.Disposable; - - /** Instance side of KeyBinding class. */ - interface KeyBinding { - enabled: boolean; - source: string; - command: string; - keystrokes: string; - keystrokeCount: number; - selector: string; - specificity: number; - - matches(keystroke: string): boolean; - compare(keyBinding: KeyBinding): number; - } - - interface ICompleteMatchEvent { - /** Keystrokes that matched the binding. */ - keystrokes: string; - /** Binding that was matched to the keystrokes. */ - binding: KeyBinding; - /** DOM element that was the target of the most recent `KeyboardEvent`. */ - keyboardEventTarget: Element; - } - - interface IPartialMatchEvent { - /** Keystrokes that matched the binding. */ - keystrokes: string; - /** Bindings that were partially matched to the keystrokes. */ - partiallyMatchedBindings: KeyBinding[]; - /** DOM element that was the target of the most recent `KeyboardEvent`. */ - keyboardEventTarget: Element; - } - - interface IFailedMatchEvent { - /** Keystrokes that failed to match a binding. */ - keystrokes: string; - /** DOM element that was the target of the most recent `KeyboardEvent`. */ - keyboardEventTarget: Element; - } - - interface IKeymapLoadEvent { - /** Path to a keymap file. */ - path: string; - } - - /** Static side of KeymapManager class. */ - interface KeymapManagerStatic { - prototype: KeymapManager; - new (options?: { defaultTarget?: Element }): KeymapManager; - } - - /** Instance side of KeymapManager class. */ - interface KeymapManager { - constructor: KeymapManagerStatic; - /** Unwatches all watched paths. */ - destroy(): void; - - // Event Subscription - - /** Sets callback to invoke when one or more keystrokes completely match a key binding. */ - onDidMatchBinding(callback: (event: ICompleteMatchEvent) => void): Disposable; - /** Sets callback to invoke when one or more keystrokes partially match a binding. */ - onDidPartiallyMatchBindings(callback: (event: IPartialMatchEvent) => void): Disposable; - /** Sets callback to invoke when one or more keystrokes fail to match any bindings. */ - onDidFailToMatchBinding(callback: (event: IFailedMatchEvent) => void): Disposable; - /** Sets callback to invoke when a keymap file is reloaded. */ - onDidReloadKeymap(callback: (event: IKeymapLoadEvent) => void): Disposable; - /** Sets callback to invoke when a keymap file is unloaded. */ - onDidUnloadKeymap(callback: (event: IKeymapLoadEvent) => void): Disposable; - /** Sets callback to invoke when a keymap file could not to be loaded. */ - onDidFailToReadFile(callback: (error: Error) => void): Disposable; - - // Adding and Removing Bindings - - /** Adds sets of key bindings grouped by CSS selector. */ - add(source: string, keyBindingsBySelector: any): Disposable; - - // Accessing Bindings - - getKeyBindings(): KeyBinding[]; - findKeyBindings(params?: { - keystrokes: string; // e.g. 'ctrl-x ctrl-s' - command: string; // e.g. 'editor:backspace' - target?: Element; - }): KeyBinding[]; - - // Managing Keymap Files - - /** - * Loads the key bindings from the given path. - * - * @param bindingsPath A path to a file or a directory. If the path is a directory all files - * inside it will be loaded. - */ - loadKeymap(bindingsPath: string, options?: { watch: boolean }): void; - /** - * Starts watching the given file/directory for changes, reloading any keymaps at that location - * when changes are detected. - * - * @param filePath A path to a file or a directory. - */ - watchKeymap(filePath: string): void; - - // Managing Keyboard Events - - /** - * Dispatches a custom event associated with the matching key binding for the given - * `KeyboardEvent` if one can be found. - */ - handleKeyboardEvent(event: KeyboardEvent): void; - /** Translates a keydown event to a keystroke string. */ - keystrokeForKeyboardEvent(event: KeyboardEvent): string; - /** - * @return The number of milliseconds allowed before pending states caused by partial matches of - * multi-keystroke bindings are terminated. - */ - getPartialMatchTimeout(): number; - } - - /** Allows commands to be associated with keystrokes in a context-sensitive way.*/ - var KeymapManager: KeymapManagerStatic; -} diff --git a/types/atom-mocha-test-runner/atom-mocha-test-runner-tests.ts b/types/atom-mocha-test-runner/atom-mocha-test-runner-tests.ts new file mode 100644 index 0000000000..0bc8205095 --- /dev/null +++ b/types/atom-mocha-test-runner/atom-mocha-test-runner-tests.ts @@ -0,0 +1,39 @@ +import { AtomEnvironment, TestRunnerParams } from "atom"; +import { createRunner } from "atom-mocha-test-runner"; +import defaultMochaRunner = require("atom-mocha-test-runner"); + +const extraOptions = { + testSuffixes: ["-spec.js", "-spec.coffee"], +}; + +function mochaSetup(mocha: Mocha) { + mocha.addFile("test.file"); +} + +let testRunner = createRunner(); +testRunner = createRunner(extraOptions); +testRunner = createRunner(extraOptions, mochaSetup); +testRunner = createRunner({ + colors: true, + globalAtom: true, + htmlTitle: "Test Title", + reporter: "dot", + testSuffixes: ["test.file"], +}); + +declare const atom: AtomEnvironment; +declare const blob: object; +declare let num: number; + +async function runTests(): Promise { + const runnerArgs: TestRunnerParams = { + testPaths: ["/var/test"], + logFile: "/var/log", + headless: false, + buildDefaultApplicationDelegate: () => blob, + buildAtomEnvironment: () => atom, + }; + + num = await defaultMochaRunner(runnerArgs); + return testRunner(runnerArgs); +} diff --git a/types/atom-mocha-test-runner/index.d.ts b/types/atom-mocha-test-runner/index.d.ts new file mode 100644 index 0000000000..3a842f4a5c --- /dev/null +++ b/types/atom-mocha-test-runner/index.d.ts @@ -0,0 +1,40 @@ +// Type definitions for atom-mocha-test-runner 1.0 +// Project: https://github.com/BinaryMuse/atom-mocha-test-runner +// Definitions by: GlenCFL +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +import { TestRunner } from "atom"; + +interface AtomMochaOptions { + /** Which reporter to use on the terminal. */ + reporter?: string; + + /** Whether or not to assign the created Atom environment to `global.atom`. */ + globalAtom?: boolean; + + /** File extensions that indicate that the file contains tests. */ + testSuffixes?: string[]; + + /** Whether or not to colorize output on the terminal. */ + colors?: boolean; + + /** The string to use for the window title in the HTML reporter. */ + htmlTitle?: string; +} + +// The test runner function is augmented on export by: +// import createRunner from './lib/create-runner' +// +// module.exports = createRunner() +// module.exports.createRunner = createRunner +// Which is what we're trying to model here. +interface TestRunnerExport extends TestRunner { + createRunner(options?: AtomMochaOptions, mochaConfigFunction?: + (mocha: Mocha) => void): TestRunner; +} + +declare const runner: TestRunnerExport; +export = runner; diff --git a/types/atom-mocha-test-runner/tsconfig.json b/types/atom-mocha-test-runner/tsconfig.json new file mode 100644 index 0000000000..c6e9fb20c0 --- /dev/null +++ b/types/atom-mocha-test-runner/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "es6", + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "atom-mocha-test-runner-tests.ts" + ] +} diff --git a/types/atom-mocha-test-runner/tslint.json b/types/atom-mocha-test-runner/tslint.json new file mode 100644 index 0000000000..e0508241c7 --- /dev/null +++ b/types/atom-mocha-test-runner/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "indent": [true, "spaces", 4], + "max-line-length": [true, 100], + "no-any": true + } +} diff --git a/types/atom/.editorconfig b/types/atom/.editorconfig deleted file mode 100644 index 2b997514d2..0000000000 --- a/types/atom/.editorconfig +++ /dev/null @@ -1,3 +0,0 @@ -[*.ts] -indent_style = tab -indent_size = 2 diff --git a/types/atom/README.md b/types/atom/README.md deleted file mode 100644 index ba2d52a6f4..0000000000 --- a/types/atom/README.md +++ /dev/null @@ -1,42 +0,0 @@ -## Atom API Type Definitions - -TypeScript type definitions for the [Atom Text Editor](https://atom.io/) public API, which is used to develop packages for the editor. Documentation for the public API can be found [here](https://atom.io/docs/api/v1.21.0/). - -### Exports - -#### The "atom" Variable - -These definitions declare a global static variable named "atom" as ambient. Once these definitions have been referenced within your project, you will be able to access properties and member functions from the [AtomEnvironment](https://atom.io/docs/api/v1.21.0/AtomEnvironment) class off of this variable, as it is an instance of that class. - -```ts -if (atom.inDevMode()) {} -``` - -#### The Atom Namespace - -All of the types used by or referenced by the Atom public API have been pulled into the Atom namespace, providing a consistent and easy way to access each of them, without having to care about where that type actually lives within the Atom codebase. - -```ts -function example(buffer: Atom.TextBuffer) {} -``` - -#### The AtomCore Namespace - -All classes which are core to Atom itself have been provided under the AtomCore namespace. - -```ts -function example(cursor: AtomCore.Cursor) {} -``` - -### Service Type Definitions - -There are many services provided by other Atom packages that you may want to use within your own Atom package. We bundle type definitions for several of these services with these type definitions. - -```ts -/// -let completionProvider: Atom.Services.Autocomplete.Provider; -``` - -The currently supported services are: -- [Autocomplete](https://github.com/atom/autocomplete-plus) -- [Status Bar](https://github.com/atom/status-bar) diff --git a/types/atom/atom-tests.ts b/types/atom/atom-tests.ts index 0f9def0a68..e0699463b1 100644 --- a/types/atom/atom-tests.ts +++ b/types/atom/atom-tests.ts @@ -1,5 +1,8 @@ +import * as Atom from "atom"; + declare let str: string; declare let num: number; +declare let nums: number[]; declare let bool: boolean; declare let strs: string[]; declare let obj: object; @@ -9,2129 +12,3187 @@ declare let regExp: RegExp; declare let element: HTMLElement; declare let elements: HTMLElement[]; declare const div: HTMLDivElement; +declare const event: KeyboardEvent; -declare let grammar: Atom.Grammar; -declare let pos: Atom.Point; -declare let posArr: Atom.Point[]; -declare let range: Atom.Range; -declare let ranges: Atom.Range[]; -declare let marker: Atom.Marker; +declare let buffer: Atom.TextBuffer; +declare const color: Atom.Color; +declare let cursor: Atom.Cursor; +declare let cursors: Atom.Cursor[]; +declare let decoration: Atom.Decoration; +declare let decorations: Atom.Decoration[]; +declare let decorationLayerProps: Atom.DecorationLayerOptions; +declare let dir: Atom.Directory; +declare let dirs: Atom.Directory[]; declare let displayMarker: Atom.DisplayMarker; declare let displayMarkers: Atom.DisplayMarker[]; declare let displayMarkerLayer: Atom.DisplayMarkerLayer; -declare let sub: Atom.Disposable; -declare let dir: Atom.Directory; -declare let dirs: Atom.Directory[]; - -declare let buffer: Atom.TextBuffer; -declare let cursor: Atom.Cursor; -declare let cursors: Atom.Cursor[]; +declare let dock: Atom.Dock; declare let editor: Atom.TextEditor; declare let editors: Atom.TextEditor[]; -declare let decoration: Atom.Decoration; -declare let decorations: Atom.Decoration[]; +declare let emitter: Atom.Emitter; +declare let file: Atom.File; +declare let grammar: Atom.Grammar; +declare let grammars: Atom.Grammar[]; +declare let gutter: Atom.Gutter; +declare let gutters: Atom.Gutter[]; +declare let historyPaths: Atom.ProjectHistory[]; +declare let layerDecoration: Atom.LayerDecoration; +declare let marker: Atom.Marker; +declare let markers: Atom.Marker[]; +declare let markerLayer: Atom.MarkerLayer; declare let notification: Atom.Notification; declare let notifications: Atom.Notification[]; -declare let scopeDescriptor: Atom.ScopeDescriptor; declare let pack: Atom.Package; declare let packs: Atom.Package[]; declare let pane: Atom.Pane; declare let panes: Atom.Pane[]; +declare let paneContainer: Atom.Dock|Atom.WorkspaceCenter; declare let panel: Atom.Panel; declare let panels: Atom.Panel[]; +declare let pos: Atom.Point; +declare let posArr: Atom.Point[]; declare let project: Atom.Project; +declare let range: Atom.Range; +declare let ranges: Atom.Range[]; +declare let registry: Atom.GrammarRegistry; declare let repository: Atom.GitRepository; declare let repositories: Atom.GitRepository[]; -declare let gutter: Atom.Gutter; -declare let gutters: Atom.Gutter[]; -declare let historyPaths: Atom.HistoryProject[]; -declare let layerDecoration: Atom.LayerDecoration; +declare let scopeDescriptor: Atom.ScopeDescriptor; declare let selection: Atom.Selection; declare let selections: Atom.Selection[]; declare let styleManager: Atom.StyleManager; +declare let subscription: Atom.Disposable; +declare let subscriptions: Atom.CompositeDisposable; declare let tooltips: Atom.Tooltip[]; -declare let dock: Atom.Dock; declare let workspaceCenter: Atom.WorkspaceCenter; -declare let paneContainer: Atom.Dock|Atom.WorkspaceCenter; -// Exports Testing ============================================================ -import { BufferedNodeProcess, BufferedProcess, GitRepository, Notification, - TextBuffer, TextEditor, Point, Range, File, Directory, Emitter, Disposable, - CompositeDisposable, Task, watchPath } from "atom"; +// AtomEnvironment ============================================================ +function testAtomEnvironment() { + // Properties + subscription = atom.commands.add("test", { "execute-command": () => {}}); -const pathWatcher = watchPath("/var/test", {}, (events) => { - for (const event of events) { - str = event.path; - str = event.action; - if (event.oldPath) str = event.oldPath; - } -}); + str = atom.clipboard.read(); -// global "atom" -atom.commands; -atom.config; -atom.clipboard; -atom.contextMenu; -atom.menu; -atom.keymaps; -atom.tooltips; -atom.notifications; -atom.project; -atom.grammars; -atom.history; -atom.packages; -atom.themes; -atom.styles; -atom.deserializers; -atom.views; -atom.workspace; -atom.textEditors; -atom.onDidBeep((): void => {}); -atom.onWillThrowError((): void => {}); -atom.onDidThrowError((): void => {}); -atom.whenShellEnvironmentLoaded((): void => {}); -atom.inDevMode(); -atom.inSafeMode(); -atom.inSpecMode(); -atom.getVersion(); -str = atom.getReleaseChannel(); -atom.isReleasedVersion(); -atom.getWindowLoadTime(); + subscription = atom.contextMenu.add({ + "atom-workspace": [{label: "Help", command: "application:open-documentation"}], + "atom-text-editor": [{ + label: "History", + submenu: [ + { label: "Undo", command: "core:undo" }, + { label: "Redo", command: "core:redo" }, + ], + }], + }); -const loadSettings = atom.getLoadSettings(); -const testValue = loadSettings.env["test"]; -if (testValue) str = testValue; + subscription = atom.menu.add([{ + label: "Hello", + submenu : [{ label: "World!", command: "hello:world" }], + }]); -atom.open({ devMode: false, newWindow: true, pathsToOpen: ["Test.file"], - safeMode: false }); -atom.close(); -atom.getSize(); -atom.setSize(42, 42); -atom.getPosition(); -atom.setPosition(42, 42); -atom.pickFolder((): void => {}); + atom.keymaps.add("Test.Path", { + selector: { + a: "execute-something", + }, + }); -obj = atom.getCurrentWindow(); + subscription = atom.tooltips.add(div, { title: "Tooltip Test" }); -atom.center(); -atom.focus(); -atom.show(); -atom.hide(); -atom.reload(); -atom.restartApplication(); -atom.isMaximized(); -atom.isFullScreen(); -atom.setFullScreen(true); -atom.toggleFullScreen(); -atom.beep(); -atom.confirm({ buttons: ["Test"], detailedMessage: "Test", message: "Test" }); + notification = atom.notifications.addError("Error"); -async function toggleDevTools() { - await atom.openDevTools(); - await atom.toggleDevTools(); + atom.project.addPath("/var/test"); + + grammar = atom.grammars.loadGrammarSync("Test.file"); + + historyPaths = atom.history.getProjects(); + + subscription = atom.packages.onDidActivatePackage((atomPackage) => { + atomPackage.isCompatible(); + }); + + subscription = atom.themes.onDidChangeActiveThemes(() => {}); + + subscription = atom.styles.onDidAddStyleElement((styleElement) => {}); + + const serializer = { + name: "Test", + deserialize: () => ({}), + }; + atom.deserializers.add(serializer); + + subscription = atom.views.addViewProvider(Atom.Range, (range): HTMLElement => { + range.start; + return div; + }); + + subscription = atom.workspace.observeTextEditors((editor) => { + subscription = editor.onDidStopChanging((event) => { + for (const change of event.changes) { + change.newExtent; + } + }); + + const text: string[] = editor.getBuffer().getLines(); + }); + + atom.textEditors.add(editor); + + // Event Subscription + subscription = atom.onDidBeep(() => {}); + subscription = atom.onWillThrowError(event => event.message); + subscription = atom.onDidThrowError(event => event.line); + subscription = atom.whenShellEnvironmentLoaded(() => {}); + + // Atom Details + bool = atom.inDevMode(); + bool = atom.inSafeMode(); + bool = atom.inSpecMode(); + str = atom.getVersion(); + bool = atom.isReleasedVersion(); + num = atom.getWindowLoadTime(); + obj = atom.getLoadSettings(); + + // Managing The Atom Window + let dim: { width: number, height: number }; + let v2: { x: number, y: number }; + + // atom.open(params); + atom.close(); + dim = atom.getSize(); + atom.setSize(42, 42); + v2 = atom.getPosition(); + atom.setPosition(42, 42); + + atom.pickFolder((paths) => { + if (paths) { + paths.length; + } + }); + + atom.getCurrentWindow(); + atom.center(); + atom.focus(); + atom.show(); + atom.hide(); + atom.reload(); + atom.restartApplication(); + bool = atom.isMaximized(); + bool = atom.isFullScreen(); + atom.setFullScreen(true); + atom.toggleFullScreen(); + + // Messaging the User + atom.beep(); + + atom.confirm({ message: "Test" }); + atom.confirm({ message: "Test", buttons: [ "a", "b" ], detailedMessage: "Test" }); + num = atom.confirm({ message: "Test", detailedMessage: "Test", buttons: { + Test: () => { atom.beep(); }, + }}); + + // Managing the Dev Tools + async function manageDevTools() { + await atom.openDevTools(); + await atom.toggleDevTools(); + } + + atom.executeJavaScriptInDevTools("Test"); } -atom.executeJavaScriptInDevTools("Test"); +// BufferedNodeProcess ======================================================== +function testBufferedNodeProcess() { + const nodeProcess = new Atom.BufferedNodeProcess({ + command: "File.path", + }); -// Usage Testing ============================================================== -// Some examples taken from the Atom documentation. -// .commands -sub = atom.commands.add("test", { "execute-command": () => {}}); - -// .clipboard -str = atom.clipboard.read(); - -// .contextMenu -sub = atom.contextMenu.add({ - "atom-workspace": [{label: "Help", command: "application:open-documentation"}], - "atom-text-editor": [{ - label: "History", - submenu: [ - { label: "Undo", command: "core:undo" }, - { label: "Redo", command: "core:redo" }, - ], - }], -}); - -// .menu -sub = atom.menu.add([{ - label: "Hello", - submenu : [{ label: "World!", command: "hello:world" }], -}]); - -// .keymaps -atom.keymaps.add("Test.Path", { - selector: { - a: "execute-something", - }, -}); - -// .tooltips -sub = atom.tooltips.add(div, { title: "Tooltip Test" }); - -// .notifications -notification = atom.notifications.addError("Error"); - -// .project -atom.project.addPath("/var/test"); - -// .grammars -grammar = atom.grammars.loadGrammarSync("Test.file"); - -// .history -historyPaths = atom.history.getProjects(); - -// .packages -sub = atom.packages.onDidActivatePackage((atomPackage) => { - atomPackage.isCompatible(); -}); - -// .themes -sub = atom.themes.onDidChangeActiveThemes(() => {}); - -// .styles -sub = atom.styles.onDidAddStyleElement((styleElement) => {}); - -// .deserializers -const serializer = { - name: "Test", - deserialize: () => ({}), -}; -atom.deserializers.add(serializer); - -// .views -sub = atom.views.addViewProvider(Range, (range): HTMLElement => { - range.start; - return div; -}); - -// .workspace -sub = atom.workspace.observeTextEditors((editor) => { - sub = editor.onDidStopChanging((event) => { - for (const change of event.changes) { - change.newExtent; - } - }); - - const text: string[] = editor.getBuffer().getLines(); -}); - -// .textEditors -atom.textEditors.add(editor); - -// Atom API Testing =========================================================== -//// AtomEnvironment ========================================================== -// Event Subscription -sub = atom.onDidBeep(() => {}); -sub = atom.onWillThrowError(event => event.message); -sub = atom.onDidThrowError(event => event.line); -sub = atom.whenShellEnvironmentLoaded(() => {}); - -// Atom Details -bool = atom.inDevMode(); -bool = atom.inSafeMode(); -bool = atom.inSpecMode(); -str = atom.getVersion(); -bool = atom.isReleasedVersion(); -num = atom.getWindowLoadTime(); -obj = atom.getLoadSettings(); - -// Managing The Atom Window -declare let dim: { width: number, height: number }; -declare let v2: { x: number, y: number }; - -// atom.open(params); -atom.close(); -dim = atom.getSize(); -atom.setSize(42, 42); -v2 = atom.getPosition(); -atom.setPosition(42, 42); - -atom.pickFolder((paths) => { - if (paths) { - paths.length; - } -}); - -atom.getCurrentWindow(); -atom.center(); -atom.focus(); -atom.show(); -atom.hide(); -atom.reload(); -atom.restartApplication(); -bool = atom.isMaximized(); -bool = atom.isFullScreen(); -atom.setFullScreen(true); -atom.toggleFullScreen(); - -// Messaging the User -atom.beep(); - -atom.confirm({ message: "Test" }); -atom.confirm({ message: "Test", buttons: [ "a", "b" ], detailedMessage: "Test" }); -num = atom.confirm({ message: "Test", detailedMessage: "Test", buttons: { - Test: () => { atom.beep(); }, -}}); - -// Managing the Dev Tools -async function manageDevTools() { - await atom.openDevTools(); - await atom.toggleDevTools(); + new Atom.BufferedNodeProcess({ + command: "File.path", + args: [], + options: { + cwd: "/var/test", + detached: true, + }, + exit: (): void => {}, + stderr: (): void => {}, + stdout: (): void => {}, + }); } -atom.executeJavaScriptInDevTools("Test"); +// BufferedProcess ============================================================ +function testBufferedProcess() { + const process = new Atom.BufferedProcess({ + command: "File.path", + }); -//// BufferedNodeProcess ====================================================== -const nodeProcess = new BufferedNodeProcess({ - command: "File.path", -}); + new Atom.BufferedProcess({ + command: "File.path", + args: [], + options: {}, + exit: (): void => {}, + stderr: (): void => {}, + stdout: (): void => {}, + }); -new BufferedNodeProcess({ - command: "File.path", - args: [], - options: { - cwd: "/var/test", - detached: true, - }, - exit: (): void => {}, - stderr: (): void => {}, - stdout: (): void => {}, -}); + subscription = process.onWillThrowError((error) => { + error.error; + error.handle(); + }); -//// BufferedProcess ========================================================== -const process = new BufferedProcess({ - command: "File.path", -}); - -new BufferedProcess({ - command: "File.path", - args: [], - options: {}, - exit: (): void => {}, - stderr: (): void => {}, - stdout: (): void => {}, -}); - -sub = process.onWillThrowError((error) => { - error.error; - error.handle(); -}); - -process.kill(); - -//// Clipboard ================================================================ -atom.clipboard.read(); -atom.clipboard.write("Test"); -const clip = atom.clipboard.readWithMetadata(); -str = clip.text; -obj = clip.metadata; - -//// Color ==================================================================== -declare const color: Atom.Color; -str = color.toHexString(); -str = color.toRGBAString(); - -//// CommandRegistry ========================================================== -atom.commands.add("test", "test:function", (event) => {}); -atom.commands.add("test", { - "test-function": (event) => {}, - "test-function2": (event) => {}, -}); -atom.commands.add("test", "test:function", { - didDispatch: (event) => event.stopImmediatePropagation(), - description: "A Command Test", - displayName: "Command: Test", -}); - -const commands = atom.commands.findCommands({ target: element }); -atom.commands.dispatch(element, "test:function"); -sub = atom.commands.onWillDispatch((event) => { event.stopPropagation(); }); -sub = atom.commands.onDidDispatch((event) => { event.cancelable; }); - -//// CompositeDisposable -- See 'event-kit' testing. -//// Config =================================================================== -atom.config.observe("test", (event) => {}); -atom.config.observe("test", { scope: scopeDescriptor }, (value) => {}); - -atom.config.onDidChange((event) => { event.newValue; }); -atom.config.onDidChange("test", (event) => { event.oldValue; }); - -// Managing Settings -atom.config.get("test"); -atom.config.get("test", { scope: scopeDescriptor }); -atom.config.get("test", { excludeSources: ["test.source"] }); -atom.config.get("test", { sources: ["test.source"] }); -atom.config.get("test", { scope: scopeDescriptor, excludeSources: ["a"], - sources: ["b"] }); - -atom.config.set("test", 42); -atom.config.set("test", 42, { scopeSelector: "test-selector" }); -atom.config.set("test", 42, { source: "test" }); -atom.config.set("test", 42, {scopeSelector: "test-selector", source: "test" }); - -atom.config.unset("test"); -atom.config.unset("test", { scopeSelector: "test-selector" }); -atom.config.unset("test", { source: "test" }); -atom.config.unset("test", { scopeSelector: "test-selector", source: "test" }); - -const allConfigValues = atom.config.getAll("test"); -for (const { scopeDescriptor, value } of allConfigValues) { - scopeDescriptor.scopes; -} -atom.config.getAll("test", { scope: scopeDescriptor }); -atom.config.getAll("test", { excludeSources: ["test"] }); -atom.config.getAll("test", { sources: ["test"] }); -atom.config.getAll("test", { scope: scopeDescriptor, excludeSources: ["a"], - sources: ["b"] }); - -strs = atom.config.getSources(); - -atom.config.getSchema("test"); - -str = atom.config.getUserConfigPath(); - -atom.config.transact(() => {}); - -//// ContextMenuManager -- See above. -//// Cursor =================================================================== -// Event Subscription -sub = cursor.onDidChangePosition((event) => { event.newBufferPosition; }); -sub = cursor.onDidDestroy(() => {}); - -// Managing Cursor Position -cursor.setScreenPosition(pos); -cursor.setScreenPosition(pos, {}); -cursor.setScreenPosition(pos, { autoscroll: true }); - -pos = cursor.getScreenPosition(); - -cursor.setBufferPosition(pos); -cursor.setBufferPosition(pos, {}); -cursor.setBufferPosition(pos, { autoscroll: true }); - -pos = cursor.getBufferPosition(); -num = cursor.getScreenRow(); -num = cursor.getScreenColumn(); -num = cursor.getBufferRow(); -num = cursor.getBufferColumn(); -str = cursor.getCurrentBufferLine(); -bool = cursor.isAtBeginningOfLine(); -bool = cursor.isAtEndOfLine(); - -// Cursor Position Details -displayMarker = cursor.getMarker(); -bool = cursor.isSurroundedByWhitespace(); -bool = cursor.isBetweenWordAndNonWord(); - -bool = cursor.isInsideWord(); -bool = cursor.isInsideWord({}); -bool = cursor.isInsideWord({ wordRegex: regExp }); - -num = cursor.getIndentLevel(); -scopeDescriptor = cursor.getScopeDescriptor(); -bool = cursor.hasPrecedingCharactersOnLine(); -bool = cursor.isLastCursor(); - -// Moving the Cursor -cursor.moveUp(); -cursor.moveUp(42); -cursor.moveUp(42, {}); -cursor.moveUp(42, { moveToEndOfSelection: true }); - -cursor.moveDown(); -cursor.moveDown(42); -cursor.moveDown(42, {}); -cursor.moveDown(42, { moveToEndOfSelection: true }); - -cursor.moveLeft(); -cursor.moveLeft(42); -cursor.moveLeft(42, {}); -cursor.moveLeft(42, { moveToEndOfSelection: true }); - -cursor.moveRight(); -cursor.moveRight(42); -cursor.moveRight(42, {}); -cursor.moveRight(42, { moveToEndOfSelection: true }); - -cursor.moveToTop(); -cursor.moveToBottom(); -cursor.moveToBeginningOfScreenLine(); -cursor.moveToBeginningOfLine(); -cursor.moveToFirstCharacterOfLine(); -cursor.moveToEndOfScreenLine(); -cursor.moveToEndOfLine(); -cursor.moveToBeginningOfWord(); -cursor.moveToEndOfWord(); -cursor.moveToBeginningOfNextWord(); -cursor.moveToPreviousWordBoundary(); -cursor.moveToNextWordBoundary(); -cursor.moveToPreviousSubwordBoundary(); -cursor.moveToNextSubwordBoundary(); -cursor.skipLeadingWhitespace(); -cursor.moveToBeginningOfNextParagraph(); -cursor.moveToBeginningOfPreviousParagraph(); - -// Local Positions and Ranges -pos = cursor.getPreviousWordBoundaryBufferPosition(); -pos = cursor.getPreviousWordBoundaryBufferPosition({}); -pos = cursor.getPreviousWordBoundaryBufferPosition({ wordRegex: regExp }); - -cursor.getNextWordBoundaryBufferPosition(); -cursor.getNextWordBoundaryBufferPosition({ wordRegex: regExp }); - -cursor.getBeginningOfCurrentWordBufferPosition(); -cursor.getBeginningOfCurrentWordBufferPosition({}); -cursor.getBeginningOfCurrentWordBufferPosition({ wordRegex: regExp }); -cursor.getBeginningOfCurrentWordBufferPosition({ allowPrevious: true }); -cursor.getBeginningOfCurrentWordBufferPosition({ includeNonWordCharacters: true }); -cursor.getBeginningOfCurrentWordBufferPosition({ wordRegex: regExp, - allowPrevious: true, includeNonWordCharacters: true }); - -cursor.getEndOfCurrentWordBufferPosition(); -cursor.getEndOfCurrentWordBufferPosition({}); -cursor.getEndOfCurrentWordBufferPosition({ wordRegex: regExp }); -cursor.getEndOfCurrentWordBufferPosition({ includeNonWordCharacters: true }); -cursor.getEndOfCurrentWordBufferPosition({ wordRegex: regExp, includeNonWordCharacters: - true }); - -cursor.getBeginningOfNextWordBufferPosition(); -cursor.getBeginningOfNextWordBufferPosition({}); -cursor.getBeginningOfNextWordBufferPosition({ wordRegex: regExp }); - -cursor.getCurrentWordBufferRange(); -cursor.getCurrentWordBufferRange({}); -cursor.getCurrentWordBufferRange({ wordRegex: regExp }); - -cursor.getCurrentLineBufferRange(); -cursor.getCurrentLineBufferRange({}); -cursor.getCurrentLineBufferRange({ includeNewline: true }); - -range = cursor.getCurrentParagraphBufferRange(); -str = cursor.getCurrentWordPrefix(); - -// Comparing to another cursor -num = cursor.compare(cursor); - -// Utilities -cursor.clearSelection(); - -regExp = cursor.wordRegExp(); -regExp = cursor.wordRegExp({}); -regExp = cursor.wordRegExp({ includeNonWordCharacters: true }); - -regExp = cursor.subwordRegExp(); -regExp = cursor.subwordRegExp({}); -regExp = cursor.subwordRegExp({ backwards: true }); - -//// Decoration =============================================================== -// Construction and Destruction -decoration.destroy(); - -// Event Subscription -sub = decoration.onDidChangeProperties(event => { event.oldProperties.gutterName; }); -sub = decoration.onDidDestroy(() => {}); - -// Decoration Details -num = decoration.getId(); -displayMarker = decoration.getMarker(); - -// Properties -const decorationProps = decoration.getProperties(); - -decoration.setProperties(decorationProps); - -//// DeserializerManager ====================================================== -class StorableClass { - name: string; - - constructor() {} - deserialize() { return {}; } + process.kill(); } -function isStorableClass(o: object): o is StorableClass { - if (typeof o === "object" && ( o).name && - ( o).name === "test") { - return true; - } else { - return false; - } +// Clipboard ================================================================== +function testClipboard() { + atom.clipboard.read(); + atom.clipboard.write("Test"); + const clip = atom.clipboard.readWithMetadata(); + str = clip.text; + obj = clip.metadata; } -let serializable = new StorableClass(); -atom.deserializers.add(serializable); -const blob = atom.deserializers.deserialize({ name: "test" }); -if (blob && isStorableClass(blob)) serializable = blob; - -//// Directory -- See 'pathwatcher' testing. -//// DisplayMarker -- See 'text-buffer' testing. -//// DisplayMarkerLayer -- See 'text-buffer' testing. -//// Disposable -- See 'event-kit' testing. -//// Dock ===================================================================== -// Methods -dock.activate(); -dock.show(); -dock.hide(); -dock.toggle(); -bool = dock.isVisible(); - -// Event Subscription -sub = dock.observePaneItems(() => {}); -sub = dock.onDidChangeActivePaneItem(() => {}); -sub = dock.onDidStopChangingActivePaneItem(() => {}); -sub = dock.observeActivePaneItem(() => {}); -sub = dock.onDidAddPane(event => event.pane.activate()); -sub = dock.onWillDestroyPane(event => event.pane); -sub = dock.onDidDestroyPane(event => event.pane); -sub = dock.observePanes(pane => pane.activate()); -sub = dock.onDidChangeActivePane(pane => pane.activate()); -sub = dock.observeActivePane(pane => pane.activate()); -sub = dock.onDidAddPaneItem(event => event.index && event.item && event.pane); -sub = dock.onWillDestroyPaneItem(event => event.index && event.item && event.pane); -sub = dock.onDidDestroyPaneItem(event => event.index && event.item && event.pane); - -// Pane Items -objs = dock.getPaneItems(); -obj = dock.getActivePaneItem(); - -// Panes -panes = dock.getPanes(); -pane = dock.getActivePane(); -bool = dock.activateNextPane(); -bool = dock.activatePreviousPane(); - -//// Emitter -- See 'event-kit' testing. -//// File -- See 'pathwatcher' testing. -//// GitRepository ============================================================ -// Construction and Destruction -repository = new GitRepository("Test"); -repository = new GitRepository("Test", {}); -repository = new GitRepository("Test", { refreshOnWindowFocus: true }); -repository = new GitRepository("Test", { config: atom.config }); -repository = new GitRepository("Test", { project: atom.project }); -repository = new GitRepository("Test", { refreshOnWindowFocus: false, config: atom.config, - project: atom.project }); -repository.destroy(); -bool = repository.isDestroyed(); - -// Event Subscription -sub = repository.onDidDestroy(() => {}); -sub = repository.onDidChangeStatus(event => event.path && event.pathStatus); -sub = repository.onDidChangeStatuses(() => {}); - -// Repository Details -repository.getType(); -str = repository.getPath(); -str = repository.getWorkingDirectory(); -bool = repository.isProjectAtRoot(); -str = repository.relativize(); -bool = repository.hasBranch("master"); - -str = repository.getShortHead(); -str = repository.getShortHead("test.path"); - -bool = repository.isSubmodule("test.path"); - -declare var aheadBehindCount: { ahead: number, behind: number }; -aheadBehindCount = repository.getAheadBehindCount("ref"); -aheadBehindCount = repository.getAheadBehindCount("ref", "test.path"); - -aheadBehindCount = repository.getCachedUpstreamAheadBehindCount(); -aheadBehindCount = repository.getCachedUpstreamAheadBehindCount("test.path"); - -str = repository.getConfigValue("username"); -str = repository.getConfigValue("username", "test.path"); - -str = repository.getOriginURL(); -str = repository.getOriginURL("test.path"); - -let upstreamBranch = repository.getUpstreamBranch(); -if (upstreamBranch) { - str = upstreamBranch; +// Color ====================================================================== +function testColor() { + str = color.toHexString(); + str = color.toRGBAString(); } -upstreamBranch = repository.getUpstreamBranch("test.path"); -if (upstreamBranch) { - str = upstreamBranch; +// CommandRegistry ============================================================ +function testCommandRegistry() { + atom.commands.add("test", "test:function", (event) => {}); + atom.commands.add("test", { + "test-function": (event) => {}, + "test-function2": (event) => {}, + }); + atom.commands.add("test", "test:function", { + didDispatch: (event) => event.stopImmediatePropagation(), + description: "A Command Test", + displayName: "Command: Test", + }); + + const commands = atom.commands.findCommands({ target: element }); + atom.commands.dispatch(element, "test:function"); + subscription = atom.commands.onWillDispatch((event) => { event.stopPropagation(); }); + subscription = atom.commands.onDidDispatch((event) => { event.cancelable; }); } -declare var gitReferences: { heads: string[], remotes: string[], tags: string[] }; -gitReferences = repository.getReferences(); -gitReferences = repository.getReferences("test.path"); +// CompositeDisposable ======================================================== +function testCompositeDisposable() { + // Construction and Lifecycle + subscriptions = new Atom.CompositeDisposable(); + new Atom.CompositeDisposable(subscription); + new Atom.CompositeDisposable(subscription, subscription); + new Atom.CompositeDisposable({ dispose() {} }); -str = repository.getReferenceTarget("ref"); -str = repository.getReferenceTarget("ref", "test.path"); + subscriptions.dispose(); -// Reading Status -bool = repository.isPathModified("file.path"); -bool = repository.isPathNew("file.path"); -bool = repository.isPathIgnored("file.path"); -num = repository.getDirectoryStatus("file.path"); -num = repository.getPathStatus("file.path"); + // Managing Disposables + subscriptions.add(subscription); + subscriptions.add( + subscription, + { dispose() {} } + ); -const cachedPathStatus = repository.getCachedPathStatus("file.path"); -if (cachedPathStatus) { - num = cachedPathStatus; + subscriptions.remove(subscription); + subscriptions.remove({ dispose() {} }); + + subscriptions.delete(subscription); + subscriptions.delete({ dispose() {} }); + + subscriptions.clear(); } -bool = repository.isStatusModified(42); -bool = repository.isStatusNew(42); +// Config ===================================================================== +function testConfig() { + atom.config.observe("test", (event) => {}); + atom.config.observe("test", { scope: scopeDescriptor }, (value) => {}); -// Retrieving Diffs -declare var diffStats: { added: number, deleted: number }; -diffStats = repository.getDiffStats("file.path"); + atom.config.onDidChange((event) => { event.newValue; }); + atom.config.onDidChange("test", (event) => { event.oldValue; }); -declare var lineDiffs: Array<{ oldStart: number, newStart: number, oldLines: number, - newLines: number }>; -lineDiffs = repository.getLineDiffs("file.path", "contents"); + // Managing Settings + atom.config.get("test"); + atom.config.get("test", { scope: scopeDescriptor }); + atom.config.get("test", { excludeSources: ["test.source"] }); + atom.config.get("test", { sources: ["test.source"] }); + atom.config.get("test", { scope: scopeDescriptor, excludeSources: ["a"], + sources: ["b"] }); -// Checking Out -bool = repository.checkoutHead("file.path"); -bool = repository.checkoutReference("ref", true); + atom.config.set("test", 42); + atom.config.set("test", 42, { scopeSelector: "test-selector" }); + atom.config.set("test", 42, { source: "test" }); + atom.config.set("test", 42, {scopeSelector: "test-selector", source: "test" }); -//// Grammar -- See 'first-mate' testing. -//// GrammarRegistry -- See 'first-mate' testing. -//// Gutter =================================================================== -// Gutter Destruction -gutter.destroy(); + atom.config.unset("test"); + atom.config.unset("test", { scopeSelector: "test-selector" }); + atom.config.unset("test", { source: "test" }); + atom.config.unset("test", { scopeSelector: "test-selector", source: "test" }); -// Event Subscription -sub = gutter.onDidChangeVisible(gutter => gutter.isVisible()); -sub = gutter.onDidDestroy(() => {}); + const allConfigValues = atom.config.getAll("test"); + for (const { scopeDescriptor, value } of allConfigValues) { + scopeDescriptor.scopes; + } + atom.config.getAll("test", { scope: scopeDescriptor }); + atom.config.getAll("test", { excludeSources: ["test"] }); + atom.config.getAll("test", { sources: ["test"] }); + atom.config.getAll("test", { scope: scopeDescriptor, excludeSources: ["a"], + sources: ["b"] }); -// Visibility -gutter.hide(); -gutter.show(); -bool = gutter.isVisible(); -decoration = gutter.decorateMarker(displayMarker, { type: "line-number" }); + strs = atom.config.getSources(); -//// HistoryManager =========================================================== -historyPaths = atom.history.getProjects(); -atom.history.clearProjects(); -sub = atom.history.onDidChangeProjects(() => {}); + atom.config.getSchema("test"); -//// KeymapManager -- See 'atom-keymap' testing. -//// LayerDecoration ========================================================== -layerDecoration.destroy(); -bool = layerDecoration.isDestroyed(); -layerDecoration.getProperties(); -declare let decorationLayerProps: Atom.Structures.DecorationLayerProps; -layerDecoration.setProperties(decorationLayerProps); -layerDecoration.setPropertiesForMarker(marker, { type: "line", class: "test-class" }); + str = atom.config.getUserConfigPath(); -//// MarkerLayer -- See 'text-buffer' testing. -//// MenuManager ============================================================== -sub = atom.menu.add([ - { - label: "Hello", - submenu : [{ label: "World!", command: "hello:world" }], - }, -]); -atom.menu.update(); - -//// Notification ============================================================= -notification = new Notification("fatal", "Test"); -notification = new Notification("success", "Test", {}); -notification = new Notification("info", "Test", { - buttons: [ - { className: "Test", text: "Test", onDidClick: () => {}}, - ], - description: "Test", - detail: "Test", - dismissable: false, - icon: "Test", -}); - -// Event Subscription -sub = notification.onDidDismiss(notification => notification.dismissed); -sub = notification.onDidDisplay(notification => notification.timestamp); - -// Methods -str = notification.getType(); -str = notification.getMessage(); - -// Extended Methods -notification.dismiss(); - -//// NotificationManager ====================================================== -// Events -atom.notifications.onDidAddNotification(notification => notification.dismiss()); - -// Adding Notifications -atom.notifications.addSuccess("Test"); -atom.notifications.addSuccess("Test", {}); -atom.notifications.addSuccess("Test", { - description: "Desc", - detail: "Details", - dismissable: true, - icon: "Icon", - buttons: [{ - text: "Button", - onDidClick: () => {}, - className: "test-class", - }], -}); - -atom.notifications.addInfo("Test"); -atom.notifications.addInfo("Test", {}); -atom.notifications.addInfo("Test", { description: "Desc" }); - -atom.notifications.addWarning("Test"); -atom.notifications.addWarning("Test", {}); -atom.notifications.addWarning("Test", { description: "Desc" }); - -atom.notifications.addError("Test"); -atom.notifications.addError("Test", {}); -atom.notifications.addError("Test", { stack: "Stack" }); - -atom.notifications.addFatalError("Test"); -atom.notifications.addFatalError("Test", {}); -atom.notifications.addFatalError("Test", { stack: "Stack" }); - -// Getting Notifications -notifications = atom.notifications.getNotifications(); - -//// Package ================================================================== -// Event Subscription -pack.onDidDeactivate(() => {}); - -// Native Module Compatibility -bool = pack.isCompatible(); -declare let exitInfo: Promise<{ code: number, stderr: string, stdout: string }>; -exitInfo = pack.rebuild(); - -const buildFailureOutput = pack.getBuildFailureOutput(); -if (buildFailureOutput) { - str = buildFailureOutput; + atom.config.transact(() => {}); } -//// PackageManager ===========================================================\ -// Event Subscription -sub = atom.packages.onDidLoadInitialPackages(() => {}); -sub = atom.packages.onDidActivateInitialPackages(() => {}); -sub = atom.packages.onDidActivatePackage(pack => pack.name); -sub = atom.packages.onDidDeactivatePackage(pack => pack.path); -sub = atom.packages.onDidLoadPackage(pack => pack.isCompatible()); -sub = atom.packages.onDidUnloadPackage(pack => pack.bundledPackage); +// Cursor ===================================================================== +function testCursor() { + // Event Subscription + subscription = cursor.onDidChangePosition((event) => { event.newBufferPosition; }); + subscription = cursor.onDidDestroy(() => {}); -// Package system data -str = atom.packages.getApmPath(); -strs = atom.packages.getPackageDirPaths(); + // Managing Cursor Position + cursor.setScreenPosition(pos); + cursor.setScreenPosition(pos, {}); + cursor.setScreenPosition(pos, { autoscroll: true }); -// General package data -const packagePath = atom.packages.resolvePackagePath("Test"); -if (packagePath) { - str = packagePath; + pos = cursor.getScreenPosition(); + + cursor.setBufferPosition(pos); + cursor.setBufferPosition(pos, {}); + cursor.setBufferPosition(pos, { autoscroll: true }); + + pos = cursor.getBufferPosition(); + num = cursor.getScreenRow(); + num = cursor.getScreenColumn(); + num = cursor.getBufferRow(); + num = cursor.getBufferColumn(); + str = cursor.getCurrentBufferLine(); + bool = cursor.isAtBeginningOfLine(); + bool = cursor.isAtEndOfLine(); + + // Cursor Position Details + displayMarker = cursor.getMarker(); + bool = cursor.isSurroundedByWhitespace(); + bool = cursor.isBetweenWordAndNonWord(); + + bool = cursor.isInsideWord(); + bool = cursor.isInsideWord({}); + bool = cursor.isInsideWord({ wordRegex: regExp }); + + num = cursor.getIndentLevel(); + scopeDescriptor = cursor.getScopeDescriptor(); + bool = cursor.hasPrecedingCharactersOnLine(); + bool = cursor.isLastCursor(); + + // Moving the Cursor + cursor.moveUp(); + cursor.moveUp(42); + cursor.moveUp(42, {}); + cursor.moveUp(42, { moveToEndOfSelection: true }); + + cursor.moveDown(); + cursor.moveDown(42); + cursor.moveDown(42, {}); + cursor.moveDown(42, { moveToEndOfSelection: true }); + + cursor.moveLeft(); + cursor.moveLeft(42); + cursor.moveLeft(42, {}); + cursor.moveLeft(42, { moveToEndOfSelection: true }); + + cursor.moveRight(); + cursor.moveRight(42); + cursor.moveRight(42, {}); + cursor.moveRight(42, { moveToEndOfSelection: true }); + + cursor.moveToTop(); + cursor.moveToBottom(); + cursor.moveToBeginningOfScreenLine(); + cursor.moveToBeginningOfLine(); + cursor.moveToFirstCharacterOfLine(); + cursor.moveToEndOfScreenLine(); + cursor.moveToEndOfLine(); + cursor.moveToBeginningOfWord(); + cursor.moveToEndOfWord(); + cursor.moveToBeginningOfNextWord(); + cursor.moveToPreviousWordBoundary(); + cursor.moveToNextWordBoundary(); + cursor.moveToPreviousSubwordBoundary(); + cursor.moveToNextSubwordBoundary(); + cursor.skipLeadingWhitespace(); + cursor.moveToBeginningOfNextParagraph(); + cursor.moveToBeginningOfPreviousParagraph(); + + // Local Positions and Ranges + pos = cursor.getPreviousWordBoundaryBufferPosition(); + pos = cursor.getPreviousWordBoundaryBufferPosition({}); + pos = cursor.getPreviousWordBoundaryBufferPosition({ wordRegex: regExp }); + + cursor.getNextWordBoundaryBufferPosition(); + cursor.getNextWordBoundaryBufferPosition({ wordRegex: regExp }); + + cursor.getBeginningOfCurrentWordBufferPosition(); + cursor.getBeginningOfCurrentWordBufferPosition({}); + cursor.getBeginningOfCurrentWordBufferPosition({ wordRegex: regExp }); + cursor.getBeginningOfCurrentWordBufferPosition({ allowPrevious: true }); + cursor.getBeginningOfCurrentWordBufferPosition({ includeNonWordCharacters: true }); + cursor.getBeginningOfCurrentWordBufferPosition({ wordRegex: regExp, + allowPrevious: true, includeNonWordCharacters: true }); + + cursor.getEndOfCurrentWordBufferPosition(); + cursor.getEndOfCurrentWordBufferPosition({}); + cursor.getEndOfCurrentWordBufferPosition({ wordRegex: regExp }); + cursor.getEndOfCurrentWordBufferPosition({ includeNonWordCharacters: true }); + cursor.getEndOfCurrentWordBufferPosition({ wordRegex: regExp, includeNonWordCharacters: + true }); + + cursor.getBeginningOfNextWordBufferPosition(); + cursor.getBeginningOfNextWordBufferPosition({}); + cursor.getBeginningOfNextWordBufferPosition({ wordRegex: regExp }); + + cursor.getCurrentWordBufferRange(); + cursor.getCurrentWordBufferRange({}); + cursor.getCurrentWordBufferRange({ wordRegex: regExp }); + + cursor.getCurrentLineBufferRange(); + cursor.getCurrentLineBufferRange({}); + cursor.getCurrentLineBufferRange({ includeNewline: true }); + + range = cursor.getCurrentParagraphBufferRange(); + str = cursor.getCurrentWordPrefix(); + + // Comparing to another cursor + num = cursor.compare(cursor); + + // Utilities + cursor.clearSelection(); + + regExp = cursor.wordRegExp(); + regExp = cursor.wordRegExp({}); + regExp = cursor.wordRegExp({ includeNonWordCharacters: true }); + + regExp = cursor.subwordRegExp(); + regExp = cursor.subwordRegExp({}); + regExp = cursor.subwordRegExp({ backwards: true }); } -bool = atom.packages.isBundledPackage("Test"); - -// Enabling and disabling packages -let potentialPack = atom.packages.enablePackage("Test"); -if (potentialPack) { - pack = potentialPack; +// TestRunner ================================================================= +function testTestRunner() { + const testRunner: Atom.TestRunner = (params) => { + const delegate = params.buildDefaultApplicationDelegate(); + const environment = params.buildAtomEnvironment({ + applicationDelegate: delegate, + configDirPath: "/var/test", + document, + enablePersistence: false, + window, + }); + const { width, height } = environment.getSize(); + return Promise.resolve(width + height); + }; } -potentialPack = atom.packages.disablePackage("Test"); -if (potentialPack) { - pack = potentialPack; +// Decoration ================================================================= +function testDecoration() { + // Construction and Destruction + decoration.destroy(); + + // Event Subscription + subscription = decoration.onDidChangeProperties(event => { event.oldProperties.gutterName; }); + subscription = decoration.onDidDestroy(() => {}); + + // Decoration Details + num = decoration.getId(); + displayMarker = decoration.getMarker(); + + // Properties + const decorationProps = decoration.getProperties(); + + decoration.setProperties(decorationProps); } -bool = atom.packages.isPackageDisabled("Test"); +// DeserializerManager ======================================================== +function testDesializerManager() { + class StorableClass { + name: string; -// Accessing active packages -packs = atom.packages.getActivePackages(); + constructor() {} + deserialize() { return {}; } + } -potentialPack = atom.packages.getActivePackage("Test"); -if (potentialPack) { - pack = potentialPack; + function isStorableClass(o: object): o is StorableClass { + if (typeof o === "object" && ( o).name && + ( o).name === "test") { + return true; + } else { + return false; + } + } + + let serializable = new StorableClass(); + atom.deserializers.add(serializable); + const blob = atom.deserializers.deserialize({ name: "test" }); + if (blob && isStorableClass(blob)) serializable = blob; } -bool = atom.packages.isPackageActive("Test"); -bool = atom.packages.hasActivatedInitialPackages(); +// Directory ================================================================== +function testDirectory() { + // Construction + dir = new Atom.Directory("Test.file"); + new Atom.Directory("Test.file", true); -// Accessing loaded packages -packs = atom.packages.getLoadedPackages(); + async function createDirectory() { + bool = await dir.create(); + bool = await dir.create(0o0777); + } -potentialPack = atom.packages.getLoadedPackage("Test"); -if (potentialPack) { - pack = potentialPack; + // Event Subscription + subscription = dir.onDidChange(() => {}); + + // Directory Metadata + bool = dir.isFile(); + bool = dir.isDirectory(); + bool = dir.isSymbolicLink(); + + async function directoryExists() { + bool = await dir.exists(); + } + + bool = dir.existsSync(); + bool = dir.isRoot(); + + // Managing Paths + str = dir.getPath(); + str = dir.getRealPathSync(); + str = dir.getBaseName(); + dir.relativize("Test.file") ; + + // Traversing + dir = dir.getParent(); + file = dir.getFile("Test.file"); + dir = dir.getSubdirectory("Test"); + dir.getEntriesSync(); + dir.getEntries((error, entries) => {}); + bool = dir.contains("Test.file"); } -bool = atom.packages.isPackageLoaded("Test"); -bool = atom.packages.hasLoadedInitialPackages(); +// DisplayMarker ============================================================== +function testDisplayMarker() { + // Construction and Destruction + displayMarker.destroy(); -// Accessing available packages -strs = atom.packages.getAvailablePackagePaths(); -strs = atom.packages.getAvailablePackageNames(); -strs = atom.packages.getAvailablePackageMetadata(); + displayMarker = displayMarker.copy(); + displayMarker = displayMarker.copy({}); + displayMarker = displayMarker.copy({ + tailed: true, + reversed: false, + invalidate: "never", + exclusive: false, + properties: { deprecated: "property" }, + }); -//// Pane ===================================================================== -// Event Subscription -sub = pane.onDidChangeFlexScale(scale => num = scale); -sub = pane.observeFlexScale(scale => num = scale); -sub = pane.onDidActivate(() => {}); -sub = pane.onWillDestroy(() => {}); -sub = pane.onDidDestroy(() => {}); -sub = pane.onDidChangeActive(active => bool = active); -sub = pane.observeActive(active => bool = active); -sub = pane.onDidAddItem(event => event.index && event.item); -sub = pane.onDidRemoveItem(event => event.index && event.item); -sub = pane.onWillRemoveItem(event => event.index && event.item); -sub = pane.onDidMoveItem(event => event.item && event.oldIndex && event.newIndex); -sub = pane.observeItems((item) => {}); -sub = pane.onDidChangeActiveItem((item) => {}); -sub = pane.onChooseNextMRUItem((item) => {}); -sub = pane.onChooseLastMRUItem((item) => {}); -sub = pane.onDoneChoosingMRUItem(() => {}); -sub = pane.observeActiveItem((item) => {}); -sub = pane.onWillDestroyItem(event => event.index && event.item); + // Event Subscription + subscription = displayMarker.onDidChange((event) => { event.hasTail; }); + subscription = displayMarker.onDidDestroy(() => {}); -// Items -objs = pane.getItems(); -obj = pane.getActiveItem(); + // TextEditorMarker Details + bool = displayMarker.isValid(); + bool = displayMarker.isDestroyed(); + bool = displayMarker.isReversed(); + bool = displayMarker.isExclusive(); + str = displayMarker.getInvalidationStrategy(); + obj = displayMarker.getProperties(); + displayMarker.setProperties(obj); -let potentialItem = pane.itemAtIndex(42); -if (potentialItem) { - obj = potentialItem; + bool = displayMarker.matchesProperties({ + startBufferPosition: pos, + endBufferPosition: pos, + startScreenPosition: pos, + endScreenPosition: pos, + startsInBufferRange: range, + endsInBufferRange: range, + startsInScreenRange: range, + endsInScreenRange: range, + startBufferRow: num, + endBufferRow: num, + startScreenRow: num, + endScreenRow: num, + intersectsBufferRowRange: [num, num], + intersectsScreenRowRange: [num, num], + containsBufferRange: range, + containsBufferPosition: pos, + containedInBufferRange: range, + containedInScreenRange: range, + intersectsBufferRange: range, + intersectsScreenRange: range, + }); + bool = displayMarker.matchesProperties({ + intersectsBufferRange: [pos, pos], + }); + bool = displayMarker.matchesProperties({ + intersectsBufferRange: [pos, [0, 0]], + }); + bool = displayMarker.matchesProperties({ + intersectsBufferRange: [[0, 0], pos], + }); + bool = displayMarker.matchesProperties({ + intersectsBufferRange: [[0, 0], [0, 0]], + }); + + // Comparing to other markers + num = displayMarker.compare(displayMarker); + bool = displayMarker.isEqual(displayMarker); + + // Managing the marker's range + range = displayMarker.getBufferRange(); + range = displayMarker.getScreenRange(); + + displayMarker.setBufferRange(range); + displayMarker.setBufferRange([pos, pos]); + displayMarker.setBufferRange([pos, [0, 0]]); + displayMarker.setBufferRange([[0, 0], pos]); + displayMarker.setBufferRange([[0, 0], [0, 0]]); + displayMarker.setBufferRange(range, { reversed: true }); + + displayMarker.setScreenRange(range); + displayMarker.setScreenRange([pos, pos]); + displayMarker.setScreenRange([pos, [0, 0]]); + displayMarker.setScreenRange([[0, 0], pos]); + displayMarker.setScreenRange([[0, 0], [0, 0]]); + displayMarker.setScreenRange(range, { reversed: false }); + + pos = displayMarker.getStartScreenPosition(); + pos = displayMarker.getStartScreenPosition({ clipDirection: "backward" }); + + pos = displayMarker.getEndScreenPosition(); + pos = displayMarker.getEndScreenPosition({ clipDirection: "forward" }); + + // Extended Methods + pos = displayMarker.getHeadBufferPosition(); + displayMarker.setHeadBufferPosition(pos); + + displayMarker.getHeadScreenPosition(); + displayMarker.getHeadScreenPosition({ clipDirection: "closest" }); + + displayMarker.setHeadScreenPosition(pos); + displayMarker.setHeadScreenPosition([0, 0]); + displayMarker.setHeadScreenPosition(pos, { clipDirection: "backward" }); + + pos = displayMarker.getTailBufferPosition(); + + displayMarker.setTailBufferPosition(pos); + displayMarker.setTailBufferPosition([0, 0]); + + pos = displayMarker.getTailScreenPosition(); + pos = displayMarker.getTailScreenPosition({ clipDirection: "forward" }); + + displayMarker.setTailScreenPosition(pos); + displayMarker.setTailScreenPosition([0, 0]); + displayMarker.setTailScreenPosition(pos, { clipDirection: "closest" }); + + pos = displayMarker.getStartBufferPosition(); + pos = displayMarker.getEndBufferPosition(); + bool = displayMarker.hasTail(); + displayMarker.plantTail(); + displayMarker.clearTail(); } -pane.activateNextItem(); -pane.activatePreviousItem(); -pane.moveItemRight(); -pane.moveItemLeft(); -num = pane.getActiveItemIndex(); -pane.activateItemAtIndex(42); +// DisplayMarkerLayer ========================================================= +function testDisplayMarkerLayer() { + // Lifecycle + displayMarkerLayer.destroy(); + displayMarkerLayer.clear(); + bool = displayMarkerLayer.isDestroyed(); -pane.activateItem(element); -pane.activateItem(element, { pending: true }); + // Event Subscription + subscription = displayMarkerLayer.onDidDestroy(() => {}); + subscription = displayMarkerLayer.onDidUpdate(() => {}); + subscription = displayMarkerLayer.onDidCreateMarker((marker) => { marker.isReversed(); }); -obj = pane.addItem(element); -obj = pane.addItem(element, {}); -obj = pane.addItem(element, { pending: true }); -obj = pane.addItem(element, { index: 42 }); -obj = pane.addItem(element, { pending: true, index: 42 }); + // Marker creation + displayMarker = displayMarkerLayer.markScreenRange(range); + displayMarker = displayMarkerLayer.markScreenRange(range, {}); + displayMarker = displayMarkerLayer.markScreenRange(range, { clipDirection: "forward" }); + displayMarker = displayMarkerLayer.markScreenRange(range, { exclusive: true }); + displayMarker = displayMarkerLayer.markScreenRange(range, { invalidate: "never" }); + displayMarker = displayMarkerLayer.markScreenRange(range, { reversed: true }); + displayMarker = displayMarkerLayer.markScreenRange(range, { clipDirection: "backward", + exclusive: false, invalidate: "overlap", reversed: false }); + displayMarker = displayMarkerLayer.markScreenRange([pos, pos]); + displayMarker = displayMarkerLayer.markScreenRange([pos, [0, 0]]); + displayMarker = displayMarkerLayer.markScreenRange([[0, 0], pos]); + displayMarker = displayMarkerLayer.markScreenRange([[0, 0], [0, 0]]); + displayMarker = displayMarkerLayer.markScreenRange([[0, 0], pos], { reversed: true }); -objs = pane.addItems(objs); -objs = pane.addItems(objs, 42); + displayMarker = displayMarkerLayer.markScreenPosition(pos); + displayMarker = displayMarkerLayer.markScreenPosition(pos, {}); + displayMarker = displayMarkerLayer.markScreenPosition(pos, { clipDirection: "forward" }); + displayMarker = displayMarkerLayer.markScreenPosition(pos, { exclusive: true }); + displayMarker = displayMarkerLayer.markScreenPosition(pos, { invalidate: "never" }); + displayMarker = displayMarkerLayer.markScreenPosition(pos, { clipDirection: "backward", + exclusive: false, invalidate: "overlap" }); + displayMarker = displayMarkerLayer.markScreenPosition([0, 0]); + displayMarker = displayMarkerLayer.markScreenPosition([0, 0], { exclusive: false }); -pane.moveItem(element, 42); -pane.moveItemToPane(element, pane, 42); -pane.destroyActiveItem(); + displayMarker = displayMarkerLayer.markBufferRange(range); + displayMarker = displayMarkerLayer.markBufferRange(range, {}); + displayMarker = displayMarkerLayer.markBufferRange(range, { invalidate: "inside" }); + displayMarker = displayMarkerLayer.markBufferRange(range, { exclusive: true }); + displayMarker = displayMarkerLayer.markBufferRange(range, { reversed: true }); + displayMarker = displayMarkerLayer.markBufferRange(range, { exclusive: false, + invalidate: "overlap", reversed: false }); + displayMarker = displayMarkerLayer.markBufferRange([pos, pos]); + displayMarker = displayMarkerLayer.markBufferRange([pos, [0, 0]]); + displayMarker = displayMarkerLayer.markBufferRange([[0, 0], pos]); + displayMarker = displayMarkerLayer.markBufferRange([[0, 0], [0, 0]]); + displayMarker = displayMarkerLayer.markBufferRange([[0, 0], pos], { reversed: true }); -async function destroyAndWait() { - bool = await pane.destroyItem(element); - bool = await pane.destroyItem(element, true); + displayMarker = displayMarkerLayer.markBufferPosition(pos); + displayMarker = displayMarkerLayer.markBufferPosition(pos, {}); + displayMarker = displayMarkerLayer.markBufferPosition(pos, { exclusive: true }); + displayMarker = displayMarkerLayer.markBufferPosition(pos, { invalidate: "never" }); + displayMarker = displayMarkerLayer.markBufferPosition(pos, { exclusive: false, + invalidate: "overlap" }); + displayMarker = displayMarkerLayer.markBufferPosition([0, 0]); + displayMarker = displayMarkerLayer.markBufferPosition([0, 0], { exclusive: false }); + + // Querying + displayMarker = displayMarkerLayer.getMarker(42); + displayMarkers = displayMarkerLayer.getMarkers(); + num = displayMarkerLayer.getMarkerCount(); + + displayMarkers = displayMarkerLayer.findMarkers({ + startBufferPosition: pos, + endBufferPosition: pos, + startScreenPosition: pos, + endScreenPosition: pos, + startsInBufferRange: range, + endsInBufferRange: range, + startsInScreenRange: range, + endsInScreenRange: range, + startBufferRow: num, + endBufferRow: num, + startScreenRow: num, + endScreenRow: num, + intersectsBufferRowRange: [num, num], + intersectsScreenRowRange: [num, num], + containsBufferRange: range, + containsBufferPosition: pos, + containedInBufferRange: range, + containedInScreenRange: range, + intersectsBufferRange: range, + intersectsScreenRange: range, + }); + displayMarkers = displayMarkerLayer.findMarkers({ + intersectsScreenRange: [pos, pos], + }); + displayMarkers = displayMarkerLayer.findMarkers({ + intersectsScreenRange: [pos, [0, 0]], + }); + displayMarkers = displayMarkerLayer.findMarkers({ + intersectsScreenRange: [[0, 0], pos], + }); + displayMarkers = displayMarkerLayer.findMarkers({ + intersectsScreenRange: [[0, 0], [0, 0]], + }); } -pane.destroyItems(); -pane.destroyInactiveItems(); - -async function savePaneItem() { - await pane.saveActiveItem(); - let actionReturn = await pane.saveActiveItem(() => true); - if (actionReturn) bool = actionReturn; - - await pane.saveActiveItemAs(() => {}); - actionReturn = await pane.saveActiveItemAs(() => false); - - await pane.saveItem(element, () => {}); - let altActionReturn = await pane.saveItem(element, () => 42); - if (altActionReturn) num = altActionReturn; - - await pane.saveItemAs(element, () => {}); - altActionReturn = await pane.saveItemAs(element, () => 42); +// Disposable ================================================================= +function testDisposable() { + if (subscription.disposalAction) subscription.disposalAction(); + subscription.dispose(); } -pane.saveItems(); +// Dock ======================================================================= +function testDock() { + // Methods + dock.activate(); + dock.show(); + dock.hide(); + dock.toggle(); + bool = dock.isVisible(); -potentialItem = pane.itemForURI("https://test"); -if (potentialItem) { - obj = potentialItem; + // Event Subscription + subscription = dock.observePaneItems(() => {}); + subscription = dock.onDidChangeActivePaneItem(() => {}); + subscription = dock.onDidStopChangingActivePaneItem(() => {}); + subscription = dock.observeActivePaneItem(() => {}); + subscription = dock.onDidAddPane(event => event.pane.activate()); + subscription = dock.onWillDestroyPane(event => event.pane); + subscription = dock.onDidDestroyPane(event => event.pane); + subscription = dock.observePanes(pane => pane.activate()); + subscription = dock.onDidChangeActivePane(pane => pane.activate()); + subscription = dock.observeActivePane(pane => pane.activate()); + subscription = dock.onDidAddPaneItem(event => event.index && event.item && event.pane); + subscription = dock.onWillDestroyPaneItem(event => { + event.index && event.item && event.pane; + }); + subscription = dock.onDidDestroyPaneItem(event => { + event.index && event.item && event.pane; + }); + + // Pane Items + objs = dock.getPaneItems(); + obj = dock.getActivePaneItem(); + + // Panes + panes = dock.getPanes(); + pane = dock.getActivePane(); + bool = dock.activateNextPane(); + bool = dock.activatePreviousPane(); } -bool = pane.activateItemForURI("https://test"); +// Emitter ==================================================================== +function testEmitter() { + emitter = new Atom.Emitter(); -// Lifecycle -bool = pane.isActive(); -pane.activate(); -pane.destroy(); -bool = pane.isDestroyed(); + emitter.clear(); + emitter.dispose(); -// Splitting -pane = pane.splitLeft(); -pane = pane.splitLeft({}); -pane = pane.splitLeft({ copyActiveItem: true }); -pane = pane.splitLeft({ items: elements }); -pane = pane.splitLeft({ copyActiveItem: true, items: elements }); + // Event Subscription + subscription = emitter.on("test-event", value => {}); + emitter.once("test-event", value => {}); + subscription = emitter.preempt("test-event", value => {}); -pane = pane.splitRight(); -pane = pane.splitRight({}); -pane = pane.splitRight({ copyActiveItem: true }); -pane = pane.splitRight({ items: elements }); -pane = pane.splitRight({ copyActiveItem: true, items: elements }); - -pane = pane.splitUp(); -pane = pane.splitUp({}); -pane = pane.splitUp({ copyActiveItem: true }); -pane = pane.splitUp({ items: elements }); -pane = pane.splitUp({ copyActiveItem: true, items: elements }); - -pane = pane.splitDown(); -pane = pane.splitDown({}); -pane = pane.splitDown({ copyActiveItem: true }); -pane = pane.splitDown({ items: elements }); -pane = pane.splitDown({ copyActiveItem: true, items: elements }); - -//// Panel ==================================================================== -// Methods -panel.destroy(); - -// Event Subscription -sub = panel.onDidChangeVisible(visible => bool = visible); -sub = panel.onDidDestroy(panel => bool = panel.isVisible()); - -// Panel Details -obj = panel.getItem(); -num = panel.getPriority(); -bool = panel.isVisible(); -panel.hide(); -panel.show(); - -//// PathWatcher ============================================================== -pathWatcher.dispose(); -sub = pathWatcher.onDidError((error) => str = error.name); - -async function waitForPathWatcher() { - await pathWatcher.getStartPromise(); + // Event Emission + emitter.emit("test-event"); + emitter.emit("test-event", 42); } -//// Point -- See 'text-buffer' testing. -//// Project ================================================================== -// Event Subscription -sub = project.onDidChangePaths(paths => paths.length); +// File ======================================================================= +function testFile() { + // Construction + file = new Atom.File("Test.file"); + new Atom.File("Test.file", false); -sub = project.onDidChangeFiles(events => { - for (const event of events) { - str = event.action; - } -}); + async function fileCreation() { + bool = await file.create(); + } -sub = project.onDidAddBuffer(buffer => buffer.id); -sub = project.observeBuffers(buffer => buffer.file); + // Event Subscription + subscription = file.onDidChange(() => {}); + subscription = file.onDidRename(() => {}); + subscription = file.onDidDelete(() => {}); + subscription = file.onWillThrowWatchError(() => {}); -// Accessing the git repository -repositories = project.getRepositories(); + // File Metadata + bool = file.isFile(); + bool = file.isDirectory(); + bool = file.isSymbolicLink(); -async function getDirectoryRepo() { - const potentialRepo = await project.repositoryForDirectory(dir); - if (potentialRepo) repository = potentialRepo; + async function fileExists() { + bool = await file.exists(); + } + + bool = file.existsSync(); + + async function getFileDigest() { + str = await file.getDigest(); + } + + str = file.getDigestSync(); + file.setEncoding("utf8"); + str = file.getEncoding(); + + // Managing Paths + str = file.getPath(); + str = file.getRealPathSync(); + + async function getFileRealPath() { + str = await file.getRealPath(); + } + + str = file.getBaseName(); + + // Traversing + dir = file.getParent(); + + // Reading and Writing + async function readFile() { + str = await file.read(); + } + + const stream = file.createReadStream(); + stream.close(); + + async function writeFile() { + await file.write("Test"); + } + + file.createWriteStream(); + file.writeSync("Test"); } -// Managing Paths -strs = project.getPaths(); -project.setPaths(["a", "b"]); -project.addPath("Test"); +// GitRepository ============================================================== +function testGitRepository() { + // Construction and Destruction + repository = new Atom.GitRepository("Test"); + repository = new Atom.GitRepository("Test", {}); + repository = new Atom.GitRepository("Test", { refreshOnWindowFocus: true }); + repository = new Atom.GitRepository("Test", { config: atom.config }); + repository = new Atom.GitRepository("Test", { project: atom.project }); + repository = new Atom.GitRepository("Test", { refreshOnWindowFocus: false, config: atom.config, + project: atom.project }); + repository.destroy(); + bool = repository.isDestroyed(); -async function initWatcher() { - await project.getWatcherPromise("/var/test"); + // Event Subscription + subscription = repository.onDidDestroy(() => {}); + subscription = repository.onDidChangeStatus(event => event.path && event.pathStatus); + subscription = repository.onDidChangeStatuses(() => {}); + + // Repository Details + repository.getType(); + str = repository.getPath(); + str = repository.getWorkingDirectory(); + bool = repository.isProjectAtRoot(); + str = repository.relativize(); + bool = repository.hasBranch("master"); + + str = repository.getShortHead(); + str = repository.getShortHead("test.path"); + + bool = repository.isSubmodule("test.path"); + + let aheadBehindCount: { ahead: number, behind: number }; + aheadBehindCount = repository.getAheadBehindCount("ref"); + aheadBehindCount = repository.getAheadBehindCount("ref", "test.path"); + + aheadBehindCount = repository.getCachedUpstreamAheadBehindCount(); + aheadBehindCount = repository.getCachedUpstreamAheadBehindCount("test.path"); + + str = repository.getConfigValue("username"); + str = repository.getConfigValue("username", "test.path"); + + str = repository.getOriginURL(); + str = repository.getOriginURL("test.path"); + + let upstreamBranch = repository.getUpstreamBranch(); + if (upstreamBranch) { + str = upstreamBranch; + } + + upstreamBranch = repository.getUpstreamBranch("test.path"); + if (upstreamBranch) { + str = upstreamBranch; + } + + let gitReferences: { heads: string[], remotes: string[], tags: string[] }; + gitReferences = repository.getReferences(); + gitReferences = repository.getReferences("test.path"); + + str = repository.getReferenceTarget("ref"); + str = repository.getReferenceTarget("ref", "test.path"); + + // Reading Status + bool = repository.isPathModified("file.path"); + bool = repository.isPathNew("file.path"); + bool = repository.isPathIgnored("file.path"); + num = repository.getDirectoryStatus("file.path"); + num = repository.getPathStatus("file.path"); + + const cachedPathStatus = repository.getCachedPathStatus("file.path"); + if (cachedPathStatus) { + num = cachedPathStatus; + } + + bool = repository.isStatusModified(42); + bool = repository.isStatusNew(42); + + // Retrieving Diffs + let diffStats: { added: number, deleted: number }; + diffStats = repository.getDiffStats("file.path"); + + let lineDiffs: Array<{ oldStart: number, newStart: number, oldLines: number, + newLines: number }>; + lineDiffs = repository.getLineDiffs("file.path", "contents"); + + // Checking Out + bool = repository.checkoutHead("file.path"); + bool = repository.checkoutReference("ref", true); } -project.removePath("Test"); -dirs = project.getDirectories(); +// Grammar ==================================================================== +function testGrammar() { + subscription = grammar.onDidUpdate(() => {}); -const [projectPath, relativePath] = project.relativizePath("Test"); -if (projectPath) { - str = projectPath; + const tokenizeLinesResult = grammar.tokenizeLines("Test String"); + for (const tokenizedLine of tokenizeLinesResult) { + for (const token of tokenizedLine) { + token.scopes; + token.value; + } + } + + grammar.tokenizeLine("Test String"); + const tokenizeLineResult = grammar.tokenizeLine("Test String", null, false); + tokenizeLineResult.line; + tokenizeLineResult.tags; + tokenizeLineResult.tokens; + grammar.tokenizeLine("Test String", tokenizeLineResult.ruleStack); + grammar.tokenizeLine("Test String", tokenizeLineResult.ruleStack, false); } -str = relativePath; -bool = project.contains("Test"); +// GrammarRegistry ============================================================ +function testGrammarRegistry() { + // Event Subscription + subscription = registry.onDidAddGrammar(grammar => grammar.name); + subscription = registry.onDidUpdateGrammar(grammar => grammar.name); -//// Range -- See 'text-buffer' testing. -//// ScopeDescriptor ========================================================== + // Managing Grammars + grammars = registry.getGrammars(); + + let potentialGrammar = registry.grammarForScopeName("scope.test"); + if (potentialGrammar) grammar = potentialGrammar; + + subscription = registry.addGrammar(grammar); + + potentialGrammar = registry.removeGrammarForScopeName("scope.test"); + + grammar = registry.readGrammarSync("/test/path"); + + registry.readGrammar("/test/path", (error, grammar) => { + if (grammar) { + grammar.name; + } else { + if (error) error.name; + } + }); + + grammar = registry.loadGrammarSync("/test/path"); + + registry.loadGrammar("/test/path", (error, grammar) => { + if (grammar) { + grammar.name; + } else { + if (error) error.name; + } + }); +} + +// Gutter ===================================================================== +function testGutter() { + // Gutter Destruction + gutter.destroy(); + + // Event Subscription + subscription = gutter.onDidChangeVisible(gutter => gutter.isVisible()); + subscription = gutter.onDidDestroy(() => {}); + + // Visibility + gutter.hide(); + gutter.show(); + bool = gutter.isVisible(); + decoration = gutter.decorateMarker(displayMarker, { type: "line-number" }); +} + +// HistoryManager ============================================================= +function testHistoryManager() { + historyPaths = atom.history.getProjects(); + atom.history.clearProjects(); + subscription = atom.history.onDidChangeProjects(() => {}); +} + +// KeymapManager ============================================================== +function testKeymapManager() { + const manager = atom.keymaps; + manager.clear(); + manager.destroy(); + + // Event Subscription + subscription = manager.onDidMatchBinding((event): void => { event.keystrokes; }); + subscription = manager.onDidPartiallyMatchBindings((event): void => { + event.partiallyMatchedBindings; }); + subscription = manager.onDidFailToMatchBinding((event): void => { event.keystrokes; }); + subscription = manager.onDidFailToReadFile((event): void => { event.stack; }); + + // Adding and Removing Bindings + subscription = manager.add("a", {}, 0); + + // Accessing Bindings + let bindings: Atom.KeyBinding[] = manager.getKeyBindings(); + bindings = manager.findKeyBindings(); + bindings = manager.findKeyBindings({ command: "a" }); + bindings = manager.findKeyBindings({ keystrokes: "a" }); + bindings = manager.findKeyBindings({ target: element }); + bindings = manager.findKeyBindings({ command: "a", keystrokes: "b"}); + bindings = manager.findKeyBindings({ command: "a", keystrokes: "b", target: element }); + + // Managing Keymap Files + manager.loadKeymap("Test.file"); + manager.loadKeymap("Test.file", { watch: true }); + manager.loadKeymap("Test.file", { watch: true, priority: 0}); + + // Managing Keyboard Events + manager.handleKeyboardEvent(event); + manager.keystrokeForKeyboardEvent(event); + + subscription = manager.addKeystrokeResolver((event): string => { + event.layoutName; + return "Test"; + }); + + const num: number = manager.getPartialMatchTimeout(); +} + +// LayerDecoration ============================================================ +function testLayerDecoration() { + layerDecoration.destroy(); + bool = layerDecoration.isDestroyed(); + layerDecoration.getProperties(); + layerDecoration.setProperties(decorationLayerProps); + layerDecoration.setPropertiesForMarker(marker, { type: "line", class: "test-class" }); +} + +// Marker ===================================================================== +function testMarker() { + // Properties + num = marker.id; + + // Lifecycle + marker = marker.copy({ + tailed: true, + reversed: true, + invalidate: "surround", + exclusive: false, + properties: { custom: "prop" }, + }); + + marker.destroy(); + + // Event Subscription + subscription = marker.onDidDestroy(() => {}); + + subscription = marker.onDidChange(event => { + event.oldHeadPosition; + event.newHeadPosition; + event.oldTailPosition; + event.newTailPosition; + event.wasValid; + event.isValid; + event.hadTail; + event.hasTail; + event.oldProperties; + event.newProperties; + event.textChanged; + }); + + // Marker Details + range = marker.getRange(); + pos = marker.getHeadPosition(); + pos = marker.getTailPosition(); + pos = marker.getStartPosition(); + pos = marker.getEndPosition(); + bool = marker.isReversed(); + bool = marker.hasTail(); + bool = marker.isValid(); + bool = marker.isDestroyed(); + bool = marker.isExclusive(); + str = marker.getInvalidationStrategy(); + + // Mutating Markers + bool = marker.setRange(range); + bool = marker.setRange([pos, pos]); + bool = marker.setRange([pos, [0, 0]]); + bool = marker.setRange([[0, 0], pos]); + bool = marker.setRange([[0, 0], [0, 0]]); + bool = marker.setRange([pos, pos], { exclusive: false }); + bool = marker.setRange(range, { exclusive: true, reversed: false }); + + bool = marker.setHeadPosition(pos); + bool = marker.setHeadPosition([0, 0]); + + bool = marker.setTailPosition(pos); + bool = marker.setTailPosition([0, 0]); + + bool = marker.clearTail(); + bool = marker.plantTail(); + + // Comparison + bool = marker.isEqual(marker); + num = marker.compare(marker); +} + +// MarkerLayer ================================================================ +function testMarkerLayer() { + // Lifecycle + markerLayer = markerLayer.copy(); + bool = markerLayer.destroy(); + markerLayer.clear(); + bool = markerLayer.isDestroyed(); + + // Querying + const potentialMarker = markerLayer.getMarker(42); + if (potentialMarker) marker = potentialMarker; + + markers = markerLayer.getMarkers(); + num = markerLayer.getMarkerCount(); + + markers = markerLayer.findMarkers({ + startPosition: pos, + endPosition: pos, + startsInRange: range, + endsInRange: range, + containsPoint: pos, + containsRange: range, + startRow: num, + endRow: num, + intersectsRow: num, + }); + markers = markerLayer.findMarkers({ containsRange: [pos, pos] }); + markers = markerLayer.findMarkers({ containsRange: [pos, [0, 0]] }); + markers = markerLayer.findMarkers({ containsRange: [[0, 0], pos] }); + markers = markerLayer.findMarkers({ containsRange: [[0, 0], [0, 0]] }); + + // Marker creation + marker = markerLayer.markRange(range); + marker = markerLayer.markRange([pos, pos]); + marker = markerLayer.markRange([pos, [0, 0]]); + marker = markerLayer.markRange([[0, 0], pos]); + marker = markerLayer.markRange([[0, 0], [0, 0]]); + marker = markerLayer.markRange(range, { exclusive: true }); + marker = markerLayer.markRange([pos, pos], { invalidate: "never" }); + marker = markerLayer.markRange(range, { + exclusive: false, invalidate: "surround", reversed: false, + }); + + marker = markerLayer.markPosition(pos); + marker = markerLayer.markPosition([0, 0]); + marker = markerLayer.markPosition(pos, { exclusive: false }); + marker = markerLayer.markPosition([0, 0], { invalidate: "inside" }); + marker = markerLayer.markPosition(pos, { exclusive: true, invalidate: "surround" }); + + // Event subscription + subscription = markerLayer.onDidUpdate(() => {}); + subscription = markerLayer.onDidCreateMarker(marker => marker.id); + subscription = markerLayer.onDidDestroy(() => {}); +} + +// MenuManager ================================================================ +function testMenuManager() { + subscription = atom.menu.add([ + { + label: "Hello", + submenu : [{ label: "World!", command: "hello:world" }], + }, + ]); + atom.menu.update(); +} + +// Notification =============================================================== +function testNotification() { + notification = new Atom.Notification("fatal", "Test"); + notification = new Atom.Notification("success", "Test", {}); + notification = new Atom.Notification("info", "Test", { + buttons: [ + { className: "Test", text: "Test", onDidClick: () => {}}, + ], + description: "Test", + detail: "Test", + dismissable: false, + icon: "Test", + }); + + // Event Subscription + subscription = notification.onDidDismiss(notification => notification.getType()); + subscription = notification.onDidDisplay(notification => notification.getMessage()); + + // Methods + str = notification.getType(); + str = notification.getMessage(); + + // Extended Methods + notification.dismiss(); +} + +// NotificationManager ======================================================== +function testNotificationManager() { + // Events + atom.notifications.onDidAddNotification(notification => notification.dismiss()); + + // Adding Notifications + atom.notifications.addSuccess("Test"); + atom.notifications.addSuccess("Test", {}); + atom.notifications.addSuccess("Test", { + description: "Desc", + detail: "Details", + dismissable: true, + icon: "Icon", + buttons: [{ + text: "Button", + onDidClick: () => {}, + className: "test-class", + }], + }); + + atom.notifications.addInfo("Test"); + atom.notifications.addInfo("Test", {}); + atom.notifications.addInfo("Test", { description: "Desc" }); + + atom.notifications.addWarning("Test"); + atom.notifications.addWarning("Test", {}); + atom.notifications.addWarning("Test", { description: "Desc" }); + + atom.notifications.addError("Test"); + atom.notifications.addError("Test", {}); + atom.notifications.addError("Test", { stack: "Stack" }); + + atom.notifications.addFatalError("Test"); + atom.notifications.addFatalError("Test", {}); + atom.notifications.addFatalError("Test", { stack: "Stack" }); + + // Getting Notifications + notifications = atom.notifications.getNotifications(); +} + +// Package ==================================================================== +function testPackage() { + // Event Subscription + pack.onDidDeactivate(() => {}); + + // Native Module Compatibility + bool = pack.isCompatible(); + + let exitInfo: Promise<{ code: number, stderr: string, stdout: string }>; + exitInfo = pack.rebuild(); + + const buildFailureOutput = pack.getBuildFailureOutput(); + if (buildFailureOutput) { + str = buildFailureOutput; + } +} + +// PackageManager ===========================================================\== +function testPackageManager() { + // Event Subscription + subscription = atom.packages.onDidLoadInitialPackages(() => {}); + subscription = atom.packages.onDidActivateInitialPackages(() => {}); + subscription = atom.packages.onDidActivatePackage(pack => pack.name); + subscription = atom.packages.onDidDeactivatePackage(pack => pack.path); + subscription = atom.packages.onDidLoadPackage(pack => pack.isCompatible()); + subscription = atom.packages.onDidUnloadPackage(pack => pack.name); + + // Package system data + str = atom.packages.getApmPath(); + strs = atom.packages.getPackageDirPaths(); + + // General package data + const packagePath = atom.packages.resolvePackagePath("Test"); + if (packagePath) { + str = packagePath; + } + + bool = atom.packages.isBundledPackage("Test"); + + // Enabling and disabling packages + let potentialPack = atom.packages.enablePackage("Test"); + if (potentialPack) { + pack = potentialPack; + } + + potentialPack = atom.packages.disablePackage("Test"); + if (potentialPack) { + pack = potentialPack; + } + + bool = atom.packages.isPackageDisabled("Test"); + + // Accessing active packages + packs = atom.packages.getActivePackages(); + + potentialPack = atom.packages.getActivePackage("Test"); + if (potentialPack) { + pack = potentialPack; + } + + bool = atom.packages.isPackageActive("Test"); + bool = atom.packages.hasActivatedInitialPackages(); + + // Accessing loaded packages + packs = atom.packages.getLoadedPackages(); + + potentialPack = atom.packages.getLoadedPackage("Test"); + if (potentialPack) { + pack = potentialPack; + } + + bool = atom.packages.isPackageLoaded("Test"); + bool = atom.packages.hasLoadedInitialPackages(); + + // Accessing available packages + strs = atom.packages.getAvailablePackagePaths(); + strs = atom.packages.getAvailablePackageNames(); + strs = atom.packages.getAvailablePackageMetadata(); +} + +// Pane ======================================================================= +function testPane() { + // Event Subscription + subscription = pane.onDidChangeFlexScale(scale => num = scale); + subscription = pane.observeFlexScale(scale => num = scale); + subscription = pane.onDidActivate(() => {}); + subscription = pane.onWillDestroy(() => {}); + subscription = pane.onDidDestroy(() => {}); + subscription = pane.onDidChangeActive(active => bool = active); + subscription = pane.observeActive(active => bool = active); + subscription = pane.onDidAddItem(event => event.index && event.item); + subscription = pane.onDidRemoveItem(event => event.index && event.item); + subscription = pane.onWillRemoveItem(event => event.index && event.item); + subscription = pane.onDidMoveItem(event => event.item && event.oldIndex && event.newIndex); + subscription = pane.observeItems((item) => {}); + subscription = pane.onDidChangeActiveItem((item) => {}); + subscription = pane.onChooseNextMRUItem((item) => {}); + subscription = pane.onChooseLastMRUItem((item) => {}); + subscription = pane.onDoneChoosingMRUItem(() => {}); + subscription = pane.observeActiveItem((item) => {}); + subscription = pane.onWillDestroyItem(event => event.index && event.item); + + // Items + objs = pane.getItems(); + obj = pane.getActiveItem(); + + let potentialItem = pane.itemAtIndex(42); + if (potentialItem) { + obj = potentialItem; + } + + pane.activateNextItem(); + pane.activatePreviousItem(); + pane.moveItemRight(); + pane.moveItemLeft(); + num = pane.getActiveItemIndex(); + pane.activateItemAtIndex(42); + + pane.activateItem(element); + pane.activateItem(element, { pending: true }); + + obj = pane.addItem(element); + obj = pane.addItem(element, {}); + obj = pane.addItem(element, { pending: true }); + obj = pane.addItem(element, { index: 42 }); + obj = pane.addItem(element, { pending: true, index: 42 }); + + objs = pane.addItems(objs); + objs = pane.addItems(objs, 42); + + pane.moveItem(element, 42); + pane.moveItemToPane(element, pane, 42); + pane.destroyActiveItem(); + + async function destroyAndWait() { + bool = await pane.destroyItem(element); + bool = await pane.destroyItem(element, true); + } + + pane.destroyItems(); + pane.destroyInactiveItems(); + + async function savePaneItem() { + await pane.saveActiveItem(); + let actionReturn = await pane.saveActiveItem(() => true); + if (actionReturn) bool = actionReturn; + + await pane.saveActiveItemAs(() => {}); + actionReturn = await pane.saveActiveItemAs(() => false); + + await pane.saveItem(element, () => {}); + let altActionReturn = await pane.saveItem(element, () => 42); + if (altActionReturn) num = altActionReturn; + + await pane.saveItemAs(element, () => {}); + altActionReturn = await pane.saveItemAs(element, () => 42); + } + + pane.saveItems(); + + potentialItem = pane.itemForURI("https://test"); + if (potentialItem) { + obj = potentialItem; + } + + bool = pane.activateItemForURI("https://test"); + + // Lifecycle + bool = pane.isActive(); + pane.activate(); + pane.destroy(); + bool = pane.isDestroyed(); + + // Splitting + pane = pane.splitLeft(); + pane = pane.splitLeft({}); + pane = pane.splitLeft({ copyActiveItem: true }); + pane = pane.splitLeft({ items: elements }); + pane = pane.splitLeft({ copyActiveItem: true, items: elements }); + + pane = pane.splitRight(); + pane = pane.splitRight({}); + pane = pane.splitRight({ copyActiveItem: true }); + pane = pane.splitRight({ items: elements }); + pane = pane.splitRight({ copyActiveItem: true, items: elements }); + + pane = pane.splitUp(); + pane = pane.splitUp({}); + pane = pane.splitUp({ copyActiveItem: true }); + pane = pane.splitUp({ items: elements }); + pane = pane.splitUp({ copyActiveItem: true, items: elements }); + + pane = pane.splitDown(); + pane = pane.splitDown({}); + pane = pane.splitDown({ copyActiveItem: true }); + pane = pane.splitDown({ items: elements }); + pane = pane.splitDown({ copyActiveItem: true, items: elements }); +} + +// Panel ====================================================================== +function testPanel() { + // Methods + panel.destroy(); + + // Event Subscription + subscription = panel.onDidChangeVisible(visible => bool = visible); + subscription = panel.onDidDestroy(panel => bool = panel.isVisible()); + + // Panel Details + obj = panel.getItem(); + num = panel.getPriority(); + bool = panel.isVisible(); + panel.hide(); + panel.show(); +} + +// PathWatcher ================================================================ +function testPathWatcher() { + pathWatcher.dispose(); + subscription = pathWatcher.onDidError((error) => str = error.name); + + async function waitForPathWatcher() { + await pathWatcher.getStartPromise(); + } +} + +// Point ====================================================================== +function testPoint() { + let point = new Atom.Point(42, 42); + new Atom.Point(); + new Atom.Point(42); + + // Properties + num = point.row; + num = point.column; + + // Construction + point = Atom.Point.fromObject({ row: 42, column: 42 }, true); + point = point.copy(); + point = point.negate(); + + // Comparison + point = Atom.Point.min(point, point); + Atom.Point.min([0, 0], [0, 0]); + Atom.Point.min(point, [0, 0]); + Atom.Point.min([0, 0], point); + + num = point.compare(point); + point.compare([0, 0]); + + bool = point.isEqual(point); + point.isEqual([0, 0]); + + bool = point.isLessThan(point); + point.isLessThan([0, 0]); + + bool = point.isLessThanOrEqual(point); + point.isLessThanOrEqual([0, 0]); + + bool = point.isGreaterThan(point); + point.isGreaterThan([0, 0]); + + bool = point.isGreaterThanOrEqual(point); + point.isGreaterThanOrEqual([0, 0]); + + // Operations + const frozenPoint: Readonly = point.freeze(); + + point = point.translate(point); + point.translate([0, 0]); + + point = point.traverse(point); + point.traverse([0, 0]); + + // Conversion + point.toArray(); + point.serialize(); + str = point.toString(); +} + +// Project ==================================================================== +function testProject() { + // Event Subscription + subscription = project.onDidChangePaths(paths => paths.length); + + subscription = project.onDidChangeFiles(events => { + for (const event of events) { + str = event.action; + } + }); + + subscription = project.onDidAddBuffer(buffer => buffer.id); + subscription = project.observeBuffers(buffer => buffer.getUri()); + + // Accessing the git repository + repositories = project.getRepositories(); + + async function getDirectoryRepo() { + const potentialRepo = await project.repositoryForDirectory(dir); + if (potentialRepo) repository = potentialRepo; + } + + // Managing Paths + strs = project.getPaths(); + project.setPaths(["a", "b"]); + project.addPath("Test"); + + async function initWatcher() { + await project.getWatcherPromise("/var/test"); + } + + project.removePath("Test"); + dirs = project.getDirectories(); + + const [projectPath, relativePath] = project.relativizePath("Test"); + if (projectPath) { + str = projectPath; + } + str = relativePath; + + bool = project.contains("Test"); +} + +// Range ====================================================================== +function testRange() { + let range = new Atom.Range(pos, pos); + new Atom.Range([0, 0], [0, 0]); + new Atom.Range(pos, [0, 0]); + new Atom.Range([0, 0], pos); + + // Properties + range.start; + range.end; + + // Construction + range = Atom.Range.fromObject({ start: pos, end: pos}, true); + Atom.Range.fromObject([pos, pos]); + Atom.Range.fromObject([[0, 0], [0, 0]]); + Atom.Range.fromObject([pos, [0, 0]]); + Atom.Range.fromObject([[0, 0], pos]); + + range = range.copy(); + range = range.negate(); + + // Serialization and Deserialization + range = Atom.Range.deserialize({}); + range.serialize(); + + // TextBuffer.Range Details + bool = range.isEmpty(); + bool = range.isSingleLine(); + num = range.getRowCount(); + nums = range.getRows(); + + // Operations + const frozenRange: Readonly = range.freeze(); + range = range.union(range); + + range = range.translate(pos); + range.translate([0, 0]); + range.translate(pos, pos); + range.translate([0, 0], pos); + range.translate(pos, [0, 0]); + range.translate([0, 0], [0, 0]); + + range = range.traverse(pos); + range.traverse([0, 0]); + + // Comparison + num = range.compare(range); + range.compare([pos, pos]); + range.compare([pos, [0, 0]]); + range.compare([[0, 0], pos]); + range.compare([[0, 0], [0, 0]]); + + bool = range.isEqual(range); + range.isEqual([pos, pos]); + range.isEqual([pos, [0, 0]]); + range.isEqual([[0, 0], pos]); + range.isEqual([[0, 0], [0, 0]]); + + bool = range.coversSameRows(range); + + bool = range.intersectsWith(range); + range.intersectsWith(range, true); + + bool = range.containsRange(range); + range.containsRange([pos, pos]); + range.containsRange([pos, [0, 0]]); + range.containsRange([[0, 0], pos]); + range.containsRange([[0, 0], [0, 0]]); + range.containsRange(range, true); + range.containsRange([pos, pos], false); + range.containsRange([pos, [0, 0]], false); + range.containsRange([[0, 0], pos], false); + range.containsRange([[0, 0], [0, 0]], false); + + bool = range.containsPoint(pos); + range.containsPoint([0, 0]); + range.containsPoint(pos, true); + range.containsPoint([0, 0], false); + + bool = range.intersectsRow(42); + bool = range.intersectsRowRange(42, 42); + + // Conversion + str = range.toString(); +} + +// ScopeDescriptor ============================================================ strs = scopeDescriptor.getScopesArray(); -//// Selection ================================================================ -// Event Subscription -sub = selection.onDidChangeRange(event => event.newBufferRange && event.oldBufferRange && - event.newScreenRange && event.oldScreenRange && event.selection); -sub = selection.onDidDestroy(() => {}); +// Selection ================================================================== +function testSelection() { + // Event Subscription + subscription = selection.onDidChangeRange(event => event.newBufferRange && + event.oldBufferRange && event.newScreenRange && event.oldScreenRange && + event.selection); + subscription = selection.onDidDestroy(() => {}); -// Managing the selection range -range = selection.getScreenRange(); + // Managing the selection range + range = selection.getScreenRange(); -selection.setScreenRange(range); -selection.setScreenRange([pos, pos]); -selection.setScreenRange([pos, [0, 0]]); -selection.setScreenRange([[0, 0], pos]); -selection.setScreenRange([[0, 0], [0, 0]]); -selection.setScreenRange([[0, 0], [0, 0]], {}); -selection.setScreenRange(range, { autoscroll: true, preserveFolds: false }); -selection.setScreenRange([pos, pos], { autoscroll: true }); + selection.setScreenRange(range); + selection.setScreenRange([pos, pos]); + selection.setScreenRange([pos, [0, 0]]); + selection.setScreenRange([[0, 0], pos]); + selection.setScreenRange([[0, 0], [0, 0]]); + selection.setScreenRange([[0, 0], [0, 0]], {}); + selection.setScreenRange(range, { autoscroll: true, preserveFolds: false }); + selection.setScreenRange([pos, pos], { autoscroll: true }); -range = selection.getBufferRange(); + range = selection.getBufferRange(); -selection.setBufferRange(range); -selection.setBufferRange([pos, pos]); -selection.setBufferRange([pos, [0, 0]]); -selection.setBufferRange([[0, 0], pos]); -selection.setBufferRange([[0, 0], [0, 0]]); -selection.setBufferRange([[0, 0], [0, 0]], {}); -selection.setBufferRange(range, { autoscroll: true, preserveFolds: false }); -selection.setBufferRange([pos, pos], { autoscroll: true }); + selection.setBufferRange(range); + selection.setBufferRange([pos, pos]); + selection.setBufferRange([pos, [0, 0]]); + selection.setBufferRange([[0, 0], pos]); + selection.setBufferRange([[0, 0], [0, 0]]); + selection.setBufferRange([[0, 0], [0, 0]], {}); + selection.setBufferRange(range, { autoscroll: true, preserveFolds: false }); + selection.setBufferRange([pos, pos], { autoscroll: true }); -const [startingRow, endingRow ]: [number, number] = selection.getBufferRowRange(); + const [startingRow, endingRow ]: [number, number] = selection.getBufferRowRange(); -// Info about the selection -bool = selection.isEmpty(); -bool = selection.isReversed(); -bool = selection.isSingleScreenLine(); -str = selection.getText(); -bool = selection.intersectsBufferRange(range); // Not range-compatible. -bool = selection.intersectsWith(selection); + // Info about the selection + bool = selection.isEmpty(); + bool = selection.isReversed(); + bool = selection.isSingleScreenLine(); + str = selection.getText(); + bool = selection.intersectsBufferRange(range); // Not range-compatible. + bool = selection.intersectsWith(selection); -// Modifying the selected range -selection.clear(); -selection.clear({}); -selection.clear({ autoscroll: false }); + // Modifying the selected range + selection.clear(); + selection.clear({}); + selection.clear({ autoscroll: false }); -selection.selectToScreenPosition(pos); -selection.selectToScreenPosition([0, 0]); + selection.selectToScreenPosition(pos); + selection.selectToScreenPosition([0, 0]); -selection.selectToBufferPosition(pos); -selection.selectToBufferPosition([0, 0]); + selection.selectToBufferPosition(pos); + selection.selectToBufferPosition([0, 0]); -selection.selectRight(); -selection.selectRight(42); + selection.selectRight(); + selection.selectRight(42); -selection.selectLeft(); -selection.selectLeft(42); + selection.selectLeft(); + selection.selectLeft(42); -selection.selectUp(); -selection.selectUp(42); + selection.selectUp(); + selection.selectUp(42); -selection.selectDown(); -selection.selectDown(42); + selection.selectDown(); + selection.selectDown(42); -selection.selectToTop(); -selection.selectToBottom(); -selection.selectAll(); -selection.selectToBeginningOfLine(); -selection.selectToFirstCharacterOfLine(); -selection.selectToEndOfLine(); -selection.selectToEndOfBufferLine(); -selection.selectToBeginningOfWord(); -selection.selectToEndOfWord(); -selection.selectToBeginningOfNextWord(); -selection.selectToPreviousWordBoundary(); -selection.selectToNextWordBoundary(); -selection.selectToPreviousSubwordBoundary(); -selection.selectToNextSubwordBoundary(); -selection.selectToBeginningOfNextParagraph(); -selection.selectToBeginningOfPreviousParagraph(); -selection.selectWord(); -selection.expandOverWord(); -selection.selectLine(42); -selection.expandOverLine(); + selection.selectToTop(); + selection.selectToBottom(); + selection.selectAll(); + selection.selectToBeginningOfLine(); + selection.selectToFirstCharacterOfLine(); + selection.selectToEndOfLine(); + selection.selectToEndOfBufferLine(); + selection.selectToBeginningOfWord(); + selection.selectToEndOfWord(); + selection.selectToBeginningOfNextWord(); + selection.selectToPreviousWordBoundary(); + selection.selectToNextWordBoundary(); + selection.selectToPreviousSubwordBoundary(); + selection.selectToNextSubwordBoundary(); + selection.selectToBeginningOfNextParagraph(); + selection.selectToBeginningOfPreviousParagraph(); + selection.selectWord(); + selection.expandOverWord(); + selection.selectLine(42); + selection.expandOverLine(); -// Modifying the selected text -selection.insertText("Replacement"); -selection.insertText("Replacement", {}); -selection.insertText("Replacement", { select: true }); -selection.insertText("Replacement", { autoIndent: true }); -selection.insertText("Replacement", { autoIndentNewline: true }); -selection.insertText("Replacement", { autoDecreaseIndent: true }); -selection.insertText("Replacement", { normalizeLineEndings: true }); -selection.insertText("Replacement", { undo: "skip" }); -selection.insertText("Replacement", { select: true, autoIndent: true, - autoIndentNewline: true, autoDecreaseIndent: true, normalizeLineEndings: true, - undo: "skip" }); + // Modifying the selected text + selection.insertText("Replacement"); + selection.insertText("Replacement", {}); + selection.insertText("Replacement", { select: true }); + selection.insertText("Replacement", { autoIndent: true }); + selection.insertText("Replacement", { autoIndentNewline: true }); + selection.insertText("Replacement", { autoDecreaseIndent: true }); + selection.insertText("Replacement", { normalizeLineEndings: true }); + selection.insertText("Replacement", { undo: "skip" }); + selection.insertText("Replacement", { select: true, autoIndent: true, + autoIndentNewline: true, autoDecreaseIndent: true, normalizeLineEndings: true, + undo: "skip" }); -selection.backspace(); -selection.deleteToPreviousWordBoundary(); -selection.deleteToNextWordBoundary(); -selection.deleteToBeginningOfWord(); -selection.deleteToBeginningOfLine(); -selection.delete(); -selection.deleteToEndOfLine(); -selection.deleteToEndOfWord(); -selection.deleteToBeginningOfSubword(); -selection.deleteToEndOfSubword(); -selection.deleteSelectedText(); -selection.deleteLine(); -selection.joinLines(); -selection.outdentSelectedRows(); -selection.autoIndentSelectedRows(); -selection.toggleLineComments(); -selection.cutToEndOfLine(); -selection.cutToEndOfBufferLine(); + selection.backspace(); + selection.deleteToPreviousWordBoundary(); + selection.deleteToNextWordBoundary(); + selection.deleteToBeginningOfWord(); + selection.deleteToBeginningOfLine(); + selection.delete(); + selection.deleteToEndOfLine(); + selection.deleteToEndOfWord(); + selection.deleteToBeginningOfSubword(); + selection.deleteToEndOfSubword(); + selection.deleteSelectedText(); + selection.deleteLine(); + selection.joinLines(); + selection.outdentSelectedRows(); + selection.autoIndentSelectedRows(); + selection.toggleLineComments(); + selection.cutToEndOfLine(); + selection.cutToEndOfBufferLine(); -selection.cut(); -selection.cut(true); -selection.cut(true, true); + selection.cut(); + selection.cut(true); + selection.cut(true, true); -selection.copy(); -selection.copy(true); -selection.copy(true, true); + selection.copy(); + selection.copy(true); + selection.copy(true, true); -selection.fold(); -selection.indentSelectedRows(); + selection.fold(); + selection.indentSelectedRows(); -// Managing multiple selections -selection.addSelectionBelow(); -selection.addSelectionAbove(); + // Managing multiple selections + selection.addSelectionBelow(); + selection.addSelectionAbove(); -selection.merge(selection); -selection.merge(selection, {}); -selection.merge(selection, { preserveFolds: true }); -selection.merge(selection, { autoscroll: true }); -selection.merge(selection, { preserveFolds: true, autoscroll: true }); + selection.merge(selection); + selection.merge(selection, {}); + selection.merge(selection, { preserveFolds: true }); + selection.merge(selection, { autoscroll: true }); + selection.merge(selection, { preserveFolds: true, autoscroll: true }); -// Comparing to other selections -num = selection.compare(selection); + // Comparing to other selections + num = selection.compare(selection); +} -//// StyleManager ============================================================= -// Event Subscription -sub = styleManager.observeStyleElements(styleElement => styleElement.context); -sub = styleManager.onDidAddStyleElement(styleElement => styleElement.sourcePath); -sub = styleManager.onDidRemoveStyleElement(styleElement => styleElement.onkeydown); -sub = styleManager.onDidUpdateStyleElement(styleElement => styleElement.sourcePath); +// StyleManager =============================================================== +function testStyleManager() { + // Event Subscription + subscription = styleManager.observeStyleElements(styleElement => styleElement.context); + subscription = styleManager.onDidAddStyleElement(styleElement => styleElement.sourcePath); + subscription = styleManager.onDidRemoveStyleElement(styleElement => styleElement.onkeydown); + subscription = styleManager.onDidUpdateStyleElement(styleElement => styleElement.sourcePath); -// Reading Style Elements -const styleElements: HTMLStyleElement[] = styleManager.getStyleElements(); + // Reading Style Elements + const styleElements: HTMLStyleElement[] = styleManager.getStyleElements(); -// Paths -str = styleManager.getUserStyleSheetPath(); + // Paths + str = styleManager.getUserStyleSheetPath(); +} -//// Task ===================================================================== -let task: Atom.Task = Task.once("File.path", {}, () => {}); -task = new Task("File.path"); +// Task ======================================================================= +function testTask() { + let task: Atom.Task = Atom.Task.once("File.path", {}, () => {}); + task = new Atom.Task("File.path"); -task.start({}, () => {}); -task.send("test-message"); -sub = task.on("test-message", () => {}); -task.terminate(); -task.cancel(); + task.start({}, () => {}); + task.send("test-message"); + subscription = task.on("test-message", () => {}); + task.terminate(); + task.cancel(); +} -//// TextBuffer -- See 'text-buffer' testing. -//// TextEditor =============================================================== -// Event Subscription -sub = editor.onDidChangeTitle(title => str = title.charAt(0)); -sub = editor.onDidChangePath(path => str = path.charAt(0)); +// TextBuffer ================================================================= +function testTextBuffer() { + const shouldDestroyOnFileDelete = () => false; -sub = editor.onDidChange(changes => { - for (const change of changes) { - change.newExtent; - change.oldExtent; - change.start; - } + buffer = new Atom.TextBuffer("test"); + new Atom.TextBuffer(); + new Atom.TextBuffer({ text: "Test" }); + new Atom.TextBuffer({ shouldDestroyOnFileDelete }); + new Atom.TextBuffer({ text: "Test", shouldDestroyOnFileDelete }); + + async function bufferLoadFile() { + buffer = await Atom.TextBuffer.load("Test.file"); + buffer = await Atom.TextBuffer.load("Test.file", { encoding: "utf8" }); + buffer = await Atom.TextBuffer.load("Test.file", { shouldDestroyOnFileDelete }); + buffer = await Atom.TextBuffer.load("Test.file", { encoding: "utf8", + shouldDestroyOnFileDelete }); + } + + buffer = Atom.TextBuffer.loadSync("Test.file"); + Atom.TextBuffer.loadSync("Test.file", { encoding: "utf8" }); + Atom.TextBuffer.loadSync("Test.file", { shouldDestroyOnFileDelete }); + Atom.TextBuffer.loadSync("Test.file", { encoding: "uft8", shouldDestroyOnFileDelete }); + + async function deserializeBuffer() { + buffer = await Atom.TextBuffer.deserialize({}); + } + + // Event Subscription + subscription = buffer.onWillChange(() => void {}); + subscription = buffer.onDidChange(() => void {}); + subscription = buffer.onDidChangeText(() => void {}); + + subscription = buffer.onDidStopChanging((event): void => { + for (const change of event.changes) { + change.newExtent; + } + }); + + subscription = buffer.onDidConflict(() => void {}); + subscription = buffer.onDidChangeModified(() => void {}); + subscription = buffer.onDidUpdateMarkers(() => void {}); + subscription = buffer.onDidCreateMarker(() => void {}); + + subscription = buffer.onDidChangePath((path): void => { + str = path; + }); + + subscription = buffer.onDidChangeEncoding(() => void {}); + + subscription = buffer.onWillSave(() => void {}); + subscription = buffer.onWillSave(() => Promise.resolve()); + + subscription = buffer.onDidSave(() => void {}); + subscription = buffer.onDidDelete(() => void {}); + subscription = buffer.onWillReload(() => void {}); + subscription = buffer.onDidReload(() => void {}); + subscription = buffer.onDidDestroy(() => void {}); + subscription = buffer.onWillThrowWatchError(() => void {}); + + const stoppedChangingDelay = buffer.getStoppedChangingDelay(); + + // File Details + bool = buffer.isModified(); + bool = buffer.isInConflict(); + + const path = buffer.getPath(); + if (path) { + str = path.substr(0, 42); + } + + buffer.setPath("Test.file"); + buffer.setEncoding("utf8"); + str = buffer.getEncoding(); + str = buffer.getUri(); + + // Reading Text + bool = buffer.isEmpty(); + str = buffer.getText(); + + str = buffer.getTextInRange(range); + str = buffer.getTextInRange([pos, pos]); + str = buffer.getTextInRange([[0, 0], [0, 0]]); + str = buffer.getTextInRange([pos, [0, 0]]); + str = buffer.getTextInRange([[0, 0], pos]); + + strs = buffer.getLines(); + str = buffer.getLastLine(); + + const rowText = buffer.lineForRow(42); + if (rowText) { + str = rowText; + } + + const lineEnding = buffer.lineEndingForRow(42); + if (lineEnding) { + str = lineEnding; + } + + num = buffer.lineLengthForRow(42); + bool = buffer.isRowBlank(42); + + const prevRow = buffer.previousNonBlankRow(42); + if (prevRow) { + num = prevRow; + } + + const nextRow = buffer.nextNonBlankRow(42); + if (nextRow) { + num = nextRow; + } + + // Mutating Text + range = buffer.setText("Test"); + buffer.setTextViaDiff("Test"); + + range = buffer.setTextInRange(range, "Test"); + range = buffer.setTextInRange([pos, pos], "Test"); + range = buffer.setTextInRange([[0, 0], [0, 0]], "Test"); + range = buffer.setTextInRange([pos, [0, 0]], "Test"); + range = buffer.setTextInRange([[0, 0], pos], "Test"); + range = buffer.setTextInRange(range, "Test", { normalizeLineEndings: true }); + range = buffer.setTextInRange(range, "Test", { undo: "skip" }); + range = buffer.setTextInRange(range, "Test", { normalizeLineEndings: true, undo: "skip" }); + range = buffer.setTextInRange([[0, 0], [0, 0]], "Test", { undo: "skip" }); + + range = buffer.insert(pos, "Test"); + buffer.insert([0, 0], "Test"); + buffer.insert(pos, "Test", { normalizeLineEndings: true }); + buffer.insert(pos, "Test", { undo: "skip" }); + buffer.insert(pos, "Test", { normalizeLineEndings: true, undo: "skip" }); + buffer.insert([0, 0], "Test", { undo: "skip" }); + + range = buffer.append("Test"); + buffer.append("Test", { normalizeLineEndings: true }); + buffer.append("Test", { undo: "skip" }); + buffer.append("Test", { normalizeLineEndings: true, undo: "skip" }); + + range = buffer.delete(range); + buffer.delete([pos, pos]); + buffer.delete([[0, 0], [0, 0]]); + buffer.delete([pos, [0, 0]]); + buffer.delete([[0, 0], pos]); + + range = buffer.deleteRow(42); + range = buffer.deleteRows(42, 42); + + // Markers + markerLayer = buffer.addMarkerLayer(); + buffer.addMarkerLayer({ maintainHistory: true }); + buffer.addMarkerLayer({ persistent: true }); + buffer.addMarkerLayer({ maintainHistory: true, persistent: true }); + + const testMarkerLayer = buffer.getMarkerLayer("Test"); + if (testMarkerLayer) { + markerLayer = testMarkerLayer; + } + + markerLayer = buffer.getDefaultMarkerLayer(); + + marker = buffer.markRange(range); + buffer.markRange([pos, pos]); + buffer.markRange([[0, 0], [0, 0]]); + buffer.markRange([pos, [0, 0]]); + buffer.markRange([[0, 0], pos]); + buffer.markRange(range, { exclusive: true}); + buffer.markRange(range, { invalidate: "surround" }); + buffer.markRange(range, { reversed: true }); + buffer.markRange(range, { exclusive: true, invalidate: "surround", reversed: true }); + buffer.markRange([pos, pos], { exclusive: true }); + + marker = buffer.markPosition(pos); + buffer.markPosition([0, 0]); + buffer.markPosition(pos, { exclusive: true }); + buffer.markPosition(pos, { invalidate: "never" }); + buffer.markPosition(pos, { exclusive: true, invalidate: "surround" }); + buffer.markPosition([0, 0], { exclusive: true }); + + markers = buffer.getMarkers(); + marker = buffer.getMarker(42); + + markers = buffer.findMarkers({ + startPosition: pos, + endPosition: pos, + startsInRange: range, + endsInRange: range, + containsPoint: pos, + containsRange: range, + startRow: num, + endRow: num, + intersectsRow: num, + }); + markers = buffer.findMarkers({ startsInRange: [pos, pos] }); + markers = buffer.findMarkers({ startsInRange: [pos, [0, 0]] }); + markers = buffer.findMarkers({ startsInRange: [[0, 0], pos] }); + markers = buffer.findMarkers({ startsInRange: [[0, 0], [0, 0]] }); + + num = buffer.getMarkerCount(); + + // History + bool = buffer.undo(); + bool = buffer.redo(); + + num = buffer.transact(500, (): number => 42); + + buffer.clearUndoStack(); + num = buffer.createCheckpoint(); + bool = buffer.revertToCheckpoint(42); + bool = buffer.groupChangesSinceCheckpoint(42); + buffer.getChangesSinceCheckpoint(42); + + // Search And Replace + buffer.scan(/r^Test/, (): void => {}); + buffer.scan(/r^Test/, (params) => { + num = params.match.index; + str = params.matchText; + range = params.range; + params.replace("Test"); + params.stop(); + }); + buffer.scan(/r^Test/, { + leadingContextLineCount: 5, + trailingContextLineCount: 5, + }, (params) => { + strs = params.leadingContextLines; + strs = params.trailingContextLines; + }); + + buffer.backwardsScan(/r^Test/, (): void => {}); + buffer.backwardsScan(/r^Test/, (params) => { + num = params.match.index; + str = params.matchText; + range = params.range; + params.replace("Test"); + params.stop(); + }); + buffer.backwardsScan(/r^Test/, { + leadingContextLineCount: 5, + trailingContextLineCount: 5, + }, (params) => { + strs = params.leadingContextLines; + strs = params.trailingContextLines; + }); + + buffer.scanInRange(/r^Test/, range, (): void => {}); + buffer.scanInRange(/r^Test/, range, (params) => { + num = params.match.index; + str = params.matchText; + range = params.range; + params.replace("Test"); + params.stop(); + }); + buffer.scanInRange(/r^Test/, range, { + leadingContextLineCount: 5, + trailingContextLineCount: 5, + }, (params) => { + strs = params.leadingContextLines; + strs = params.trailingContextLines; + }); + buffer.scanInRange(/r^Test/, [pos, pos], (): void => {}); + buffer.scanInRange(/r^Test/, [[0, 0], [0, 0]], (): void => {}); + buffer.scanInRange(/r^Test/, [pos, [0, 0]], (): void => {}); + buffer.scanInRange(/r^Test/, [[0, 0], pos], (): void => {}); + buffer.scanInRange(/r^Test/, [[0, 0], [0, 0]], { trailingContextLineCount: 42 }, + (): void => {}); + + buffer.backwardsScanInRange(/r^Test/, range, (): void => {}); + buffer.backwardsScanInRange(/r^Test/, range, (params) => { + num = params.match.index; + str = params.matchText; + range = params.range; + params.replace("Test"); + params.stop(); + }); + buffer.backwardsScanInRange(/r^Test/, range, { + leadingContextLineCount: 5, + trailingContextLineCount: 5, + }, (params) => { + strs = params.leadingContextLines; + strs = params.trailingContextLines; + }); + buffer.backwardsScanInRange(/r^Test/, [pos, pos], (): void => {}); + buffer.backwardsScanInRange(/r^Test/, [[0, 0], [0, 0]], (): void => {}); + buffer.backwardsScanInRange(/r^Test/, [pos, [0, 0]], (): void => {}); + buffer.backwardsScanInRange(/r^Test/, [[0, 0], pos], (): void => {}); + buffer.backwardsScanInRange(/r^Test/, [[0, 0], [0, 0]], { trailingContextLineCount: 42 }, + (): void => {}); + + num = buffer.replace(/r^Test/, "Test"); + + // Buffer TextBuffer.Range Details + range = buffer.getRange(); + num = buffer.getLineCount(); + num = buffer.getLastRow(); + pos = buffer.getFirstPosition(); + pos = buffer.getEndPosition(); + num = buffer.getMaxCharacterIndex(); + range = buffer.rangeForRow(42, true); + num = buffer.characterIndexForPosition(pos); + pos = buffer.positionForCharacterIndex(42); + + range = buffer.clipRange(range); + range = buffer.clipRange([pos, pos]); + range = buffer.clipRange([pos, [0, 0]]); + range = buffer.clipRange([[0, 0], pos]); + range = buffer.clipRange([[0, 0], [0, 0]]); + + pos = buffer.clipPosition(pos); + pos = buffer.clipPosition([0, 0]); + + // Buffer Operations + async function saveBuffer() { + await buffer.save(); + await buffer.saveAs("Test.file"); + } + + buffer.reload(); +} + +// TextEditor ================================================================= +function testTextEditor() { + // Event Subscription + subscription = editor.onDidChangeTitle(title => str = title.charAt(0)); + subscription = editor.onDidChangePath(path => str = path.charAt(0)); + + subscription = editor.onDidChange(changes => { + for (const change of changes) { + change.newExtent; + change.oldExtent; + change.start; + } + }); + + subscription = editor.onDidStopChanging(event => { + for (const change of event.changes) { + change.newExtent && change.oldExtent && change.newRange && change.oldRange && + change.newText && change.oldText && change.start; + } + }); + + subscription = editor.onDidChangeCursorPosition(event => event.newBufferPosition); + subscription = editor.onDidChangeSelectionRange(event => event.selection); + subscription = editor.onDidSave(event => event.path); + subscription = editor.onDidDestroy(() => {}); + subscription = editor.observeGutters(gutter => gutter.show()); + subscription = editor.onDidAddGutter(gutter => gutter.hide()); + subscription = editor.onDidRemoveGutter(name => name.length); + subscription = editor.onDidChangeSoftWrapped(softWrapped => {}); + subscription = editor.onDidChangeEncoding(encoding => {}); + subscription = editor.observeGrammar(grammar => grammar.name); + subscription = editor.onDidChangeGrammar(grammar => grammar.name); + subscription = editor.onDidChangeModified(modified => {}); + subscription = editor.onDidConflict(() => {}); + subscription = editor.onWillInsertText(event => event.cancel && event.text); + subscription = editor.onDidInsertText(event => event.text); + subscription = editor.observeCursors(cursor => cursor.moveToBottom()); + subscription = editor.onDidAddCursor(cursor => cursor.getMarker()); + subscription = editor.onDidRemoveCursor(cursor => cursor.compare(cursor)); + subscription = editor.observeSelections(selection => selection.cutToEndOfBufferLine()); + subscription = editor.onDidAddSelection(selection => selection.selectWord()); + subscription = editor.onDidRemoveSelection(selection => selection.toggleLineComments()); + subscription = editor.observeDecorations(decoration => decoration.getId()); + subscription = editor.onDidAddDecoration(decoration => decoration.id); + subscription = editor.onDidRemoveDecoration(decoration => decoration.getId()); + subscription = editor.onDidChangePlaceholderText(placeholderText => + placeholderText.toLowerCase()); + buffer = editor.getBuffer(); + + // File Details + str = editor.getTitle(); + str = editor.getLongTitle(); + + const filePath = editor.getPath(); + if (filePath) { + str = filePath; + } + + bool = editor.isModified(); + bool = editor.isEmpty(); + str = editor.getEncoding(); + editor.setEncoding("utf8"); + + // File Operations + async function saveEditor() { + await editor.save(); + await editor.saveAs("test.file"); + } + + // Reading Text + str = editor.getText(); + str = editor.getTextInBufferRange(range); + num = editor.getLineCount(); + num = editor.getScreenLineCount(); + num = editor.getLastBufferRow(); + num = editor.getLastScreenRow(); + str = editor.lineTextForBufferRow(42); + str = editor.lineTextForScreenRow(42); + range = editor.getCurrentParagraphBufferRange(); + + // Mutating Text + editor.setText("Test"); + + editor.setTextInBufferRange(range, "Test"); + editor.setTextInBufferRange([pos, pos], "Test"); + editor.setTextInBufferRange([pos, [0, 0]], "Test"); + editor.setTextInBufferRange([[0, 0], pos], "Test"); + editor.setTextInBufferRange([[0, 0], [0, 0]], "Test"); + editor.setTextInBufferRange(range, "Test", {}); + editor.setTextInBufferRange([pos, pos], "Test", { normalizeLineEndings: true }); + editor.setTextInBufferRange(range, "Test", { normalizeLineEndings: true, + undo: "skip" }); + + editor.insertText("Test"); + editor.insertText("Test", {}); + editor.insertText("Test", { autoDecreaseIndent: true }); + editor.insertText("Test", { autoIndent: true }); + editor.insertText("Test", { autoIndentNewline: true }); + editor.insertText("Test", { normalizeLineEndings: true }); + editor.insertText("Test", { select: true }); + editor.insertText("Test", { undo: "skip" }); + editor.insertText("Text", { autoDecreaseIndent: false, autoIndent: false, + autoIndentNewline: false, normalizeLineEndings: false, select: false, undo: "skip" }); + + editor.insertNewline(); + editor.delete(); + editor.backspace(); + editor.mutateSelectedText((selection, index) => { selection.clear(); }); + editor.transpose(); + editor.upperCase(); + editor.lowerCase(); + editor.toggleLineCommentsInSelection(); + editor.insertNewlineBelow(); + editor.insertNewlineAbove(); + editor.deleteToBeginningOfWord(); + editor.deleteToPreviousWordBoundary(); + editor.deleteToNextWordBoundary(); + editor.deleteToBeginningOfSubword(); + editor.deleteToEndOfSubword(); + editor.deleteToBeginningOfLine(); + editor.deleteToEndOfLine(); + editor.deleteToEndOfWord(); + editor.deleteLine(); + + // History + editor.undo(); + editor.redo(); + + editor.transact(() => {}); + editor.transact(42, () => {}); + + editor.abortTransaction(); + num = editor.createCheckpoint(); + bool = editor.revertToCheckpoint(42); + bool = editor.groupChangesSinceCheckpoint(42); + + // TextEditor Coordinates + pos = editor.screenPositionForBufferPosition(pos); + pos = editor.screenPositionForBufferPosition([0, 0]); + pos = editor.screenPositionForBufferPosition(pos, {}); + pos = editor.screenPositionForBufferPosition(pos, { clipDirection: "backward" }); + pos = editor.screenPositionForBufferPosition([0, 0], { clipDirection: "forward" }); + + pos = editor.bufferPositionForScreenPosition(pos); + pos = editor.bufferPositionForScreenPosition([0, 0]); + pos = editor.bufferPositionForScreenPosition(pos, {}); + pos = editor.bufferPositionForScreenPosition(pos, { clipDirection: "backward" }); + pos = editor.bufferPositionForScreenPosition([0, 0], { clipDirection: "forward" }); + + range = editor.screenRangeForBufferRange(range); + range = editor.screenRangeForBufferRange([pos, pos]); + range = editor.screenRangeForBufferRange([pos, [0, 0]]); + range = editor.screenRangeForBufferRange([[0, 0], pos]); + range = editor.screenRangeForBufferRange([[0, 0], [0, 0]]); + + range = editor.bufferRangeForScreenRange(range); + range = editor.bufferRangeForScreenRange([pos, pos]); + range = editor.bufferRangeForScreenRange([pos, [0, 0]]); + range = editor.bufferRangeForScreenRange([[0, 0], pos]); + range = editor.bufferRangeForScreenRange([[0, 0], [0, 0]]); + + pos = editor.clipBufferPosition(pos); + pos = editor.clipBufferPosition([0, 0]); + + range = editor.clipBufferRange(range); + range = editor.clipBufferRange([pos, pos]); + range = editor.clipBufferRange([pos, [0, 0]]); + range = editor.clipBufferRange([[0, 0], pos]); + range = editor.clipBufferRange([[0, 0], [0, 0]]); + + pos = editor.clipScreenPosition(pos); + pos = editor.clipScreenPosition([0, 0]); + pos = editor.clipScreenPosition(pos, {}); + pos = editor.clipScreenPosition(pos, { clipDirection: "closest" }); + pos = editor.clipScreenPosition([0, 0], { clipDirection: "closest" }); + + range = editor.clipScreenRange(range); + range = editor.clipScreenRange([pos, pos]); + range = editor.clipScreenRange([pos, [0, 0]]); + range = editor.clipScreenRange([[0, 0], pos]); + range = editor.clipScreenRange([[0, 0], [0, 0]]); + range = editor.clipScreenRange(range, {}); + range = editor.clipScreenRange(range, { clipDirection: "closest" }); + range = editor.clipScreenRange([pos, pos], { clipDirection: "closest" }); + + // Decorations + decoration = editor.decorateMarker(displayMarker, { type: "line" }); + decoration = editor.decorateMarker(displayMarker, { type: "line", avoidOverflow: true, + class: "test-class", gutterName: "gutterName", item: element, onlyEmpty: true, + onlyHead: true, onlyNonEmpty: true, position: "before" }); + + layerDecoration = editor.decorateMarkerLayer(displayMarkerLayer, { type: "line-number" }); + layerDecoration = editor.decorateMarkerLayer(displayMarkerLayer, { type: "line-number", + avoidOverflow: false, class: "test-class", item: element, onlyEmpty: false, onlyHead: false, + onlyNonEmpty: false, position: "after" }); + + decorations = editor.getDecorations(); + decorations = editor.getDecorations({}); + decorations = editor.getDecorations({ type: "line-number" }); + decorations = editor.getDecorations({ type: "line", avoidOverflow: true, + class: "test-class", gutterName: "gutterName", item: element, onlyEmpty: true, + onlyHead: true, onlyNonEmpty: true, position: "before" }); + + decorations = editor.getLineDecorations(); + decorations = editor.getLineDecorations({}); + decorations = editor.getLineDecorations({ avoidOverflow: true }); + decorations = editor.getLineDecorations({ avoidOverflow: true, class: "test-class", + item: element, onlyEmpty: true, onlyHead: true, onlyNonEmpty: true, + position: "before" }); + + decorations = editor.getLineNumberDecorations(); + decorations = editor.getLineNumberDecorations({}); + decorations = editor.getLineNumberDecorations({ onlyHead: true }); + decorations = editor.getLineNumberDecorations({ avoidOverflow: true, + class: "test-class", gutterName: "gutterName", item: element, onlyEmpty: true, + onlyHead: true, onlyNonEmpty: true, position: "before" }); + + decorations = editor.getHighlightDecorations(); + decorations = editor.getHighlightDecorations({}); + decorations = editor.getHighlightDecorations({ onlyHead: true }); + decorations = editor.getHighlightDecorations({ avoidOverflow: true, + class: "test-class", item: element, onlyEmpty: true, onlyHead: true, onlyNonEmpty: true, + position: "before" }); + + decorations = editor.getOverlayDecorations(); + decorations = editor.getOverlayDecorations({}); + decorations = editor.getOverlayDecorations({ onlyHead: true }); + decorations = editor.getOverlayDecorations({ avoidOverflow: true, + class: "test-class", item: element, onlyEmpty: true, onlyHead: true, onlyNonEmpty: true, + position: "before" }); + + // Markers + displayMarker = editor.markBufferRange(range); + displayMarker = editor.markBufferRange([pos, pos]); + displayMarker = editor.markBufferRange([pos, [0, 0]]); + displayMarker = editor.markBufferRange([[0, 0], pos]); + displayMarker = editor.markBufferRange([[0, 0], [0, 0]]); + displayMarker = editor.markBufferRange(range, {}); + displayMarker = editor.markBufferRange(range, { invalidate: "surround" }); + displayMarker = editor.markBufferRange(range, { maintainHistory: true }); + displayMarker = editor.markBufferRange(range, { reversed: true }); + displayMarker = editor.markBufferRange([[0, 0], [0, 0]], { invalidate: "overlap" }); + displayMarker = editor.markBufferRange(range, { invalidate: "surround", + maintainHistory: false, reversed: false }); + + displayMarker = editor.markBufferPosition(pos); + displayMarker = editor.markBufferPosition([0, 0]); + displayMarker = editor.markBufferPosition(pos, {}); + displayMarker = editor.markBufferPosition(pos, { invalidate: "never" }); + displayMarker = editor.markBufferPosition([0, 0], { invalidate: "surround" }); + + displayMarker = editor.markScreenPosition(pos); + displayMarker = editor.markScreenPosition([0, 0]); + displayMarker = editor.markScreenPosition(pos, {}); + displayMarker = editor.markScreenPosition(pos, { invalidate: "never" }); + displayMarker = editor.markScreenPosition(pos, { clipDirection: "forward" }); + displayMarker = editor.markScreenPosition([0, 0], { invalidate: "surround", + clipDirection: "backward" }); + + displayMarkers = editor.findMarkers({ startBufferRow: 42 }); + displayMarkers = editor.findMarkers({ endBufferRow: 42 }); + displayMarkers = editor.findMarkers({ containsBufferRange: range }); + displayMarkers = editor.findMarkers({ containsBufferRange: [pos, pos] }); + displayMarkers = editor.findMarkers({ containsBufferRange: [pos, [0, 0]] }); + displayMarkers = editor.findMarkers({ containsBufferRange: [[0, 0], pos] }); + displayMarkers = editor.findMarkers({ containsBufferRange: [[0, 0], [0, 0]] }); + displayMarkers = editor.findMarkers({ containsBufferPosition: pos }); + displayMarkers = editor.findMarkers({ containsBufferPosition: [42, 42] }); + displayMarkers = editor.findMarkers({ + startBufferPosition: pos, + endBufferPosition: pos, + startScreenPosition: pos, + endScreenPosition: pos, + startsInBufferRange: range, + endsInBufferRange: range, + startsInScreenRange: range, + endsInScreenRange: range, + startBufferRow: 42, + endBufferRow: 42, + startScreenRow: 42, + endScreenRow: 42, + intersectsBufferRowRange: [42, 42], + intersectsScreenRowRange: [42, 42], + containsBufferRange: range, + containsBufferPosition: pos, + containedInBufferRange: range, + containedInScreenRange: range, + intersectsBufferRange: range, + intersectsScreenRange: range, + }); + + displayMarkerLayer = editor.addMarkerLayer(); + displayMarkerLayer = editor.addMarkerLayer({}); + displayMarkerLayer = editor.addMarkerLayer({ maintainHistory: true }); + displayMarkerLayer = editor.addMarkerLayer({ persistent: true }); + displayMarkerLayer = editor.addMarkerLayer({ maintainHistory: true, persistent: true }); + + const potentialMarkerLayer = editor.getMarkerLayer(42); + if (potentialMarkerLayer) { + displayMarkerLayer = potentialMarkerLayer; + } + + displayMarkerLayer = editor.getDefaultMarkerLayer(); + displayMarker = editor.getMarker(42); + displayMarkers = editor.getMarkers(); + num = editor.getMarkerCount(); + + // Cursors + pos = editor.getCursorBufferPosition(); + posArr = editor.getCursorBufferPositions(); + + editor.setCursorBufferPosition(pos); + editor.setCursorBufferPosition(pos, {}); + editor.setCursorBufferPosition(pos, { autoscroll: true }); + editor.setCursorBufferPosition([0, 0], { autoscroll: true }); + + let potentialCursor = editor.getCursorAtScreenPosition(pos); + if (potentialCursor) { + cursor = potentialCursor; + } + + potentialCursor = editor.getCursorAtScreenPosition([0, 0]); + if (potentialCursor) { + cursor = potentialCursor; + } + + pos = editor.getCursorScreenPosition(); + posArr = editor.getCursorScreenPositions(); + + editor.setCursorScreenPosition(pos); + editor.setCursorScreenPosition([0, 0]); + editor.setCursorScreenPosition(pos, {}); + editor.setCursorBufferPosition(pos, { autoscroll: true }); + + cursor = editor.addCursorAtBufferPosition(pos); + cursor = editor.addCursorAtBufferPosition([0, 0]); + + cursor = editor.addCursorAtScreenPosition(pos); + cursor = editor.addCursorAtScreenPosition([0, 0]); + + bool = editor.hasMultipleCursors(); + + editor.moveUp(); + editor.moveUp(42); + + editor.moveDown(); + editor.moveDown(42); + + editor.moveLeft(); + editor.moveLeft(42); + + editor.moveRight(); + editor.moveRight(42); + + editor.moveToBeginningOfLine(); + editor.moveToBeginningOfScreenLine(); + editor.moveToFirstCharacterOfLine(); + editor.moveToEndOfLine(); + editor.moveToEndOfScreenLine(); + editor.moveToBeginningOfWord(); + editor.moveToEndOfWord(); + editor.moveToTop(); + editor.moveToBottom(); + editor.moveToBeginningOfNextWord(); + editor.moveToPreviousWordBoundary(); + editor.moveToNextWordBoundary(); + editor.moveToPreviousSubwordBoundary(); + editor.moveToNextSubwordBoundary(); + editor.moveToBeginningOfNextParagraph(); + editor.moveToBeginningOfPreviousParagraph(); + cursor = editor.getLastCursor(); + + str = editor.getWordUnderCursor(); + str = editor.getWordUnderCursor({}); + str = editor.getWordUnderCursor({ allowPrevious: true }); + str = editor.getWordUnderCursor({ includeNonWordCharacters: true }); + str = editor.getWordUnderCursor({ wordRegex: /r/ }); + str = editor.getWordUnderCursor({ allowPrevious: true, includeNonWordCharacters: true, + wordRegex: /r/ }); + + cursors = editor.getCursors(); + cursors = editor.getCursorsOrderedByBufferPosition(); + + // Selections + str = editor.getSelectedText(); + range = editor.getSelectedBufferRange(); + ranges = editor.getSelectedBufferRanges(); + + editor.setSelectedBufferRange(range); + editor.setSelectedBufferRange(range, {}); + editor.setSelectedBufferRange(range, { preserveFolds: true }); + editor.setSelectedBufferRange(range, { reversed: true }); + editor.setSelectedBufferRange(range, { preserveFolds: true, reversed: true }); + editor.setSelectedBufferRange([pos, pos]); + editor.setSelectedBufferRange([pos, [0, 0]]); + editor.setSelectedBufferRange([[0, 0], pos]); + editor.setSelectedBufferRange([[0, 0], [0, 0]]); + + editor.setSelectedBufferRanges(ranges); + editor.setSelectedBufferRanges([[pos, pos]]); + editor.setSelectedBufferRanges([[pos, [0, 0]]]); + editor.setSelectedBufferRanges([[[0, 0], pos]]); + editor.setSelectedBufferRanges([[[0, 0], [0, 0]]]); + editor.setSelectedBufferRanges(ranges, {}); + editor.setSelectedBufferRanges([[pos, pos]], {}); + editor.setSelectedBufferRanges(ranges, { reversed: true }); + editor.setSelectedBufferRanges([[pos, pos]], { preserveFolds: true }); + editor.setSelectedBufferRanges([[pos, pos]], { reversed: true, preserveFolds: true }); + + range = editor.getSelectedScreenRange(); + ranges = editor.getSelectedScreenRanges(); + + editor.setSelectedScreenRange(range); + editor.setSelectedScreenRange([pos, pos]); + editor.setSelectedScreenRange([pos, [0, 0]]); + editor.setSelectedScreenRange([[0, 0], pos]); + editor.setSelectedScreenRange([[0, 0], [0, 0]]); + editor.setSelectedScreenRange(range, {}); + editor.setSelectedScreenRange([pos, pos], {}); + editor.setSelectedScreenRange(range, { reversed: true }); + editor.setSelectedScreenRange([pos, pos], { reversed: true }); + + editor.setSelectedScreenRanges(ranges); + editor.setSelectedScreenRanges([[pos, pos]]); + editor.setSelectedScreenRanges([[pos, [0, 0]]]); + editor.setSelectedScreenRanges([[[0, 0], pos]]); + editor.setSelectedScreenRanges([[[0, 0], [0, 0]]]); + editor.setSelectedScreenRanges(ranges, {}); + editor.setSelectedScreenRanges([[pos, pos]], {}); + editor.setSelectedScreenRanges(ranges, { reversed: true }); + editor.setSelectedScreenRanges([[pos, pos]], { reversed: true }); + + selection = editor.addSelectionForBufferRange(range); + selection = editor.addSelectionForBufferRange([pos, pos]); + selection = editor.addSelectionForBufferRange([pos, [0, 0]]); + selection = editor.addSelectionForBufferRange([[0, 0], pos]); + selection = editor.addSelectionForBufferRange([[0, 0], [0, 0]]); + selection = editor.addSelectionForBufferRange(range, {}); + selection = editor.addSelectionForBufferRange(range, { preserveFolds: true }); + selection = editor.addSelectionForBufferRange(range, { reversed: true }); + selection = editor.addSelectionForBufferRange(range, { preserveFolds: false, + reversed: false }); + selection = editor.addSelectionForBufferRange([pos, pos], { preserveFolds: false }); + + selection = editor.addSelectionForScreenRange(range); + selection = editor.addSelectionForScreenRange([pos, pos]); + selection = editor.addSelectionForScreenRange([pos, [0, 0]]); + selection = editor.addSelectionForScreenRange([[0, 0], pos]); + selection = editor.addSelectionForScreenRange([[0, 0], [0, 0]]); + selection = editor.addSelectionForScreenRange(range, {}); + selection = editor.addSelectionForScreenRange(range, { preserveFolds: true }); + selection = editor.addSelectionForScreenRange(range, { reversed: true }); + selection = editor.addSelectionForScreenRange(range, { preserveFolds: false, + reversed: false }); + selection = editor.addSelectionForScreenRange([pos, pos], { preserveFolds: false }); + + editor.selectToBufferPosition(pos); + editor.selectToScreenPosition(pos); + + editor.selectUp(); + editor.selectUp(42); + + editor.selectDown(); + editor.selectDown(42); + + editor.selectLeft(); + editor.selectLeft(42); + + editor.selectRight(); + editor.selectRight(42); + + editor.selectToTop(); + editor.selectToBottom(); + editor.selectAll(); + editor.selectToBeginningOfLine(); + editor.selectToFirstCharacterOfLine(); + editor.selectToEndOfLine(); + editor.selectToBeginningOfWord(); + editor.selectToEndOfWord(); + editor.selectLinesContainingCursors(); + editor.selectWordsContainingCursors(); + editor.selectToPreviousSubwordBoundary(); + editor.selectToNextSubwordBoundary(); + editor.selectToPreviousWordBoundary(); + editor.selectToNextWordBoundary(); + editor.selectToBeginningOfNextWord(); + editor.selectToBeginningOfNextParagraph(); + editor.selectToBeginningOfPreviousParagraph(); + + const potentialRange = editor.selectMarker(displayMarker); + if (potentialRange) { + range = potentialRange; + } + + selection = editor.getLastSelection(); + selections = editor.getSelections(); + selections = editor.getSelectionsOrderedByBufferPosition(); + bool = editor.selectionIntersectsBufferRange(range); // not range-compatible + + // Searching and Replacing + editor.scan(/r/, params => { + num = params.match.index; + str = params.matchText; + range = params.range; + params.replace("Test"); + params.stop(); + }); + + editor.scan(/r/, {}, () => {}); + editor.scan(/r/, { leadingContextLineCount: 42 }, () => {}); + editor.scan(/r/, { trailingContextLineCount: 42 }, () => {}); + editor.scan(/r/, { leadingContextLineCount: 42, trailingContextLineCount: 42 }, + () => {}); + + editor.scanInBufferRange(/r/, range, () => {}); + editor.scanInBufferRange(/r/, [pos, pos], () => {}); + editor.scanInBufferRange(/r/, [pos, [0, 0]], () => {}); + editor.scanInBufferRange(/r/, [[0, 0], pos], () => {}); + editor.scanInBufferRange(/r/, [[0, 0], [0, 0]], () => {}); + editor.scanInBufferRange(/r/, range, params => { + num = params.match.index; + str = params.matchText; + range = params.range; + params.replace("Test"); + params.stop(); + }); + + editor.backwardsScanInBufferRange(/r/, range, () => {}); + editor.backwardsScanInBufferRange(/r/, [pos, pos], () => {}); + editor.backwardsScanInBufferRange(/r/, [pos, [0, 0]], () => {}); + editor.backwardsScanInBufferRange(/r/, [[0, 0], pos], () => {}); + editor.backwardsScanInBufferRange(/r/, [[0, 0], [0, 0]], () => {}); + editor.backwardsScanInBufferRange(/r/, range, params => { + num = params.match.index; + str = params.matchText; + range = params.range; + params.replace("Test"); + params.stop(); + }); + + // Tab Behavior + bool = editor.getSoftTabs(); + editor.setSoftTabs(true); + bool = editor.toggleSoftTabs(); + num = editor.getTabLength(); + editor.setTabLength(42); + + const potentialBool = editor.usesSoftTabs(); + if (potentialBool) { + bool = potentialBool; + } + + str = editor.getTabText(); + + // Soft Wrap Behavior + bool = editor.isSoftWrapped(); + editor.setSoftWrapped(true); + bool = editor.toggleSoftWrapped(); + num = editor.getSoftWrapColumn(); + + // Indentation + num = editor.indentationForBufferRow(42); + + editor.setIndentationForBufferRow(42, 42); + editor.setIndentationForBufferRow(42, 42, {}); + editor.setIndentationForBufferRow(42, 42, { preserveLeadingWhitespace: true }); + + editor.indentSelectedRows(); + editor.outdentSelectedRows(); + num = editor.indentLevelForLine("Test"); + editor.autoIndentSelectedRows(); + + // Grammars + grammar = editor.getGrammar(); + editor.setGrammar(grammar); + + // Managing Syntax Scopes + scopeDescriptor = editor.getRootScopeDescriptor(); + + scopeDescriptor = editor.scopeDescriptorForBufferPosition(pos); + scopeDescriptor = editor.scopeDescriptorForBufferPosition([0, 0]); + + range = editor.bufferRangeForScopeAtCursor("selector"); + bool = editor.isBufferRowCommented(42); + + // Clipboard Operations + editor.copySelectedText(); + editor.cutSelectedText(); + + editor.pasteText(); + editor.pasteText({}); + editor.pasteText({ autoIndentNewline: true }); + editor.pasteText({ autoIndent: true }); + editor.pasteText({ autoDecreaseIndent: true }); + editor.pasteText({ normalizeLineEndings: true }); + editor.pasteText({ select: true }); + editor.pasteText({ undo: "skip" }); + editor.pasteText({ autoIndentNewline: true, autoIndent: true, autoDecreaseIndent: true, + normalizeLineEndings: true, select: true, undo: "skip" }); + + editor.cutToEndOfLine(); + editor.cutToEndOfBufferLine(); + + // Folds + editor.foldCurrentRow(); + editor.unfoldCurrentRow(); + editor.foldBufferRow(42); + editor.unfoldBufferRow(42); + editor.foldSelectedLines(); + editor.foldAll(); + editor.unfoldAll(); + editor.foldAllAtIndentLevel(42); + editor.isFoldableAtBufferRow(42); + editor.isFoldableAtScreenRow(42); + editor.toggleFoldAtBufferRow(42); + editor.isFoldedAtCursorRow(); + editor.isFoldedAtBufferRow(42); + editor.isFoldedAtScreenRow(42); + + // Gutters + editor.addGutter({ name: "Test" }); + editor.addGutter({ name: "Test", priority: 42 }); + editor.addGutter({ name: "Test", visible: true }); + editor.addGutter({ name: "Test", priority: 42, visible: true }); + + gutters = editor.getGutters(); + + const potentialGutter = editor.gutterWithName("test-gutter"); + if (potentialGutter) { + gutter = potentialGutter; + } + + editor.scrollToCursorPosition(); + editor.scrollToCursorPosition({}); + editor.scrollToCursorPosition({ center: true }); + + editor.scrollToBufferPosition(pos); + editor.scrollToBufferPosition([0, 0]); + editor.scrollToBufferPosition(pos, {}); + editor.scrollToBufferPosition([0, 0], {}); + editor.scrollToBufferPosition(pos, { center: true }); + editor.scrollToBufferPosition([0, 0], { center: true }); + + editor.scrollToScreenPosition(pos); + editor.scrollToScreenPosition([0, 0]); + editor.scrollToScreenPosition(pos, {}); + editor.scrollToScreenPosition([0, 0], {}); + editor.scrollToScreenPosition(pos, { center: true }); + editor.scrollToScreenPosition([0, 0], { center: true }); + + // TextEditor Rendering + str = editor.getPlaceholderText(); + editor.setPlaceholderText("Test"); +} + +// ThemeManager =============================================================== +function testThemeManager() { + // Event Subscription + subscription = atom.themes.onDidChangeActiveThemes(() => {}); + + // Accessing Loaded Themes + let potentialStrs = atom.themes.getLoadedThemeNames(); + if (potentialStrs) { + strs = potentialStrs; + } + + let potentialPacks = atom.themes.getLoadedThemes(); + if (potentialPacks) { + packs = potentialPacks; + } + + // Accessing Active Themes + potentialStrs = atom.themes.getActiveThemeNames(); + if (potentialStrs) { + strs = potentialStrs; + } + + potentialPacks = atom.themes.getActiveThemes(); + if (potentialPacks) { + packs = potentialPacks; + } + + // Managing Enabled Themes + strs = atom.themes.getEnabledThemeNames(); +} + +// TooltipManager ============================================================= +function testTooltipManager() { + subscription = atom.tooltips.add(element, { title: "Test"}); + subscription = atom.tooltips.add(element, { title: "

Test

", html: true }); + subscription = atom.tooltips.add(element, { item: element}); + subscription = atom.tooltips.add(element, { class: "test-class" }); + subscription = atom.tooltips.add(element, { placement: "top" }); + + subscription = atom.tooltips.add(element, { placement: () => "left" }); + + subscription = atom.tooltips.add(element, { trigger: "click" }); + subscription = atom.tooltips.add(element, { delay: { hide: 42, show: 42 }}); + subscription = atom.tooltips.add(element, { keyBindingCommand: "test-command", + keyBindingTarget: element }); + + tooltips = atom.tooltips.findTooltips(element); +} + +// ViewRegistry =============================================================== +function testViewRegistry() { + atom.views.addViewProvider(Atom.Point, (point) => { + point.column; + return element; + }); + + element = atom.views.getView(element); +} + +// Workspace ================================================================== +function testWorkspace() { + // Event Subscription + subscription = atom.workspace.observeTextEditors(editor => editor.id); + subscription = atom.workspace.observePaneItems((item) => {}); + subscription = atom.workspace.onDidChangeActivePaneItem((item) => {}); + subscription = atom.workspace.onDidStopChangingActivePaneItem((item) => {}); + + subscription = atom.workspace.onDidChangeActiveTextEditor(editor => { + if (editor) { + editor.id; + } + }); + + subscription = atom.workspace.observeActivePaneItem((item) => {}); + + subscription = atom.workspace.observeActiveTextEditor(editor => { + if (editor) { + editor.id; + } + }); + + subscription = atom.workspace.onDidOpen(event => event.index && event.item && + event.pane && event.uri); + subscription = atom.workspace.onDidAddPane(event => event.pane); + subscription = atom.workspace.onWillDestroyPane(event => event.pane); + subscription = atom.workspace.onDidDestroyPane(event => event.pane); + subscription = atom.workspace.observePanes(pane => pane.activate()); + subscription = atom.workspace.onDidChangeActivePane(pane => pane.activate()); + subscription = atom.workspace.observeActivePane(pane => pane.activate()); + subscription = atom.workspace.onDidAddPaneItem(event => event.index && event.item && + event.pane); + subscription = atom.workspace.onWillDestroyPaneItem(event => { + event.index && event.item && event.pane; + }); + subscription = atom.workspace.onDidDestroyPaneItem(event => event.index && + event.item && event.pane); + subscription = atom.workspace.onDidAddTextEditor(event => event.index && event.pane && + event.textEditor); + + // Opening + async function workspaceOpen() { + obj = await atom.workspace.open(); + obj = await atom.workspace.open("https://test"); + obj = await atom.workspace.open("https://test", { activateItem: true }); + obj = await atom.workspace.open("https://test", { activatePane: true }); + obj = await atom.workspace.open("https://test", { initialColumn: 42 }); + obj = await atom.workspace.open("https://test", { initialLine: 42 }); + obj = await atom.workspace.open("https://test", { location: "right" }); + obj = await atom.workspace.open("https://test", { split: "up" }); + obj = await atom.workspace.open("https://test", { pending: true }); + obj = await atom.workspace.open("https://test", { searchAllPanes: true }); + obj = await atom.workspace.open("https://test", { + activateItem: true, + activatePane: true, + initialColumn: 42, + initialLine: 42, + location: "left", + split: "left", + pending: true, + searchAllPanes: true, + }); + } + + bool = atom.workspace.hide("https://test"); + bool = atom.workspace.hide(element); + + async function workspaceToggle() { + await atom.workspace.toggle("https://test"); + await atom.workspace.toggle(element); + } + + obj = atom.workspace.createItemForURI("https://test"); + + bool = atom.workspace.isTextEditor(obj); + + async function workspaceReopen() { + const result = await atom.workspace.reopenItem(); + if (result) obj = result; + } + + atom.workspace.addOpener((uri) => { + if (uri === "test://") { + return { + getTitle: () => "Test Title", + }; + } + }); + + atom.workspace.buildTextEditor(obj); + + // Pane Items + objs = atom.workspace.getPaneItems(); + obj = atom.workspace.getActivePaneItem(); + editors = atom.workspace.getTextEditors(); + + const potentialEditor = atom.workspace.getActiveTextEditor(); + if (potentialEditor) { + editor = potentialEditor; + } + + // Panes + paneContainer = atom.workspace.getActivePaneContainer(); + panes = atom.workspace.getPanes(); + pane = atom.workspace.getActivePane(); + bool = atom.workspace.activateNextPane(); + bool = atom.workspace.activatePreviousPane(); + + let potentialPaneContainer = atom.workspace.paneContainerForURI("https://test"); + if (potentialPaneContainer) { + paneContainer = potentialPaneContainer; + } + + potentialPaneContainer = atom.workspace.paneContainerForItem(element); + if (potentialPaneContainer) { + paneContainer = potentialPaneContainer; + } + + let potentialPane = atom.workspace.paneForURI("https://test"); + if (potentialPane) { + pane = potentialPane; + } + + potentialPane = atom.workspace.paneForItem(element); + if (potentialPane) { + pane = potentialPane; + } + + // Pane Locations + workspaceCenter = atom.workspace.getCenter(); + dock = atom.workspace.getLeftDock(); + dock = atom.workspace.getRightDock(); + dock = atom.workspace.getBottomDock(); + + // Panels + panels = atom.workspace.getBottomPanels(); + + panel = atom.workspace.addBottomPanel({ item: element }); + panel = atom.workspace.addBottomPanel({ item: element, priority: 100, visible: true }); + + panels = atom.workspace.getLeftPanels(); + + panel = atom.workspace.addLeftPanel({ item: element }); + panel = atom.workspace.addLeftPanel({ item: element, priority: 100, visible: true }); + + panels = atom.workspace.getRightPanels(); + + panel = atom.workspace.addRightPanel({ item: element }); + panel = atom.workspace.addRightPanel({ item: element, priority: 100, visible: true }); + + panels = atom.workspace.getTopPanels(); + + panel = atom.workspace.addTopPanel({ item: element }); + panel = atom.workspace.addTopPanel({ item: element, priority: 100, visible: true }); + + panels = atom.workspace.getHeaderPanels(); + + panel = atom.workspace.addHeaderPanel({ item: element }); + panel = atom.workspace.addHeaderPanel({ item: element, priority: 100, visible: true }); + + panels = atom.workspace.getFooterPanels(); + + panel = atom.workspace.addFooterPanel({ item: element }); + panel = atom.workspace.addFooterPanel({ item: element, priority: 100, visible: true }); + + panels = atom.workspace.getModalPanels(); + + panel = atom.workspace.addModalPanel({ item: element }); + panel = atom.workspace.addModalPanel({ item: element, priority: 100, visible: true }); + + const potentialPanel = atom.workspace.panelForItem(element); + if (potentialPanel) { + panel = potentialPanel; + } + + const scanResults = atom.workspace.scan(/r/, () => {}); + scanResults.cancel(); + + // Searching and Replacing + async function workspaceScan() { + await scanResults; + + const scanOptions = { + onPathsSearched: (pathsSearched: number) => {}, + leadingContextLineCount: 5, + trailingContextLineCount: 5, + paths: ["a"], + }; + await atom.workspace.scan(/r/, scanOptions, (results) => { + str = results.filePath; + for (const match of results.matches) { + range = Atom.Range.fromObject(match.range); + strs = match.leadingContextLines; + strs = match.trailingContextLines; + } + }); + } + + async function workspaceReplace() { + await atom.workspace.replace(/r/, "Test", ["a"], (options) => {}); + } +} + +// WorkspaceCenter ============================================================ +function testWorkspaceCenter() { + // Event Subscription + subscription = workspaceCenter.observeTextEditors(editor => editor.id); + subscription = workspaceCenter.observePaneItems(item => {}); + subscription = workspaceCenter.onDidChangeActivePaneItem(item => {}); + subscription = workspaceCenter.onDidStopChangingActivePaneItem(item => {}); + subscription = workspaceCenter.observeActivePaneItem(item => {}); + + // Pane Items + objs = workspaceCenter.getPaneItems(); + workspaceCenter.getActivePaneItem(); + editors = workspaceCenter.getTextEditors(); + + const potentialEditor = workspaceCenter.getActiveTextEditor(); + if (potentialEditor) { + editor = potentialEditor; + } + + // Panes + panes = workspaceCenter.getPanes(); + pane = workspaceCenter.getActivePane(); + workspaceCenter.activateNextPane(); + workspaceCenter.activatePreviousPane(); +} + +// watchPath ================================================================== +const pathWatcher = Atom.watchPath("/var/test", {}, (events) => { + for (const event of events) { + str = event.path; + str = event.action; + if (event.oldPath) str = event.oldPath; + } }); - -sub = editor.onDidStopChanging(event => { - for (const change of event.changes) { - change.newExtent && change.oldExtent && change.newRange && change.oldRange && - change.newText && change.oldText && change.start; - } -}); - -sub = editor.onDidChangeCursorPosition(event => event.newBufferPosition); -sub = editor.onDidChangeSelectionRange(event => event.selection); -sub = editor.onDidSave(event => event.path); -sub = editor.onDidDestroy(() => {}); -sub = editor.observeGutters(gutter => gutter.show()); -sub = editor.onDidAddGutter(gutter => gutter.hide()); -sub = editor.onDidRemoveGutter(name => name.length); -sub = editor.onDidChangeSoftWrapped(softWrapped => {}); -sub = editor.onDidChangeEncoding(encoding => {}); -sub = editor.observeGrammar(grammar => grammar.name); -sub = editor.onDidChangeGrammar(grammar => grammar.scopeName); -sub = editor.onDidChangeModified(modified => {}); -sub = editor.onDidConflict(() => {}); -sub = editor.onWillInsertText(event => event.cancel && event.text); -sub = editor.onDidInsertText(event => event.text); -sub = editor.observeCursors(cursor => cursor.moveToBottom()); -sub = editor.onDidAddCursor(cursor => cursor.getMarker()); -sub = editor.onDidRemoveCursor(cursor => cursor.compare(cursor)); -sub = editor.observeSelections(selection => selection.cutToEndOfBufferLine()); -sub = editor.onDidAddSelection(selection => selection.selectWord()); -sub = editor.onDidRemoveSelection(selection => selection.toggleLineComments()); -sub = editor.observeDecorations(decoration => decoration.getId()); -sub = editor.onDidAddDecoration(decoration => decoration.id); -sub = editor.onDidRemoveDecoration(decoration => decoration.getId()); -sub = editor.onDidChangePlaceholderText(placeholderText => - placeholderText.toLowerCase()); -buffer = editor.getBuffer(); - -// File Details -str = editor.getTitle(); -str = editor.getLongTitle(); - -const filePath = editor.getPath(); -if (filePath) { - str = filePath; -} - -bool = editor.isModified(); -bool = editor.isEmpty(); -str = editor.getEncoding(); -editor.setEncoding("utf8"); - -// File Operations -async function saveEditor() { - await editor.save(); - await editor.saveAs("test.file"); -} - -// Reading Text -str = editor.getText(); -str = editor.getTextInBufferRange(range); -num = editor.getLineCount(); -num = editor.getScreenLineCount(); -num = editor.getLastBufferRow(); -num = editor.getLastScreenRow(); -str = editor.lineTextForBufferRow(42); -str = editor.lineTextForScreenRow(42); -range = editor.getCurrentParagraphBufferRange(); - -// Mutating Text -editor.setText("Test"); - -editor.setTextInBufferRange(range, "Test"); -editor.setTextInBufferRange([pos, pos], "Test"); -editor.setTextInBufferRange([pos, [0, 0]], "Test"); -editor.setTextInBufferRange([[0, 0], pos], "Test"); -editor.setTextInBufferRange([[0, 0], [0, 0]], "Test"); -editor.setTextInBufferRange(range, "Test", {}); -editor.setTextInBufferRange([pos, pos], "Test", { normalizeLineEndings: true }); -editor.setTextInBufferRange(range, "Test", { normalizeLineEndings: true, - undo: "skip" }); - -editor.insertText("Test"); -editor.insertText("Test", {}); -editor.insertText("Test", { autoDecreaseIndent: true }); -editor.insertText("Test", { autoIndent: true }); -editor.insertText("Test", { autoIndentNewline: true }); -editor.insertText("Test", { normalizeLineEndings: true }); -editor.insertText("Test", { select: true }); -editor.insertText("Test", { undo: "skip" }); -editor.insertText("Text", { autoDecreaseIndent: false, autoIndent: false, - autoIndentNewline: false, normalizeLineEndings: false, select: false, undo: "skip" }); - -editor.insertNewline(); -editor.delete(); -editor.backspace(); -editor.mutateSelectedText((selection, index) => { selection.clear(); }); -editor.transpose(); -editor.upperCase(); -editor.lowerCase(); -editor.toggleLineCommentsInSelection(); -editor.insertNewlineBelow(); -editor.insertNewlineAbove(); -editor.deleteToBeginningOfWord(); -editor.deleteToPreviousWordBoundary(); -editor.deleteToNextWordBoundary(); -editor.deleteToBeginningOfSubword(); -editor.deleteToEndOfSubword(); -editor.deleteToBeginningOfLine(); -editor.deleteToEndOfLine(); -editor.deleteToEndOfWord(); -editor.deleteLine(); - -// History -editor.undo(); -editor.redo(); - -editor.transact(() => {}); -editor.transact(42, () => {}); - -editor.abortTransaction(); -num = editor.createCheckpoint(); -bool = editor.revertToCheckpoint(42); -bool = editor.groupChangesSinceCheckpoint(42); - -// TextEditor Coordinates -pos = editor.screenPositionForBufferPosition(pos); -pos = editor.screenPositionForBufferPosition([0, 0]); -pos = editor.screenPositionForBufferPosition(pos, {}); -pos = editor.screenPositionForBufferPosition(pos, { clipDirection: "backward" }); -pos = editor.screenPositionForBufferPosition([0, 0], { clipDirection: "forward" }); - -pos = editor.bufferPositionForScreenPosition(pos); -pos = editor.bufferPositionForScreenPosition([0, 0]); -pos = editor.bufferPositionForScreenPosition(pos, {}); -pos = editor.bufferPositionForScreenPosition(pos, { clipDirection: "backward" }); -pos = editor.bufferPositionForScreenPosition([0, 0], { clipDirection: "forward" }); - -range = editor.screenRangeForBufferRange(range); -range = editor.screenRangeForBufferRange([pos, pos]); -range = editor.screenRangeForBufferRange([pos, [0, 0]]); -range = editor.screenRangeForBufferRange([[0, 0], pos]); -range = editor.screenRangeForBufferRange([[0, 0], [0, 0]]); - -range = editor.bufferRangeForScreenRange(range); -range = editor.bufferRangeForScreenRange([pos, pos]); -range = editor.bufferRangeForScreenRange([pos, [0, 0]]); -range = editor.bufferRangeForScreenRange([[0, 0], pos]); -range = editor.bufferRangeForScreenRange([[0, 0], [0, 0]]); - -pos = editor.clipBufferPosition(pos); -pos = editor.clipBufferPosition([0, 0]); - -range = editor.clipBufferRange(range); -range = editor.clipBufferRange([pos, pos]); -range = editor.clipBufferRange([pos, [0, 0]]); -range = editor.clipBufferRange([[0, 0], pos]); -range = editor.clipBufferRange([[0, 0], [0, 0]]); - -pos = editor.clipScreenPosition(pos); -pos = editor.clipScreenPosition([0, 0]); -pos = editor.clipScreenPosition(pos, {}); -pos = editor.clipScreenPosition(pos, { clipDirection: "closest" }); -pos = editor.clipScreenPosition([0, 0], { clipDirection: "closest" }); - -range = editor.clipScreenRange(range); -range = editor.clipScreenRange([pos, pos]); -range = editor.clipScreenRange([pos, [0, 0]]); -range = editor.clipScreenRange([[0, 0], pos]); -range = editor.clipScreenRange([[0, 0], [0, 0]]); -range = editor.clipScreenRange(range, {}); -range = editor.clipScreenRange(range, { clipDirection: "closest" }); -range = editor.clipScreenRange([pos, pos], { clipDirection: "closest" }); - -// Decorations -decoration = editor.decorateMarker(displayMarker, { type: "line" }); -decoration = editor.decorateMarker(displayMarker, { type: "line", avoidOverflow: true, - class: "test-class", gutterName: "gutterName", item: element, onlyEmpty: true, - onlyHead: true, onlyNonEmpty: true, position: "before" }); - -layerDecoration = editor.decorateMarkerLayer(displayMarkerLayer, { type: "line-number" }); -layerDecoration = editor.decorateMarkerLayer(displayMarkerLayer, { type: "line-number", - avoidOverflow: false, class: "test-class", item: element, onlyEmpty: false, onlyHead: false, - onlyNonEmpty: false, position: "after" }); - -decorations = editor.getDecorations(); -decorations = editor.getDecorations({}); -decorations = editor.getDecorations({ type: "line-number" }); -decorations = editor.getDecorations({ type: "line", avoidOverflow: true, - class: "test-class", gutterName: "gutterName", item: element, onlyEmpty: true, - onlyHead: true, onlyNonEmpty: true, position: "before" }); - -decorations = editor.getLineDecorations(); -decorations = editor.getLineDecorations({}); -decorations = editor.getLineDecorations({ avoidOverflow: true }); -decorations = editor.getLineDecorations({ avoidOverflow: true, class: "test-class", - item: element, onlyEmpty: true, onlyHead: true, onlyNonEmpty: true, - position: "before" }); - -decorations = editor.getLineNumberDecorations(); -decorations = editor.getLineNumberDecorations({}); -decorations = editor.getLineNumberDecorations({ onlyHead: true }); -decorations = editor.getLineNumberDecorations({ avoidOverflow: true, - class: "test-class", gutterName: "gutterName", item: element, onlyEmpty: true, - onlyHead: true, onlyNonEmpty: true, position: "before" }); - -decorations = editor.getHighlightDecorations(); -decorations = editor.getHighlightDecorations({}); -decorations = editor.getHighlightDecorations({ onlyHead: true }); -decorations = editor.getHighlightDecorations({ avoidOverflow: true, - class: "test-class", item: element, onlyEmpty: true, onlyHead: true, onlyNonEmpty: true, - position: "before" }); - -decorations = editor.getOverlayDecorations(); -decorations = editor.getOverlayDecorations({}); -decorations = editor.getOverlayDecorations({ onlyHead: true }); -decorations = editor.getOverlayDecorations({ avoidOverflow: true, - class: "test-class", item: element, onlyEmpty: true, onlyHead: true, onlyNonEmpty: true, - position: "before" }); - -// Markers -displayMarker = editor.markBufferRange(range); -displayMarker = editor.markBufferRange([pos, pos]); -displayMarker = editor.markBufferRange([pos, [0, 0]]); -displayMarker = editor.markBufferRange([[0, 0], pos]); -displayMarker = editor.markBufferRange([[0, 0], [0, 0]]); -displayMarker = editor.markBufferRange(range, {}); -displayMarker = editor.markBufferRange(range, { invalidate: "surround" }); -displayMarker = editor.markBufferRange(range, { maintainHistory: true }); -displayMarker = editor.markBufferRange(range, { reversed: true }); -displayMarker = editor.markBufferRange([[0, 0], [0, 0]], { invalidate: "overlap" }); -displayMarker = editor.markBufferRange(range, { invalidate: "surround", - maintainHistory: false, reversed: false }); - -displayMarker = editor.markBufferPosition(pos); -displayMarker = editor.markBufferPosition([0, 0]); -displayMarker = editor.markBufferPosition(pos, {}); -displayMarker = editor.markBufferPosition(pos, { invalidate: "never" }); -displayMarker = editor.markBufferPosition([0, 0], { invalidate: "surround" }); - -displayMarker = editor.markScreenPosition(pos); -displayMarker = editor.markScreenPosition([0, 0]); -displayMarker = editor.markScreenPosition(pos, {}); -displayMarker = editor.markScreenPosition(pos, { invalidate: "never" }); -displayMarker = editor.markScreenPosition(pos, { clipDirection: "forward" }); -displayMarker = editor.markScreenPosition([0, 0], { invalidate: "surround", - clipDirection: "backward" }); - -displayMarkers = editor.findMarkers({ startBufferRow: 42 }); -displayMarkers = editor.findMarkers({ endBufferRow: 42 }); -displayMarkers = editor.findMarkers({ containsBufferRange: range }); -displayMarkers = editor.findMarkers({ containsBufferRange: [pos, pos] }); -displayMarkers = editor.findMarkers({ containsBufferRange: [pos, [0, 0]] }); -displayMarkers = editor.findMarkers({ containsBufferRange: [[0, 0], pos] }); -displayMarkers = editor.findMarkers({ containsBufferRange: [[0, 0], [0, 0]] }); -displayMarkers = editor.findMarkers({ containsBufferPosition: pos }); -displayMarkers = editor.findMarkers({ containsBufferPosition: [42, 42] }); -displayMarkers = editor.findMarkers({ - startBufferPosition: pos, - endBufferPosition: pos, - startScreenPosition: pos, - endScreenPosition: pos, - startsInBufferRange: range, - endsInBufferRange: range, - startsInScreenRange: range, - endsInScreenRange: range, - startBufferRow: 42, - endBufferRow: 42, - startScreenRow: 42, - endScreenRow: 42, - intersectsBufferRowRange: [42, 42], - intersectsScreenRowRange: [42, 42], - containsBufferRange: range, - containsBufferPosition: pos, - containedInBufferRange: range, - containedInScreenRange: range, - intersectsBufferRange: range, - intersectsScreenRange: range, -}); - -displayMarkerLayer = editor.addMarkerLayer(); -displayMarkerLayer = editor.addMarkerLayer({}); -displayMarkerLayer = editor.addMarkerLayer({ maintainHistory: true }); -displayMarkerLayer = editor.addMarkerLayer({ persistent: true }); -displayMarkerLayer = editor.addMarkerLayer({ maintainHistory: true, persistent: true }); - -const potentialMarkerLayer = editor.getMarkerLayer(42); -if (potentialMarkerLayer) { - displayMarkerLayer = potentialMarkerLayer; -} - -displayMarkerLayer = editor.getDefaultMarkerLayer(); -displayMarker = editor.getMarker(42); -displayMarkers = editor.getMarkers(); -num = editor.getMarkerCount(); - -// Cursors -pos = editor.getCursorBufferPosition(); -posArr = editor.getCursorBufferPositions(); - -editor.setCursorBufferPosition(pos); -editor.setCursorBufferPosition(pos, {}); -editor.setCursorBufferPosition(pos, { autoscroll: true }); -editor.setCursorBufferPosition([0, 0], { autoscroll: true }); - -let potentialCursor = editor.getCursorAtScreenPosition(pos); -if (potentialCursor) { - cursor = potentialCursor; -} - -potentialCursor = editor.getCursorAtScreenPosition([0, 0]); -if (potentialCursor) { - cursor = potentialCursor; -} - -pos = editor.getCursorScreenPosition(); -posArr = editor.getCursorScreenPositions(); - -editor.setCursorScreenPosition(pos); -editor.setCursorScreenPosition([0, 0]); -editor.setCursorScreenPosition(pos, {}); -editor.setCursorBufferPosition(pos, { autoscroll: true }); - -cursor = editor.addCursorAtBufferPosition(pos); -cursor = editor.addCursorAtBufferPosition([0, 0]); - -cursor = editor.addCursorAtScreenPosition(pos); -cursor = editor.addCursorAtScreenPosition([0, 0]); - -bool = editor.hasMultipleCursors(); - -editor.moveUp(); -editor.moveUp(42); - -editor.moveDown(); -editor.moveDown(42); - -editor.moveLeft(); -editor.moveLeft(42); - -editor.moveRight(); -editor.moveRight(42); - -editor.moveToBeginningOfLine(); -editor.moveToBeginningOfScreenLine(); -editor.moveToFirstCharacterOfLine(); -editor.moveToEndOfLine(); -editor.moveToEndOfScreenLine(); -editor.moveToBeginningOfWord(); -editor.moveToEndOfWord(); -editor.moveToTop(); -editor.moveToBottom(); -editor.moveToBeginningOfNextWord(); -editor.moveToPreviousWordBoundary(); -editor.moveToNextWordBoundary(); -editor.moveToPreviousSubwordBoundary(); -editor.moveToNextSubwordBoundary(); -editor.moveToBeginningOfNextParagraph(); -editor.moveToBeginningOfPreviousParagraph(); -cursor = editor.getLastCursor(); - -str = editor.getWordUnderCursor(); -str = editor.getWordUnderCursor({}); -str = editor.getWordUnderCursor({ allowPrevious: true }); -str = editor.getWordUnderCursor({ includeNonWordCharacters: true }); -str = editor.getWordUnderCursor({ wordRegex: /r/ }); -str = editor.getWordUnderCursor({ allowPrevious: true, includeNonWordCharacters: true, - wordRegex: /r/ }); - -cursors = editor.getCursors(); -cursors = editor.getCursorsOrderedByBufferPosition(); - -// Selections -str = editor.getSelectedText(); -range = editor.getSelectedBufferRange(); -ranges = editor.getSelectedBufferRanges(); - -editor.setSelectedBufferRange(range); -editor.setSelectedBufferRange(range, {}); -editor.setSelectedBufferRange(range, { preserveFolds: true }); -editor.setSelectedBufferRange(range, { reversed: true }); -editor.setSelectedBufferRange(range, { preserveFolds: true, reversed: true }); -editor.setSelectedBufferRange([pos, pos]); -editor.setSelectedBufferRange([pos, [0, 0]]); -editor.setSelectedBufferRange([[0, 0], pos]); -editor.setSelectedBufferRange([[0, 0], [0, 0]]); - -editor.setSelectedBufferRanges(ranges); -editor.setSelectedBufferRanges([[pos, pos]]); -editor.setSelectedBufferRanges([[pos, [0, 0]]]); -editor.setSelectedBufferRanges([[[0, 0], pos]]); -editor.setSelectedBufferRanges([[[0, 0], [0, 0]]]); -editor.setSelectedBufferRanges(ranges, {}); -editor.setSelectedBufferRanges([[pos, pos]], {}); -editor.setSelectedBufferRanges(ranges, { reversed: true }); -editor.setSelectedBufferRanges([[pos, pos]], { preserveFolds: true }); -editor.setSelectedBufferRanges([[pos, pos]], { reversed: true, preserveFolds: true }); - -range = editor.getSelectedScreenRange(); -ranges = editor.getSelectedScreenRanges(); - -editor.setSelectedScreenRange(range); -editor.setSelectedScreenRange([pos, pos]); -editor.setSelectedScreenRange([pos, [0, 0]]); -editor.setSelectedScreenRange([[0, 0], pos]); -editor.setSelectedScreenRange([[0, 0], [0, 0]]); -editor.setSelectedScreenRange(range, {}); -editor.setSelectedScreenRange([pos, pos], {}); -editor.setSelectedScreenRange(range, { reversed: true }); -editor.setSelectedScreenRange([pos, pos], { reversed: true }); - -editor.setSelectedScreenRanges(ranges); -editor.setSelectedScreenRanges([[pos, pos]]); -editor.setSelectedScreenRanges([[pos, [0, 0]]]); -editor.setSelectedScreenRanges([[[0, 0], pos]]); -editor.setSelectedScreenRanges([[[0, 0], [0, 0]]]); -editor.setSelectedScreenRanges(ranges, {}); -editor.setSelectedScreenRanges([[pos, pos]], {}); -editor.setSelectedScreenRanges(ranges, { reversed: true }); -editor.setSelectedScreenRanges([[pos, pos]], { reversed: true }); - -selection = editor.addSelectionForBufferRange(range); -selection = editor.addSelectionForBufferRange([pos, pos]); -selection = editor.addSelectionForBufferRange([pos, [0, 0]]); -selection = editor.addSelectionForBufferRange([[0, 0], pos]); -selection = editor.addSelectionForBufferRange([[0, 0], [0, 0]]); -selection = editor.addSelectionForBufferRange(range, {}); -selection = editor.addSelectionForBufferRange(range, { preserveFolds: true }); -selection = editor.addSelectionForBufferRange(range, { reversed: true }); -selection = editor.addSelectionForBufferRange(range, { preserveFolds: false, - reversed: false }); -selection = editor.addSelectionForBufferRange([pos, pos], { preserveFolds: false }); - -selection = editor.addSelectionForScreenRange(range); -selection = editor.addSelectionForScreenRange([pos, pos]); -selection = editor.addSelectionForScreenRange([pos, [0, 0]]); -selection = editor.addSelectionForScreenRange([[0, 0], pos]); -selection = editor.addSelectionForScreenRange([[0, 0], [0, 0]]); -selection = editor.addSelectionForScreenRange(range, {}); -selection = editor.addSelectionForScreenRange(range, { preserveFolds: true }); -selection = editor.addSelectionForScreenRange(range, { reversed: true }); -selection = editor.addSelectionForScreenRange(range, { preserveFolds: false, - reversed: false }); -selection = editor.addSelectionForScreenRange([pos, pos], { preserveFolds: false }); - -editor.selectToBufferPosition(pos); -editor.selectToScreenPosition(pos); - -editor.selectUp(); -editor.selectUp(42); - -editor.selectDown(); -editor.selectDown(42); - -editor.selectLeft(); -editor.selectLeft(42); - -editor.selectRight(); -editor.selectRight(42); - -editor.selectToTop(); -editor.selectToBottom(); -editor.selectAll(); -editor.selectToBeginningOfLine(); -editor.selectToFirstCharacterOfLine(); -editor.selectToEndOfLine(); -editor.selectToBeginningOfWord(); -editor.selectToEndOfWord(); -editor.selectLinesContainingCursors(); -editor.selectWordsContainingCursors(); -editor.selectToPreviousSubwordBoundary(); -editor.selectToNextSubwordBoundary(); -editor.selectToPreviousWordBoundary(); -editor.selectToNextWordBoundary(); -editor.selectToBeginningOfNextWord(); -editor.selectToBeginningOfNextParagraph(); -editor.selectToBeginningOfPreviousParagraph(); - -const potentialRange = editor.selectMarker(displayMarker); -if (potentialRange) { - range = potentialRange; -} - -selection = editor.getLastSelection(); -selections = editor.getSelections(); -selections = editor.getSelectionsOrderedByBufferPosition(); -bool = editor.selectionIntersectsBufferRange(range); // not range-compatible - -// Searching and Replacing -editor.scan(/r/, params => { - num = params.match.index; - str = params.matchText; - range = params.range; - params.replace("Test"); - params.stop(); -}); - -editor.scan(/r/, {}, () => {}); -editor.scan(/r/, { leadingContextLineCount: 42 }, () => {}); -editor.scan(/r/, { trailingContextLineCount: 42 }, () => {}); -editor.scan(/r/, { leadingContextLineCount: 42, trailingContextLineCount: 42 }, - () => {}); - -editor.scanInBufferRange(/r/, range, () => {}); -editor.scanInBufferRange(/r/, [pos, pos], () => {}); -editor.scanInBufferRange(/r/, [pos, [0, 0]], () => {}); -editor.scanInBufferRange(/r/, [[0, 0], pos], () => {}); -editor.scanInBufferRange(/r/, [[0, 0], [0, 0]], () => {}); -editor.scanInBufferRange(/r/, range, params => { - num = params.match.index; - str = params.matchText; - range = params.range; - params.replace("Test"); - params.stop(); -}); - -editor.backwardsScanInBufferRange(/r/, range, () => {}); -editor.backwardsScanInBufferRange(/r/, [pos, pos], () => {}); -editor.backwardsScanInBufferRange(/r/, [pos, [0, 0]], () => {}); -editor.backwardsScanInBufferRange(/r/, [[0, 0], pos], () => {}); -editor.backwardsScanInBufferRange(/r/, [[0, 0], [0, 0]], () => {}); -editor.backwardsScanInBufferRange(/r/, range, params => { - num = params.match.index; - str = params.matchText; - range = params.range; - params.replace("Test"); - params.stop(); -}); - -// Tab Behavior -bool = editor.getSoftTabs(); -editor.setSoftTabs(true); -bool = editor.toggleSoftTabs(); -num = editor.getTabLength(); -editor.setTabLength(42); - -const potentialBool = editor.usesSoftTabs(); -if (potentialBool) { - bool = potentialBool; -} - -str = editor.getTabText(); - -// Soft Wrap Behavior -bool = editor.isSoftWrapped(); -editor.setSoftWrapped(true); -bool = editor.toggleSoftWrapped(); -num = editor.getSoftWrapColumn(); - -// Indentation -num = editor.indentationForBufferRow(42); - -editor.setIndentationForBufferRow(42, 42); -editor.setIndentationForBufferRow(42, 42, {}); -editor.setIndentationForBufferRow(42, 42, { preserveLeadingWhitespace: true }); - -editor.indentSelectedRows(); -editor.outdentSelectedRows(); -num = editor.indentLevelForLine("Test"); -editor.autoIndentSelectedRows(); - -// Grammars -grammar = editor.getGrammar(); -editor.setGrammar(grammar); - -// Managing Syntax Scopes -scopeDescriptor = editor.getRootScopeDescriptor(); - -scopeDescriptor = editor.scopeDescriptorForBufferPosition(pos); -scopeDescriptor = editor.scopeDescriptorForBufferPosition([0, 0]); - -range = editor.bufferRangeForScopeAtCursor("selector"); -bool = editor.isBufferRowCommented(42); - -// Clipboard Operations -editor.copySelectedText(); -editor.cutSelectedText(); - -editor.pasteText(); -editor.pasteText({}); -editor.pasteText({ autoIndentNewline: true }); -editor.pasteText({ autoIndent: true }); -editor.pasteText({ autoDecreaseIndent: true }); -editor.pasteText({ normalizeLineEndings: true }); -editor.pasteText({ select: true }); -editor.pasteText({ undo: "skip" }); -editor.pasteText({ autoIndentNewline: true, autoIndent: true, autoDecreaseIndent: true, - normalizeLineEndings: true, select: true, undo: "skip" }); - -editor.cutToEndOfLine(); -editor.cutToEndOfBufferLine(); - -// Folds -editor.foldCurrentRow(); -editor.unfoldCurrentRow(); -editor.foldBufferRow(42); -editor.unfoldBufferRow(42); -editor.foldSelectedLines(); -editor.foldAll(); -editor.unfoldAll(); -editor.foldAllAtIndentLevel(42); -editor.isFoldableAtBufferRow(42); -editor.isFoldableAtScreenRow(42); -editor.toggleFoldAtBufferRow(42); -editor.isFoldedAtCursorRow(); -editor.isFoldedAtBufferRow(42); -editor.isFoldedAtScreenRow(42); - -// Gutters -editor.addGutter({ name: "Test" }); -editor.addGutter({ name: "Test", priority: 42 }); -editor.addGutter({ name: "Test", visible: true }); -editor.addGutter({ name: "Test", priority: 42, visible: true }); - -gutters = editor.getGutters(); - -const potentialGutter = editor.gutterWithName("test-gutter"); -if (potentialGutter) { - gutter = potentialGutter; -} - -editor.scrollToCursorPosition(); -editor.scrollToCursorPosition({}); -editor.scrollToCursorPosition({ center: true }); - -editor.scrollToBufferPosition(pos); -editor.scrollToBufferPosition([0, 0]); -editor.scrollToBufferPosition(pos, {}); -editor.scrollToBufferPosition([0, 0], {}); -editor.scrollToBufferPosition(pos, { center: true }); -editor.scrollToBufferPosition([0, 0], { center: true }); - -editor.scrollToScreenPosition(pos); -editor.scrollToScreenPosition([0, 0]); -editor.scrollToScreenPosition(pos, {}); -editor.scrollToScreenPosition([0, 0], {}); -editor.scrollToScreenPosition(pos, { center: true }); -editor.scrollToScreenPosition([0, 0], { center: true }); - -// TextEditor Rendering -str = editor.getPlaceholderText(); -editor.setPlaceholderText("Test"); - -//// ThemeManager ============================================================= -// Event Subscription -sub = atom.themes.onDidChangeActiveThemes(() => {}); - -// Accessing Loaded Themes -let potentialStrs = atom.themes.getLoadedThemeNames(); -if (potentialStrs) { - strs = potentialStrs; -} - -let potentialPacks = atom.themes.getLoadedThemes(); -if (potentialPacks) { - packs = potentialPacks; -} - -// Accessing Active Themes -potentialStrs = atom.themes.getActiveThemeNames(); -if (potentialStrs) { - strs = potentialStrs; -} - -potentialPacks = atom.themes.getActiveThemes(); -if (potentialPacks) { - packs = potentialPacks; -} - -// Managing Enabled Themes -strs = atom.themes.getEnabledThemeNames(); - -//// TooltipManager =========================================================== -sub = atom.tooltips.add(element, { title: "Test"}); -sub = atom.tooltips.add(element, { title: "

Test

", html: true }); -sub = atom.tooltips.add(element, { item: element}); -sub = atom.tooltips.add(element, { class: "test-class" }); -sub = atom.tooltips.add(element, { placement: "top" }); - -sub = atom.tooltips.add(element, { placement: () => "left" }); - -sub = atom.tooltips.add(element, { trigger: "click" }); -sub = atom.tooltips.add(element, { delay: { hide: 42, show: 42 }}); -sub = atom.tooltips.add(element, { keyBindingCommand: "test-command", - keyBindingTarget: element }); - -tooltips = atom.tooltips.findTooltips(element); - -//// ViewRegistry ============================================================= -atom.views.addViewProvider(Point, (point) => { - point.column; - return element; -}); - -element = atom.views.getView(element); - -//// Workspace ================================================================ -// Event Subscription -sub = atom.workspace.observeTextEditors(editor => editor.id); -sub = atom.workspace.observePaneItems((item) => {}); -sub = atom.workspace.onDidChangeActivePaneItem((item) => {}); -sub = atom.workspace.onDidStopChangingActivePaneItem((item) => {}); - -sub = atom.workspace.onDidChangeActiveTextEditor(editor => { - if (editor) { - editor.alive; - } -}); - -sub = atom.workspace.observeActivePaneItem((item) => {}); - -sub = atom.workspace.observeActiveTextEditor(editor => { - if (editor) { - editor.id; - } -}); - -sub = atom.workspace.onDidOpen(event => event.index && event.item && event.pane && - event.uri); -sub = atom.workspace.onDidAddPane(event => event.pane); -sub = atom.workspace.onWillDestroyPane(event => event.pane); -sub = atom.workspace.onDidDestroyPane(event => event.pane); -sub = atom.workspace.observePanes(pane => pane.activate()); -sub = atom.workspace.onDidChangeActivePane(pane => pane.activate()); -sub = atom.workspace.observeActivePane(pane => pane.activate()); -sub = atom.workspace.onDidAddPaneItem(event => event.index && event.item && event.pane); -sub = atom.workspace.onWillDestroyPaneItem(event => event.index && event.item && event.pane); -sub = atom.workspace.onDidDestroyPaneItem(event => event.index && event.item && event.pane); -sub = atom.workspace.onDidAddTextEditor(event => event.index && event.pane && - event.textEditor); - -// Opening -async function workspaceOpen() { - obj = await atom.workspace.open(); - obj = await atom.workspace.open("https://test"); - obj = await atom.workspace.open("https://test", { activateItem: true }); - obj = await atom.workspace.open("https://test", { activatePane: true }); - obj = await atom.workspace.open("https://test", { initialColumn: 42 }); - obj = await atom.workspace.open("https://test", { initialLine: 42 }); - obj = await atom.workspace.open("https://test", { location: "right" }); - obj = await atom.workspace.open("https://test", { split: "up" }); - obj = await atom.workspace.open("https://test", { pending: true }); - obj = await atom.workspace.open("https://test", { searchAllPanes: true }); - obj = await atom.workspace.open("https://test", { - activateItem: true, - activatePane: true, - initialColumn: 42, - initialLine: 42, - location: "left", - split: "left", - pending: true, - searchAllPanes: true, - }); -} - -bool = atom.workspace.hide("https://test"); -bool = atom.workspace.hide(element); - -async function workspaceToggle() { - await atom.workspace.toggle("https://test"); - await atom.workspace.toggle(element); -} - -obj = atom.workspace.createItemForURI("https://test"); - -bool = atom.workspace.isTextEditor(obj); - -async function workspaceReopen() { - const result = await atom.workspace.reopenItem(); - if (result) obj = result; -} - -atom.workspace.addOpener(() => element); - -atom.workspace.buildTextEditor(obj); - -// Pane Items -objs = atom.workspace.getPaneItems(); -obj = atom.workspace.getActivePaneItem(); -editors = atom.workspace.getTextEditors(); - -let potentialEditor = atom.workspace.getActiveTextEditor(); -if (potentialEditor) { - editor = potentialEditor; -} - -// Panes -paneContainer = atom.workspace.getActivePaneContainer(); -panes = atom.workspace.getPanes(); -pane = atom.workspace.getActivePane(); -bool = atom.workspace.activateNextPane(); -bool = atom.workspace.activatePreviousPane(); - -let potentialPaneContainer = atom.workspace.paneContainerForURI("https://test"); -if (potentialPaneContainer) { - paneContainer = potentialPaneContainer; -} - -potentialPaneContainer = atom.workspace.paneContainerForItem(element); -if (potentialPaneContainer) { - paneContainer = potentialPaneContainer; -} - -let potentialPane = atom.workspace.paneForURI("https://test"); -if (potentialPane) { - pane = potentialPane; -} - -potentialPane = atom.workspace.paneForItem(element); -if (potentialPane) { - pane = potentialPane; -} - -// Pane Locations -workspaceCenter = atom.workspace.getCenter(); -dock = atom.workspace.getLeftDock(); -dock = atom.workspace.getRightDock(); -dock = atom.workspace.getBottomDock(); - -// Panels -panels = atom.workspace.getBottomPanels(); - -panel = atom.workspace.addBottomPanel({ item: element }); -panel = atom.workspace.addBottomPanel({ item: element, priority: 100, visible: true }); - -panels = atom.workspace.getLeftPanels(); - -panel = atom.workspace.addLeftPanel({ item: element }); -panel = atom.workspace.addLeftPanel({ item: element, priority: 100, visible: true }); - -panels = atom.workspace.getRightPanels(); - -panel = atom.workspace.addRightPanel({ item: element }); -panel = atom.workspace.addRightPanel({ item: element, priority: 100, visible: true }); - -panels = atom.workspace.getTopPanels(); - -panel = atom.workspace.addTopPanel({ item: element }); -panel = atom.workspace.addTopPanel({ item: element, priority: 100, visible: true }); - -panels = atom.workspace.getHeaderPanels(); - -panel = atom.workspace.addHeaderPanel({ item: element }); -panel = atom.workspace.addHeaderPanel({ item: element, priority: 100, visible: true }); - -panels = atom.workspace.getFooterPanels(); - -panel = atom.workspace.addFooterPanel({ item: element }); -panel = atom.workspace.addFooterPanel({ item: element, priority: 100, visible: true }); - -panels = atom.workspace.getModalPanels(); - -panel = atom.workspace.addModalPanel({ item: element }); -panel = atom.workspace.addModalPanel({ item: element, priority: 100, visible: true }); - -const potentialPanel = atom.workspace.panelForItem(element); -if (potentialPanel) { - panel = potentialPanel; -} - -const scanResults = atom.workspace.scan(/r/, () => {}); -scanResults.cancel(); - -// Searching and Replacing -async function workspaceScan() { - await scanResults; - - const scanOptions = { - onPathsSearched: (pathsSearched: number) => {}, - leadingContextLineCount: 5, - trailingContextLineCount: 5, - paths: ["a"], - }; - await atom.workspace.scan(/r/, scanOptions, (results) => { - str = results.filePath; - for (const match of results.matches) { - range = Range.fromObject(match.range); - strs = match.leadingContextLines; - strs = match.trailingContextLines; - } - }); -} - -async function workspaceReplace() { - await atom.workspace.replace(/r/, "Test", ["a"], (options) => {}); -} - -//// WorkspaceCenter ========================================================== -// Event Subscription -sub = workspaceCenter.observeTextEditors(editor => editor.id); -sub = workspaceCenter.observePaneItems(item => {}); -sub = workspaceCenter.onDidChangeActivePaneItem(item => {}); -sub = workspaceCenter.onDidStopChangingActivePaneItem(item => {}); -sub = workspaceCenter.observeActivePaneItem(item => {}); - -// Pane Items -objs = workspaceCenter.getPaneItems(); -workspaceCenter.getActivePaneItem(); -editors = workspaceCenter.getTextEditors(); - -potentialEditor = workspaceCenter.getActiveTextEditor(); -if (potentialEditor) { - editor = potentialEditor; -} - -// Panes -panes = workspaceCenter.getPanes(); -pane = workspaceCenter.getActivePane(); -workspaceCenter.activateNextPane(); -workspaceCenter.activatePreviousPane(); diff --git a/types/atom/autocomplete-plus/config.d.ts b/types/atom/autocomplete-plus/config.d.ts new file mode 100644 index 0000000000..e4c9f3a2d4 --- /dev/null +++ b/types/atom/autocomplete-plus/config.d.ts @@ -0,0 +1,128 @@ +import "../index"; + +declare module "atom" { + interface ConfigValues { + /** + * Suggestions will show as you type if this preference is enabled. If it is + * disabled, you can still see suggestions by using the keymapping for + * 'autocomplete-plus:activate' (shown below). + */ + "autocomplete-plus.enableAutoActivation": boolean; + + /** + * If you are experiencing performance issues when typing, you should try + * increasing this value to a non-zero number (e.g. 100). + */ + "autocomplete-plus.autoActivationDelay": number; + + /** The suggestion list will only show this many suggestions. */ + "autocomplete-plus.maxVisibleSuggestions": number; + + /** + * You should use the key(s) indicated here to confirm a suggestion from the + * suggestion list and have it inserted into the file. + */ + "autocomplete-plus.confirmCompletion": + | "tab" + | "enter" + | "tab and enter" + | "tab always, enter when suggestion explicitly selected"; + + /** + * Disable this if you want to bind your own keystrokes to move around the + * suggestion list. You will also need to add definitions to your keymap. + */ + "autocomplete-plus.useCoreMovementCommands": boolean; + + /** + * Suggestions will not be provided for files matching this list, e.g. *.md + * for Markdown files. To blacklist more than one file extension, use comma + * as a separator, e.g. ["*.md", "*.txt"] (both Markdown and text files). + */ + "autocomplete-plus.fileBlacklist": string[]; + + /** Suggestions will not be provided for scopes matching this list. */ + "autocomplete-plus.scopeBlacklist": string[]; + + /** + * For grammars with no registered provider(s), the default provider will + * include completions from all buffers, instead of just the buffer you are + * currently editing. + */ + "autocomplete-plus.includeCompletionsFromAllBuffers": boolean; + + /** + * Fuzzy searching is performed if this is disabled; if it is enabled, suggestions + * must begin with the prefix from the current word. + */ + "autocomplete-plus.strictMatching": boolean; + + /** + * Only autocomplete when you've typed at least this many characters. + * Note: May not affect external providers. + */ + "autocomplete-plus.minimumWordLength": number; + + /** + * The package comes with a built-in provider that will provide suggestions + * using the words in your current buffer or all open buffers. You will get + * better suggestions by installing additional autocomplete+ providers. + * To stop using the built-in provider, disable this option. + */ + "autocomplete-plus.enableBuiltinProvider": boolean; + + /** Don't use the built-in provider for these selector(s). */ + "autocomplete-plus.builtinProviderBlacklist": string; + + /** + * If enabled, typing `backspace` will show the suggestion list if suggestions + * are available. If disabled, suggestions will not be shown while backspacing. + */ + "autocomplete-plus.backspaceTriggersAutocomplete": boolean; + + /** + * If enabled, automatically insert suggestion on manual activation with + * 'autocomplete-plus:activate' when there is only one match. + */ + "autocomplete-plus.enableAutoConfirmSingleSuggestion": boolean; + + /** + * With 'Cursor' the suggestion list appears at the cursor's position. + * With 'Word' it appears at the beginning of the word that's being completed. + */ + "autocomplete-plus.suggestionListFollows": "Word"|"Cursor"; + + /** + * If you're having trouble with autocomplete, you may consider falling back + * to the Symbol provider and filing an issue. + */ + "autocomplete-plus.defaultProvider": "Subsequence"|"Symbol"; + + /** Don't auto-activate when any of these classes are present in the editor. */ + "autocomplete-plus.suppressActivationForEditorClasses": string[]; + + /** + * Completing a suggestion consumes text following the cursor matching the + * suffix of the chosen suggestion. + */ + "autocomplete-plus.consumeSuffix": boolean; + + /** + * -EXPERIMENTAL- Prefers runs of consecutive characters, acronyms and start + * of words. + */ + "autocomplete-plus.useAlternateScoring": boolean; + + /** Gives words near the cursor position a higher score than those far away. */ + "autocomplete-plus.useLocalityBonus": boolean; + + /** Identifies non-latin alphabet characters as letters. */ + "autocomplete-plus.enableExtendedUnicodeSupport": boolean; + + /** + * Should similar suggestions be removed from the list? If so how to determine + * they are similar. + */ + "autocomplete-plus.similarSuggestionRemoval": "none"|"textOrSnippet"; + } +} diff --git a/types/atom/autocomplete-plus/index.d.ts b/types/atom/autocomplete-plus/index.d.ts new file mode 100644 index 0000000000..2e91a81262 --- /dev/null +++ b/types/atom/autocomplete-plus/index.d.ts @@ -0,0 +1,157 @@ +// Autocomplete Plus 2.x +// https://atom.io/packages/autocomplete-plus + +/// + +import { Point, ScopeDescriptor, TextEditor } from "../index"; + +/** The parameters passed into getSuggestions by Autocomplete+. */ +export interface SuggestionsRequestedEvent { + /** The current TextEditor. */ + editor: TextEditor; + + /** The position of the cursor. */ + bufferPosition: Point; + + /** The scope descriptor for the current cursor position. */ + scopeDescriptor: ScopeDescriptor; + + /** The prefix for the word immediately preceding the current cursor position. */ + prefix: string; + + /** Whether the autocomplete request was initiated by the user. */ + activatedManually: boolean; +} + +/** The parameters passed into onDidInsertSuggestion by Autocomplete+. */ +export interface SuggestionInsertedEvent { + editor: TextEditor; + triggerPosition: Point; + suggestion: TextSuggestion|SnippetSuggestion; +} + +/** + * An autocompletion suggestion for the user. + * Primary data type for the Atom Autocomplete+ service. + */ +export interface Suggestion { + /** + * A string that will show in the UI for this suggestion. + * When not set, snippet || text is displayed. + */ + displayText?: string; + + /** + * The text immediately preceding the cursor, which will be replaced by the text. + * If not provided, the prefix passed into getSuggestions will be used. + */ + replacementPrefix?: string; + + /** + * The suggestion type. It will be converted into an icon shown against the + * suggestion. + */ + type?: string; + + /** This is shown before the suggestion. Useful for return values. */ + leftLabel?: string; + + /** Use this instead of leftLabel if you want to use html for the left label. */ + leftLabelHTML?: string; + + /** + * An indicator (e.g. function, variable) denoting the "kind" of suggestion this + * represents. + */ + rightLabel?: string; + + /** Use this instead of rightLabel if you want to use html for the right label. */ + rightLabelHTML?: string; + + /** + * Class name for the suggestion in the suggestion list. Allows you to style your + * suggestion via CSS, if desired. + */ + className?: string; + + /** + * If you want complete control over the icon shown against the suggestion. + * e.g. iconHTML: + */ + iconHTML?: string; + + /** + * A doc-string summary or short description of the suggestion. When specified, it + * will be displayed at the bottom of the suggestions list. + */ + description?: string; + + /** + * A url to the documentation or more information about this suggestion. + * When specified, a More.. link will be displayed in the description area. + */ + descriptionMoreURL?: string; +} + +export interface TextSuggestion extends Suggestion { + /** The text which will be inserted into the editor, in place of the prefix. */ + text: string; +} + +export interface SnippetSuggestion extends Suggestion { + /** + * A snippet string. This will allow users to tab through function arguments + * or other options. + */ + snippet: string; +} + +export type Suggestions = Array; + +/** The interface that all Autocomplete+ providers must implement. */ +export interface AutocompleteProvider { + /** + * Defines the scope selector(s) (can be comma-separated) for which your provider + * should receive suggestion requests. + */ + selector: string; + + /** + * Is called when a suggestion request has been dispatched by autocomplete+ to + * your provider. Return an array of suggestions (if any) in the order you would + * like them displayed to the user. Returning a Promise of an array of suggestions + * is also supported. + */ + getSuggestions(params: SuggestionsRequestedEvent): Suggestions|Promise; + + /** + * Defines the scope selector(s) (can be comma-separated) for which your provider + * should not be used. + */ + disableForSelector?: string; + + /** + * A number to indicate its priority to be included in a suggestions request. + * The default provider has an inclusion priority of 0. Higher priority providers + * can suppress lower priority providers with excludeLowerPriority. + */ + inclusionPriority?: number; + + /** Will not use lower priority providers when this provider is used. */ + excludeLowerPriority?: boolean; + + /** + * A number to determine the sort order of suggestions. The default provider has + * an suggestion priority of 1. + */ + suggestionPriority?: number; + + /** + * Function that is called when a suggestion from your provider was inserted + * into the buffer. + */ + onDidInsertSuggestion?(params: SuggestionInsertedEvent): void; + + /** Will be called if your provider is being destroyed by autocomplete+ */ + dispose?(): void; +} diff --git a/types/atom/index.d.ts b/types/atom/index.d.ts index 1cd564c19c..2a13373b7d 100644 --- a/types/atom/index.d.ts +++ b/types/atom/index.d.ts @@ -1,4211 +1,6566 @@ -// Type definitions for Atom 1.21 +// Type definitions for Atom 1.22 // Project: https://github.com/atom/atom -// Definitions by: GlenCFL +// Definitions by: GlenCFL , +// smhxx // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // 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.22.0/exports/atom.js + /// -/// -/// -/// -/// +/// + +import { ReadStream, WriteStream } from "fs"; +import { ChildProcess } from "child_process"; declare global { - /** The core classes for the Atom Text Editor. */ - namespace AtomCore { - /** Objects that appear as parameters to callbacks. */ - namespace Events { - interface ExceptionThrown { - originalError: Error; - message: string; - url: string; - line: number; - column: number; - } - - interface PreventableExceptionThrown extends ExceptionThrown { - preventDefault(): void; - } - - interface SelectionChanged { - oldBufferRange: TextBuffer.Range; - oldScreenRange: TextBuffer.Range; - newBufferRange: TextBuffer.Range; - newScreenRange: TextBuffer.Range; - selection: Selection; - } - - interface PaneItemObserved { - item: object; - pane: Pane; - index: number; - } - - interface PaneItemOpened extends PaneItemObserved { - uri: string; - } - - interface EditorChanged { - /** A Point representing where the change started. */ - start: TextBuffer.Point; - - /** A Point representing the replaced extent. */ - oldExtent: TextBuffer.Point; - - /** A Point representing the replacement extent. */ - newExtent: TextBuffer.Point; - } - - interface StyleElementObserved extends HTMLStyleElement { - sourcePath: string; - context: string; - } - - interface TextEditorObserved { - textEditor: TextEditor; - pane: Pane; - index: number; - } - - interface RepoStatusChanged { - path: string; - - /** This value can be passed to ::isStatusModified or ::isStatusNew to get more - * information. - */ - pathStatus: number; - } - - interface PaneListItemShifted { - /** The pane item that was added or removed. */ - item: object; - - /** A number indicating where the item is located. */ - index: number; - } - - interface PaneItemMoved { - /** The removed pane item. */ - item: object; - - /** A number indicating where the item was located. */ - oldIndex: number; - - /** A number indicating where the item is now located. */ - newIndex: number; - } - - interface CursorPositionChanged { - oldBufferPosition: TextBuffer.Point; - oldScreenPosition: TextBuffer.Point; - newBufferPosition: TextBuffer.Point; - newScreenPosition: TextBuffer.Point; - textChanged: boolean; - Cursor: Cursor; - } - - interface DecorationPropsChanged { - /** Object the old parameters the decoration used to have. */ - oldProperties: Structures.DecorationProps; - - /** Object the new parameters the decoration now has */ - newProperties: Structures.DecorationProps; - } - - type FilesystemChange = Array<{ - /** A string describing the filesystem action that occurred. */ - action: "created"|"modified"|"deleted"|"renamed"; - - /** The absolute path to the filesystem entry that was acted upon. */ - path: string; - - /** For rename events, a string containing the filesystem entry's former - * absolute path. - */ - oldPath?: string; - }>; - } - - /** Objects that appear as parameters to functions. */ - namespace Options { - interface TextInsertion { - select?: boolean; - autoIndent?: boolean; - autoIndentNewline?: boolean; - autoDecreaseIndent?: boolean; - normalizeLineEndings?: boolean; - undo?: "skip"; - } - - interface Menu { - /** The menu itme's label. */ - label: string; - - /** An array of sub menus. */ - submenu?: ReadonlyArray; - - /** The command to trigger when the item is clicked. */ - command?: string; - } - - interface ContextMenu { - /** The menu item's label. */ - label?: string; - - /** The command to invoke on the target of the right click that invoked the - * context menu. - */ - command?: string; - - /** Whether the menu item should be clickable. Disabled menu items typically - * appear grayed out. Defaults to true. - */ - enabled?: boolean; - - /** An array of additional items. */ - submenu?: ReadonlyArray; - - /** If you want to create a separator, provide an item with type: 'separator' - * and no other keys. - */ - type?: "separator"; - - /** Whether the menu item should appear in the menu. Defaults to true. */ - visible?: boolean; - - /** A function that is called on the item each time a context menu is created - * via a right click. - */ - created?(event: Event): void; - - /** A function that is called to determine whether to display this item on a - * given context menu deployment. - */ - shouldDisplay?(event: Event): void; - } - - interface SpawnProcess { - /** Current working directory of the child process. */ - cwd?: string; - - /** Environment key-value pairs. */ - env?: { [key: string]: string }; - - /** The child's stdio configuration. */ - stdio?: string|Array; - - /** Prepare child to run independently of its parent process. */ - detached?: boolean; - - /** Sets the user identity of the process. */ - uid?: number; - - /** Sets the group identity of the process. */ - gid?: number; - - /** If true, runs command inside of a shell. Uses "/bin/sh" on UNIX, and process.env.ComSpec - * on Windows. A different shell can be specified as a string. - */ - shell?: boolean | string; - } - - interface NodeProcess { - /** The command to execute. */ - command: string; - - /** The array of arguments to pass to the command. */ - args?: ReadonlyArray; - - /** The options object to pass to Node's ChildProcess.spawn method. */ - options?: SpawnProcess; - - /** The callback that receives a single argument which contains the standard - * output from the command. - */ - stdout?(data: string): void; - - /** The callback that receives a single argument which contains the standard - * error output from the command. - */ - stderr?(data: string): void; - - /** The callback which receives a single argument containing the exit status. */ - exit?(code: number): void; - } - - interface Process extends NodeProcess { - /** Whether the command will automatically start when this BufferedProcess is - * created. - */ - autoStart?: boolean; - } - - interface Notification { - buttons?: Array<{ - className?: string; - onDidClick?(event: MouseEvent): void; - text?: string; - }>; - description?: string; - detail?: string; - dismissable?: boolean; - icon?: string; - } - - interface ErrorNotification extends Notification { - stack?: string; - } - - /** The options for a Bootstrap 3 Tooltip class, which Atom uses a variant of. */ - interface Tooltip { - /** Apply a CSS fade transition to the tooltip. */ - animation?: boolean; - - /** Appends the tooltip to a specific element. */ - container?: string|HTMLElement|false; - - /** Delay showing and hiding the tooltip (ms) - does not apply to manual - * trigger type. - */ - delay?: number|{ show: number, hide: number }; - - /** Allow HTML in the tooltip. */ - html?: boolean; - - /** How to position the tooltip. */ - placement?: "top"|"bottom"|"left"|"right"|"auto"; - - /** If a selector is provided, tooltip objects will be delegated to the - * specified targets. - */ - selector?: string; - - /** Base HTML to use when creating the tooltip. */ - template?: string; - - /** Default title value if title attribute isn't present. - * If a function is given, it will be called with its this reference set to - * the element that the tooltip is attached to. - */ - title?: string|HTMLElement|(() => string); - - /** How tooltip is triggered - click | hover | focus | manual. - * You may pass multiple triggers; separate them with a space. - */ - trigger?: string; - } - - interface WorkspaceScan { - /** An array of glob patterns to search within. */ - paths?: ReadonlyArray; - - /** A function to be periodically called with the number of paths searched. */ - onPathsSearched?(pathsSearched: number): void; - - /** The number of lines before the matched line to include in the results object. */ - leadingContextLineCount?: number; - - /** The number of lines after the matched line to include in the results object. */ - trailingContextLineCount?: number; - } - } - - /** The static side to each exported class. Should generally only be used internally. */ - namespace Statics { - /* tslint:disable:no-unnecessary-qualifier */ - /** The static side to the BufferedProcess class. */ - interface BufferedProcess { - new (options: AtomCore.Options.Process): AtomCore.BufferedProcess; - } - - /** The static side to the BufferedNodeProcess class. */ - interface BufferedNodeProcess { - /** Runs the given Node script by spawning a new child process. */ - new (options: AtomCore.Options.NodeProcess): AtomCore.BufferedNodeProcess; - } - - /** The static side to the GitRepository class. */ - interface GitRepository { - /** Creates a new GitRepository instance. */ - open(path: string, options?: { refreshOnWindowFocus?: boolean }): AtomCore.GitRepository; - - new (path: string, options?: { refreshOnWindowFocus?: boolean, config?: AtomCore.Config, - project?: AtomCore.Project }): AtomCore.GitRepository; - } - - /** The static side to the Notification class. */ - interface Notification { - new (type: "warning"|"info"|"success", message: string, options?: - AtomCore.Options.Notification): AtomCore.Notification; - new (type: "fatal"|"error", message: string, options?: - AtomCore.Options.ErrorNotification): AtomCore.Notification; - } - - /** The static side to the Task class. */ - interface Task { - // NOTE: this is actually the best we can do here with the REST parameter for - // this appearing in the middle of the parameter list, which isn't aligned with - // the ES6 spec. Maybe when they rewrite it in JavaScript this will change. - /** A helper method to easily launch and run a task once. */ - once(taskPath: string, ...args: any[]): AtomCore.Task; - - /** Creates a task. You should probably use .once */ - new (taskPath: string): AtomCore.Task; - } - - /** The static side to the TextEditor class. */ - type TextEditor = object; - /* tslint:enable:no-unnecessary-qualifier */ - } - - /** Data structures that are used within classes. */ - namespace Structures { - interface SharedDecorationProps { - /** This CSS class will be applied to the decorated line number, line, highlight, - * or overlay. - */ - class?: string; - - /** An HTMLElement or a model Object with a corresponding view registered. Only - * applicable to the gutter, overlay and block types. - */ - item?: HTMLElement; - - /** If true, the decoration will only be applied to the head of the DisplayMarker. - * Only applicable to the line and line-number types. - */ - onlyHead?: boolean; - - /** If true, the decoration will only be applied if the associated DisplayMarker - * is empty. Only applicable to the gutter, line, and line-number types. - */ - onlyEmpty?: boolean; - - /** If true, the decoration will only be applied if the associated DisplayMarker - * is non-empty. Only applicable to the gutter, line, and line-number types. - */ - onlyNonEmpty?: boolean; - - /** Only applicable to decorations of type overlay and block. Controls where the - * view is positioned relative to the TextEditorMarker. Values can be - * 'head' (the default) or 'tail' for overlay decorations, and 'before' (the default) - * or 'after' for block decorations. - */ - position?: "head"|"tail"|"before"|"after"; - - /** Only applicable to decorations of type overlay. Determines whether the decoration - * adjusts its horizontal or vertical position to remain fully visible when it would - * otherwise overflow the editor. Defaults to true. - */ - avoidOverflow?: boolean; - } - - interface DecorationProps extends SharedDecorationProps { - /** One of several supported decoration types. */ - type?: "line"|"line-number"|"highlight"|"overlay"|"gutter"|"block"; - - /** The name of the gutter we're decorating, if type is "gutter". */ - gutterName?: string; - } - - interface DecorationLayerProps extends SharedDecorationProps { - /** One of several supported decoration types. */ - type?: "line"|"line-number"|"highlight"|"block"; - } - - interface Invisibles { - tab?: string|false; - cr?: string|false; - eol?: string|false; - space?: string|false; - } - - interface CancellablePromise extends Promise { - cancel(): void; - } - - interface ScandalResult { - filePath: string; - matches: Array<{ - matchText: string; - lineText: string; - lineTextOffset: number; - range: [[number, number], [number, number]]; - leadingContextLines: string[]; - trailingContextLines: string[]; - }>; - } - - interface WindowLoadSettings { - appVersion: string; - atomHome: string; - devMode: boolean; - env: { [key: string]: string|undefined }; - profileStartup: boolean; - resourcePath: string; - safeMode: boolean; - } - } - - /** Atom global for dealing with packages, themes, menus, and the window. - * An instance of this class is always available as the atom global. - */ - interface AtomEnvironment { - // Properties - /** A CommandRegistry instance. */ - commands: CommandRegistry; - - /** A Config instance. */ - config: Config; - - /** A Clipboard instance. */ - clipboard: Clipboard; - - /** A ContextMenuManager instance. */ - contextMenu: ContextMenuManager; - - /** A MenuManager instance. */ - menu: MenuManager; - - /** A KeymapManager instance. */ - keymaps: AtomKeymap.KeymapManager; - - /** A TooltipManager instance. */ - tooltips: TooltipManager; - - /** A NotificationManager instance. */ - notifications: NotificationManager; - - /** A Project instance. */ - project: Project; - - /** A GrammarRegistry instance. */ - grammars: FirstMate.GrammarRegistry; - - /** A HistoryManager instance. */ - history: HistoryManager; - - /** A PackageManager instance. */ - packages: PackageManager; - - /** A ThemeManager instance. */ - themes: ThemeManager; - - /** A StyleManager instance. */ - styles: StyleManager; - - /** A DeserializerManager instance. */ - deserializers: DeserializerManager; - - /** A ViewRegistry instance. */ - views: ViewRegistry; - - /** A Workspace instance. */ - workspace: Workspace; - - /** A TextEditorRegistry instance. */ - textEditors: TextEditorRegistry; - - // Event Subscription - /** Invoke the given callback whenever ::beep is called. */ - onDidBeep(callback: () => void): EventKit.Disposable; - - /** Invoke the given callback when there is an unhandled error, but before - * the devtools pop open. - */ - onWillThrowError(callback: (event: Events.PreventableExceptionThrown) => - void): EventKit.Disposable; - - /** Invoke the given callback whenever there is an unhandled error. */ - onDidThrowError(callback: (event: Events.ExceptionThrown) => void): - EventKit.Disposable; - - /** Invoke the given callback as soon as the shell environment is loaded (or - * immediately if it was already loaded). - */ - whenShellEnvironmentLoaded(callback: () => void): EventKit.Disposable; - - // Atom Details - /** Returns a boolean that is true if the current window is in development mode. */ - inDevMode(): boolean; - - /** Returns a boolean that is true if the current window is in safe mode. */ - inSafeMode(): boolean; - - /** Returns a boolean that is true if the current window is running specs. */ - inSpecMode(): boolean; - - /** Get the version of the Atom application. */ - getVersion(): string; - - /** Gets the release channel of the Atom application. - * Returns the release channel, which can be 'dev', 'beta', or 'stable'. - */ - getReleaseChannel(): "dev"|"beta"|"stable"; - - /** Returns a boolean that is true if the current version is an official release. */ - isReleasedVersion(): boolean; - - /** Get the time taken to completely load the current window. */ - getWindowLoadTime(): number; - - /** Get the load settings for the current window. */ - getLoadSettings(): Structures.WindowLoadSettings; - - // Managing the Atom Window - /** Open a new Atom window using the given options. */ - open(params: { - pathsToOpen: ReadonlyArray, - newWindow: boolean, - devMode: boolean, - safeMode: boolean, - }): void; - - /** Close the current window. */ - close(): void; - - /** Get the size of current window. */ - getSize(): { width: number, height: number }; - - /** Set the size of current window. */ - setSize(width: number, height: number): void; - - /** Get the position of current window. */ - getPosition(): { x: number, y: number }; - - /** Set the position of current window. */ - setPosition(x: number, y: number): void; - - /** Prompt the user to select one or more folders. */ - pickFolder(callback: (paths: string[]|null) => void): void; - - /** Get the current window. */ - getCurrentWindow(): object; // Electron's BrowserWindow class. - - /** Move current window to the center of the screen. */ - center(): void; - - /** Focus the current window. */ - focus(): void; - - /** Show the current window. */ - show(): void; - - /** Hide the current window. */ - hide(): void; - - /** Reload the current window. */ - reload(): void; - - /** Relaunch the entire application. */ - restartApplication(): void; - - /** Returns a boolean that is true if the current window is maximized. */ - isMaximized(): boolean; - - /** Returns a boolean that is true if the current window is in full screen mode. */ - isFullScreen(): boolean; - - /** Set the full screen state of the current window. */ - setFullScreen(fullScreen: boolean): void; - - /** Toggle the full screen state of the current window. */ - toggleFullScreen(): void; - - // Messaging the User - /** Visually and audibly trigger a beep. */ - beep(): void; - - /** A flexible way to open a dialog akin to an alert dialog. - * Returns the chosen button index number if the buttons option was an array. - */ - confirm(options: { - message: string, - detailedMessage?: string, - buttons?: ReadonlyArray, - }): void; - - /** A flexible way to open a dialog akin to an alert dialog. - * Returns the chosen button index number if the buttons option was an array. - */ - confirm(options: { - message: string, - detailedMessage?: string, - buttons?: { - [key: string]: () => void - }, - }): number; - - // Managing the Dev Tools - /** Open the dev tools for the current window. */ - openDevTools(): Promise; - - /** Toggle the visibility of the dev tools for the current window. */ - toggleDevTools(): Promise; - - /** Execute code in dev tools. */ - executeJavaScriptInDevTools(code: string): void; - } - - /** A wrapper which provides standard error/output line buffering for - * Node's ChildProcess. - */ - interface BufferedProcess { - // Properties - process: NodeJS.EventEmitter; - - // Event Subscription - /** Will call your callback when an error will be raised by the process. Usually - * this is due to the command not being available or not on the PATH. You can - * call handle() on the object passed to your callback to indicate that you - * have handled this error. - */ - onWillThrowError(callback: (errorObject: { error: Error, handle(): void }) => - void): EventKit.Disposable; - - // Helper Methods - /** Terminate the process. */ - kill(): void; - - /** Runs the process. */ - start(): void; - } - - /** Like BufferedProcess, but accepts a Node script as the command to run. - * This is necessary on Windows since it doesn't support shebang #! lines. - */ - type BufferedNodeProcess = BufferedProcess; - - /** Represents the clipboard used for copying and pasting in Atom. */ - interface Clipboard { - /** Write the given text to the clipboard. */ - write(text: string, metadata?: object): void; - - /** Read the text from the clipboard. */ - read(): string; - - /** Read the text from the clipboard and return both the text and the associated - * metadata. - */ - readWithMetadata(): { text: string, metadata: object }; - } - - /** A simple color class returned from Config::get when the value at the key path is - * of type 'color'. - */ - interface Color { - /** Returns a string in the form '#abcdef'. */ - toHexString(): string; - - /** Returns a string in the form 'rgba(25, 50, 75, .9)'. */ - toRGBAString(): string; - } - - /** Used to access all of Atom's configuration details. */ - interface Config { - // Config Subscription - /** Add a listener for changes to a given key path. This is different than ::onDidChange in - * that it will immediately call your callback with the current value of the config entry. - */ - observe(keyPath: string, callback: (value: any) => void): - EventKit.Disposable; - /** Add a listener for changes to a given key path. This is different than ::onDidChange in - * that it will immediately call your callback with the current value of the config entry. - */ - observe(keyPath: string, options: { scope: string[]|ScopeDescriptor }, - callback: (value: any) => void): EventKit.Disposable; - - /** Add a listener for changes to a given key path. If keyPath is not specified, your - * callback will be called on changes to any key. - */ - onDidChange(callback: (values: { newValue: T, oldValue: T }) => void): - EventKit.Disposable; - /** Add a listener for changes to a given key path. If keyPath is not specified, your - * callback will be called on changes to any key. - */ - onDidChange(keyPath: string, callback: (values: { newValue: T, - oldValue: T }) => void): EventKit.Disposable; - /** Add a listener for changes to a given key path. If keyPath is not specified, your - * callback will be called on changes to any key. - */ - onDidChange(keyPath: string, options: { scope: string[]|ScopeDescriptor }, - callback: (values: { newValue: T, oldValue: T }) => void): EventKit.Disposable; - - // Managing Settings - /** Retrieves the setting for the given key. */ - get(keyPath: string, options?: { sources?: string[], excludeSources?: string[], - scope?: string[]|ScopeDescriptor }): any; - - /** Sets the value for a configuration setting. - * This value is stored in Atom's internal configuration file. - */ - set(keyPath: string, value: any, options?: { scopeSelector?: string, source?: - string }): void; - - /** Restore the setting at keyPath to its default value. */ - unset(keyPath: string, options?: { scopeSelector?: string, source?: string }): void; - - /** Get all of the values for the given key-path, along with their associated - * scope selector. - */ - getAll(keyPath: string, options?: { sources?: string[], excludeSources?: string[], - scope?: ScopeDescriptor }): Array<{ scopeDescriptor: ScopeDescriptor, value: any}>; - - /** Get an Array of all of the source Strings with which settings have been added - * via ::set. - */ - getSources(): string[]; - - /** Retrieve the schema for a specific key path. The schema will tell you what type - * the keyPath expects, and other metadata about the config option. - */ - getSchema(keyPath: string): object|null; - - /** Get the string path to the config file being used. */ - getUserConfigPath(): string; - - /** Suppress calls to handler functions registered with ::onDidChange and ::observe - * for the duration of callback. After callback executes, handlers will be called - * once if the value for their key-path has changed. - */ - transact(callback: () => void): void; - } - - /** Provides a registry for commands that you'd like to appear in the context menu. */ - interface ContextMenuManager { - /** Add context menu items scoped by CSS selectors. */ - add(itemsBySelector: { - [key: string]: ReadonlyArray - }): EventKit.Disposable; - } - - /** Associates listener functions with commands in a context-sensitive way - * using CSS selectors. - */ - interface CommandRegistry { - /** Register a single command. */ - add(target: string|Node, commandName: string, listener: { - didDispatch(event: AtomKeymap.CommandEvent): void, - displayName?: string, - description?: string, - } | ((event: AtomKeymap.CommandEvent) => void)): EventKit.Disposable; - - /** Register multiple commands. */ - add(target: string|Node, commands: { [key: string]: (event: - AtomKeymap.CommandEvent) => void }): EventKit.CompositeDisposable; - - /** Find all registered commands matching a query. */ - findCommands(params: { target: Node }): Array<{ - name: string, - displayName: string, - description?: string, - tags?: string[], - }>; - - /** Simulate the dispatch of a command on a DOM node. */ - dispatch(target: Node, commandName: string): void; - - /** Invoke the given callback before dispatching a command event. */ - onWillDispatch(callback: (event: AtomKeymap.CommandEvent) => void): EventKit.Disposable; - - /** Invoke the given callback after dispatching a command event. */ - onDidDispatch(callback: (event: AtomKeymap.CommandEvent) => void): EventKit.Disposable; - } - - /** The Cursor class represents the little blinking line identifying where text - * can be inserted. - */ - interface Cursor { - // Event Subscription - /** Calls your callback when the cursor has been moved. */ - onDidChangePosition(callback: (event: Events.CursorPositionChanged) => void): - EventKit.Disposable; - - /** Calls your callback when the cursor is destroyed. */ - onDidDestroy(callback: () => void): EventKit.Disposable; - - /** Calls your callback when the cursor's visibility has changed. */ - onDidChangeVisibility(callback: (visibility: boolean) => void): - EventKit.Disposable; - - // Managing Cursor Position - /** Moves a cursor to a given screen position. */ - setScreenPosition(screenPosition: TextBuffer.PointLike|[number, number], - options?: { autoscroll?: boolean }): void; - - /** Returns the screen position of the cursor as a Point. */ - getScreenPosition(): TextBuffer.Point; - - /** Moves a cursor to a given buffer position. */ - setBufferPosition(bufferPosition: TextBuffer.PointLike|[number, number], - options?: { autoscroll?: boolean }): void; - - /** Returns the current buffer position as an Array. */ - getBufferPosition(): TextBuffer.Point; - - /** Returns the cursor's current screen row. */ - getScreenRow(): number; - - /** Returns the cursor's current screen column. */ - getScreenColumn(): number; - - /** Retrieves the cursor's current buffer row. */ - getBufferRow(): number; - - /** Returns the cursor's current buffer column. */ - getBufferColumn(): number; - - /** Returns the cursor's current buffer row of text excluding its line ending. */ - getCurrentBufferLine(): string; - - /** Returns whether the cursor is at the start of a line. */ - isAtBeginningOfLine(): boolean; - - /** Returns whether the cursor is on the line return character. */ - isAtEndOfLine(): boolean; - - // Cursor Position Details - /** Returns the underlying DisplayMarker for the cursor. Useful with overlay - * Decorations. - */ - getMarker(): TextBuffer.DisplayMarker; - - /** Identifies if the cursor is surrounded by whitespace. - * "Surrounded" here means that the character directly before and after the cursor - * are both whitespace. - */ - isSurroundedByWhitespace(): boolean; - - /** This method returns false if the character before or after the cursor is whitespace. */ - isBetweenWordAndNonWord(): boolean; - - /** Returns whether this cursor is between a word's start and end. */ - isInsideWord(options?: { wordRegex?: RegExp }): boolean; - - /** Returns the indentation level of the current line. */ - getIndentLevel(): number; - - /** Retrieves the scope descriptor for the cursor's current position. */ - getScopeDescriptor(): ScopeDescriptor; - - /** Returns true if this cursor has no non-whitespace characters before its - * current position. - */ - hasPrecedingCharactersOnLine(): boolean; - - /** Identifies if this cursor is the last in the TextEditor. - * "Last" is defined as the most recently added cursor. - */ - isLastCursor(): boolean; - - // Moving the Cursor - /** Moves the cursor up one screen row. */ - moveUp(rowCount?: number, options?: { moveToEndOfSelection?: boolean }): void; - - /** Moves the cursor down one screen row. */ - moveDown(rowCount?: number, options?: { moveToEndOfSelection?: boolean }): void; - - /** Moves the cursor left one screen column. */ - moveLeft(columnCount?: number, options?: { moveToEndOfSelection?: boolean }): void; - - /** Moves the cursor right one screen column. */ - moveRight(columnCount?: number, options?: { moveToEndOfSelection?: boolean }): void; - - /** Moves the cursor to the top of the buffer. */ - moveToTop(): void; - - /** Moves the cursor to the bottom of the buffer. */ - moveToBottom(): void; - - /** Moves the cursor to the beginning of the line. */ - moveToBeginningOfScreenLine(): void; - - /** Moves the cursor to the beginning of the buffer line. */ - moveToBeginningOfLine(): void; - - /** Moves the cursor to the beginning of the first character in the line. */ - moveToFirstCharacterOfLine(): void; - - /** Moves the cursor to the end of the line. */ - moveToEndOfScreenLine(): void; - - /** Moves the cursor to the end of the buffer line. */ - moveToEndOfLine(): void; - - /** Moves the cursor to the beginning of the word. */ - moveToBeginningOfWord(): void; - - /** Moves the cursor to the end of the word. */ - moveToEndOfWord(): void; - - /** Moves the cursor to the beginning of the next word. */ - moveToBeginningOfNextWord(): void; - - /** Moves the cursor to the previous word boundary. */ - moveToPreviousWordBoundary(): void; - - /** Moves the cursor to the next word boundary. */ - moveToNextWordBoundary(): void; - - /** Moves the cursor to the previous subword boundary. */ - moveToPreviousSubwordBoundary(): void; - - /** Moves the cursor to the next subword boundary. */ - moveToNextSubwordBoundary(): void; - - /** Moves the cursor to the beginning of the buffer line, skipping all whitespace. */ - skipLeadingWhitespace(): void; - - /** Moves the cursor to the beginning of the next paragraph. */ - moveToBeginningOfNextParagraph(): void; - - /** Moves the cursor to the beginning of the previous paragraph. */ - moveToBeginningOfPreviousParagraph(): void; - - // Local Positions and Ranges - /** Returns buffer position of previous word boundary. It might be on the current - * word, or the previous word. - */ - getPreviousWordBoundaryBufferPosition(options?: { wordRegex?: RegExp }): - TextBuffer.Point; - - /** Returns buffer position of the next word boundary. It might be on the current - * word, or the previous word. - */ - getNextWordBoundaryBufferPosition(options?: { wordRegex?: RegExp }): - TextBuffer.Point; - - /** Retrieves the buffer position of where the current word starts. */ - getBeginningOfCurrentWordBufferPosition(options?: { - wordRegex?: RegExp, - includeNonWordCharacters?: boolean, - allowPrevious?: boolean - }): TextBuffer.Point; - - /** Retrieves the buffer position of where the current word ends. */ - getEndOfCurrentWordBufferPosition(options?: { - wordRegex?: RegExp, - includeNonWordCharacters?: boolean - }): TextBuffer.Point; - - /** Retrieves the buffer position of where the next word starts. */ - getBeginningOfNextWordBufferPosition(options?: { wordRegex?: RegExp }): TextBuffer.Point; - - /** Returns the buffer Range occupied by the word located under the cursor. */ - getCurrentWordBufferRange(options?: { wordRegex?: RegExp }): TextBuffer.Range; - - /** Returns the buffer Range for the current line. */ - getCurrentLineBufferRange(options?: { includeNewline?: boolean }): TextBuffer.Range; - - /** Retrieves the range for the current paragraph. - * A paragraph is defined as a block of text surrounded by empty lines or comments. - */ - getCurrentParagraphBufferRange(): TextBuffer.Range; - - /** Returns the characters preceding the cursor in the current word. */ - getCurrentWordPrefix(): string; - - // Visibility - /** Sets whether the cursor is visible. */ - setVisible(visible: boolean): void; - - /** Returns the visibility of the cursor. */ - isVisible(): boolean; - - // Comparing to another cursor - /** Compare this cursor's buffer position to another cursor's buffer position. - * See Point::compare for more details. - */ - compare(otherCursor: Cursor): number; - - // Utilities - /** Prevents this cursor from causing scrolling. */ - clearAutoscroll(): void; - - /** Deselects the current selection. */ - clearSelection(): void; - - /** Get the RegExp used by the cursor to determine what a "word" is. */ - wordRegExp(options?: { includeNonWordCharacters?: boolean }): RegExp; - - /** Get the RegExp used by the cursor to determine what a "subword" is. */ - subwordRegExp(options?: { backwards?: boolean }): RegExp; - } - - /** Represents a decoration that follows a DisplayMarker. A decoration is basically - * a visual representation of a marker. It allows you to add CSS classes to line - * numbers in the gutter, lines, and add selection-line regions around marked ranges - * of text. - */ - interface Decoration { - id: number; - - // Construction and Destruction - /** Destroy this marker decoration. - * You can also destroy the marker if you own it, which will destroy this decoration. - */ - destroy(): void; - - // Event Subscription - /** When the Decoration is updated via Decoration::setProperties. */ - onDidChangeProperties(callback: (event: Events.DecorationPropsChanged) => void): - EventKit.Disposable; - - /** Invoke the given callback when the Decoration is destroyed. */ - onDidDestroy(callback: () => void): EventKit.Disposable; - - // Decoration Details - /** An id unique across all Decoration objects. */ - getId(): number; - - /** Returns the marker associated with this Decoration. */ - getMarker(): TextBuffer.DisplayMarker; - - // Properties - /** Returns the Decoration's properties. */ - getProperties(): Structures.DecorationProps; - - /** Update the marker with new Properties. Allows you to change the decoration's - * class. - */ - setProperties(newProperties: Structures.DecorationProps): void; - } - - interface Deserializer { - name: string; - deserialize(state: object): object; - } - - /** Manages the deserializers used for serialized state. */ - interface DeserializerManager { - /** Register the given class(es) as deserializers. */ - add(...deserializers: Deserializer[]): EventKit.Disposable; - - /** Deserialize the state and params. */ - deserialize(state: object): object|undefined; - } - - /** A container at the edges of the editor window capable of holding items. */ - interface Dock { - // Methods - /** Show the dock and focus its active Pane. */ - activate(): void; - - /** Show the dock without focusing it. */ - show(): void; - - /** Hide the dock and activate the WorkspaceCenter if the dock was was previously focused. */ - hide(): void; - - /** Toggle the dock's visibility without changing the Workspace's active pane container. */ - toggle(): void; - - /** Check if the dock is visible. */ - isVisible(): boolean; - - // Event Subscription - /** Invoke the given callback when the visibility of the dock changes. */ - onDidChangeVisible(callback: (visible: boolean) => void): EventKit.Disposable; - - /** Invoke the given callback with the current and all future visibilities of the dock. */ - observeVisible(callback: (visible: boolean) => void): EventKit.Disposable; - - /** Invoke the given callback with all current and future panes items in the dock. */ - observePaneItems(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback when the active pane item changes. - * - * Because observers are invoked synchronously, it's important not to perform any expensive - * operations via this method. Consider ::onDidStopChangingActivePaneItem to delay operations - * until after changes stop occurring. - */ - onDidChangeActivePaneItem(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback when the active pane item stops changing. */ - onDidStopChangingActivePaneItem(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback with the current active pane item and with all future - * active pane items in the dock. - */ - observeActivePaneItem(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback when a pane is added to the dock. */ - onDidAddPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; - - /** Invoke the given callback before a pane is destroyed in the dock. */ - onWillDestroyPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; - - /** Invoke the given callback when a pane is destroyed in the dock. */ - onDidDestroyPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; - - /** Invoke the given callback with all current and future panes in the dock. */ - observePanes(callback: (pane: Pane) => void): EventKit.Disposable; - - /** Invoke the given callback when the active pane changes. */ - onDidChangeActivePane(callback: (pane: Pane) => void): EventKit.Disposable; - - /** Invoke the given callback with the current active pane and when the active pane changes. */ - observeActivePane(callback: (pane: Pane) => void): EventKit.Disposable; - - /** Invoke the given callback when a pane item is added to the dock. */ - onDidAddPaneItem(callback: (event: Events.PaneItemObserved) => void): - EventKit.Disposable; - - /** Invoke the given callback when a pane item is about to be destroyed, before the user is - * prompted to save it. - */ - onWillDestroyPaneItem(callback: (event: Events.PaneItemObserved) => void): - EventKit.Disposable; - - /** Invoke the given callback when a pane item is destroyed. */ - onDidDestroyPaneItem(callback: (event: Events.PaneItemObserved) => void): - EventKit.Disposable; - - // Pane Items - /** Get all pane items in the dock. */ - getPaneItems(): object[]; - - /** Get the active Pane's active item. */ - getActivePaneItem(): object; - - // Panes - /** Returns an Array of Panes. */ - getPanes(): Pane[]; - - /** Get the active Pane. */ - getActivePane(): Pane; - - /** Make the next pane active. */ - activateNextPane(): boolean; - - /** Make the previous pane active. */ - activatePreviousPane(): boolean; - } - - /** Represents the underlying git operations performed by Atom. */ - interface GitRepository { - // Lifecycle - /** Destroy this GitRepository object. */ - destroy(): void; - - /** Returns a boolean indicating if this repository has been destroyed. */ - isDestroyed(): boolean; - - // Event Subscription - /** Invoke the given callback when this GitRepository's destroy() method is - * invoked. - */ - onDidDestroy(callback: () => void): EventKit.Disposable; - - /** Invoke the given callback when a specific file's status has changed. When - * a file is updated, reloaded, etc, and the status changes, this will be fired. - */ - onDidChangeStatus(callback: (event: Events.RepoStatusChanged) => void): - EventKit.Disposable; - - /** Invoke the given callback when a multiple files' statuses have changed. */ - onDidChangeStatuses(callback: () => void): EventKit.Disposable; - - // Repository Details - /** A string indicating the type of version control system used by this repository. */ - getType(): "git"; - - /** Returns the string path of the repository. */ - getPath(): string; - - /** Returns the string working directory path of the repository. */ - getWorkingDirectory(): string; - - /** Returns true if at the root, false if in a subfolder of the repository. */ - isProjectAtRoot(): boolean; - - /** Makes a path relative to the repository's working directory. */ - relativize(): string; - - /** Returns true if the given branch exists. */ - hasBranch(branch: string): boolean; - - /** Retrieves a shortened version of the HEAD reference value. */ - getShortHead(path?: string): string; - - /** Is the given path a submodule in the repository? */ - isSubmodule(path: string): boolean; - - /** Returns the number of commits behind the current branch is from the its - * upstream remote branch. The default reference is the HEAD. - * @param reference The branch reference name. - * @param path The path in the repository to get this ifnromation for, only - * needed if the repository contains submodules. - * @return Returns the number of commits behind the current branch is from its - * upstream remote branch. - */ - getAheadBehindCount(reference: string, path?: string): { ahead: number, behind: number }; - - /** Get the cached ahead/behind commit counts for the current branch's - * upstream branch. - */ - getCachedUpstreamAheadBehindCount(path?: string): { ahead: number, behind: number }; - - /** Returns the git configuration value specified by the key. */ - getConfigValue(key: string, path?: string): string; - - /** Returns the origin url of the repository. */ - getOriginURL(path?: string): string; - - /** Returns the upstream branch for the current HEAD, or null if there is no - * upstream branch for the current HEAD. - */ - getUpstreamBranch(path?: string): string|null; - - /** Gets all the local and remote references. */ - getReferences(path?: string): { heads: string[], remotes: string[], tags: string[] }; - - /** Returns the current string SHA for the given reference. */ - getReferenceTarget(reference: string, path?: string): string; - - // Reading Status - /** Returns true if the given path is modified. */ - isPathModified(path: string): boolean; - - /** Returns true if the given path is new. */ - isPathNew(path: string): boolean; - - /** Is the given path ignored? */ - isPathIgnored(path: string): boolean; - - /** Get the status of a directory in the repository's working directory. */ - getDirectoryStatus(path: string): number; - - /** Get the status of a single path in the repository. */ - getPathStatus(path: string): number; - - /** Get the cached status for the given path. */ - getCachedPathStatus(path: string): number|null; - - /** Returns true if the given status indicates modification. */ - isStatusModified(status: number): boolean; - - /** Returns true if the given status indicates a new path. */ - isStatusNew(status: number): boolean; - - // Retrieving Diffs - /** Retrieves the number of lines added and removed to a path. - * This compares the working directory contents of the path to the HEAD version. - */ - getDiffStats(path: string): { added: number, deleted: number }; - - /** Retrieves the line diffs comparing the HEAD version of the given path - * and the given text. - */ - getLineDiffs(path: string, text: string): Array<{ oldStart: number, - newStart: number, oldLines: number, newLines: number }>; - - // Checking Out - /** Restore the contents of a path in the working directory and index to the - * version at HEAD. - */ - checkoutHead(path: string): boolean; - - /** Checks out a branch in your repository. */ - checkoutReference(reference: string, create: boolean): boolean; - } - - /** Represents a gutter within a TextEditor. */ - interface Gutter { - // Gutter Destruction - /** Destroys the gutter. */ - destroy(): void; - - // Event Subscription - /** Calls your callback when the gutter's visibility changes. */ - onDidChangeVisible(callback: (gutter: Gutter) => void): EventKit.Disposable; - - /** Calls your callback when the gutter is destroyed. */ - onDidDestroy(callback: () => void): EventKit.Disposable; - - // Visibility - /** Hide the gutter. */ - hide(): void; - - /** Show the gutter. */ - show(): void; - - /** Determine whether the gutter is visible. */ - isVisible(): boolean; - - /** Add a decoration that tracks a DisplayMarker. When the marker moves, is - * invalidated, or is destroyed, the decoration will be updated to reflect - * the marker's state. - */ - decorateMarker(marker: TextBuffer.DisplayMarker, decorationParams: - Structures.DecorationProps): Decoration; - } - - /** History manager for remembering which projects have been opened. - * An instance of this class is always available as the atom.history global. - * The project history is used to enable the 'Reopen Project' menu. - */ - interface HistoryManager { - /** Obtain a list of previously opened projects. */ - getProjects(): HistoryProject[]; - - /** Clear all projects from the history. - * Note: This is not a privacy function - other traces will still exist, e.g. - * window state. - */ - clearProjects(): void; - - /** Invoke the given callback when the list of projects changes. */ - onDidChangeProjects(callback: (args: { reloaded: boolean }) => void): EventKit.Disposable; - } - - interface HistoryProject { - paths: string[]; - lastOpened: Date; - } - - /** Represents a decoration that applies to every marker on a given layer. Created via - * TextEditor::decorateMarkerLayer. - */ - interface LayerDecoration { - /** Destroys the decoration. */ - destroy(): void; - - /** Determine whether this decoration is destroyed. */ - isDestroyed(): boolean; - - /** Get this decoration's properties. */ - getProperties(): Structures.DecorationLayerProps; - - /** Set this decoration's properties. */ - setProperties(newProperties: Structures.DecorationLayerProps): void; - - /** Override the decoration properties for a specific marker. */ - setPropertiesForMarker(marker: TextBuffer.DisplayMarker|TextBuffer.Marker, - properties: Structures.DecorationLayerProps): void; - } - - /** Provides a registry for menu items that you'd like to appear in the application menu. */ - interface MenuManager { - /** Adds the given items to the application menu. */ - add(items: ReadonlyArray): EventKit.Disposable; - - /** Refreshes the currently visible menu. */ - update(): void; - } - - interface Model { - // Properties - alive: boolean; - - // Lifecycle - /** Destroys this Model. */ - destroy(): void; - - /** Returns whether or not this Model is alive. */ - isAlive(): boolean; - - /** Returns whether or not this Model has been destroyed. */ - isDestroyed(): boolean; - } - - /** A notification to the user containing a message and type. */ - interface Notification { - // Properties - dismissed: boolean; - displayed: boolean; - timestamp: Date; - - // Event Subscription - /** Invoke the given callback when the notification is dismissed. */ - onDidDismiss(callback: (notification: Notification) => void): EventKit.Disposable; - - /** Invoke the given callback when the notification is displayed. */ - onDidDisplay(callback: (notification: Notification) => void): EventKit.Disposable; - - // Methods - /** Returns the Notification's type. */ - getType(): string; - - /** Returns the Notification's message. */ - getMessage(): string; - - /** Dismisses the notification, removing it from the UI. Calling this - * programmatically will call all callbacks added via onDidDismiss. - */ - dismiss(): void; - } - - /** A notification manager used to create Notifications to be shown to the user. */ - interface NotificationManager { - // Properties - notifications: Notification[]; - - // Events - /** Invoke the given callback after a notification has been added. */ - onDidAddNotification(callback: (notification: Notification) => void): - EventKit.Disposable; - - // Adding Notifications - /** Add a success notification. */ - addSuccess(message: string, options?: Options.Notification): Notification; - - /** Add an informational notification. */ - addInfo(message: string, options?: Options.Notification): Notification; - - /** Add a warning notification. */ - addWarning(message: string, options?: Options.Notification): Notification; - - /** Add an error notification. */ - addError(message: string, options?: Options.ErrorNotification): Notification; - - /** Add a fatal error notification. */ - addFatalError(message: string, options?: Options.ErrorNotification): Notification; - - // Getting Notifications - /** Get all the notifications. */ - getNotifications(): Notification[]; - } - - /** Loads and activates a package's main module and resources such as stylesheets, - * keymaps, grammar, editor properties, and menus. - */ - interface Package { - // Properties - name: string; - bundledPackage: boolean; - path: string; - - // Event Subscription - /** Invoke the given callback when all packages have been activated. */ - onDidDeactivate(callback: () => void): EventKit.Disposable; - - // Native Module Compatibility - /** Are all native modules depended on by this package correctly compiled - * against the current version of Atom? - */ - isCompatible(): boolean; - - /** Rebuild native modules in this package's dependencies for the current - * version of Atom. - */ - rebuild(): Promise<{ code: number, stdout: string, stderr: string }>; - - /** If a previous rebuild failed, get the contents of stderr. */ - getBuildFailureOutput(): string|null; - } - - /** Package manager for coordinating the lifecycle of Atom packages. */ - interface PackageManager { - // Event Subscription - /** Invoke the given callback when all packages have been loaded. */ - onDidLoadInitialPackages(callback: () => void): EventKit.Disposable; - - /** Invoke the given callback when all packages have been activated. */ - onDidActivateInitialPackages(callback: () => void): EventKit.Disposable; - - /** Invoke the given callback when a package is activated. */ - onDidActivatePackage(callback: (package: Package) => void): EventKit.Disposable; - - /** Invoke the given callback when a package is deactivated. */ - onDidDeactivatePackage(callback: (package: Package) => void): EventKit.Disposable; - - /** Invoke the given callback when a package is loaded. */ - onDidLoadPackage(callback: (package: Package) => void): EventKit.Disposable; - - /** Invoke the given callback when a package is unloaded. */ - onDidUnloadPackage(callback: (package: Package) => void): EventKit.Disposable; - - // Package System Data - /** Get the path to the apm command. */ - getApmPath(): string; - - /** Get the paths being used to look for packages. */ - getPackageDirPaths(): string[]; - - // General Package Data - /** Resolve the given package name to a path on disk. */ - resolvePackagePath(name: string): string|undefined; - - /** Is the package with the given name bundled with Atom? */ - isBundledPackage(name: string): boolean; - - // Enabling and Disabling Packages - /** Enable the package with the given name. */ - enablePackage(name: string): Package|undefined; - - /** Disable the package with the given name. */ - disablePackage(name: string): Package|undefined; - - /** Is the package with the given name disabled? */ - isPackageDisabled(name: string): boolean; - - // Accessing Active Packages - /** Get an Array of all the active Packages. */ - getActivePackages(): Package[]; - - /** Get the active Package with the given name. */ - getActivePackage(name: string): Package|undefined; - - /** Is the Package with the given name active? */ - isPackageActive(name: string): boolean; - - /** Returns a boolean indicating whether package activation has occurred. */ - hasActivatedInitialPackages(): boolean; - - // Accessing Loaded Packages - /** Get an Array of all the loaded Packages. */ - getLoadedPackages(): Package[]; - - /** Get the loaded Package with the given name. */ - getLoadedPackage(name: string): Package|undefined; - - /** Is the package with the given name loaded? */ - isPackageLoaded(name: string): boolean; - - /** Returns a boolean indicating whether package loading has occurred. */ - hasLoadedInitialPackages(): boolean; - - // Accessing Available Packages - /** Returns an Array of strings of all the available package paths. */ - getAvailablePackagePaths(): string[]; - - /** Returns an Array of strings of all the available package names. */ - getAvailablePackageNames(): string[]; - - /** Returns an Array of strings of all the available package metadata. */ - getAvailablePackageMetadata(): string[]; - } - - /** A container for presenting content in the center of the workspace. */ - interface Pane { - // Event Subscription - /** Invoke the given callback when the pane resizes. */ - onDidChangeFlexScale(callback: (flexScale: number) => void): EventKit.Disposable; - - /** Invoke the given callback with the current and future values of ::getFlexScale. */ - observeFlexScale(callback: (flexScale: number) => void): EventKit.Disposable; - - /** Invoke the given callback when the pane is activated. */ - onDidActivate(callback: () => void): EventKit.Disposable; - - /** Invoke the given callback before the pane is destroyed. */ - onWillDestroy(callback: () => void): EventKit.Disposable; - - /** Invoke the given callback when the pane is destroyed. */ - onDidDestroy(callback: () => void): EventKit.Disposable; - - /** Invoke the given callback when the value of the ::isActive property changes. */ - onDidChangeActive(callback: (active: boolean) => void): EventKit.Disposable; - - /** Invoke the given callback with the current and future values of the ::isActive - * property. - */ - observeActive(callback: (active: boolean) => void): EventKit.Disposable; - - /** Invoke the given callback when an item is added to the pane. */ - onDidAddItem(callback: (event: Events.PaneListItemShifted) => void): - EventKit.Disposable; - - /** Invoke the given callback when an item is removed from the pane. */ - onDidRemoveItem(callback: (event: Events.PaneListItemShifted) => void): - EventKit.Disposable; - - /** Invoke the given callback before an item is removed from the pane. */ - onWillRemoveItem(callback: (event: Events.PaneListItemShifted) => void): - EventKit.Disposable; - - /** Invoke the given callback when an item is moved within the pane. */ - onDidMoveItem(callback: (event: Events.PaneItemMoved) => void): - EventKit.Disposable; - - /** Invoke the given callback with all current and future items. */ - observeItems(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback when the value of ::getActiveItem changes. */ - onDidChangeActiveItem(callback: (activeItem: object) => void): EventKit.Disposable; - - /** Invoke the given callback when ::activateNextRecentlyUsedItem has been called, - * either initiating or continuing a forward MRU traversal of pane items. - */ - onChooseNextMRUItem(callback: (nextRecentlyUsedItem: object) => void): EventKit.Disposable; - - /** Invoke the given callback when ::activatePreviousRecentlyUsedItem has been called, - * either initiating or continuing a reverse MRU traversal of pane items. - */ - onChooseLastMRUItem(callback: (previousRecentlyUsedItem: object) => void): - EventKit.Disposable; - - /** Invoke the given callback when ::moveActiveItemToTopOfStack has been called, - * terminating an MRU traversal of pane items and moving the current active item - * to the top of the stack. Typically bound to a modifier (e.g. CTRL) key up event. - */ - onDoneChoosingMRUItem(callback: () => void): EventKit.Disposable; - - /** Invoke the given callback with the current and future values of ::getActiveItem. */ - observeActiveItem(callback: (activeItem: object) => void): EventKit.Disposable; - - /** Invoke the given callback before items are destroyed. */ - onWillDestroyItem(callback: (event: Events.PaneListItemShifted) => void): - EventKit.Disposable; - - // Items - /** Get the items in this pane. */ - getItems(): object[]; - - /** Get the active pane item in this pane. */ - getActiveItem(): object; - - /** Return the item at the given index. */ - itemAtIndex(index: number): object|undefined; - - /** Makes the next item active. */ - activateNextItem(): void; - - /** Makes the previous item active. */ - activatePreviousItem(): void; - - /** Move the active tab to the right. */ - moveItemRight(): void; - - /** Move the active tab to the left. */ - moveItemLeft(): void; - - /** Get the index of the active item. */ - getActiveItemIndex(): number; - - /** Activate the item at the given index. */ - activateItemAtIndex(index: number): void; - - /** Make the given item active, causing it to be displayed by the pane's view. */ - activateItem(item: object, options?: { pending: boolean }): void; - - /** Add the given item to the pane. */ - addItem(item: object, options?: { index?: number, pending?: boolean }): object; - - /** Add the given items to the pane. */ - addItems(items: object[], index?: number): object[]; - - /** Move the given item to the given index. */ - moveItem(item: object, index: number): void; - - /** Move the given item to the given index on another pane. */ - moveItemToPane(item: object, pane: Pane, index: number): void; - - /** Destroy the active item and activate the next item. */ - destroyActiveItem(): void; - - /** Destroy the given item. */ - destroyItem(item: object, force?: boolean): Promise; - - /** Destroy all items. */ - destroyItems(): void; - - /** Destroy all items except for the active item. */ - destroyInactiveItems(): void; - - /** Save the active item. */ - saveActiveItem(nextAction?: (error?: Error) => T): - Promise|undefined; - - /** Prompt the user for a location and save the active item with the path - * they select. - */ - saveActiveItemAs(nextAction?: (error?: Error) => T): - Promise|undefined; - - /** Save the given item. */ - saveItem(item: object, nextAction?: (error?: Error) => T): - Promise|undefined; - - /** Prompt the user for a location and save the active item with the path - * they select. - */ - saveItemAs(item: object, nextAction?: (error?: Error) => T): - Promise|undefined; - - /** Save all items. */ - saveItems(): void; - - /** Return the first item that matches the given URI or undefined if none exists. */ - itemForURI(uri: string): object|undefined; - - /** Activate the first item that matches the given URI. */ - activateItemForURI(uri: string): boolean; - - // Lifecycle - /** Determine whether the pane is active. */ - isActive(): boolean; - - /** Makes this pane the active pane, causing it to gain focus. */ - activate(): void; - - /** Close the pane and destroy all its items. */ - destroy(): void; - - /** Determine whether this pane has been destroyed. */ - isDestroyed(): boolean; - - // Splitting - /** Create a new pane to the left of this pane. */ - splitLeft(params?: { - items?: object[], - copyActiveItem?: boolean, - }): Pane; - - /** Create a new pane to the right of this pane. */ - splitRight(params?: { - items?: object[], - copyActiveItem?: boolean, - }): Pane; - - /** Creates a new pane above the receiver. */ - splitUp(params?: { - items?: object[], - copyActiveItem?: boolean, - }): Pane; - - /** Creates a new pane below the receiver. */ - splitDown(params?: { - items?: object[], - copyActiveItem?: boolean, - }): Pane; - } - - /** A container representing a panel on the edges of the editor window. You - * should not create a Panel directly, instead use Workspace::addTopPanel and - * friends to add panels. - */ - interface Panel { - visible: boolean; - - // Construction and Destruction - /** Destroy and remove this panel from the UI. */ - destroy(): void; - - // Event Subscription - /** Invoke the given callback when the pane hidden or shown. */ - onDidChangeVisible(callback: (visible: boolean) => void): EventKit.Disposable; - - /** Invoke the given callback when the pane is destroyed. */ - onDidDestroy(callback: (panel: Panel) => void): EventKit.Disposable; - - // Panel Details - /** Returns the panel's item. */ - getItem(): object; - - /** Returns a number indicating this panel's priority. */ - getPriority(): number; - - /** Returns a boolean true when the panel is visible. */ - isVisible(): boolean; - - /** Hide this panel. */ - hide(): void; - - /** Show this panel. */ - show(): void; - } - - /** Manage a subscription to filesystem events that occur beneath a root directory. */ - interface PathWatcher extends EventKit.DisposableLike { - /** Return a Promise that will resolve when the underlying native watcher is - * ready to begin sending events. - */ - getStartPromise(): Promise; - - /** Invokes a function when any errors related to this watcher are reported. */ - onDidError(callback: (error: Error) => void): EventKit.Disposable; - - /** Unsubscribe all subscribers from filesystem events. Native resources will be - * release asynchronously, but this watcher will stop broadcasting events - * immediately. - */ - dispose(): void; - } - - /** Represents a project that's opened in Atom. */ - interface Project { - // Event Subscription - /** Invoke the given callback when the project paths change. */ - onDidChangePaths(callback: (projectPaths: string[]) => void): EventKit.Disposable; - - /** Invoke the given callback when a text buffer is added to the project. */ - onDidAddBuffer(callback: (buffer: TextBuffer.TextBuffer) => void): EventKit.Disposable; - - /** Invoke the given callback with all current and future text buffers in - * the project. - */ - observeBuffers(callback: (buffer: TextBuffer.TextBuffer) => void): EventKit.Disposable; - - /** Invoke a callback when a filesystem change occurs within any open project path. */ - onDidChangeFiles(callback: (events: Events.FilesystemChange) => void): EventKit.Disposable; - - // Accessing the Git Repository - /** Get an Array of GitRepositorys associated with the project's directories. */ - getRepositories(): GitRepository[]; - - /** Get the repository for a given directory asynchronously. */ - repositoryForDirectory(directory: PathWatcher.Directory): Promise; - - // Managing Paths - /** Get an Array of strings containing the paths of the project's directories. */ - getPaths(): string[]; - - /** Set the paths of the project's directories. */ - setPaths(projectPaths: string[]): void; - - /** Add a path to the project's list of root paths. */ - addPath(projectPath: string): void; - - /** Access a promise that resolves when the filesystem watcher associated with a - * project root directory is ready to begin receiving events. - */ - getWatcherPromise(projectPath: string): Promise; - - /** Remove a path from the project's list of root paths. */ - removePath(projectPath: string): void; - - /** Get an Array of Directorys associated with this project. */ - getDirectories(): PathWatcher.Directory[]; - - /** Get the relative path from the project directory to the given path. */ - relativize(fullPath: string): string; - - /** Get the path to the project directory that contains the given path, and - * the relative path from that project directory to the given path. - */ - relativizePath(fullPath: string): [string|null, string]; - - /** Determines whether the given path (real or symbolic) is inside the - * project's directory. - */ - contains(pathToCheck: string): boolean; - } - - /** Wraps an Array of Strings. The Array describes a path from the root of the - * syntax tree to a token including all scope names for the entire path. - */ - interface ScopeDescriptor { - scopes: string[]; - - /** Returns all scopes for this descriptor. */ - getScopesArray(): string[]; - } - - /** Represents a selection in the TextEditor. */ - interface Selection { - // Event Subscription - /** Calls your callback when the selection was moved. */ - onDidChangeRange(callback: (event: Events.SelectionChanged) => void): - EventKit.Disposable; - - /** Calls your callback when the selection was destroyed. */ - onDidDestroy(callback: () => void): EventKit.Disposable; - - // Managing the selection range - /** Returns the screen Range for the selection. */ - getScreenRange(): TextBuffer.Range; - - /** Modifies the screen range for the selection. */ - setScreenRange(screenRange: TextBuffer.RangeLike|[TextBuffer.PointLike, - TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], - TextBuffer.PointLike]|[[number, number], [number, number]], options?: - { preserveFolds?: boolean, autoscroll?: boolean }): void; - - /** Returns the buffer Range for the selection. */ - getBufferRange(): TextBuffer.Range; - - /** Modifies the buffer Range for the selection. */ - setBufferRange(bufferRange: TextBuffer.RangeLike|[TextBuffer.PointLike, - TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], - TextBuffer.PointLike]|[[number, number], [number, number]], options?: - { preserveFolds?: boolean, autoscroll?: boolean }): void; - - /** Returns the starting and ending buffer rows the selection is highlighting. */ - getBufferRowRange(): [number, number]; - - // Info about the selection - /** Determines if the selection contains anything. */ - isEmpty(): boolean; - - /** Determines if the ending position of a marker is greater than the starting position. - * This can happen when, for example, you highlight text "up" in a TextBuffer. - */ - isReversed(): boolean; - - /** Returns whether the selection is a single line or not. */ - isSingleScreenLine(): boolean; - - /** Returns the text in the selection. */ - getText(): string; - - // NOTE: this calls into Range.intersectsWith(), which is one of the few functions - // that doesn't take a range-compatible range, despite what the API says. - /** Identifies if a selection intersects with a given buffer range. */ - intersectsBufferRange(bufferRange: TextBuffer.RangeLike): boolean; - - /** Identifies if a selection intersects with another selection. */ - intersectsWith(otherSelection: Selection): boolean; - - // Modifying the selected range - /** Clears the selection, moving the marker to the head. */ - clear(options?: { autoscroll?: boolean }): void; - - /** Selects the text from the current cursor position to a given screen position. */ - selectToScreenPosition(position: TextBuffer.PointLike|[number, number]): void; - - /** Selects the text from the current cursor position to a given buffer position. */ - selectToBufferPosition(position: TextBuffer.PointLike|[number, number]): void; - - /** Selects the text one position right of the cursor. */ - selectRight(columnCount?: number): void; - - /** Selects the text one position left of the cursor. */ - selectLeft(columnCount?: number): void; - - /** Selects all the text one position above the cursor. */ - selectUp(rowCount?: number): void; - - /** Selects all the text one position below the cursor. */ - selectDown(rowCount?: number): void; - - /** Selects all the text from the current cursor position to the top of the - * buffer. - */ - selectToTop(): void; - - /** Selects all the text from the current cursor position to the bottom of - * the buffer. - */ - selectToBottom(): void; - - /** Selects all the text in the buffer. */ - selectAll(): void; - - /** Selects all the text from the current cursor position to the beginning of - * the line. - */ - selectToBeginningOfLine(): void; - - /** Selects all the text from the current cursor position to the first character - * of the line. - */ - selectToFirstCharacterOfLine(): void; - - /** Selects all the text from the current cursor position to the end of the - * screen line. - */ - selectToEndOfLine(): void; - - /** Selects all the text from the current cursor position to the end of the - * buffer line. - */ - selectToEndOfBufferLine(): void; - - /** Selects all the text from the current cursor position to the beginning - * of the word. - */ - selectToBeginningOfWord(): void; - - /** Selects all the text from the current cursor position to the end of the word. */ - selectToEndOfWord(): void; - - /** Selects all the text from the current cursor position to the beginning of - * the next word. - */ - selectToBeginningOfNextWord(): void; - - /** Selects text to the previous word boundary. */ - selectToPreviousWordBoundary(): void; - - /** Selects text to the next word boundary. */ - selectToNextWordBoundary(): void; - - /** Selects text to the previous subword boundary. */ - selectToPreviousSubwordBoundary(): void; - - /** Selects text to the next subword boundary. */ - selectToNextSubwordBoundary(): void; - - /** Selects all the text from the current cursor position to the beginning of - * the next paragraph. - */ - selectToBeginningOfNextParagraph(): void; - - /** Selects all the text from the current cursor position to the beginning of - * the previous paragraph. - */ - selectToBeginningOfPreviousParagraph(): void; - - /** Modifies the selection to encompass the current word. */ - selectWord(): void; - - /** Expands the newest selection to include the entire word on which the - * cursors rests. - */ - expandOverWord(): void; - - /** Selects an entire line in the buffer. */ - selectLine(row: number): void; - - /** Expands the newest selection to include the entire line on which the cursor - * currently rests. - * It also includes the newline character. - */ - expandOverLine(): void; - - // Modifying the selected text - /** Replaces text at the current selection. */ - insertText(text: string, options?: Options.TextInsertion): void; - - /** Removes the first character before the selection if the selection is empty - * otherwise it deletes the selection. - */ - backspace(): 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; - - /** 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; - - /** 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; - - /** Removes from the beginning of the line which the selection begins on all - * the way through to the end of the selection. - */ - deleteToBeginningOfLine(): void; - - /** Removes the selection or the next character after the start of the selection - * if the selection is empty. - */ - delete(): 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; - - /** 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; - - /** 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; - - /** 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; - - /** Removes only the selected text. */ - deleteSelectedText(): 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; - - /** 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; - - /** Removes one level of indent from the currently selected rows. */ - outdentSelectedRows(): void; - - /** Sets the indentation level of all selected rows to values suggested by the - * relevant grammars. - */ - autoIndentSelectedRows(): 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; - - /** Cuts the selection until the end of the screen line. */ - cutToEndOfLine(): void; - - /** Cuts the selection until the end of the buffer line. */ - cutToEndOfBufferLine(): void; - - /** Copies the selection to the clipboard and then deletes it. */ - cut(maintainClipboard?: boolean, fullLine?: boolean): void; - - /** Copies the current selection to the clipboard. */ - copy(maintainClipboard?: boolean, fullLine?: boolean): void; - - /** Creates a fold containing the current selection. */ - fold(): void; - - /** If the selection spans multiple rows, indent all of them. */ - indentSelectedRows(): void; - - // Managing multiple selections - /** Moves the selection down one row. */ - addSelectionBelow(): void; - - /** Moves the selection up one row. */ - addSelectionAbove(): void; - - /** Combines the given selection into this selection and then destroys the - * given selection. - */ - merge(otherSelection: Selection, options?: { preserveFolds?: boolean, - autoscroll?: boolean }): void; - - // Comparing to other selections - /** Compare this selection's buffer range to another selection's buffer range. - * See Range::compare for more details. - */ - compare(otherSelection: Selection): number; - } - - /** A singleton instance of this class available via atom.styles, which you can - * use to globally query and observe the set of active style sheets. - */ - interface StyleManager { - // Event Subscription - /** Invoke callback for all current and future style elements. */ - observeStyleElements(callback: (styleElement: Events.StyleElementObserved) => - void): EventKit.Disposable; - - /** Invoke callback when a style element is added. */ - onDidAddStyleElement(callback: (styleElement: Events.StyleElementObserved) => - void): EventKit.Disposable; - - /** Invoke callback when a style element is removed. */ - onDidRemoveStyleElement(callback: (styleElement: HTMLStyleElement) => void): - EventKit.Disposable; - - /** Invoke callback when an existing style element is updated. */ - onDidUpdateStyleElement(callback: (styleElement: Events.StyleElementObserved) => - void): EventKit.Disposable; - - // Reading Style Elements - /** Get all loaded style elements. */ - getStyleElements(): HTMLStyleElement[]; - - // Paths - /** Get the path of the user style sheet in ~/.atom. */ - getUserStyleSheetPath(): string; - } - - /** Run a node script in a separate process. */ - interface Task { - // NOTE: this is actually the best we can do here with the REST parameter - // for this appearing in the beginning of the parameter list, which isn't - // aligned with the ES6 spec. - /** Starts the task. - * Throws an error if this task has already been terminated or if sending a - * message to the child process fails. - */ - start(...args: any[]): void; - - /** Send message to the task. - * Throws an error if this task has already been terminated or if sending a - * message to the child process fails. - */ - send(message: string): void; - - /** Call a function when an event is emitted by the child process. */ - on(eventName: string, callback: (param: any) => void): EventKit.Disposable; - - /** Forcefully stop the running task. - * No more events are emitted once this method is called. - */ - terminate(): void; - - /** Cancel the running task and emit an event if it was canceled. */ - cancel(): boolean; - } - - /** This class represents all essential editing state for a single TextBuffer, - * including cursor and selection positions, folds, and soft wraps. - */ - interface TextEditor extends Model { - // Properties - id: number; - buffer: TextBuffer.TextBuffer; - element: HTMLElement; - - // Event Subscription - /** Calls your callback when the buffer's title has changed. */ - onDidChangeTitle(callback: (title: string) => void): EventKit.Disposable; - - /** Calls your callback when the buffer's path, and therefore title, has changed. */ - onDidChangePath(callback: (path: string) => void): EventKit.Disposable; - - /** Invoke the given callback synchronously when the content of the buffer - * changes. - */ - onDidChange(callback: (event: Events.EditorChanged[]) => void): - EventKit.Disposable; - - /** Invoke callback when the buffer's contents change. It is emit - * asynchronously 300ms after the last buffer change. This is a good place - * to handle changes to the buffer without compromising typing performance. - */ - onDidStopChanging(callback: (event: TextBuffer.Events.BufferStoppedChanging) => void): - EventKit.Disposable; - - /** Calls your callback when a Cursor is moved. If there are multiple cursors, - * your callback will be called for each cursor. - */ - onDidChangeCursorPosition(callback: (event: Events.CursorPositionChanged) => void): - EventKit.Disposable; - - /** Calls your callback when a selection's screen range changes. */ - onDidChangeSelectionRange(callback: (event: Events.SelectionChanged) => void): - EventKit.Disposable; - - /** Invoke the given callback after the buffer is saved to disk. */ - onDidSave(callback: (event: { path: string }) => void): EventKit.Disposable; - - /** Invoke the given callback when the editor is destroyed. */ - onDidDestroy(callback: () => void): EventKit.Disposable; - - /** Retrieves the current TextBuffer. */ - getBuffer(): TextBuffer.TextBuffer; - - /** Calls your callback when a Gutter is added to the editor. Immediately calls - * your callback for each existing gutter. - */ - observeGutters(callback: (gutter: Gutter) => void): EventKit.Disposable; - - /** Calls your callback when a Gutter is added to the editor. */ - onDidAddGutter(callback: (gutter: Gutter) => void): EventKit.Disposable; - - /** Calls your callback when a Gutter is removed from the editor. */ - onDidRemoveGutter(callback: (name: string) => void): EventKit.Disposable; - - /** Calls your callback when soft wrap was enabled or disabled. */ - onDidChangeSoftWrapped(callback: (softWrapped: boolean) => void): EventKit.Disposable; - - /** Calls your callback when the buffer's encoding has changed. */ - onDidChangeEncoding(callback: (encoding: string) => void): EventKit.Disposable; - - /** Calls your callback when the grammar that interprets and colorizes the text - * has been changed. Immediately calls your callback with the current grammar. - */ - observeGrammar(callback: (grammar: FirstMate.Grammar) => void): EventKit.Disposable; - - /** Calls your callback when the grammar that interprets and colorizes the text - * has been changed. - */ - onDidChangeGrammar(callback: (grammar: FirstMate.Grammar) => void): EventKit.Disposable; - - /** Calls your callback when the result of ::isModified changes. */ - onDidChangeModified(callback: (modified: boolean) => void): EventKit.Disposable; - - /** Calls your callback when the buffer's underlying file changes on disk at a - * moment when the result of ::isModified is true. - */ - onDidConflict(callback: () => void): EventKit.Disposable; - - /** Calls your callback before text has been inserted. */ - onWillInsertText(callback: (event: { text: string, cancel(): void }) => void): - EventKit.Disposable; - - /** Calls your callback after text has been inserted. */ - onDidInsertText(callback: (event: { text: string }) => void): EventKit.Disposable; - - /** Calls your callback when a Cursor is added to the editor. Immediately calls - * your callback for each existing cursor. - */ - observeCursors(callback: (cursor: Cursor) => void): EventKit.Disposable; - - /** Calls your callback when a Cursor is added to the editor. */ - onDidAddCursor(callback: (cursor: Cursor) => void): EventKit.Disposable; - - /** Calls your callback when a Cursor is removed from the editor. */ - onDidRemoveCursor(callback: (cursor: Cursor) => void): EventKit.Disposable; - - /** Calls your callback when a Selection is added to the editor. Immediately - * calls your callback for each existing selection. - */ - observeSelections(callback: (selection: Selection) => void): EventKit.Disposable; - - /** Calls your callback when a Selection is added to the editor. */ - onDidAddSelection(callback: (selection: Selection) => void): EventKit.Disposable; - - /** Calls your callback when a Selection is removed from the editor. */ - onDidRemoveSelection(callback: (selection: Selection) => void): EventKit.Disposable; - - /** Calls your callback with each Decoration added to the editor. Calls your - * callback immediately for any existing decorations. - */ - observeDecorations(callback: (decoration: Decoration) => void): EventKit.Disposable; - - /** Calls your callback when a Decoration is added to the editor. */ - onDidAddDecoration(callback: (decoration: Decoration) => void): EventKit.Disposable; - - /** Calls your callback when a Decoration is removed from the editor. */ - onDidRemoveDecoration(callback: (decoration: Decoration) => void): EventKit.Disposable; - - /** Calls your callback when the placeholder text is changed. */ - onDidChangePlaceholderText(callback: (placeholderText: string) => void): EventKit.Disposable; - - // File Details - /** Get the editor's title for display in other parts of the UI such as the tabs. - * If the editor's buffer is saved, its title is the file name. If it is unsaved, - * its title is "untitled". - */ - getTitle(): string; - - /** Get unique title for display in other parts of the UI, such as the window title. - * If the editor's buffer is unsaved, its title is "untitled" If the editor's - * buffer is saved, its unique title is formatted as one of the following, - * - * "" when it is the only editing buffer with this file name. - * " — " when other buffers have this file name. - */ - getLongTitle(): string; - - /** Returns the string path of this editor's text buffer. */ - getPath(): string|undefined; - - /** Returns boolean true if this editor has been modified. */ - isModified(): boolean; - - /** Returns boolean true if this editor has no content. */ - isEmpty(): boolean; - - /** Returns the string character set encoding of this editor's text buffer. */ - getEncoding(): string; - - /** Set the character set encoding to use in this editor's text buffer. */ - setEncoding(encoding: string): void; - - // File Operations - /** Saves the editor's text buffer. - * See TextBuffer::save for more details. - */ - save(): Promise; - - /** Saves the editor's text buffer as the given path. - * See TextBuffer::saveAs for more details. - */ - saveAs(filePath: string): Promise; - - // Reading Text - /** Returns a string representing the entire contents of the editor. */ - getText(): string; - - /** Get the text in the given range in buffer coordinates. */ - getTextInBufferRange(range: TextBuffer.RangeLike|[TextBuffer.PointLike, - TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], - TextBuffer.PointLike]|[[number, number], [number, number]]): string; - - /** Returns a number representing the number of lines in the buffer. */ - getLineCount(): number; - - /** Returns a number representing the number of screen lines in the editor. - * This accounts for folds. - */ - getScreenLineCount(): number; - - /** Returns a number representing the last zero-indexed buffer row number of - * the editor. - */ - getLastBufferRow(): number; - - /** Returns a number representing the last zero-indexed screen row number of - * the editor. - */ - getLastScreenRow(): number; - - /** Returns a string representing the contents of the line at the given - * buffer row. - */ - lineTextForBufferRow(bufferRow: number): string; - - /** Returns a string representing the contents of the line at the given - * screen row. - */ - lineTextForScreenRow(screenRow: number): string; - - /** Get the range of the paragraph surrounding the most recently added cursor. */ - getCurrentParagraphBufferRange(): TextBuffer.Range; - - // Mutating Text - /** Replaces the entire contents of the buffer with the given string. */ - setText(text: string): void; - - /** Set the text in the given Range in buffer coordinates. */ - setTextInBufferRange(range: TextBuffer.RangeLike|[TextBuffer.PointLike, - TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], - TextBuffer.PointLike]|[[number, number], [number, number]], text: string, - options?: { normalizeLineEndings?: boolean, undo?: "skip" }): void; - - /* For each selection, replace the selected text with the given text. */ - insertText(text: string, options?: { select?: boolean, autoIndent?: boolean, - autoIndentNewline?: boolean, autoDecreaseIndent?: boolean, - normalizeLineEndings?: boolean, undo?: "skip" }): TextBuffer.Range|boolean; - - /** For each selection, replace the selected text with a newline. */ - insertNewline(): void; - - /** For each selection, if the selection is empty, delete the character following - * the cursor. Otherwise delete the selected text. - */ - delete(): void; - - /** For each selection, if the selection is empty, delete the character preceding - * the cursor. Otherwise delete the selected text. - */ - backspace(): void; - - /** Mutate the text of all the selections in a single transaction. - * All the changes made inside the given function can be reverted with a single - * call to ::undo. - */ - mutateSelectedText(fn: (selection: Selection, index: number) => void): void; - - /** For each selection, transpose the selected text. - * If the selection is empty, the characters preceding and following the cursor - * are swapped. Otherwise, the selected characters are reversed. - */ - transpose(): 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; - - /** 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; - - /** Toggle line comments for rows intersecting selections. - * If the current grammar doesn't support comments, does nothing. - */ - toggleLineCommentsInSelection(): void; - - /** For each cursor, insert a newline at beginning the following line. */ - insertNewlineBelow(): void; - - /** For each cursor, insert a newline at the end of the preceding line. */ - insertNewlineAbove(): 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; - - /** Similar to ::deleteToBeginningOfWord, but deletes only back to the previous - * word boundary. - */ - deleteToPreviousWordBoundary(): void; - - /** Similar to ::deleteToEndOfWord, but deletes only up to the next word boundary. */ - deleteToNextWordBoundary(): 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; - - /** 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; - - /** 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; - - /** 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; - - /** 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; - - /** Delete all lines intersecting selections. */ - deleteLine(): void; - - // History - /** Undo the last change. */ - undo(): void; - - /** Redo the last change. */ - redo(): void; - - /** Batch multiple operations as a single undo/redo step. - * Any group of operations that are logically grouped from the perspective of undoing - * and redoing should be performed in a transaction. If you want to abort the transaction, - * call ::abortTransaction to terminate the function's execution and revert any changes - * performed up to the abortion. - */ - transact(fn: () => void): void; - /** Batch multiple operations as a single undo/redo step. - * Any group of operations that are logically grouped from the perspective of undoing - * and redoing should be performed in a transaction. If you want to abort the transaction, - * call ::abortTransaction to terminate the function's execution and revert any changes - * performed up to the abortion. - */ - transact(groupingInterval: number, fn: () => void): void; - - /** Abort an open transaction, undoing any operations performed so far within the transaction. */ - abortTransaction(): void; - - /** Create a pointer to the current state of the buffer for use with ::revertToCheckpoint - * and ::groupChangesSinceCheckpoint. - */ - createCheckpoint(): number; - - /** Revert the buffer to the state it was in when the given checkpoint was created. - * The redo stack will be empty following this operation, so changes since the checkpoint - * will be lost. If the given checkpoint is no longer present in the undo history, no - * changes will be made to the buffer and this method will return false. - */ - revertToCheckpoint(checkpoint: number): boolean; - - /** Group all changes since the given checkpoint into a single transaction for purposes - * of undo/redo. - * If the given checkpoint is no longer present in the undo history, no grouping will be - * performed and this method will return false. - */ - groupChangesSinceCheckpoint(checkpoint: number): boolean; - - // TextEditor Coordinates - /** Convert a position in buffer-coordinates to screen-coordinates. */ - screenPositionForBufferPosition(bufferPosition: TextBuffer.PointLike|[number, number], - options?: { clipDirection?: "backward"|"forward"|"closest"}): TextBuffer.Point; - - /** Convert a position in screen-coordinates to buffer-coordinates. */ - bufferPositionForScreenPosition(bufferPosition: TextBuffer.PointLike|[number, number], - options?: { clipDirection?: "backward"|"forward"|"closest"}): TextBuffer.Point; - - /** Convert a range in buffer-coordinates to screen-coordinates. */ - screenRangeForBufferRange(bufferRange: TextBuffer.RangeLike|[TextBuffer.PointLike, - TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], - TextBuffer.PointLike]|[[number, number], [number, number]]): TextBuffer.Range; - - /** Convert a range in screen-coordinates to buffer-coordinates. */ - bufferRangeForScreenRange(screenRange: TextBuffer.RangeLike|[TextBuffer.PointLike, - TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], - TextBuffer.PointLike]|[[number, number], [number, number]]): TextBuffer.Range; - - /** Clip the given Point to a valid position in the buffer. */ - clipBufferPosition(bufferPosition: TextBuffer.PointLike|[number, number]): - TextBuffer.Point; - - /** Clip the start and end of the given range to valid positions in the buffer. - * See ::clipBufferPosition for more information. - */ - clipBufferRange(range: TextBuffer.RangeLike|[TextBuffer.PointLike, TextBuffer.PointLike]| - [TextBuffer.PointLike, [number, number]]|[[number, number], TextBuffer.PointLike]| - [[number, number], [number, number]]): TextBuffer.Range; - - /** Clip the given Point to a valid position on screen. */ - clipScreenPosition(screenPosition: TextBuffer.PointLike|[number, number], - options?: { clipDirection?: "backward"|"forward"|"closest"}): TextBuffer.Point; - - /** Clip the start and end of the given range to valid positions on screen. - * See ::clipScreenPosition for more information. - */ - clipScreenRange(range: TextBuffer.RangeLike|[TextBuffer.PointLike, TextBuffer.PointLike]| - [TextBuffer.PointLike, [number, number]]|[[number, number], TextBuffer.PointLike]| - [[number, number], [number, number]], options?: { clipDirection?: - "backward"|"forward"|"closest"}): TextBuffer.Range; - - // Decorations - /** Add a decoration that tracks a DisplayMarker. When the marker moves, is - * invalidated, or is destroyed, the decoration will be updated to reflect - * the marker's state. - */ - decorateMarker(marker: TextBuffer.DisplayMarker, decorationParams: - Structures.DecorationProps): Decoration; - - /** Add a decoration to every marker in the given marker layer. Can be used to - * decorate a large number of markers without having to create and manage many - * individual decorations. - */ - decorateMarkerLayer(markerLayer: TextBuffer.MarkerLayer|TextBuffer.DisplayMarkerLayer, - decorationParams: Structures.DecorationLayerProps): LayerDecoration; - - /** Get all decorations. */ - getDecorations(propertyFilter?: Structures.DecorationProps): Decoration[]; - - /** Get all decorations of type 'line'. */ - getLineDecorations(propertyFilter?: Structures.DecorationProps): Decoration[]; - - /** Get all decorations of type 'line-number'. */ - getLineNumberDecorations(propertyFilter?: Structures.DecorationProps): Decoration[]; - - /** Get all decorations of type 'highlight'. */ - getHighlightDecorations(propertyFilter?: Structures.DecorationProps): Decoration[]; - - /** Get all decorations of type 'overlay'. */ - getOverlayDecorations(propertyFilter?: Structures.DecorationProps): Decoration[]; - - // Markers - /** Create a marker on the default marker layer with the given range in buffer coordinates. - * This marker will maintain its logical location as the buffer is changed, so if you mark - * a particular word, the marker will remain over that word even if the word's location - * in the buffer changes. - */ - markBufferRange(range: TextBuffer.RangeLike|[TextBuffer.PointLike, TextBuffer.PointLike]| - [TextBuffer.PointLike, [number, number]]|[[number, number], TextBuffer.PointLike]| - [[number, number], [number, number]], properties?: { maintainHistory?: boolean, - reversed?: boolean, invalidate?: "never"|"surround"|"overlap"|"inside"|"touch" }): - TextBuffer.DisplayMarker; - - /** Create a marker on the default marker layer with the given range in screen coordinates. - * This marker will maintain its logical location as the buffer is changed, so if you mark - * a particular word, the marker will remain over that word even if the word's location in - * the buffer changes. - */ - markScreenRange(range: TextBuffer.RangeLike|[TextBuffer.PointLike, TextBuffer.PointLike]| - [TextBuffer.PointLike, [number, number]]|[[number, number], TextBuffer.PointLike]| - [[number, number], [number, number]], properties?: { maintainHistory?: boolean, - reversed?: boolean, invalidate?: "never"|"surround"|"overlap"|"inside"|"touch" }): - TextBuffer.DisplayMarker; - - /** Create a marker on the default marker layer with the given buffer position and no tail. - * To group multiple markers together in their own private layer, see ::addMarkerLayer. - */ - markBufferPosition(bufferPosition: TextBuffer.PointLike|[number, number], options?: - { invalidate?: "never"|"surround"|"overlap"|"inside"|"touch" }): - TextBuffer.DisplayMarker; - - /** Create a marker on the default marker layer with the given screen position and no tail. - * To group multiple markers together in their own private layer, see ::addMarkerLayer. - */ - markScreenPosition(screenPosition: TextBuffer.PointLike|[number, number], options?: - { invalidate?: "never"|"surround"|"overlap"|"inside"|"touch", clipDirection?: - "backward"|"forward"|"closest" }): TextBuffer.DisplayMarker; - - /** Find all DisplayMarkers on the default marker layer that match the given properties. - * - * This method finds markers based on the given properties. Markers can be associated - * with custom properties that will be compared with basic equality. In addition, there - * are several special properties that will be compared with the range of the markers - * rather than their properties. - */ - findMarkers(properties: TextBuffer.Options.FindDisplayMarker): TextBuffer.DisplayMarker[]; - - /** Create a marker layer to group related markers. */ - addMarkerLayer(options?: { - maintainHistory?: boolean, - persistent?: boolean, - }): TextBuffer.DisplayMarkerLayer; - - /** Get a DisplayMarkerLayer by id. */ - getMarkerLayer(id: number): TextBuffer.DisplayMarkerLayer|undefined; - - /** Get the default DisplayMarkerLayer. - * All marker APIs not tied to an explicit layer interact with this default layer. - */ - getDefaultMarkerLayer(): TextBuffer.DisplayMarkerLayer; - - /** Get the DisplayMarker on the default layer for the given marker id. */ - getMarker(id: number): TextBuffer.DisplayMarker; - - /** Get all DisplayMarkers on the default marker layer. Consider using ::findMarkers. */ - getMarkers(): TextBuffer.DisplayMarker[]; - - /** Get the number of markers in the default marker layer. */ - getMarkerCount(): number; - - // Cursors - /** Get the position of the most recently added cursor in buffer coordinates. */ - getCursorBufferPosition(): TextBuffer.Point; - - /** Get the position of all the cursor positions in buffer coordinates. */ - getCursorBufferPositions(): TextBuffer.Point[]; - - /** Move the cursor to the given position in buffer coordinates. - * If there are multiple cursors, they will be consolidated to a single cursor. - */ - setCursorBufferPosition(position: TextBuffer.PointLike|[number, number], options?: - { autoscroll?: boolean }): void; - - /** Get a Cursor at given screen coordinates Point. */ - getCursorAtScreenPosition(position: TextBuffer.PointLike|[number, number]): - Cursor|undefined; - - /** Get the position of the most recently added cursor in screen coordinates. */ - getCursorScreenPosition(): TextBuffer.Point; - - /** Get the position of all the cursor positions in screen coordinates. */ - getCursorScreenPositions(): TextBuffer.Point[]; - - /** Move the cursor to the given position in screen coordinates. - * If there are multiple cursors, they will be consolidated to a single cursor. - */ - setCursorScreenPosition(position: TextBuffer.PointLike|[number, number], - options?: { autoscroll?: boolean }): void; - - /** Add a cursor at the given position in buffer coordinates. */ - addCursorAtBufferPosition(bufferPosition: TextBuffer.PointLike|[number, number]): Cursor; - - /** Add a cursor at the position in screen coordinates. */ - addCursorAtScreenPosition(screenPosition: TextBuffer.PointLike|[number, number]): Cursor; - - /** Returns a boolean indicating whether or not there are multiple cursors. */ - hasMultipleCursors(): boolean; - - /** Move every cursor up one row in screen coordinates. */ - moveUp(lineCount?: number): void; - - /** Move every cursor down one row in screen coordinates. */ - moveDown(lineCount?: number): void; - - /** Move every cursor left one column. */ - moveLeft(columnCount?: number): void; - - /** Move every cursor right one column. */ - moveRight(columnCount?: number): void; - - /** Move every cursor to the beginning of its line in buffer coordinates. */ - moveToBeginningOfLine(): void; - - /** Move every cursor to the beginning of its line in screen coordinates. */ - moveToBeginningOfScreenLine(): void; - - /** Move every cursor to the first non-whitespace character of its line. */ - moveToFirstCharacterOfLine(): void; - - /** Move every cursor to the end of its line in buffer coordinates. */ - moveToEndOfLine(): void; - - /** Move every cursor to the end of its line in screen coordinates. */ - moveToEndOfScreenLine(): void; - - /** Move every cursor to the beginning of its surrounding word. */ - moveToBeginningOfWord(): void; - - /** Move every cursor to the end of its surrounding word. */ - moveToEndOfWord(): void; - - /** Move every cursor to the top of the buffer. - * If there are multiple cursors, they will be merged into a single cursor. - */ - moveToTop(): void; - - /** Move every cursor to the bottom of the buffer. - * If there are multiple cursors, they will be merged into a single cursor. - */ - moveToBottom(): void; - - /** Move every cursor to the beginning of the next word. */ - moveToBeginningOfNextWord(): void; - - /** Move every cursor to the previous word boundary. */ - moveToPreviousWordBoundary(): void; - - /** Move every cursor to the next word boundary. */ - moveToNextWordBoundary(): void; - - /** Move every cursor to the previous subword boundary. */ - moveToPreviousSubwordBoundary(): void; - - /** Move every cursor to the next subword boundary. */ - moveToNextSubwordBoundary(): void; - - /** Move every cursor to the beginning of the next paragraph. */ - moveToBeginningOfNextParagraph(): void; - - /** Move every cursor to the beginning of the previous paragraph. */ - moveToBeginningOfPreviousParagraph(): void; - - /** Returns the most recently added Cursor. */ - getLastCursor(): Cursor; - - /** Returns the word surrounding the most recently added cursor. */ - getWordUnderCursor(options?: { - wordRegex?: RegExp, - includeNonWordCharacters?: boolean, - allowPrevious?: boolean, - }): string; - - /** Get an Array of all Cursors. */ - getCursors(): Cursor[]; - - /** Get all Cursorss, ordered by their position in the buffer instead of the - * order in which they were added. - */ - getCursorsOrderedByBufferPosition(): Cursor[]; - - // Selections - /** Get the selected text of the most recently added selection. */ - getSelectedText(): string; - - /** Get the Range of the most recently added selection in buffer coordinates. */ - getSelectedBufferRange(): TextBuffer.Range; - - /** Get the Ranges of all selections in buffer coordinates. - * The ranges are sorted by when the selections were added. Most recent at the end. - */ - getSelectedBufferRanges(): TextBuffer.Range[]; - - /** Set the selected range in buffer coordinates. If there are multiple selections, - * they are reduced to a single selection with the given range. - */ - setSelectedBufferRange(bufferRange: TextBuffer.RangeLike|[TextBuffer.PointLike, - TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], - TextBuffer.PointLike]|[[number, number], [number, number]], options?: - { reversed?: boolean, preserveFolds?: boolean}): void; - - /** Set the selected ranges in buffer coordinates. If there are multiple selections, - * they are replaced by new selections with the given ranges. - */ - setSelectedBufferRanges(bufferRanges: ReadonlyArray, - options?: { reversed?: boolean, preserveFolds?: boolean}): void; - - /** Get the Range of the most recently added selection in screen coordinates. */ - getSelectedScreenRange(): TextBuffer.Range; - - /** Get the Ranges of all selections in screen coordinates. - * The ranges are sorted by when the selections were added. Most recent at the end. - */ - getSelectedScreenRanges(): TextBuffer.Range[]; - - /** Set the selected range in screen coordinates. If there are multiple selections, - * they are reduced to a single selection with the given range. - */ - setSelectedScreenRange(screenRange: TextBuffer.RangeLike|[TextBuffer.PointLike, - TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], - TextBuffer.PointLike]|[[number, number], [number, number]], options?: - { reversed?: boolean }): void; - - /** Set the selected ranges in screen coordinates. If there are multiple selections, - * they are replaced by new selections with the given ranges. - */ - setSelectedScreenRanges(screenRanges: ReadonlyArray, options?: { reversed?: boolean }): void; - - /** Add a selection for the given range in buffer coordinates. */ - addSelectionForBufferRange(bufferRange: TextBuffer.RangeLike|[TextBuffer.PointLike, - TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], - TextBuffer.PointLike]|[[number, number], [number, number]], options?: - { reversed?: boolean, preserveFolds?: boolean }): Selection; - - /** Add a selection for the given range in screen coordinates. */ - addSelectionForScreenRange(screenRange: TextBuffer.RangeLike|[TextBuffer.PointLike, - TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], - TextBuffer.PointLike]|[[number, number], [number, number]], options?: - { reversed?: boolean, preserveFolds?: boolean }): Selection; - - /** Select from the current cursor position to the given position in buffer coordinates. - * This method may merge selections that end up intersecting. - */ - selectToBufferPosition(position: TextBuffer.PointLike|[number, number]): void; - - /** Select from the current cursor position to the given position in screen coordinates. - * This method may merge selections that end up intersecting. - */ - selectToScreenPosition(position: TextBuffer.PointLike|[number, number]): void; - - /** Move the cursor of each selection one character upward while preserving the - * selection's tail position. - * This method may merge selections that end up intersecting. - */ - selectUp(rowCount?: number): void; - - /** Move the cursor of each selection one character downward while preserving - * the selection's tail position. - * This method may merge selections that end up intersecting. - */ - selectDown(rowCount?: number): void; - - /** Move the cursor of each selection one character leftward while preserving - * the selection's tail position. - * This method may merge selections that end up intersecting. - */ - selectLeft(columnCount?: number): void; - - /** Move the cursor of each selection one character rightward while preserving - * the selection's tail position. - * This method may merge selections that end up intersecting. - */ - selectRight(columnCount?: number): void; - - /** Select from the top of the buffer to the end of the last selection in the buffer. - * This method merges multiple selections into a single selection. - */ - selectToTop(): void; - - /** Selects from the top of the first selection in the buffer to the end of the buffer. - * This method merges multiple selections into a single selection. - */ - selectToBottom(): void; - - /** Select all text in the buffer. - * This method merges multiple selections into a single selection. - */ - selectAll(): void; - - /** Move the cursor of each selection to the beginning of its line while preserving - * the selection's tail position. - * This method may merge selections that end up intersecting. - */ - selectToBeginningOfLine(): void; - - /** Move the cursor of each selection to the first non-whitespace character of its - * line while preserving the selection's tail position. If the cursor is already - * on the first character of the line, move it to the beginning of the line. - * This method may merge selections that end up intersecting. - */ - selectToFirstCharacterOfLine(): void; - - /** Move the cursor of each selection to the end of its line while preserving the - * selection's tail position. - * This method may merge selections that end up intersecting. - */ - selectToEndOfLine(): void; - - /** Expand selections to the beginning of their containing word. - * Operates on all selections. Moves the cursor to the beginning of the containing - * word while preserving the selection's tail position. - */ - selectToBeginningOfWord(): void; - - /** Expand selections to the end of their containing word. - * Operates on all selections. Moves the cursor to the end of the containing word - * while preserving the selection's tail position. - */ - selectToEndOfWord(): void; - - /** For each cursor, select the containing line. - * This method merges selections on successive lines. - */ - selectLinesContainingCursors(): void; - - /** Select the word surrounding each cursor. */ - selectWordsContainingCursors(): void; - - /** For each selection, move its cursor to the preceding subword boundary while - * maintaining the selection's tail position. - * This method may merge selections that end up intersecting. - */ - selectToPreviousSubwordBoundary(): void; - - /** For each selection, move its cursor to the next subword boundary while maintaining - * the selection's tail position. - * This method may merge selections that end up intersecting. - */ - selectToNextSubwordBoundary(): void; - - /** For each selection, move its cursor to the preceding word boundary while - * maintaining the selection's tail position. - * This method may merge selections that end up intersecting. - */ - selectToPreviousWordBoundary(): void; - - /** For each selection, move its cursor to the next word boundary while maintaining - * the selection's tail position. - * This method may merge selections that end up intersecting. - */ - selectToNextWordBoundary(): void; - - /** Expand selections to the beginning of the next word. - * Operates on all selections. Moves the cursor to the beginning of the next word - * while preserving the selection's tail position. - */ - selectToBeginningOfNextWord(): void; - - /** Expand selections to the beginning of the next paragraph. - * Operates on all selections. Moves the cursor to the beginning of the next - * paragraph while preserving the selection's tail position. - */ - selectToBeginningOfNextParagraph(): void; - - /** Expand selections to the beginning of the next paragraph. - * Operates on all selections. Moves the cursor to the beginning of the next - * paragraph while preserving the selection's tail position. - */ - selectToBeginningOfPreviousParagraph(): void; - - /** Select the range of the given marker if it is valid. */ - selectMarker(marker: TextBuffer.DisplayMarker): TextBuffer.Range|undefined; - - /** Get the most recently added Selection. */ - getLastSelection(): Selection; - - /** Get current Selections. */ - getSelections(): Selection[]; - - /** Get all Selections, ordered by their position in the buffer instead of the - * order in which they were added. - */ - getSelectionsOrderedByBufferPosition(): Selection[]; - - // NOTE: this calls into Selection::intersectsBufferRange, which itself calls - // into Range::intersectsWith. Range::intersectsWith is one of the few functions - // which does NOT take a range-compatible array. - /** Determine if a given range in buffer coordinates intersects a selection. */ - selectionIntersectsBufferRange(bufferRange: TextBuffer.RangeLike): boolean; - - // Searching and Replacing - /** Scan regular expression matches in the entire buffer, calling the given - * iterator function on each match. - * - * ::scan functions as the replace method as well via the replace. - */ - scan(regex: RegExp, options: TextBuffer.Options.ScanContext, iterator: (params: - TextBuffer.Structures.ContextualBufferScanResult) => void): void; - /** Scan regular expression matches in the entire buffer, calling the given - * iterator function on each match. - * - * ::scan functions as the replace method as well via the replace. - */ - scan(regex: RegExp, iterator: (params: TextBuffer.Structures.BufferScanResult) => void): - void; - - /** Scan regular expression matches in a given range, calling the given iterator. - * function on each match. - */ - scanInBufferRange(regex: RegExp, range: TextBuffer.RangeLike|[TextBuffer.PointLike, - TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], - TextBuffer.PointLike]|[[number, number], [number, number]], iterator: (params: - TextBuffer.Structures.BufferScanResult) => void): void; - - /** Scan regular expression matches in a given range in reverse order, calling the - * given iterator function on each match. - */ - backwardsScanInBufferRange(regex: RegExp, range: TextBuffer.RangeLike|[TextBuffer.PointLike, - TextBuffer.PointLike]|[TextBuffer.PointLike, [number, number]]|[[number, number], - TextBuffer.PointLike]|[[number, number], [number, number]], iterator: (params: - TextBuffer.Structures.BufferScanResult) => void): void; - - // Tab Behavior - /** Returns a boolean indicating whether softTabs are enabled for this editor. */ - getSoftTabs(): boolean; - - /** Enable or disable soft tabs for this editor. */ - setSoftTabs(softTabs: boolean): void; - - /** Toggle soft tabs for this editor. */ - toggleSoftTabs(): boolean; - - /** Get the on-screen length of tab characters. */ - getTabLength(): number; - - /** Set the on-screen length of tab characters. Setting this to a number will - * override the editor.tabLength setting. - */ - setTabLength(tabLength: number): void; - - /** Determine if the buffer uses hard or soft tabs. */ - usesSoftTabs(): boolean|undefined; - - /** Get the text representing a single level of indent. - * If soft tabs are enabled, the text is composed of N spaces, where N is the - * tab length. Otherwise the text is a tab character (\t). - */ - getTabText(): string; - - // Soft Wrap Behavior - /** Determine whether lines in this editor are soft-wrapped. */ - isSoftWrapped(): boolean; - - /** Enable or disable soft wrapping for this editor. */ - setSoftWrapped(softWrapped: boolean): boolean; - - /** Toggle soft wrapping for this editor. */ - toggleSoftWrapped(): boolean; - - /** Gets the column at which column will soft wrap. */ - getSoftWrapColumn(): number; - - // Indentation - /** Get the indentation level of the given buffer row. - * Determines how deeply the given row is indented based on the soft tabs and tab - * length settings of this editor. Note that if soft tabs are enabled and the tab - * length is 2, a row with 4 leading spaces would have an indentation level of 2. - */ - indentationForBufferRow(bufferRow: number): number; - - /** Set the indentation level for the given buffer row. - * Inserts or removes hard tabs or spaces based on the soft tabs and tab length settings - * of this editor in order to bring it to the given indentation level. Note that if soft - * tabs are enabled and the tab length is 2, a row with 4 leading spaces would have an - * indentation level of 2. - */ - setIndentationForBufferRow(bufferRow: number, newLevel: number, options?: - { preserveLeadingWhitespace?: boolean }): void; - - /** Indent rows intersecting selections by one level. */ - indentSelectedRows(): void; - - /** Outdent rows intersecting selections by one level. */ - outdentSelectedRows(): void; - - /** Get the indentation level of the given line of text. - * Determines how deeply the given line is indented based on the soft tabs and tab length - * settings of this editor. Note that if soft tabs are enabled and the tab length is 2, - * a row with 4 leading spaces would have an indentation level of 2. - */ - indentLevelForLine(line: string): number; - - /** Indent rows intersecting selections based on the grammar's suggested indent level. */ - autoIndentSelectedRows(): void; - - // Grammars - /** Get the current Grammar of this editor. */ - getGrammar(): FirstMate.Grammar; - - /** Set the current Grammar of this editor. - * Assigning a grammar will cause the editor to re-tokenize based on the new grammar. - */ - setGrammar(grammar: FirstMate.Grammar): void; - - // Managing Syntax Scopes - /** Returns a ScopeDescriptor that includes this editor's language. - * e.g. [".source.ruby"], or [".source.coffee"]. - */ - getRootScopeDescriptor(): ScopeDescriptor; - - /** Get the syntactic scopeDescriptor for the given position in buffer coordinates. */ - scopeDescriptorForBufferPosition(bufferPosition: TextBuffer.PointLike|[number, number]): - ScopeDescriptor; - - /** Get the range in buffer coordinates of all tokens surrounding the cursor - * that match the given scope selector. - */ - bufferRangeForScopeAtCursor(scopeSelector: string): TextBuffer.Range; - - /** Determine if the given row is entirely a comment. */ - isBufferRowCommented(bufferRow: number): boolean; - - // Clipboard Operations - /** For each selection, copy the selected text. */ - copySelectedText(): void; - - /** For each selection, cut the selected text. */ - cutSelectedText(): void; - - /** For each selection, replace the selected text with the contents of the clipboard. - * If the clipboard contains the same number of selections as the current editor, - * each selection will be replaced with the content of the corresponding clipboard - * selection text. - */ - pasteText(options?: Options.TextInsertion): 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; - - /** 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; - - // Folds - /** Fold the most recent cursor's row based on its indentation level. - * The fold will extend from the nearest preceding line with a lower indentation - * level up to the nearest following row with a lower indentation level. - */ - foldCurrentRow(): void; - - /** Unfold the most recent cursor's row by one level. */ - unfoldCurrentRow(): void; - - /** Fold the given row in buffer coordinates based on its indentation level. - * If the given row is foldable, the fold will begin there. Otherwise, it will - * begin at the first foldable row preceding the given row. - */ - foldBufferRow(bufferRow: number): void; - - /** Unfold all folds containing the given row in buffer coordinates. */ - unfoldBufferRow(bufferRow: number): void; - - /** For each selection, fold the rows it intersects. */ - foldSelectedLines(): void; - - /** Fold all foldable lines. */ - foldAll(): void; - - /** Unfold all existing folds. */ - unfoldAll(): void; - - /** Fold all foldable lines at the given indent level. */ - foldAllAtIndentLevel(level: number): void; - - /** Determine whether the given row in buffer coordinates is foldable. - * A foldable row is a row that starts a row range that can be folded. - */ - isFoldableAtBufferRow(bufferRow: number): boolean; - - /** Determine whether the given row in screen coordinates is foldable. - * A foldable row is a row that starts a row range that can be folded. - */ - isFoldableAtScreenRow(bufferRow: number): boolean; - - /** Fold the given buffer row if it isn't currently folded, and unfold it otherwise. */ - toggleFoldAtBufferRow(bufferRow: number): void; - - /** Determine whether the most recently added cursor's row is folded. */ - isFoldedAtCursorRow(): boolean; - - /** Determine whether the given row in buffer coordinates is folded. */ - isFoldedAtBufferRow(bufferRow: number): boolean; - - /** Determine whether the given row in screen coordinates is folded. */ - isFoldedAtScreenRow(screenRow: number): boolean; - - // Gutters - /** Add a custom Gutter. */ - addGutter(options: { - name: string, - priority?: number, - visible?: boolean, - }): Gutter; - - /** Get this editor's gutters. */ - getGutters(): Gutter[]; - - /** Get the gutter with the given name. */ - gutterWithName(name: string): Gutter|null; - - // Scrolling the TextEditor - /** Scroll the editor to reveal the most recently added cursor if it is off-screen. */ - scrollToCursorPosition(options?: { center?: boolean }): void; - - /** Scrolls the editor to the given buffer position. */ - scrollToBufferPosition(bufferPosition: TextBuffer.PointLike|[number, number], - options?: { center?: boolean }): void; - - /** Scrolls the editor to the given screen position. */ - scrollToScreenPosition(screenPosition: TextBuffer.PointLike|[number, number], - options?: { center?: boolean }): void; - - // TextEditor Rendering - /** Retrieves the rendered line height in pixels. */ - getLineHeightInPixels(): number; - - /** Retrieves the greyed out placeholder of a mini editor. */ - getPlaceholderText(): string; - - /** Set the greyed out placeholder of a mini editor. Placeholder text will be - * displayed when the editor has no content. - */ - setPlaceholderText(placeholderText: string): void; - } - - /** Experimental: This global registry tracks registered TextEditors. */ - interface TextEditorRegistry { - // Managing Text Editors - /** Remove all editors from the registry. */ - clear(): void; - - /** Register a TextEditor. */ - add(editor: TextEditor): EventKit.Disposable; - - /** Remove the given TextEditor from the registry. */ - remove(editor: TextEditor): boolean; - - /** Keep a TextEditor's configuration in sync with Atom's settings. */ - maintainConfig(editor: TextEditor): EventKit.Disposable; - - /** Set a TextEditor's grammar based on its path and content, and continue - * to update its grammar as gramamrs are added or updated, or the editor's - * file path changes. - */ - maintainGrammar(editor: TextEditor): EventKit.Disposable; - - /** Force a TextEditor to use a different grammar than the one that would - * otherwise be selected for it. - */ - setGrammarOverride(editor: TextEditor, scopeName: string): void; - - /** Retrieve the grammar scope name that has been set as a grammar override - * for the given TextEditor. - */ - getGrammarOverride(editor: TextEditor): string|null; - - /** Remove any grammar override that has been set for the given {TextEditor}. */ - clearGrammarOverride(editor: TextEditor): void; - - // Event Subscription - /** Invoke the given callback with all the current and future registered TextEditors. */ - observe(callback: (editor: TextEditor) => void): EventKit.Disposable; - } - - /** Handles loading and activating available themes. */ - interface ThemeManager { - // Event Subscription - /** Invoke callback when style sheet changes associated with updating the - * list of active themes have completed. - */ - onDidChangeActiveThemes(callback: () => void): EventKit.Disposable; - - // Accessing Loaded Themes - /** Returns an Array of strings of all the loaded theme names. */ - getLoadedThemeNames(): string[]|undefined; - - /** Returns an Array of all the loaded themes. */ - getLoadedThemes(): Package[]|undefined; - - // Accessing Active Themes - /** Returns an Array of strings all the active theme names. */ - getActiveThemeNames(): string[]|undefined; - - /** Returns an Array of all the active themes. */ - getActiveThemes(): Package[]|undefined; - - // Managing Enabled Themes - /** Get the enabled theme names from the config. */ - getEnabledThemeNames(): string[]; - } - - /** This tooltip class is derived from Bootstrap 3, but modified to not require - * jQuery, which is an expensive dependency we want to eliminate. - */ - interface Tooltip { - options: Options.Tooltip; - enabled: boolean; - timeout: number; - hoverState: "in"|"out"|null; - element: JQuery|HTMLElement; - - getTitle(): string; - getTooltipElement(): HTMLElement; - getArrowElement(): HTMLElement; - enable(): void; - disable(): void; - toggleEnabled(): void; - toggle(): void; - recalculatePosition(): void; - } - - /** Associates tooltips with HTML elements or selectors. */ - interface TooltipManager { - /** Add a tooltip to the given element. */ - add(target: JQuery|HTMLElement, options: { - title?: string, - html?: boolean, - item?: HTMLElement|{ element: HTMLElement }, - class?: string, - placement?: "top"|"bottom"|"left"|"right"|"auto"|(() => string), - trigger?: "click"|"hover"|"focus"|"manual", - delay?: { show: number, hide: number }, - keyBindingCommand?: string, - keyBindingTarget?: HTMLElement - } | { - title?: string|(() => string), - html?: boolean, - item?: HTMLElement|{ element: HTMLElement }, - class?: string, - placement?: "top"|"bottom"|"left"|"right"|"auto"|(() => string), - trigger?: "click"|"hover"|"focus"|"manual", - delay?: { show: number, hide: number }, - }): EventKit.Disposable; - - /** Find the tooltips that have been applied to the given element. */ - findTooltips(target: HTMLElement): Tooltip[]; - } - - /** ViewRegistry handles the association between model and view types in Atom. - * We call this association a View Provider. As in, for a given model, this class - * can provide a view via ::getView, as long as the model/view association was - * registered via ::addViewProvider. - */ - interface ViewRegistry { - /** Add a provider that will be used to construct views in the workspace's view - * layer based on model objects in its model layer. - */ - addViewProvider(createView: (model: object) => HTMLElement|undefined): EventKit.Disposable; - /** Add a provider that will be used to construct views in the workspace's view - * layer based on model objects in its model layer. - */ - addViewProvider(modelConstructor: { new (...args: any[]): T }, createView: - (instance: T) => HTMLElement|undefined): EventKit.Disposable; - - /** Get the view associated with an object in the workspace. */ - getView(obj: object): HTMLElement; - } - - /** Represents the state of the user interface for the entire window. */ - interface Workspace { - // Event Subscription - /** Invoke the given callback with all current and future text editors in - * the workspace. - */ - observeTextEditors(callback: (editor: TextEditor) => void): EventKit.Disposable; - - /** Invoke the given callback with all current and future panes items in the - * workspace. - */ - observePaneItems(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback when the active pane item changes. */ - onDidChangeActivePaneItem(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback when the active pane item stops changing. */ - onDidStopChangingActivePaneItem(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback when a text editor becomes the active text editor and - * when there is no longer an active text editor. - */ - onDidChangeActiveTextEditor(callback: (editor?: TextEditor) => void): EventKit.Disposable; - - /** Invoke the given callback with the current active pane item and with all - * future active pane items in the workspace. - */ - observeActivePaneItem(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback with the current active text editor (if any), with all - * future active text editors, and when there is no longer an active text editor. - */ - observeActiveTextEditor(callback: (editor?: TextEditor) => void): EventKit.Disposable; - - /** Invoke the given callback whenever an item is opened. Unlike ::onDidAddPaneItem, - * observers will be notified for items that are already present in the workspace - * when they are reopened. - */ - onDidOpen(callback: (event: Events.PaneItemOpened) => void): EventKit.Disposable; - - /** Invoke the given callback when a pane is added to the workspace. */ - onDidAddPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; - - /** Invoke the given callback before a pane is destroyed in the workspace. */ - onWillDestroyPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; - - /** Invoke the given callback when a pane is destroyed in the workspace. */ - onDidDestroyPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; - - /** Invoke the given callback with all current and future panes in the workspace. */ - observePanes(callback: (pane: Pane) => void): EventKit.Disposable; - - /** Invoke the given callback when the active pane changes. */ - onDidChangeActivePane(callback: (pane: Pane) => void): EventKit.Disposable; - - /** Invoke the given callback with the current active pane and when the - * active pane changes. - */ - observeActivePane(callback: (pane: Pane) => void): EventKit.Disposable; - - /** Invoke the given callback when a pane item is added to the workspace. */ - onDidAddPaneItem(callback: (event: Events.PaneItemObserved) => void): - EventKit.Disposable; - - /** Invoke the given callback when a pane item is about to be destroyed, - * before the user is prompted to save it. - */ - onWillDestroyPaneItem(callback: (event: Events.PaneItemObserved) => void): - EventKit.Disposable; - - /** Invoke the given callback when a pane item is destroyed. */ - onDidDestroyPaneItem(callback: (event: Events.PaneItemObserved) => void): - EventKit.Disposable; - - /** Invoke the given callback when a text editor is added to the workspace. */ - onDidAddTextEditor(callback: (event: Events.TextEditorObserved) => void): - EventKit.Disposable; - - // Opening - /** Opens the given URI in Atom asynchronously. If the URI is already open, - * the existing item for that URI will be activated. If no URI is given, or - * no registered opener can open the URI, a new empty TextEditor will be created. - */ - open(uri: string, options?: { - initialLine?: number, - initialColumn?: number, - split?: "left"|"right"|"up"|"down", - activatePane?: boolean, - activateItem?: boolean, - pending?: boolean, - searchAllPanes?: boolean, - location?: "left"|"right"|"bottom"|"center", - }): Promise; - /** Opens the given URI in Atom asynchronously. If the URI is already open, - * the existing item for that URI will be activated. If no URI is given, or - * no registered opener can open the URI, a new empty TextEditor will be created. - */ - open(): Promise; - - /** Search the workspace for items matching the given URI and hide them. - * Returns a boolean indicating whether any items were found (and hidden). - */ - hide(itemOrURI: object|string): boolean; - - /** Search the workspace for items matching the given URI. If any are found, - * hide them. Otherwise, open the URL. - * Returns a Promise that resolves when the item is shown or hidden. - */ - toggle(itemOrURI: object|string): Promise; - - /** Creates a new item that corresponds to the provided URI. - * If no URI is given, or no registered opener can open the URI, a new empty TextEditor - * will be created. - */ - createItemForURI(uri: string): Promise; - - /** Returns a boolean that is true if object is a TextEditor. */ - isTextEditor(object: object): boolean; - - /** Asynchronously reopens the last-closed item's URI if it hasn't already - * been reopened. - */ - reopenItem(): Promise; - - /** Register an opener for a URI. */ - addOpener(opener: (uri: string) => HTMLElement|{ getTitle(): string }|undefined): - EventKit.Disposable; - - /** Create a new text editor. */ - buildTextEditor(params: object): TextEditor; - - // Pane Items - /** Get all pane items in the workspace. */ - getPaneItems(): object[]; - - /** Get the active Pane's active item. */ - getActivePaneItem(): object; - - /** Get all text editors in the workspace. */ - getTextEditors(): TextEditor[]; - - /** Get the workspace center's active item if it is a TextEditor. */ - getActiveTextEditor(): TextEditor|undefined; - - // Panes - /** Get the most recently focused pane container. */ - getActivePaneContainer(): Dock|WorkspaceCenter; - - /** Get all panes in the workspace. */ - getPanes(): Pane[]; - - /** Get the active Pane. */ - getActivePane(): Pane; - - /** Make the next pane active. */ - activateNextPane(): boolean; - - /** Make the previous pane active. */ - activatePreviousPane(): boolean; - - /** Get the first pane container that contains an item with the given URI. */ - paneContainerForURI(uri: string): Dock|WorkspaceCenter|undefined; - - /** Get the first pane container that contains the given item. */ - paneContainerForItem(item: object): Dock|WorkspaceCenter|undefined; - - /** Get the first Pane with an item for the given URI. */ - paneForURI(uri: string): Pane|undefined; - - /** Get the Pane containing the given item. */ - paneForItem(item: object): Pane|undefined; - - // Pane Locations - /** Get the WorkspaceCenter at the center of the editor window. */ - getCenter(): WorkspaceCenter; - - /** Get the Dock to the left of the editor window. */ - getLeftDock(): Dock; - - /** Get the Dock to the right of the editor window. */ - getRightDock(): Dock; - - /** Get the Dock below the editor window. */ - getBottomDock(): Dock; - - /** Returns all Pane containers. */ - getPaneContainers(): [WorkspaceCenter, Dock, Dock, Dock]; - - // Panels - /** Get an Array of all the panel items at the bottom of the editor window. */ - getBottomPanels(): Panel[]; - - /** Adds a panel item to the bottom of the editor window. */ - addBottomPanel(options: { - item: object, - visible?: boolean, - priority?: number, - }): Panel; - - /** Get an Array of all the panel items to the left of the editor window. */ - getLeftPanels(): Panel[]; - - /** Adds a panel item to the left of the editor window. */ - addLeftPanel(options: { - item: object, - visible?: boolean, - priority?: number, - }): Panel; - - /** Get an Array of all the panel items to the right of the editor window. */ - getRightPanels(): Panel[]; - - /** Adds a panel item to the right of the editor window. */ - addRightPanel(options: { - item: object, - visible?: boolean, - priority?: number, - }): Panel; - - /** Get an Array of all the panel items at the top of the editor window. */ - getTopPanels(): Panel[]; - - /** Adds a panel item to the top of the editor window above the tabs. */ - addTopPanel(options: { - item: object, - visible?: boolean, - priority?: number - }): Panel; - - /** Get an Array of all the panel items in the header. */ - getHeaderPanels(): Panel[]; - - /** Adds a panel item to the header. */ - addHeaderPanel(options: { - item: object, - visible?: boolean, - priority?: number, - }): Panel; - - /** Get an Array of all the panel items in the footer. */ - getFooterPanels(): Panel[]; - - /** Adds a panel item to the footer. */ - addFooterPanel(options: { - item: object, - visible?: boolean, - priority?: number, - }): Panel; - - /** Get an Array of all the modal panel items. */ - getModalPanels(): Panel[]; - - /** Adds a panel item as a modal dialog. */ - addModalPanel(options: { - item: object, - visible?: boolean, - priority?: number, - autoFocus?: boolean, - }): Panel; - - /** Returns the Panel associated with the given item or null when the item - * has no panel. - */ - panelForItem(item: object): Panel|null; - - // Searching and Replacing - /** Performs a search across all files in the workspace. */ - scan(regex: RegExp, iterator: (result: Structures.ScandalResult) => void): - Structures.CancellablePromise; - /** Performs a search across all files in the workspace. */ - scan(regex: RegExp, options: Options.WorkspaceScan, iterator: - (result: Structures.ScandalResult) => void): Structures.CancellablePromise; - - /** Performs a replace across all the specified files in the project. */ - replace(regex: RegExp, replacementText: string, filePaths: ReadonlyArray, - iterator: (result: { filePath: string|undefined, replacements: number }) => void): - Promise; - } - - // https://github.com/atom/atom/blob/master/src/workspace-center.js - /** The central container for the editor window capable of holding items. */ - interface WorkspaceCenter { - // Event Subscription - /** Invoke the given callback with all current and future text editors in the - * workspace center. - */ - observeTextEditors(callback: (editor: TextEditor) => void): EventKit.Disposable; - - /** Invoke the given callback with all current and future panes items in the - * workspace center. - */ - observePaneItems(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback when the active pane item changes. */ - onDidChangeActivePaneItem(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback when the active pane item stops changing. */ - onDidStopChangingActivePaneItem(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback with the current active pane item and with all future - * active pane items in the workspace center. - */ - observeActivePaneItem(callback: (item: object) => void): EventKit.Disposable; - - /** Invoke the given callback when a pane is added to the workspace center. */ - onDidAddPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; - - /** Invoke the given callback before a pane is destroyed in the workspace center. */ - onWillDestroyPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; - - /** Invoke the given callback when a pane is destroyed in the workspace center. */ - onDidDestroyPane(callback: (event: { pane: Pane }) => void): EventKit.Disposable; - - /** Invoke the given callback with all current and future panes in the workspace center. */ - observePanes(callback: (pane: Pane) => void): EventKit.Disposable; - - /** Invoke the given callback when the active pane changes. */ - onDidChangeActivePane(callback: (pane: Pane) => void): EventKit.Disposable; - - /** Invoke the given callback with the current active pane and when the active pane changes. */ - observeActivePane(callback: (pane: Pane) => void): EventKit.Disposable; - - /** Invoke the given callback when a pane item is added to the workspace center. */ - onDidAddPaneItem(callback: (event: Events.PaneItemObserved) => void): - EventKit.Disposable; - - /** Invoke the given callback when a pane item is about to be destroyed, before the user - * is prompted to save it. - */ - onWillDestroyPaneItem(callback: (event: Events.PaneItemObserved) => void): - EventKit.Disposable; - - /** Invoke the given callback when a pane item is destroyed. */ - onDidDestroyPaneItem(callback: (event: Events.PaneItemObserved) => void): - EventKit.Disposable; - - /** Invoke the given callback when a text editor is added to the workspace center. */ - onDidAddTextEditor(callback: (event: Events.TextEditorObserved) => void): - EventKit.Disposable; - - // Pane Items - /** Get all pane items in the workspace center. */ - getPaneItems(): object[]; - - /** Get the active Pane's active item. */ - getActivePaneItem(): object|undefined; - - /** Get all text editors in the workspace center. */ - getTextEditors(): TextEditor[]; - - /** Get the active item if it is an TextEditor. */ - getActiveTextEditor(): TextEditor|undefined; - - /** Save all pane items. */ - saveAll(): void; - - // Panes - /** Get all panes in the workspace center. */ - getPanes(): Pane[]; - - /** Get the active Pane. */ - getActivePane(): Pane; - - /** Make the next pane active. */ - activateNextPane(): void; - - /** Make the previous pane active. */ - activatePreviousPane(): void; - - /** Retrieve the Pane associated with the given URI. */ - paneForURI(uri: string): Pane|undefined; - - /** Retrieve the Pane associated with the given item. */ - paneForItem(item: object): Pane|undefined; - - /** Destroy (close) the active pane. */ - destroyActivePane(): void; - } - } - - /** An amalgamation of all types used within the public Atom API. */ - namespace Atom { - /** Objects that appear as parameters to callbacks. */ - namespace Events { - // Atom Keymap ========================================================== - type FullKeybindingMatch = AtomKeymap.Events.FullKeybindingMatch; - type PartialKeybindingMatch = AtomKeymap.Events.PartialKeybindingMatch; - type FailedKeybindingMatch = AtomKeymap.Events.FailedKeybindingMatch; - type FailedKeymapFileRead = AtomKeymap.Events.FailedKeymapFileRead; - type KeymapLoaded = AtomKeymap.Events.KeymapLoaded; - type AddedKeystrokeResolver = AtomKeymap.Events.AddedKeystrokeResolver; - - // Path Watcher ========================================================= - type PathWatchErrorThrown = PathWatcher.Events.PathWatchErrorThrown; - type WatchedFilePathChanged = PathWatcher.Events.WatchedFilePathChanged; - - // Text Buffer ========================================================== - type BufferWatchError = TextBuffer.Events.BufferWatchError; - type FileSaved = TextBuffer.Events.FileSaved; - type MarkerChanged = TextBuffer.Events.MarkerChanged; - type BufferChanging = TextBuffer.Events.BufferChanging; - type BufferChanged = TextBuffer.Events.BufferChanged; - type BufferStoppedChanging = TextBuffer.Events.BufferStoppedChanging; - type DisplayMarkerChanged = TextBuffer.Events.DisplayMarkerChanged; - - // Core ================================================================= - type ExceptionThrown = AtomCore.Events.ExceptionThrown; - type PreventableExceptionThrown = AtomCore.Events.PreventableExceptionThrown; - type SelectionChanged = AtomCore.Events.SelectionChanged; - type PaneItemObserved = AtomCore.Events.PaneItemObserved; - type PaneItemOpened = AtomCore.Events.PaneItemOpened; - type EditorChanged = AtomCore.Events.EditorChanged; - type StyleElementObserved = AtomCore.Events.StyleElementObserved; - type TextEditorObserved = AtomCore.Events.TextEditorObserved; - type RepoStatusChanged = AtomCore.Events.RepoStatusChanged; - type PaneListItemShifted = AtomCore.Events.PaneListItemShifted; - type PaneItemMoved = AtomCore.Events.PaneItemMoved; - type CursorPositionChanged = AtomCore.Events.CursorPositionChanged; - type DecorationPropsChanged = AtomCore.Events.DecorationPropsChanged; - type FilesystemChange = AtomCore.Events.FilesystemChange; - } - - /** Objects that appear as parameters to functions. */ - namespace Options { - // Atom Keymap ========================================================== - type BuildKeyEvent = AtomKeymap.Options.BuildKeyEvent; - - // First Mate =========================================================== - type Grammar = FirstMate.Options.Grammar; - - // Text Buffer ========================================================== - type BufferLoad = TextBuffer.Options.BufferLoad; - type CopyMarker = TextBuffer.Options.CopyMarker; - type FindMarker = TextBuffer.Options.FindMarker; - type FindDisplayMarker = TextBuffer.Options.FindDisplayMarker; - type ScanContext = TextBuffer.Options.ScanContext; - - // Core ================================================================= - type TextInsertion = AtomCore.Options.TextInsertion; - type Menu = AtomCore.Options.Menu; - type ContextMenu = AtomCore.Options.ContextMenu; - type SpawnProcess = AtomCore.Options.SpawnProcess; - type Process = AtomCore.Options.Process; - type NodeProcess = AtomCore.Options.NodeProcess; - type Notification = AtomCore.Options.Notification; - type ErrorNotification = AtomCore.Options.ErrorNotification; - type Tooltip = AtomCore.Options.Tooltip; - type WorkspaceScan = AtomCore.Options.WorkspaceScan; - } - - /** Data structures that are used within classes. */ - namespace Structures { - // First Mate =========================================================== - type GrammarToken = FirstMate.Structures.GrammarToken; - type TokenizeLineResult = FirstMate.Structures.TokenizeLineResult; - type GrammarRule = FirstMate.Structures.GrammarRule; - - // Text Buffer ========================================================== - type TextChange = TextBuffer.Structures.TextChange; - type BufferScanResult = TextBuffer.Structures.BufferScanResult; - type ContextualBufferScanResult = TextBuffer.Structures.ContextualBufferScanResult; - - // Core ================================================================= - type SharedDecorationProps = AtomCore.Structures.SharedDecorationProps; - type DecorationProps = AtomCore.Structures.DecorationProps; - type DecorationLayerProps = AtomCore.Structures.DecorationLayerProps; - type Invisibles = AtomCore.Structures.Invisibles; - type CancellablePromise = AtomCore.Structures.CancellablePromise; - type ScandalResult = AtomCore.Structures.ScandalResult; - type WindowLoadSettings = AtomCore.Structures.WindowLoadSettings; - } - - // Atom Keymap ============================================================ - /** This custom subclass of CustomEvent exists to provide the ::abortKeyBinding - * method, as well as versions of the ::stopPropagation methods that record the - * intent to stop propagation so event bubbling can be properly simulated for - * detached elements. - */ - type CommandEvent = AtomKeymap.CommandEvent; - - type KeyBinding = AtomKeymap.KeyBinding; - - /** Allows commands to be associated with keystrokes in a context-sensitive way. - * In Atom, you can access a global instance of this object via `atom.keymaps`. - */ - type KeymapManager = AtomKeymap.KeymapManager; - - // Event Kit ============================================================== - /** An object that aggregates multiple Disposable instances together into a - * single disposable, so they can all be disposed as a group. - */ - type CompositeDisposable = EventKit.CompositeDisposable; - - type DisposableLike = EventKit.DisposableLike; - - /** A handle to a resource that can be disposed. */ - type Disposable = EventKit.Disposable; - - /** Utility class to be used when implementing event-based APIs that allows - * for handlers registered via ::on to be invoked with calls to ::emit. - */ - type Emitter = EventKit.Emitter; - - // First Mate ============================================================= - /** Grammar that tokenizes lines of text. */ - type Grammar = FirstMate.Grammar; - - /** Instance side of GrammarRegistry class. */ - type GrammarRegistry = FirstMate.GrammarRegistry; - - type ScopeSelector = FirstMate.ScopeSelector; - - // Path Watcher =========================================================== - /** Represents a directory on disk that can be watched for changes. */ - type Directory = PathWatcher.Directory; - - /** Represents an individual file that can be watched, read from, and written to. */ - type File = PathWatcher.File; - - // Text Buffer ============================================================ - /** The interface that should be implemented for all "point-compatible" objects. */ - /** Represents a buffer annotation that remains logically stationary even as the - * buffer changes. This is used to represent cursors, folds, snippet targets, - * misspelled words, and anything else that needs to track a logical location - * in the buffer over time. - */ - type DisplayMarker = TextBuffer.DisplayMarker; - - /** Experimental: A container for a related set of markers at the DisplayLayer level. - * Wraps an underlying MarkerLayer on the TextBuffer. - * - * This API is experimental and subject to change on any release. - */ - type DisplayMarkerLayer = TextBuffer.DisplayMarkerLayer; - - /** Represents a buffer annotation that remains logically stationary even as - * the buffer changes. - */ - type Marker = TextBuffer.Marker; - - /** Experimental: A container for a related set of markers. */ - type MarkerLayer = TextBuffer.MarkerLayer; - - /** The interface that should be implemented for all "point-compatible" objects. */ - type PointLike = TextBuffer.PointLike; - - /** Represents a point in a buffer in row/column coordinates. */ - type Point = TextBuffer.Point; - - /** The interface that should be implemented for all "range-compatible" objects. */ - type RangeLike = TextBuffer.RangeLike; - - /** Represents a region in a buffer in row/column coordinates. */ - type Range = TextBuffer.Range; - - /** A mutable text container with undo/redo support and the ability to - * annotate logical regions in the text. - */ - type TextBuffer = TextBuffer.TextBuffer; - - // Atom =================================================================== - /** Atom global for dealing with packages, themes, menus, and the window. - * An instance of this class is always available as the atom global. - */ - type AtomEnvironment = AtomCore.AtomEnvironment; - - /** A wrapper which provides standard error/output line buffering for - * Node's ChildProcess. - */ - type BufferedProcess = AtomCore.BufferedProcess; - - /** Like BufferedProcess, but accepts a Node script as the command to run. - * This is necessary on Windows since it doesn't support shebang #! lines. - */ - type BufferedNodeProcess = AtomCore.BufferedNodeProcess; - - /** Represents the clipboard used for copying and pasting in Atom. */ - type Clipboard = AtomCore.Clipboard; - - /** A simple color class returned from Config::get when the value at the key path is - * of type 'color'. - */ - type Color = AtomCore.Color; - - /** Used to access all of Atom's configuration details. */ - type Config = AtomCore.Config; - - /** Provides a registry for commands that you'd like to appear in the context menu. */ - type ContextMenuManager = AtomCore.ContextMenuManager; - - /** Associates listener functions with commands in a context-sensitive way - * using CSS selectors. - */ - type CommandRegistry = AtomCore.CommandRegistry; - - /** The Cursor class represents the little blinking line identifying where text - * can be inserted. - */ - type Cursor = AtomCore.Cursor; - - /** Represents a decoration that follows a DisplayMarker. A decoration is basically - * a visual representation of a marker. It allows you to add CSS classes to line - * numbers in the gutter, lines, and add selection-line regions around marked ranges - * of text. - */ - type Decoration = AtomCore.Decoration; - - type Deserializer = AtomCore.Deserializer; - - /** Manages the deserializers used for serialized state. */ - type DeserializerManager = AtomCore.DeserializerManager; - - /** A container at the edges of the editor window capable of holding items. */ - type Dock = AtomCore.Dock; - - /** Represents the underlying git operations performed by Atom. */ - type GitRepository = AtomCore.GitRepository; - - /** Represents a gutter within a TextEditor. */ - type Gutter = AtomCore.Gutter; - - /** History manager for remembering which projects have been opened. - * An instance of this class is always available as the atom.history global. - * The project history is used to enable the 'Reopen Project' menu. - */ - type HistoryManager = AtomCore.HistoryManager; - - type HistoryProject = AtomCore.HistoryProject; - - /** Represents a decoration that applies to every marker on a given layer. Created via - * TextEditor::decorateMarkerLayer. - */ - type LayerDecoration = AtomCore.LayerDecoration; - - /** Provides a registry for menu items that you'd like to appear in the application menu. */ - type MenuManager = AtomCore.MenuManager; - - type Model = AtomCore.Model; - - /** A notification to the user containing a message and type. */ - type Notification = AtomCore.Notification; - - /** A notification manager used to create Notifications to be shown to the user. */ - type NotificationManager = AtomCore.NotificationManager; - - /** Loads and activates a package's main module and resources such as stylesheets, - * keymaps, grammar, editor properties, and menus. - */ - type Package = AtomCore.Package; - - /** Package manager for coordinating the lifecycle of Atom packages. */ - type PackageManager = AtomCore.PackageManager; - - /** A container for presenting content in the center of the workspace. */ - type Pane = AtomCore.Pane; - - /** A container representing a panel on the edges of the editor window. You - * should not create a Panel directly, instead use Workspace::addTopPanel and - * friends to add panels. - */ - type Panel = AtomCore.Panel; - - /** Manage a subscription to filesystem events that occur beneath a root directory. */ - type PathWatcher = AtomCore.PathWatcher; - - /** Represents a project that's opened in Atom. */ - type Project = AtomCore.Project; - - /** Wraps an Array of Strings. The Array describes a path from the root of the - * syntax tree to a token including all scope names for the entire path. - */ - type ScopeDescriptor = AtomCore.ScopeDescriptor; - - /** Represents a selection in the TextEditor. */ - type Selection = AtomCore.Selection; - - /** A singleton instance of this class available via atom.styles, which you can - * use to globally query and observe the set of active style sheets. - */ - type StyleManager = AtomCore.StyleManager; - - /** Run a node script in a separate process. */ - type Task = AtomCore.Task; - - /** This class represents all essential editing state for a single TextBuffer, - * including cursor and selection positions, folds, and soft wraps. - */ - type TextEditor = AtomCore.TextEditor; - - /** Experimental: This global registry tracks registered TextEditors. */ - type TextEditorRegistry = AtomCore.TextEditorRegistry; - - /** Handles loading and activating available themes. */ - type ThemeManager = AtomCore.ThemeManager; - - type Tooltip = AtomCore.Tooltip; - - /** Associates tooltips with HTML elements or selectors. */ - type TooltipManager = AtomCore.TooltipManager; - - /** ViewRegistry handles the association between model and view types in Atom. - * We call this association a View Provider. As in, for a given model, this class - * can provide a view via ::getView, as long as the model/view association was - * registered via ::addViewProvider. - */ - type ViewRegistry = AtomCore.ViewRegistry; - - /** Represents the state of the user interface for the entire window. */ - type Workspace = AtomCore.Workspace; - - // https://github.com/atom/atom/blob/master/src/workspace-center.js - /** The central container for the editor window capable of holding items. */ - type WorkspaceCenter = AtomCore.WorkspaceCenter; - } - - var atom: AtomCore.AtomEnvironment; + const atom: AtomEnvironment; } -export { CompositeDisposable, Disposable, Emitter } from "event-kit"; -export { File, Directory } from "pathwatcher"; - -/** A wrapper which provides standard error/output line buffering for - * Node's ChildProcess. - */ -export const BufferedProcess: AtomCore.Statics.BufferedProcess; - -/** Like BufferedProcess, but accepts a Node script as the command to run. - * This is necessary on Windows since it doesn't support shebang #! lines. - */ -export const BufferedNodeProcess: AtomCore.Statics.BufferedNodeProcess; - -/** Represents the underlying git operations performed by Atom. */ -export const GitRepository: AtomCore.Statics.GitRepository; - -/** A notification to the user containing a message and type. */ -export const Notification: AtomCore.Statics.Notification; - -/** Represents a point in a buffer in row/column coordinates. */ -export const Point: TextBuffer.Statics.Point; - -/** Represents a region in a buffer in row/column coordinates. */ -export const Range: TextBuffer.Statics.Range; - -/** Run a node script in a separate process. */ -export const Task: AtomCore.Statics.Task; - -/** A mutable text container with undo/redo support and the ability to annotate - * logical regions in the text. - */ -export const TextBuffer: TextBuffer.Statics.TextBuffer; - -/** This class represents all essential editing state for a single TextBuffer, - * including cursor and selection positions, folds, and soft wraps. - */ -export const TextEditor: AtomCore.Statics.TextEditor; - -/** Invoke a callback with each filesystem event that occurs beneath a specified path. +/** + * Invoke a callback with each filesystem event that occurs beneath a specified path. * If you only need to watch events within the project's root paths, use * Project::onDidChangeFiles instead. */ export function watchPath(rootPath: string, options: {}, eventCallback: (events: - AtomCore.Events.FilesystemChange) => void): AtomCore.PathWatcher; + FilesystemChangeEvent) => void): PathWatcher; + +// Essential Classes ========================================================== + +/** + * Atom global for dealing with packages, themes, menus, and the window. + * An instance of this class is always available as the atom global. + */ +export interface AtomEnvironment { + // Properties + /** A CommandRegistry instance. */ + commands: CommandRegistry; + + /** A Config instance. */ + config: Config; + + /** A Clipboard instance. */ + clipboard: Clipboard; + + /** A ContextMenuManager instance. */ + contextMenu: ContextMenuManager; + + /** A MenuManager instance. */ + menu: MenuManager; + + /** A KeymapManager instance. */ + keymaps: KeymapManager; + + /** A TooltipManager instance. */ + tooltips: TooltipManager; + + /** A NotificationManager instance. */ + notifications: NotificationManager; + + /** A Project instance. */ + project: Project; + + /** A GrammarRegistry instance. */ + grammars: GrammarRegistry; + + /** A HistoryManager instance. */ + history: HistoryManager; + + /** A PackageManager instance. */ + packages: PackageManager; + + /** A ThemeManager instance. */ + themes: ThemeManager; + + /** A StyleManager instance. */ + styles: StyleManager; + + /** A DeserializerManager instance. */ + deserializers: DeserializerManager; + + /** A ViewRegistry instance. */ + views: ViewRegistry; + + /** A Workspace instance. */ + workspace: Workspace; + + /** A TextEditorRegistry instance. */ + textEditors: TextEditorRegistry; + + // Event Subscription + /** Invoke the given callback whenever ::beep is called. */ + onDidBeep(callback: () => void): Disposable; + + /** + * Invoke the given callback when there is an unhandled error, but before + * the devtools pop open. + */ + onWillThrowError(callback: (event: PreventableExceptionThrownEvent) => void): Disposable; + + /** Invoke the given callback whenever there is an unhandled error. */ + onDidThrowError(callback: (event: ExceptionThrownEvent) => void): Disposable; + + /** + * Invoke the given callback as soon as the shell environment is loaded (or + * immediately if it was already loaded). + */ + whenShellEnvironmentLoaded(callback: () => void): Disposable; + + // Atom Details + /** Returns a boolean that is true if the current window is in development mode. */ + inDevMode(): boolean; + + /** Returns a boolean that is true if the current window is in safe mode. */ + inSafeMode(): boolean; + + /** Returns a boolean that is true if the current window is running specs. */ + inSpecMode(): boolean; + + /** Get the version of the Atom application. */ + getVersion(): string; + + /** + * Gets the release channel of the Atom application. + * Returns the release channel, which can be 'dev', 'beta', or 'stable'. + */ + getReleaseChannel(): "dev"|"beta"|"stable"; + + /** Returns a boolean that is true if the current version is an official release. */ + isReleasedVersion(): boolean; + + /** Get the time taken to completely load the current window. */ + getWindowLoadTime(): number; + + /** Get the load settings for the current window. */ + getLoadSettings(): WindowLoadSettings; + + // Managing the Atom Window + /** Open a new Atom window using the given options. */ + open(params?: { + pathsToOpen: ReadonlyArray, + newWindow?: boolean, + devMode?: boolean, + safeMode?: boolean, + }): void; + + /** Close the current window. */ + close(): void; + + /** Get the size of current window. */ + getSize(): { width: number, height: number }; + + /** Set the size of current window. */ + setSize(width: number, height: number): void; + + /** Get the position of current window. */ + getPosition(): { x: number, y: number }; + + /** Set the position of current window. */ + setPosition(x: number, y: number): void; + + /** Prompt the user to select one or more folders. */ + pickFolder(callback: (paths: string[]|null) => void): void; + + /** Get the current window. */ + getCurrentWindow(): object; + + /** Move current window to the center of the screen. */ + center(): void; + + /** Focus the current window. */ + focus(): void; + + /** Show the current window. */ + show(): void; + + /** Hide the current window. */ + hide(): void; + + /** Reload the current window. */ + reload(): void; + + /** Relaunch the entire application. */ + restartApplication(): void; + + /** Returns a boolean that is true if the current window is maximized. */ + isMaximized(): boolean; + + /** Returns a boolean that is true if the current window is in full screen mode. */ + isFullScreen(): boolean; + + /** Set the full screen state of the current window. */ + setFullScreen(fullScreen: boolean): void; + + /** Toggle the full screen state of the current window. */ + toggleFullScreen(): void; + + // Messaging the User + /** Visually and audibly trigger a beep. */ + beep(): void; + + /** + * A flexible way to open a dialog akin to an alert dialog. + * If the dialog is closed (via `Esc` key or `X` in the top corner) without + * selecting a button the first button will be clicked unless a "Cancel" or "No" + * button is provided. + * + * Returns the chosen button index number if the buttons option was an array. + */ + confirm(options: { + message: string, + detailedMessage?: string, + buttons?: ReadonlyArray, + }): void; + + /** + * A flexible way to open a dialog akin to an alert dialog. + * If the dialog is closed (via `Esc` key or `X` in the top corner) without + * selecting a button the first button will be clicked unless a "Cancel" or "No" + * button is provided. + * + * Returns the chosen button index number if the buttons option was an array. + */ + confirm(options: { + message: string, + detailedMessage?: string, + buttons?: { + [key: string]: () => void + }, + }): number; + + // Managing the Dev Tools + /** Open the dev tools for the current window. */ + openDevTools(): Promise; + + /** Toggle the visibility of the dev tools for the current window. */ + toggleDevTools(): Promise; + + /** Execute code in dev tools. */ + executeJavaScriptInDevTools(code: string): void; +} + +/** + * A simple color class returned from Config::get when the value at the key path is + * of type 'color'. + */ +export interface Color { + /** Returns a string in the form '#abcdef'. */ + toHexString(): string; + + /** Returns a string in the form 'rgba(25, 50, 75, .9)'. */ + toRGBAString(): string; +} + +/** + * Associates listener functions with commands in a context-sensitive way + * using CSS selectors. + */ +export interface CommandRegistry { + /** Register a single command. */ + add(target: string|Node, commandName: string, listener: { + didDispatch(event: CommandEvent): void, + displayName?: string, + description?: string, + } | ((event: CommandEvent) => void)): Disposable; + + /** Register multiple commands. */ + add(target: string|Node, commands: { + [key: string]: (event: CommandEvent) => void + }): CompositeDisposable; + + /** Find all registered commands matching a query. */ + findCommands(params: { target: string|Node }): Array<{ + name: string, + displayName: string, + description?: string, + tags?: string[], + }>; + + /** + * Simulate the dispatch of a command on a DOM node. + * @return Whether or not there was a matching command for the target. + */ + dispatch(target: Node, commandName: string): boolean; + + /** Invoke the given callback before dispatching a command event. */ + onWillDispatch(callback: (event: CommandEvent) => void): Disposable; + + /** Invoke the given callback after dispatching a command event. */ + onDidDispatch(callback: (event: CommandEvent) => void): Disposable; +} + +/** + * An object that aggregates multiple Disposable instances together into a + * single disposable, so they can all be disposed as a group. + */ +export class CompositeDisposable implements DisposableLike { + /** Construct an instance, optionally with one or more disposables. */ + constructor(...disposables: DisposableLike[]); + + /** + * Dispose all disposables added to this composite disposable. + * If this object has already been disposed, this method has no effect. + */ + dispose(): void; + + // Managing Disposables + /** + * Add disposables to be disposed when the composite is disposed. + * If this object has already been disposed, this method has no effect. + */ + add(...disposables: DisposableLike[]): void; + + /** Remove a previously added disposable. */ + remove(disposable: DisposableLike): void; + + /** Alias to CompositeDisposable::remove. */ + delete(disposable: DisposableLike): void; + + /** + * Clear all disposables. They will not be disposed by the next call to + * dispose. + */ + clear(): void; +} + +/** Used to access all of Atom's configuration details. */ +export interface Config { + // Config Subscription + /** + * Add a listener for changes to a given key path. This is different than ::onDidChange in + * that it will immediately call your callback with the current value of the config entry. + */ + observe(keyPath: T, callback: + (value: ConfigValues[T]) => void): Disposable; + /** + * Add a listener for changes to a given key path. This is different than ::onDidChange in + * that it will immediately call your callback with the current value of the config entry. + */ + observe(keyPath: T, options: + { scope: string[]|ScopeDescriptor }, callback: (value: ConfigValues[T]) => void): + Disposable; + + /** + * Add a listener for changes to a given key path. If keyPath is not specified, your + * callback will be called on changes to any key. + */ + // tslint:disable-next-line:no-any + onDidChange(callback: (values: { newValue: T, oldValue: T }) => void): + Disposable; + /** + * Add a listener for changes to a given key path. If keyPath is not specified, your + * callback will be called on changes to any key. + */ + onDidChange(keyPath: T, callback: (values: { + newValue: ConfigValues[T], + oldValue?: ConfigValues[T], + }) => void): Disposable; + /** + * Add a listener for changes to a given key path. If keyPath is not specified, your + * callback will be called on changes to any key. + */ + onDidChange(keyPath: T, options: + { scope: string[]|ScopeDescriptor }, callback: + (values: { newValue: ConfigValues[T], oldValue?: ConfigValues[T] }) => void): + Disposable; + + // Managing Settings + /** Retrieves the setting for the given key. */ + get(keyPath: T, options?: { sources?: string[], + excludeSources?: string[], scope?: string[]|ScopeDescriptor }): + ConfigValues[T]|undefined; + + /** + * Sets the value for a configuration setting. + * This value is stored in Atom's internal configuration file. + */ + set(keyPath: T, value: ConfigValues[T], options?: + { scopeSelector?: string, source?: string }): void; + + /** Restore the setting at keyPath to its default value. */ + unset(keyPath: string, options?: { scopeSelector?: string, source?: string }): void; + + /** + * Get all of the values for the given key-path, along with their associated + * scope selector. + */ + getAll(keyPath: T, options?: { sources?: string[], + excludeSources?: string[], scope?: ScopeDescriptor }): + Array<{ scopeDescriptor: ScopeDescriptor, value: ConfigValues[T] }>; + + /** + * Get an Array of all of the source Strings with which settings have been added + * via ::set. + */ + getSources(): string[]; + + /** + * Retrieve the schema for a specific key path. The schema will tell you what type + * the keyPath expects, and other metadata about the config option. + */ + getSchema(keyPath: string): object|null; + + /** Get the string path to the config file being used. */ + getUserConfigPath(): string; + + /** + * Suppress calls to handler functions registered with ::onDidChange and ::observe + * for the duration of callback. After callback executes, handlers will be called + * once if the value for their key-path has changed. + */ + transact(callback: () => void): void; +} + +/** + * Represents a decoration that follows a DisplayMarker. A decoration is basically + * a visual representation of a marker. It allows you to add CSS classes to line + * numbers in the gutter, lines, and add selection-line regions around marked ranges + * of text. + */ +export interface Decoration { + /** The identifier for this Decoration. */ + id: number; + + // Construction and Destruction + /** + * Destroy this marker decoration. + * You can also destroy the marker if you own it, which will destroy this decoration. + */ + destroy(): void; + + // Event Subscription + /** When the Decoration is updated via Decoration::setProperties. */ + onDidChangeProperties(callback: (event: DecorationPropsChangedEvent) => void): Disposable; + + /** Invoke the given callback when the Decoration is destroyed. */ + onDidDestroy(callback: () => void): Disposable; + + // Decoration Details + /** An id unique across all Decoration objects. */ + getId(): number; + + /** Returns the marker associated with this Decoration. */ + getMarker(): DisplayMarker; + + // Properties + /** Returns the Decoration's properties. */ + getProperties(): DecorationOptions; + + /** + * Update the marker with new Properties. Allows you to change the decoration's + * class. + */ + setProperties(newProperties: DecorationOptions): void; +} + +/** + * Represents a buffer annotation that remains logically stationary even as the + * buffer changes. This is used to represent cursors, folds, snippet targets, + * misspelled words, and anything else that needs to track a logical location + * in the buffer over time. + */ +export interface DisplayMarker { + // Construction and Destruction + /** + * Destroys the marker, causing it to emit the 'destroyed' event. Once destroyed, + * a marker cannot be restored by undo/redo operations. + */ + destroy(): void; + + /** Creates and returns a new DisplayMarker with the same properties as this marker. */ + copy(options?: CopyMarkerOptions): DisplayMarker; + + // Event Subscription + /** Invoke the given callback when the state of the marker changes. */ + onDidChange(callback: (event: DisplayMarkerChangedEvent) => void): Disposable; + + /** Invoke the given callback when the marker is destroyed. */ + onDidDestroy(callback: () => void): Disposable; + + // TextEditorMarker Details + /** + * Returns a boolean indicating whether the marker is valid. Markers can be + * invalidated when a region surrounding them in the buffer is changed. + */ + isValid(): boolean; + + /** + * Returns a boolean indicating whether the marker has been destroyed. A marker + * can be invalid without being destroyed, in which case undoing the invalidating + * operation would restore the marker. + */ + isDestroyed(): boolean; + + /** Returns a boolean indicating whether the head precedes the tail. */ + isReversed(): boolean; + + /** + * Returns a boolean indicating whether changes that occur exactly at the marker's + * head or tail cause it to move. + */ + isExclusive(): boolean; + + /** + * Get the invalidation strategy for this marker. + * Valid values include: never, surround, overlap, inside, and touch. + */ + getInvalidationStrategy(): string; + + /** Returns an Object containing any custom properties associated with the marker. */ + getProperties(): object; + + /** Merges an Object containing new properties into the marker's existing properties. */ + setProperties(properties: object): void; + + /** Returns whether this marker matches the given parameters. */ + matchesProperties(attributes: FindDisplayMarkerOptions): boolean; + + // Comparing to other markers + /** Compares this marker to another based on their ranges. */ + compare(other: DisplayMarker): number; + + /** + * Returns a boolean indicating whether this marker is equivalent to another + * marker, meaning they have the same range and options. + */ + isEqual(other: DisplayMarker): boolean; + + // Managing the marker's range + /** Gets the buffer range of this marker. */ + getBufferRange(): Range; + + /** Gets the screen range of this marker. */ + getScreenRange(): Range; + + /** Modifies the buffer range of this marker. */ + setBufferRange(bufferRange: RangeCompatible, properties?: { reversed: boolean }): + void; + + /** Modifies the screen range of this marker. */ + setScreenRange(screenRange: RangeCompatible, options?: { reversed?: boolean, + clipDirection?: "backward"|"forward"|"closest" }): void; + + /** + * Retrieves the screen position of the marker's start. This will always be + * less than or equal to the result of DisplayMarker::getEndScreenPosition. + */ + getStartScreenPosition(options?: { clipDirection: "backward"|"forward"|"closest" }): + Point; + + /** + * Retrieves the screen position of the marker's end. This will always be + * greater than or equal to the result of DisplayMarker::getStartScreenPosition. + */ + getEndScreenPosition(options?: { clipDirection: "backward"|"forward"|"closest" }): + Point; + + /** Retrieves the buffer position of the marker's head. */ + getHeadBufferPosition(): Point; + + /** Sets the buffer position of the marker's head. */ + setHeadBufferPosition(bufferPosition: PointCompatible): void; + + /** Retrieves the screen position of the marker's head. */ + getHeadScreenPosition(options?: { clipDirection: "backward"|"forward"|"closest" }): + Point; + + /** Sets the screen position of the marker's head. */ + setHeadScreenPosition(screenPosition: PointCompatible, + options?: { clipDirection: "backward"|"forward"|"closest" }): void; + + /** Retrieves the buffer position of the marker's tail. */ + getTailBufferPosition(): Point; + + /** Sets the buffer position of the marker's tail. */ + setTailBufferPosition(bufferPosition: PointCompatible): void; + + /** Retrieves the screen position of the marker's tail. */ + getTailScreenPosition(options?: { clipDirection: "backward"|"forward"|"closest" }): + Point; + + /** Sets the screen position of the marker's tail. */ + setTailScreenPosition(screenPosition: PointCompatible, + options?: { clipDirection: "backward"|"forward"|"closest" }): void; + + /** + * Retrieves the buffer position of the marker's start. This will always be less + * than or equal to the result of DisplayMarker::getEndBufferPosition. + */ + getStartBufferPosition(): Point; + + /** + * Retrieves the buffer position of the marker's end. This will always be greater + * than or equal to the result of DisplayMarker::getStartBufferPosition. + */ + getEndBufferPosition(): Point; + + /** Returns a boolean indicating whether the marker has a tail. */ + hasTail(): boolean; + + /** + * Plants the marker's tail at the current head position. After calling the + * marker's tail position will be its head position at the time of the call, + * regardless of where the marker's head is moved. + */ + plantTail(): void; + + /** + * Removes the marker's tail. After calling the marker's head position will be + * reported as its current tail position until the tail is planted again. + */ + clearTail(): void; +} + +/** + * Experimental: A container for a related set of markers at the DisplayLayer level. + * Wraps an underlying MarkerLayer on the TextBuffer. + * + * This API is experimental and subject to change on any release. + */ +export interface DisplayMarkerLayer { + // Lifecycle + /** Destroy this layer. */ + destroy(): void; + + /** Destroy all markers in this layer. */ + clear(): void; + + /** Determine whether this layer has been destroyed. */ + isDestroyed(): boolean; + + // Event Subscription + /** Subscribe to be notified synchronously when this layer is destroyed. */ + onDidDestroy(callback: () => void): Disposable; + + /** + * Subscribe to be notified asynchronously whenever markers are created, updated, + * or destroyed on this layer. Prefer this method for optimal performance when + * interacting with layers that could contain large numbers of markers. + */ + onDidUpdate(callback: () => void): Disposable; + + /** + * Subscribe to be notified synchronously whenever markers are created on this + * layer. Avoid this method for optimal performance when interacting with layers + * that could contain large numbers of markers. + */ + onDidCreateMarker(callback: (marker: DisplayMarker|Marker) => void): Disposable; + + // Marker creation + /** Create a marker with the given screen range. */ + markScreenRange(range: RangeCompatible, options?: { reversed?: boolean, + invalidate?: "never"|"surround"|"overlap"|"inside"|"touch", exclusive?: + boolean, clipDirection?: "backward"|"forward"|"closest" }): DisplayMarker; + + /** + * Create a marker on this layer with its head at the given screen position + * and no tail. + */ + markScreenPosition(screenPosition: PointCompatible, options?: { invalidate?: + "never"|"surround"|"overlap"|"inside"|"touch", exclusive?: boolean, + clipDirection?: "backward"|"forward"|"closest" }): DisplayMarker; + + /** Create a marker with the given buffer range. */ + markBufferRange(range: RangeCompatible, options?: { + reversed?: boolean, invalidate?: "never"|"surround"|"overlap"|"inside"|"touch", + exclusive?: boolean }): DisplayMarker; + + /** + * Create a marker on this layer with its head at the given buffer position + * and no tail. + */ + markBufferPosition(bufferPosition: PointCompatible, options?: { invalidate?: + "never"|"surround"|"overlap"|"inside"|"touch", exclusive?: boolean }): + DisplayMarker; + + // Querying + /** Get an existing marker by its id. */ + getMarker(id: number): DisplayMarker; + + /** Get all markers in the layer. */ + getMarkers(): DisplayMarker[]; + + /** Get the number of markers in the marker layer. */ + getMarkerCount(): number; + + /** + * Find markers in the layer conforming to the given parameters. + * + * This method finds markers based on the given properties. Markers can be associated + * with custom properties that will be compared with basic equality. In addition, + * there are several special properties that will be compared with the range of the + * markers rather than their properties. + */ + findMarkers(properties: FindDisplayMarkerOptions): DisplayMarker[]; +} + +/** A handle to a resource that can be disposed. */ +export class Disposable implements DisposableLike { + /** Ensure that Object correctly implements the Disposable contract. */ + static isDisposable(object: object): boolean; + + /** Construct a Disposable. */ + constructor(disposableAction?: () => void); + + /** A callback which will be called within dispose(). */ + disposalAction?(): void; + + /** + * Perform the disposal action, indicating that the resource associated + * with this disposable is no longer needed. + */ + dispose(): void; +} + +/** + * Utility class to be used when implementing event-based APIs that allows + * for handlers registered via ::on to be invoked with calls to ::emit. + */ +export class Emitter implements DisposableLike { + /** Construct an emitter. */ + constructor(); + + /** Clear out any existing subscribers. */ + clear(): void; + + /** Unsubscribe all handlers. */ + dispose(): boolean; + + // Event Subscription + /** Registers a handler to be invoked whenever the given event is emitted. */ + on(eventName: T, handler: (value?: Emissions[T]) => void): + Disposable; + + /** + * Register the given handler function to be invoked the next time an event + * with the given name is emitted via ::emit. + */ + once(eventName: T, handler: (value?: Emissions[T]) => void): + Disposable; + + /** + * Register the given handler function to be invoked before all other + * handlers existing at the time of subscription whenever events by the + * given name are emitted via ::emit. + */ + preempt(eventName: T, handler: (value?: Emissions[T]) => void): + Disposable; + + // Event Emission + /** Invoke the handlers registered via ::on for the given event name. */ + emit(eventName: T, value?: Emissions[T]): void; +} + +/** + * Represents a decoration that applies to every marker on a given layer. Created via + * TextEditor::decorateMarkerLayer. + */ +export interface LayerDecoration { + /** Destroys the decoration. */ + destroy(): void; + + /** Determine whether this decoration is destroyed. */ + isDestroyed(): boolean; + + /** Get this decoration's properties. */ + getProperties(): DecorationLayerOptions; + + /** Set this decoration's properties. */ + setProperties(newProperties: DecorationLayerOptions): void; + + /** Override the decoration properties for a specific marker. */ + setPropertiesForMarker(marker: DisplayMarker|Marker, properties: DecorationLayerOptions): + void; +} + +/** + * Represents a buffer annotation that remains logically stationary even as + * the buffer changes. + */ +export interface Marker { + /** The identifier for this Marker. */ + id: number; + + // Lifecycle + /** + * Creates and returns a new Marker with the same properties as this + * marker. + */ + copy(options?: CopyMarkerOptions): Marker; + + /** Destroys the marker, causing it to emit the "destroyed" event. */ + destroy(): void; + + // Event Subscription + /** Invoke the given callback when the marker is destroyed. */ + onDidDestroy(callback: () => void): Disposable; + + /** Invoke the given callback when the state of the marker changes. */ + onDidChange(callback: (event: MarkerChangedEvent) => void): Disposable; + + // Marker Details + /** Returns the current range of the marker. The range is immutable. */ + getRange(): Range; + + /** Returns a point representing the marker's current head position. */ + getHeadPosition(): Point; + + /** Returns a point representing the marker's current tail position. */ + getTailPosition(): Point; + + /** + * Returns a point representing the start position of the marker, which + * could be the head or tail position, depending on its orientation. + */ + getStartPosition(): Point; + + /** + * Returns a point representing the end position of the marker, which + * could be the head or tail position, depending on its orientation. + */ + getEndPosition(): Point; + + /** Returns a boolean indicating whether the head precedes the tail. */ + isReversed(): boolean; + + /** Returns a boolean indicating whether the marker has a tail. */ + hasTail(): boolean; + + /** Is the marker valid? */ + isValid(): boolean; + + /** Is the marker destroyed? */ + isDestroyed(): boolean; + + /** + * Returns a boolean indicating whether changes that occur exactly at + * the marker's head or tail cause it to move. + */ + isExclusive(): boolean; + + /** Get the invalidation strategy for this marker. */ + getInvalidationStrategy(): string; + + // Mutating Markers + /** + * Sets the range of the marker. + * Returns a boolean indicating whether or not the marker was updated. + */ + setRange(range: RangeCompatible, params?: { reversed?: boolean, exclusive?: + boolean }): boolean; + + /** + * Sets the head position of the marker. + * Returns a boolean indicating whether or not the marker was updated. + */ + setHeadPosition(position: PointCompatible): boolean; + + /** + * Sets the tail position of the marker. + * Returns a boolean indicating whether or not the marker was updated. + */ + setTailPosition(position: PointCompatible): boolean; + + /** + * Removes the marker's tail. + * Returns a boolean indicating whether or not the marker was updated. + */ + clearTail(): boolean; + + /** + * Plants the marker's tail at the current head position. + * Returns a boolean indicating whether or not the marker was updated. + */ + plantTail(): boolean; + + // Comparison + /** + * Returns a boolean indicating whether this marker is equivalent to + * another marker, meaning they have the same range and options. + */ + isEqual(other: Marker): boolean; + + /** + * Compares this marker to another based on their ranges. + * Returns "-1" if this marker precedes the argument. + * Returns "0" if this marker is equivalent to the argument. + * Returns "1" if this marker follows the argument. + */ + compare(other: Marker): number; +} + +/** Experimental: A container for a related set of markers. */ +export interface MarkerLayer { + // Lifecycle + /** Create a copy of this layer with markers in the same state and locations. */ + copy(): MarkerLayer; + + /** Destroy this layer. */ + destroy(): boolean; + + /** Remove all markers from this layer. */ + clear(): void; + + /** Determine whether this layer has been destroyed. */ + isDestroyed(): boolean; + + // Querying + /** Get an existing marker by its id. */ + getMarker(id: number): Marker|undefined; + + /** Get all existing markers on the marker layer. */ + getMarkers(): Marker[]; + + /** Get the number of markers in the marker layer. */ + getMarkerCount(): number; + + /** Find markers in the layer conforming to the given parameters. */ + findMarkers(params: FindMarkerOptions): Marker[]; + + // Marker Creation + /** Create a marker with the given range. */ + markRange(range: RangeCompatible, options?: { reversed?: boolean, invalidate?: + "never"|"surround"|"overlap"|"inside"|"touch", exclusive?: boolean }): Marker; + + /** Create a marker at with its head at the given position with no tail. */ + markPosition(position: PointCompatible, options?: { invalidate?: "never"|"surround" + |"overlap"|"inside"|"touch", exclusive?: boolean }): Marker; + + // Event Subscription + /** + * Subscribe to be notified asynchronously whenever markers are created, + * updated, or destroyed on this layer. + */ + onDidUpdate(callback: () => void): Disposable; + + /** + * Subscribe to be notified synchronously whenever markers are created on + * this layer. + */ + onDidCreateMarker(callback: (marker: Marker) => void): Disposable; + + /** Subscribe to be notified synchronously when this layer is destroyed. */ + onDidDestroy(callback: () => void): Disposable; +} + +/** A notification to the user containing a message and type. */ +export class Notification { + constructor(type: "warning"|"info"|"success", message: string, + options?: NotificationOptions); + constructor(type: "fatal"|"error", message: string, options?: ErrorNotificationOptions); + + // Event Subscription + /** Invoke the given callback when the notification is dismissed. */ + onDidDismiss(callback: (notification: Notification) => void): Disposable; + + /** Invoke the given callback when the notification is displayed. */ + onDidDisplay(callback: (notification: Notification) => void): Disposable; + + // Methods + /** Returns the Notification's type. */ + getType(): string; + + /** Returns the Notification's message. */ + getMessage(): string; + + /** + * Dismisses the notification, removing it from the UI. Calling this + * programmatically will call all callbacks added via onDidDismiss. + */ + dismiss(): void; +} + +/** A notification manager used to create Notifications to be shown to the user. */ +export interface NotificationManager { + // Properties + notifications: Notification[]; + + // Events + /** Invoke the given callback after a notification has been added. */ + onDidAddNotification(callback: (notification: Notification) => void): Disposable; + + // Adding Notifications + /** Add a success notification. */ + addSuccess(message: string, options?: NotificationOptions): Notification; + + /** Add an informational notification. */ + addInfo(message: string, options?: NotificationOptions): Notification; + + /** Add a warning notification. */ + addWarning(message: string, options?: NotificationOptions): Notification; + + /** Add an error notification. */ + addError(message: string, options?: ErrorNotificationOptions): Notification; + + /** Add a fatal error notification. */ + addFatalError(message: string, options?: ErrorNotificationOptions): Notification; + + // Getting Notifications + /** Get all the notifications. */ + getNotifications(): Notification[]; +} + +/** Represents a point in a buffer in row/column coordinates. */ +export class Point { + // Properties + /** A zero-indexed number representing the row of the Point. */ + row: number; + + /** A zero-indexed number representing the column of the Point. */ + column: number; + + // Construction + /** + * Create a Point from an array containing two numbers representing the + * row and column. + */ + static fromObject(object: [number, number]): Point; + + /** Create a Point from an existing object which implements PointLike. */ + static fromObject(object: PointLike, copy?: boolean): Point; + + /** Construct a Point object */ + constructor(row?: number, column?: number); + + /** Returns a new Point with the same row and column. */ + copy(): Point; + + /** Returns a new Point with the row and column negated. */ + negate(): Point; + + // Comparison + /** Returns the given Point that is earlier in the buffer. */ + static min(point1: PointCompatible, point2: PointCompatible): Point; + + /** + * Compare another Point to this Point instance. + * Returns -1 if this point precedes the argument. + * Returns 0 if this point is equivalent to the argument. + * Returns 1 if this point follows the argument. + */ + compare(other: PointCompatible): number; + + /** + * Returns a boolean indicating whether this point has the same row and + * column as the given Point. + */ + isEqual(other: PointCompatible): boolean; + + /** Returns a Boolean indicating whether this point precedes the given Point. */ + isLessThan(other: PointCompatible): boolean; + + /** + * Returns a Boolean indicating whether this point precedes or is equal to + * the given Point. + */ + isLessThanOrEqual(other: PointCompatible): boolean; + + /** Returns a Boolean indicating whether this point follows the given Point. */ + isGreaterThan(other: PointCompatible): boolean; + + /** + * Returns a Boolean indicating whether this point follows or is equal to + * the given Point. + */ + isGreaterThanOrEqual(other: PointCompatible): boolean; + + // Operations + /** Makes this point immutable and returns itself. */ + freeze(): Readonly; + + /** + * Build and return a new point by adding the rows and columns of the + * given point. + */ + translate(other: PointCompatible): Point; + + /** + * Build and return a new Point by traversing the rows and columns + * specified by the given point. + */ + traverse(other: PointCompatible): Point; + + /** Returns an array of this point's row and column. */ + toArray(): [number, number]; + + /** Returns an array of this point's row and column. */ + serialize(): [number, number]; + + /** Returns a string representation of the point. */ + toString(): string; +} + +/** Represents a region in a buffer in row/column coordinates. */ +export class Range { + // Properties + /** A Point representing the start of the Range. */ + start: Point; + + /** A Point representing the end of the Range. */ + end: Point; + + // Construction + /** Convert any range-compatible object to a Range. */ + static fromObject(object: RangeCompatible, copy?: boolean): Range; + + /** Construct a Range object. */ + constructor(pointA?: PointCompatible, pointB?: PointCompatible); + + /** Call this with the result of Range::serialize to construct a new Range. */ + static deserialize(array: object): Range; + + /** Returns a new range with the same start and end positions. */ + copy(): Range; + + /** Returns a new range with the start and end positions negated. */ + negate(): Range; + + // Serialization and Deserialization + /** Returns a plain javascript object representation of the Range. */ + serialize(): number[][]; + + // Range Details + /** Is the start position of this range equal to the end position? */ + isEmpty(): boolean; + + /** + * Returns a boolean indicating whether this range starts and ends on the + * same row. + */ + isSingleLine(): boolean; + + /** Get the number of rows in this range. */ + getRowCount(): number; + + /** Returns an array of all rows in the range. */ + getRows(): number[]; + + // Operations + /** + * Freezes the range and its start and end point so it becomes immutable + * and returns itself. + */ + freeze(): Readonly; + + // NOTE: this function doesn't actually take a range-compatible parameter. + /** Returns a new range that contains this range and the given range. */ + union(other: RangeLike): Range; + + /** + * Build and return a new range by translating this range's start and end + * points by the given delta(s). + */ + translate(startDelta: PointCompatible, endDelta?: PointCompatible): Range; + + /** + * Build and return a new range by traversing this range's start and end + * points by the given delta. + */ + traverse(delta: PointCompatible): Range; + + // Comparison + /** + * Compare two Ranges. + * Returns -1 if this range starts before the argument or contains it. + * Returns 0 if this range is equivalent to the argument. + * Returns 1 if this range starts after the argument or is contained by it. + */ + compare(otherRange: RangeCompatible): number; + + /** + * Returns a Boolean indicating whether this range has the same start and + * end points as the given Range. + */ + isEqual(otherRange: RangeCompatible): boolean; + + // NOTE: this function doesn't actually take a range-compatible parameter. + /** + * Returns a Boolean indicating whether this range starts and ends on the + * same row as the argument. + */ + coversSameRows(otherRange: RangeLike): boolean; + + // NOTE: this function doesn't actually take a range-compatible parameter. + /** Determines whether this range intersects with the argument. */ + intersectsWith(otherRange: RangeLike, exclusive?: boolean): boolean; + + /** Returns a boolean indicating whether this range contains the given range. */ + containsRange(otherRange: RangeCompatible, exclusive?: boolean): boolean; + + /** Returns a boolean indicating whether this range contains the given point. */ + containsPoint(point: PointCompatible, exclusive?: boolean): boolean; + + /** + * Returns a boolean indicating whether this range intersects the given + * row number. + */ + intersectsRow(row: number): boolean; + + /** + * Returns a boolean indicating whether this range intersects the row range + * indicated by the given startRow and endRow numbers. + */ + intersectsRowRange(startRow: number, endRow: number): boolean; + + // Conversion + /** Returns a string representation of the range. */ + toString(): string; +} + +/** + * This class represents all essential editing state for a single TextBuffer, + * including cursor and selection positions, folds, and soft wraps. + */ +export class TextEditor { + id: number; + buffer: TextBuffer; + + // NOTE: undocumented within the public API. Don't go down the rabbit hole. + constructor(options?: object); + + // Event Subscription + /** Calls your callback when the buffer's title has changed. */ + onDidChangeTitle(callback: (title: string) => void): Disposable; + + /** Calls your callback when the buffer's path, and therefore title, has changed. */ + onDidChangePath(callback: (path: string) => void): Disposable; + + /** + * Invoke the given callback synchronously when the content of the buffer + * changes. + */ + onDidChange(callback: (event: EditorChangedEvent[]) => void): Disposable; + + /** + * Invoke callback when the buffer's contents change. It is emit + * asynchronously 300ms after the last buffer change. This is a good place + * to handle changes to the buffer without compromising typing performance. + */ + onDidStopChanging(callback: (event: BufferStoppedChangingEvent) => void): Disposable; + + /** + * Calls your callback when a Cursor is moved. If there are multiple cursors, + * your callback will be called for each cursor. + */ + onDidChangeCursorPosition(callback: (event: CursorPositionChangedEvent) => void): + Disposable; + + /** Calls your callback when a selection's screen range changes. */ + onDidChangeSelectionRange(callback: (event: SelectionChangedEvent) => void): Disposable; + + /** Invoke the given callback after the buffer is saved to disk. */ + onDidSave(callback: (event: { path: string }) => void): Disposable; + + /** Invoke the given callback when the editor is destroyed. */ + onDidDestroy(callback: () => void): Disposable; + + /** Retrieves the current TextBuffer. */ + getBuffer(): TextBuffer; + + /** + * Calls your callback when a Gutter is added to the editor. Immediately calls + * your callback for each existing gutter. + */ + observeGutters(callback: (gutter: Gutter) => void): Disposable; + + /** Calls your callback when a Gutter is added to the editor. */ + onDidAddGutter(callback: (gutter: Gutter) => void): Disposable; + + /** Calls your callback when a Gutter is removed from the editor. */ + onDidRemoveGutter(callback: (name: string) => void): Disposable; + + /** Calls your callback when soft wrap was enabled or disabled. */ + onDidChangeSoftWrapped(callback: (softWrapped: boolean) => void): Disposable; + + /** Calls your callback when the buffer's encoding has changed. */ + onDidChangeEncoding(callback: (encoding: string) => void): Disposable; + + /** + * Calls your callback when the grammar that interprets and colorizes the text + * has been changed. Immediately calls your callback with the current grammar. + */ + observeGrammar(callback: (grammar: Grammar) => void): Disposable; + + /** + * Calls your callback when the grammar that interprets and colorizes the text + * has been changed. + */ + onDidChangeGrammar(callback: (grammar: Grammar) => void): Disposable; + + /** Calls your callback when the result of ::isModified changes. */ + onDidChangeModified(callback: (modified: boolean) => void): Disposable; + + /** + * Calls your callback when the buffer's underlying file changes on disk at a + * moment when the result of ::isModified is true. + */ + onDidConflict(callback: () => void): Disposable; + + /** Calls your callback before text has been inserted. */ + onWillInsertText(callback: (event: { text: string, cancel(): void }) => void): Disposable; + + /** Calls your callback after text has been inserted. */ + onDidInsertText(callback: (event: { text: string }) => void): Disposable; + + /** + * Calls your callback when a Cursor is added to the editor. Immediately calls + * your callback for each existing cursor. + */ + observeCursors(callback: (cursor: Cursor) => void): Disposable; + + /** Calls your callback when a Cursor is added to the editor. */ + onDidAddCursor(callback: (cursor: Cursor) => void): Disposable; + + /** Calls your callback when a Cursor is removed from the editor. */ + onDidRemoveCursor(callback: (cursor: Cursor) => void): Disposable; + + /** + * Calls your callback when a Selection is added to the editor. Immediately + * calls your callback for each existing selection. + */ + observeSelections(callback: (selection: Selection) => void): Disposable; + + /** Calls your callback when a Selection is added to the editor. */ + onDidAddSelection(callback: (selection: Selection) => void): Disposable; + + /** Calls your callback when a Selection is removed from the editor. */ + onDidRemoveSelection(callback: (selection: Selection) => void): Disposable; + + /** + * Calls your callback with each Decoration added to the editor. Calls your + * callback immediately for any existing decorations. + */ + observeDecorations(callback: (decoration: Decoration) => void): Disposable; + + /** Calls your callback when a Decoration is added to the editor. */ + onDidAddDecoration(callback: (decoration: Decoration) => void): Disposable; + + /** Calls your callback when a Decoration is removed from the editor. */ + onDidRemoveDecoration(callback: (decoration: Decoration) => void): Disposable; + + /** Calls your callback when the placeholder text is changed. */ + onDidChangePlaceholderText(callback: (placeholderText: string) => void): Disposable; + + // File Details + /** + * Get the editor's title for display in other parts of the UI such as the tabs. + * If the editor's buffer is saved, its title is the file name. If it is unsaved, + * its title is "untitled". + */ + getTitle(): string; + + /** + * Get unique title for display in other parts of the UI, such as the window title. + * If the editor's buffer is unsaved, its title is "untitled" If the editor's + * buffer is saved, its unique title is formatted as one of the following, + * + * "" when it is the only editing buffer with this file name. + * " — " when other buffers have this file name. + */ + getLongTitle(): string; + + /** Returns the string path of this editor's text buffer. */ + getPath(): string|undefined; + + /** Returns boolean true if this editor has been modified. */ + isModified(): boolean; + + /** Returns boolean true if this editor has no content. */ + isEmpty(): boolean; + + /** Returns the string character set encoding of this editor's text buffer. */ + getEncoding(): string; + + /** Set the character set encoding to use in this editor's text buffer. */ + setEncoding(encoding: string): void; + + // File Operations + /** + * Saves the editor's text buffer. + * See TextBuffer::save for more details. + */ + save(): Promise; + + /** + * Saves the editor's text buffer as the given path. + * See TextBuffer::saveAs for more details. + */ + saveAs(filePath: string): Promise; + + // Reading Text + /** Returns a string representing the entire contents of the editor. */ + getText(): string; + + /** Get the text in the given range in buffer coordinates. */ + getTextInBufferRange(range: RangeCompatible): string; + + /** Returns a number representing the number of lines in the buffer. */ + getLineCount(): number; + + /** + * Returns a number representing the number of screen lines in the editor. + * This accounts for folds. + */ + getScreenLineCount(): number; + + /** + * Returns a number representing the last zero-indexed buffer row number of + * the editor. + */ + getLastBufferRow(): number; + + /** + * Returns a number representing the last zero-indexed screen row number of + * the editor. + */ + getLastScreenRow(): number; + + /** + * Returns a string representing the contents of the line at the given + * buffer row. + */ + lineTextForBufferRow(bufferRow: number): string; + + /** + * Returns a string representing the contents of the line at the given + * screen row. + */ + lineTextForScreenRow(screenRow: number): string; + + /** Get the range of the paragraph surrounding the most recently added cursor. */ + getCurrentParagraphBufferRange(): Range; + + // Mutating Text + /** Replaces the entire contents of the buffer with the given string. */ + setText(text: string): void; + + /** Set the text in the given Range in buffer coordinates. */ + setTextInBufferRange(range: RangeCompatible, text: string, options?: + { normalizeLineEndings?: boolean, undo?: "skip" }): void; + + /* For each selection, replace the selected text with the given text. */ + insertText(text: string, options?: { + select?: boolean, + autoIndent?: boolean, + autoIndentNewline?: boolean, + autoDecreaseIndent?: boolean, + normalizeLineEndings?: boolean, + undo?: "skip" + }): Range|boolean; + + /** For each selection, replace the selected text with a newline. */ + insertNewline(): void; + + /** + * For each selection, if the selection is empty, delete the character following + * the cursor. Otherwise delete the selected text. + */ + delete(): void; + + /** + * For each selection, if the selection is empty, delete the character preceding + * the cursor. Otherwise delete the selected text. + */ + backspace(): void; + + /** + * Mutate the text of all the selections in a single transaction. + * All the changes made inside the given function can be reverted with a single + * call to ::undo. + */ + mutateSelectedText(fn: (selection: Selection, index: number) => void): void; + + /** + * For each selection, transpose the selected text. + * If the selection is empty, the characters preceding and following the cursor + * are swapped. Otherwise, the selected characters are reversed. + */ + transpose(): 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; + + /** + * 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; + + /** + * Toggle line comments for rows intersecting selections. + * If the current grammar doesn't support comments, does nothing. + */ + toggleLineCommentsInSelection(): void; + + /** For each cursor, insert a newline at beginning the following line. */ + insertNewlineBelow(): void; + + /** For each cursor, insert a newline at the end of the preceding line. */ + insertNewlineAbove(): 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; + + /** + * Similar to ::deleteToBeginningOfWord, but deletes only back to the previous + * word boundary. + */ + deleteToPreviousWordBoundary(): void; + + /** Similar to ::deleteToEndOfWord, but deletes only up to the next word boundary. */ + deleteToNextWordBoundary(): 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** Delete all lines intersecting selections. */ + deleteLine(): void; + + // History + /** Undo the last change. */ + undo(): void; + + /** Redo the last change. */ + redo(): void; + + /** + * Batch multiple operations as a single undo/redo step. + * Any group of operations that are logically grouped from the perspective of undoing + * and redoing should be performed in a transaction. If you want to abort the transaction, + * call ::abortTransaction to terminate the function's execution and revert any changes + * performed up to the abortion. + */ + transact(fn: () => void): void; + /** + * Batch multiple operations as a single undo/redo step. + * Any group of operations that are logically grouped from the perspective of undoing + * and redoing should be performed in a transaction. If you want to abort the transaction, + * call ::abortTransaction to terminate the function's execution and revert any changes + * performed up to the abortion. + */ + transact(groupingInterval: number, fn: () => void): void; + + /** + * Abort an open transaction, undoing any operations performed so far within the + * transaction. + */ + abortTransaction(): void; + + /** + * Create a pointer to the current state of the buffer for use with ::revertToCheckpoint + * and ::groupChangesSinceCheckpoint. + */ + createCheckpoint(): number; + + /** + * Revert the buffer to the state it was in when the given checkpoint was created. + * The redo stack will be empty following this operation, so changes since the checkpoint + * will be lost. If the given checkpoint is no longer present in the undo history, no + * changes will be made to the buffer and this method will return false. + */ + revertToCheckpoint(checkpoint: number): boolean; + + /** + * Group all changes since the given checkpoint into a single transaction for purposes + * of undo/redo. + * If the given checkpoint is no longer present in the undo history, no grouping will be + * performed and this method will return false. + */ + groupChangesSinceCheckpoint(checkpoint: number): boolean; + + // TextEditor Coordinates + /** Convert a position in buffer-coordinates to screen-coordinates. */ + screenPositionForBufferPosition(bufferPosition: PointCompatible, options?: + { clipDirection?: "backward"|"forward"|"closest"}): Point; + + /** Convert a position in screen-coordinates to buffer-coordinates. */ + bufferPositionForScreenPosition(bufferPosition: PointCompatible, options?: + { clipDirection?: "backward"|"forward"|"closest"}): Point; + + /** Convert a range in buffer-coordinates to screen-coordinates. */ + screenRangeForBufferRange(bufferRange: RangeCompatible): Range; + + /** Convert a range in screen-coordinates to buffer-coordinates. */ + bufferRangeForScreenRange(screenRange: RangeCompatible): Range; + + /** Clip the given Point to a valid position in the buffer. */ + clipBufferPosition(bufferPosition: PointCompatible): Point; + + /** + * Clip the start and end of the given range to valid positions in the buffer. + * See ::clipBufferPosition for more information. + */ + clipBufferRange(range: RangeCompatible): Range; + + /** Clip the given Point to a valid position on screen. */ + clipScreenPosition(screenPosition: PointCompatible, options?: + { clipDirection?: "backward"|"forward"|"closest"}): Point; + + /** + * Clip the start and end of the given range to valid positions on screen. + * See ::clipScreenPosition for more information. + */ + clipScreenRange(range: RangeCompatible, options?: { clipDirection?: + "backward"|"forward"|"closest"}): Range; + + // Decorations + /** + * Add a decoration that tracks a DisplayMarker. When the marker moves, is + * invalidated, or is destroyed, the decoration will be updated to reflect + * the marker's state. + */ + decorateMarker(marker: DisplayMarker, decorationParams: DecorationOptions): Decoration; + + /** + * Add a decoration to every marker in the given marker layer. Can be used to + * decorate a large number of markers without having to create and manage many + * individual decorations. + */ + decorateMarkerLayer(markerLayer: MarkerLayer|DisplayMarkerLayer, + decorationParams: DecorationLayerOptions): LayerDecoration; + + /** Get all decorations. */ + getDecorations(propertyFilter?: DecorationOptions): Decoration[]; + + /** Get all decorations of type 'line'. */ + getLineDecorations(propertyFilter?: DecorationOptions): Decoration[]; + + /** Get all decorations of type 'line-number'. */ + getLineNumberDecorations(propertyFilter?: DecorationOptions): Decoration[]; + + /** Get all decorations of type 'highlight'. */ + getHighlightDecorations(propertyFilter?: DecorationOptions): Decoration[]; + + /** Get all decorations of type 'overlay'. */ + getOverlayDecorations(propertyFilter?: DecorationOptions): Decoration[]; + + // Markers + /** + * Create a marker on the default marker layer with the given range in buffer coordinates. + * This marker will maintain its logical location as the buffer is changed, so if you mark + * a particular word, the marker will remain over that word even if the word's location + * in the buffer changes. + */ + markBufferRange(range: RangeCompatible, properties?: { + maintainHistory?: boolean, + reversed?: boolean, + invalidate?: "never"|"surround"|"overlap"|"inside"|"touch", + }): DisplayMarker; + + /** + * Create a marker on the default marker layer with the given range in screen coordinates. + * This marker will maintain its logical location as the buffer is changed, so if you mark + * a particular word, the marker will remain over that word even if the word's location in + * the buffer changes. + */ + markScreenRange(range: RangeCompatible, properties?: { + maintainHistory?: boolean, reversed?: boolean, + invalidate?: "never"|"surround"|"overlap"|"inside" |"touch", + }): DisplayMarker; + + /** + * Create a marker on the default marker layer with the given buffer position and no tail. + * To group multiple markers together in their own private layer, see ::addMarkerLayer. + */ + markBufferPosition(bufferPosition: PointCompatible, options?: { + invalidate?: "never"|"surround"|"overlap"|"inside"|"touch", + }): DisplayMarker; + + /** + * Create a marker on the default marker layer with the given screen position and no tail. + * To group multiple markers together in their own private layer, see ::addMarkerLayer. + */ + markScreenPosition(screenPosition: PointCompatible, options?: { + invalidate?: "never"|"surround"|"overlap"|"inside"|"touch", + clipDirection?: "backward"|"forward"|"closest", + }): DisplayMarker; + + /** + * Find all DisplayMarkers on the default marker layer that match the given properties. + * + * This method finds markers based on the given properties. Markers can be associated + * with custom properties that will be compared with basic equality. In addition, there + * are several special properties that will be compared with the range of the markers + * rather than their properties. + */ + findMarkers(properties: FindDisplayMarkerOptions): DisplayMarker[]; + + /** Create a marker layer to group related markers. */ + addMarkerLayer(options?: { maintainHistory?: boolean, persistent?: boolean }): + DisplayMarkerLayer; + + /** Get a DisplayMarkerLayer by id. */ + getMarkerLayer(id: number): DisplayMarkerLayer|undefined; + + /** + * Get the default DisplayMarkerLayer. + * All marker APIs not tied to an explicit layer interact with this default layer. + */ + getDefaultMarkerLayer(): DisplayMarkerLayer; + + /** Get the DisplayMarker on the default layer for the given marker id. */ + getMarker(id: number): DisplayMarker; + + /** Get all DisplayMarkers on the default marker layer. Consider using ::findMarkers. */ + getMarkers(): DisplayMarker[]; + + /** Get the number of markers in the default marker layer. */ + getMarkerCount(): number; + + // Cursors + /** Get the position of the most recently added cursor in buffer coordinates. */ + getCursorBufferPosition(): Point; + + /** Get the position of all the cursor positions in buffer coordinates. */ + getCursorBufferPositions(): Point[]; + + /** + * Move the cursor to the given position in buffer coordinates. + * If there are multiple cursors, they will be consolidated to a single cursor. + */ + setCursorBufferPosition(position: PointCompatible, options?: { autoscroll?: boolean }): + void; + + /** Get a Cursor at given screen coordinates Point. */ + getCursorAtScreenPosition(position: PointCompatible): Cursor|undefined; + + /** Get the position of the most recently added cursor in screen coordinates. */ + getCursorScreenPosition(): Point; + + /** Get the position of all the cursor positions in screen coordinates. */ + getCursorScreenPositions(): Point[]; + + /** + * Move the cursor to the given position in screen coordinates. + * If there are multiple cursors, they will be consolidated to a single cursor. + */ + setCursorScreenPosition(position: PointCompatible, options?: { autoscroll?: boolean }): + void; + + /** Add a cursor at the given position in buffer coordinates. */ + addCursorAtBufferPosition(bufferPosition: PointCompatible): Cursor; + + /** Add a cursor at the position in screen coordinates. */ + addCursorAtScreenPosition(screenPosition: PointCompatible): Cursor; + + /** Returns a boolean indicating whether or not there are multiple cursors. */ + hasMultipleCursors(): boolean; + + /** Move every cursor up one row in screen coordinates. */ + moveUp(lineCount?: number): void; + + /** Move every cursor down one row in screen coordinates. */ + moveDown(lineCount?: number): void; + + /** Move every cursor left one column. */ + moveLeft(columnCount?: number): void; + + /** Move every cursor right one column. */ + moveRight(columnCount?: number): void; + + /** Move every cursor to the beginning of its line in buffer coordinates. */ + moveToBeginningOfLine(): void; + + /** Move every cursor to the beginning of its line in screen coordinates. */ + moveToBeginningOfScreenLine(): void; + + /** Move every cursor to the first non-whitespace character of its line. */ + moveToFirstCharacterOfLine(): void; + + /** Move every cursor to the end of its line in buffer coordinates. */ + moveToEndOfLine(): void; + + /** Move every cursor to the end of its line in screen coordinates. */ + moveToEndOfScreenLine(): void; + + /** Move every cursor to the beginning of its surrounding word. */ + moveToBeginningOfWord(): void; + + /** Move every cursor to the end of its surrounding word. */ + moveToEndOfWord(): void; + + /** + * Move every cursor to the top of the buffer. + * If there are multiple cursors, they will be merged into a single cursor. + */ + moveToTop(): void; + + /** + * Move every cursor to the bottom of the buffer. + * If there are multiple cursors, they will be merged into a single cursor. + */ + moveToBottom(): void; + + /** Move every cursor to the beginning of the next word. */ + moveToBeginningOfNextWord(): void; + + /** Move every cursor to the previous word boundary. */ + moveToPreviousWordBoundary(): void; + + /** Move every cursor to the next word boundary. */ + moveToNextWordBoundary(): void; + + /** Move every cursor to the previous subword boundary. */ + moveToPreviousSubwordBoundary(): void; + + /** Move every cursor to the next subword boundary. */ + moveToNextSubwordBoundary(): void; + + /** Move every cursor to the beginning of the next paragraph. */ + moveToBeginningOfNextParagraph(): void; + + /** Move every cursor to the beginning of the previous paragraph. */ + moveToBeginningOfPreviousParagraph(): void; + + /** Returns the most recently added Cursor. */ + getLastCursor(): Cursor; + + /** Returns the word surrounding the most recently added cursor. */ + getWordUnderCursor(options?: { + wordRegex?: RegExp, + includeNonWordCharacters?: boolean, + allowPrevious?: boolean, + }): string; + + /** Get an Array of all Cursors. */ + getCursors(): Cursor[]; + + /** + * Get all Cursorss, ordered by their position in the buffer instead of the + * order in which they were added. + */ + getCursorsOrderedByBufferPosition(): Cursor[]; + + // Selections + /** Get the selected text of the most recently added selection. */ + getSelectedText(): string; + + /** Get the Range of the most recently added selection in buffer coordinates. */ + getSelectedBufferRange(): Range; + + /** + * Get the Ranges of all selections in buffer coordinates. + * The ranges are sorted by when the selections were added. Most recent at the end. + */ + getSelectedBufferRanges(): Range[]; + + /** + * Set the selected range in buffer coordinates. If there are multiple selections, + * they are reduced to a single selection with the given range. + */ + setSelectedBufferRange(bufferRange: RangeCompatible, options?: + { reversed?: boolean, preserveFolds?: boolean}): void; + + /** + * Set the selected ranges in buffer coordinates. If there are multiple selections, + * they are replaced by new selections with the given ranges. + */ + setSelectedBufferRanges(bufferRanges: ReadonlyArray, options?: + { reversed?: boolean, preserveFolds?: boolean}): void; + + /** Get the Range of the most recently added selection in screen coordinates. */ + getSelectedScreenRange(): Range; + + /** + * Get the Ranges of all selections in screen coordinates. + * The ranges are sorted by when the selections were added. Most recent at the end. + */ + getSelectedScreenRanges(): Range[]; + + /** + * Set the selected range in screen coordinates. If there are multiple selections, + * they are reduced to a single selection with the given range. + */ + setSelectedScreenRange(screenRange: RangeCompatible, options?: { reversed?: boolean }): + void; + + /** + * Set the selected ranges in screen coordinates. If there are multiple selections, + * they are replaced by new selections with the given ranges. + */ + setSelectedScreenRanges(screenRanges: ReadonlyArray, options?: + { reversed?: boolean }): void; + + /** Add a selection for the given range in buffer coordinates. */ + addSelectionForBufferRange(bufferRange: RangeCompatible, options?: + { reversed?: boolean, preserveFolds?: boolean }): Selection; + + /** Add a selection for the given range in screen coordinates. */ + addSelectionForScreenRange(screenRange: RangeCompatible, options?: + { reversed?: boolean, preserveFolds?: boolean }): Selection; + + /** + * Select from the current cursor position to the given position in buffer coordinates. + * This method may merge selections that end up intersecting. + */ + selectToBufferPosition(position: PointCompatible): void; + + /** + * Select from the current cursor position to the given position in screen coordinates. + * This method may merge selections that end up intersecting. + */ + selectToScreenPosition(position: PointCompatible): void; + + /** + * Move the cursor of each selection one character upward while preserving the + * selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectUp(rowCount?: number): void; + + /** + * Move the cursor of each selection one character downward while preserving + * the selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectDown(rowCount?: number): void; + + /** + * Move the cursor of each selection one character leftward while preserving + * the selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectLeft(columnCount?: number): void; + + /** + * Move the cursor of each selection one character rightward while preserving + * the selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectRight(columnCount?: number): void; + + /** + * Select from the top of the buffer to the end of the last selection in the buffer. + * This method merges multiple selections into a single selection. + */ + selectToTop(): void; + + /** + * Selects from the top of the first selection in the buffer to the end of the buffer. + * This method merges multiple selections into a single selection. + */ + selectToBottom(): void; + + /** + * Select all text in the buffer. + * This method merges multiple selections into a single selection. + */ + selectAll(): void; + + /** + * Move the cursor of each selection to the beginning of its line while preserving + * the selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectToBeginningOfLine(): void; + + /** + * Move the cursor of each selection to the first non-whitespace character of its + * line while preserving the selection's tail position. If the cursor is already + * on the first character of the line, move it to the beginning of the line. + * This method may merge selections that end up intersecting. + */ + selectToFirstCharacterOfLine(): void; + + /** + * Move the cursor of each selection to the end of its line while preserving the + * selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectToEndOfLine(): void; + + /** + * Expand selections to the beginning of their containing word. + * Operates on all selections. Moves the cursor to the beginning of the containing + * word while preserving the selection's tail position. + */ + selectToBeginningOfWord(): void; + + /** + * Expand selections to the end of their containing word. + * Operates on all selections. Moves the cursor to the end of the containing word + * while preserving the selection's tail position. + */ + selectToEndOfWord(): void; + + /** + * For each cursor, select the containing line. + * This method merges selections on successive lines. + */ + selectLinesContainingCursors(): void; + + /** Select the word surrounding each cursor. */ + selectWordsContainingCursors(): void; + + /** + * For each selection, move its cursor to the preceding subword boundary while + * maintaining the selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectToPreviousSubwordBoundary(): void; + + /** + * For each selection, move its cursor to the next subword boundary while maintaining + * the selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectToNextSubwordBoundary(): void; + + /** + * For each selection, move its cursor to the preceding word boundary while + * maintaining the selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectToPreviousWordBoundary(): void; + + /** + * For each selection, move its cursor to the next word boundary while maintaining + * the selection's tail position. + * This method may merge selections that end up intersecting. + */ + selectToNextWordBoundary(): void; + + /** + * Expand selections to the beginning of the next word. + * Operates on all selections. Moves the cursor to the beginning of the next word + * while preserving the selection's tail position. + */ + selectToBeginningOfNextWord(): void; + + /** + * Expand selections to the beginning of the next paragraph. + * Operates on all selections. Moves the cursor to the beginning of the next + * paragraph while preserving the selection's tail position. + */ + selectToBeginningOfNextParagraph(): void; + + /** + * Expand selections to the beginning of the next paragraph. + * Operates on all selections. Moves the cursor to the beginning of the next + * paragraph while preserving the selection's tail position. + */ + selectToBeginningOfPreviousParagraph(): void; + + /** Select the range of the given marker if it is valid. */ + selectMarker(marker: DisplayMarker): Range|undefined; + + /** Get the most recently added Selection. */ + getLastSelection(): Selection; + + /** Get current Selections. */ + getSelections(): Selection[]; + + /** + * Get all Selections, ordered by their position in the buffer instead of the + * order in which they were added. + */ + getSelectionsOrderedByBufferPosition(): Selection[]; + + // NOTE: this calls into Selection::intersectsBufferRange, which itself calls + // into Range::intersectsWith. Range::intersectsWith is one of the few functions + // which does NOT take a range-compatible array. + /** Determine if a given range in buffer coordinates intersects a selection. */ + selectionIntersectsBufferRange(bufferRange: RangeLike): boolean; + + // Searching and Replacing + /** + * Scan regular expression matches in the entire buffer, calling the given + * iterator function on each match. + * + * ::scan functions as the replace method as well via the replace. + */ + scan(regex: RegExp, options: ScanContextOptions, iterator: (params: + ContextualBufferScanResult) => void): void; + /** + * Scan regular expression matches in the entire buffer, calling the given + * iterator function on each match. + * + * ::scan functions as the replace method as well via the replace. + */ + scan(regex: RegExp, iterator: (params: BufferScanResult) => void): void; + + /** + * Scan regular expression matches in a given range, calling the given iterator. + * function on each match. + */ + scanInBufferRange(regex: RegExp, range: RangeCompatible, iterator: + (params: BufferScanResult) => void): void; + + /** + * Scan regular expression matches in a given range in reverse order, calling the + * given iterator function on each match. + */ + backwardsScanInBufferRange(regex: RegExp, range: RangeCompatible, + iterator: (params: BufferScanResult) => void): void; + + // Tab Behavior + /** Returns a boolean indicating whether softTabs are enabled for this editor. */ + getSoftTabs(): boolean; + + /** Enable or disable soft tabs for this editor. */ + setSoftTabs(softTabs: boolean): void; + + /** Toggle soft tabs for this editor. */ + toggleSoftTabs(): boolean; + + /** Get the on-screen length of tab characters. */ + getTabLength(): number; + + /** + * Set the on-screen length of tab characters. Setting this to a number will + * override the editor.tabLength setting. + */ + setTabLength(tabLength: number): void; + + /** Determine if the buffer uses hard or soft tabs. */ + usesSoftTabs(): boolean|undefined; + + /** + * Get the text representing a single level of indent. + * If soft tabs are enabled, the text is composed of N spaces, where N is the + * tab length. Otherwise the text is a tab character (\t). + */ + getTabText(): string; + + // Soft Wrap Behavior + /** Determine whether lines in this editor are soft-wrapped. */ + isSoftWrapped(): boolean; + + /** Enable or disable soft wrapping for this editor. */ + setSoftWrapped(softWrapped: boolean): boolean; + + /** Toggle soft wrapping for this editor. */ + toggleSoftWrapped(): boolean; + + /** Gets the column at which column will soft wrap. */ + getSoftWrapColumn(): number; + + // Indentation + /** + * Get the indentation level of the given buffer row. + * Determines how deeply the given row is indented based on the soft tabs and tab + * length settings of this editor. Note that if soft tabs are enabled and the tab + * length is 2, a row with 4 leading spaces would have an indentation level of 2. + */ + indentationForBufferRow(bufferRow: number): number; + + /** + * Set the indentation level for the given buffer row. + * Inserts or removes hard tabs or spaces based on the soft tabs and tab length settings + * of this editor in order to bring it to the given indentation level. Note that if soft + * tabs are enabled and the tab length is 2, a row with 4 leading spaces would have an + * indentation level of 2. + */ + setIndentationForBufferRow(bufferRow: number, newLevel: number, options?: + { preserveLeadingWhitespace?: boolean }): void; + + /** Indent rows intersecting selections by one level. */ + indentSelectedRows(): void; + + /** Outdent rows intersecting selections by one level. */ + outdentSelectedRows(): void; + + /** + * Get the indentation level of the given line of text. + * Determines how deeply the given line is indented based on the soft tabs and tab length + * settings of this editor. Note that if soft tabs are enabled and the tab length is 2, + * a row with 4 leading spaces would have an indentation level of 2. + */ + indentLevelForLine(line: string): number; + + /** Indent rows intersecting selections based on the grammar's suggested indent level. */ + autoIndentSelectedRows(): void; + + // Grammars + /** Get the current Grammar of this editor. */ + getGrammar(): Grammar; + + /** + * Set the current Grammar of this editor. + * Assigning a grammar will cause the editor to re-tokenize based on the new grammar. + */ + setGrammar(grammar: Grammar): void; + + // Managing Syntax Scopes + /** + * Returns a ScopeDescriptor that includes this editor's language. + * e.g. [".source.ruby"], or [".source.coffee"]. + */ + getRootScopeDescriptor(): ScopeDescriptor; + + /** Get the syntactic scopeDescriptor for the given position in buffer coordinates. */ + scopeDescriptorForBufferPosition(bufferPosition: PointCompatible): ScopeDescriptor; + + /** + * Get the range in buffer coordinates of all tokens surrounding the cursor + * that match the given scope selector. + */ + bufferRangeForScopeAtCursor(scopeSelector: string): Range; + + /** Determine if the given row is entirely a comment. */ + isBufferRowCommented(bufferRow: number): boolean; + + // Clipboard Operations + /** For each selection, copy the selected text. */ + copySelectedText(): void; + + /** For each selection, cut the selected text. */ + cutSelectedText(): void; + + /** + * For each selection, replace the selected text with the contents of the clipboard. + * If the clipboard contains the same number of selections as the current editor, + * each selection will be replaced with the content of the corresponding clipboard + * selection text. + */ + pasteText(options?: TextInsertionOptions): 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; + + /** + * 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; + + // Folds + /** + * Fold the most recent cursor's row based on its indentation level. + * The fold will extend from the nearest preceding line with a lower indentation + * level up to the nearest following row with a lower indentation level. + */ + foldCurrentRow(): void; + + /** Unfold the most recent cursor's row by one level. */ + unfoldCurrentRow(): void; + + /** + * Fold the given row in buffer coordinates based on its indentation level. + * If the given row is foldable, the fold will begin there. Otherwise, it will + * begin at the first foldable row preceding the given row. + */ + foldBufferRow(bufferRow: number): void; + + /** Unfold all folds containing the given row in buffer coordinates. */ + unfoldBufferRow(bufferRow: number): void; + + /** For each selection, fold the rows it intersects. */ + foldSelectedLines(): void; + + /** Fold all foldable lines. */ + foldAll(): void; + + /** Unfold all existing folds. */ + unfoldAll(): void; + + /** Fold all foldable lines at the given indent level. */ + foldAllAtIndentLevel(level: number): void; + + /** + * Determine whether the given row in buffer coordinates is foldable. + * A foldable row is a row that starts a row range that can be folded. + */ + isFoldableAtBufferRow(bufferRow: number): boolean; + + /** + * Determine whether the given row in screen coordinates is foldable. + * A foldable row is a row that starts a row range that can be folded. + */ + isFoldableAtScreenRow(bufferRow: number): boolean; + + /** Fold the given buffer row if it isn't currently folded, and unfold it otherwise. */ + toggleFoldAtBufferRow(bufferRow: number): void; + + /** Determine whether the most recently added cursor's row is folded. */ + isFoldedAtCursorRow(): boolean; + + /** Determine whether the given row in buffer coordinates is folded. */ + isFoldedAtBufferRow(bufferRow: number): boolean; + + /** Determine whether the given row in screen coordinates is folded. */ + isFoldedAtScreenRow(screenRow: number): boolean; + + // Gutters + /** Add a custom Gutter. */ + addGutter(options: { + name: string, + priority?: number, + visible?: boolean, + }): Gutter; + + /** Get this editor's gutters. */ + getGutters(): Gutter[]; + + /** Get the gutter with the given name. */ + gutterWithName(name: string): Gutter|null; + + // Scrolling the TextEditor + /** Scroll the editor to reveal the most recently added cursor if it is off-screen. */ + scrollToCursorPosition(options?: { center?: boolean }): void; + + /** Scrolls the editor to the given buffer position. */ + scrollToBufferPosition(bufferPosition: PointCompatible, options?: { center?: boolean }): + void; + + /** Scrolls the editor to the given screen position. */ + scrollToScreenPosition(screenPosition: PointCompatible, options?: { center?: boolean }): + void; + + // TextEditor Rendering + /** Retrieves the rendered line height in pixels. */ + getLineHeightInPixels(): number; + + /** Retrieves the greyed out placeholder of a mini editor. */ + getPlaceholderText(): string; + + /** + * Set the greyed out placeholder of a mini editor. Placeholder text will be + * displayed when the editor has no content. + */ + setPlaceholderText(placeholderText: string): void; +} + +/** Experimental: This global registry tracks registered TextEditors. */ +export interface TextEditorRegistry { + // Managing Text Editors + /** Remove all editors from the registry. */ + clear(): void; + + /** Register a TextEditor. */ + add(editor: TextEditor): Disposable; + + /** Remove the given TextEditor from the registry. */ + remove(editor: TextEditor): boolean; + + /** Keep a TextEditor's configuration in sync with Atom's settings. */ + maintainConfig(editor: TextEditor): Disposable; + + /** + * Set a TextEditor's grammar based on its path and content, and continue + * to update its grammar as gramamrs are added or updated, or the editor's + * file path changes. + */ + maintainGrammar(editor: TextEditor): Disposable; + + /** + * Force a TextEditor to use a different grammar than the one that would + * otherwise be selected for it. + */ + setGrammarOverride(editor: TextEditor, scopeName: string): void; + + /** + * Retrieve the grammar scope name that has been set as a grammar override + * for the given TextEditor. + */ + getGrammarOverride(editor: TextEditor): string|null; + + /** Remove any grammar override that has been set for the given TextEditor. */ + clearGrammarOverride(editor: TextEditor): void; + + // Event Subscription + /** Invoke the given callback with all the current and future registered TextEditors. */ + observe(callback: (editor: TextEditor) => void): Disposable; +} + +/** Associates tooltips with HTML elements or selectors. */ +export interface TooltipManager { + /** Add a tooltip to the given element. */ + add(target: HTMLElement, options: { + title?: string, + html?: boolean, + item?: HTMLElement|{ element: HTMLElement }, + class?: string, + placement?: "top"|"bottom"|"left"|"right"|"auto"|(() => string), + trigger?: "click"|"hover"|"focus"|"manual", + delay?: { show: number, hide: number }, + keyBindingCommand?: string, + keyBindingTarget?: HTMLElement + } | { + title?: string|(() => string), + html?: boolean, + item?: HTMLElement|{ element: HTMLElement }, + class?: string, + placement?: "top"|"bottom"|"left"|"right"|"auto"|(() => string), + trigger?: "click"|"hover"|"focus"|"manual", + delay?: { show: number, hide: number }, + }): Disposable; + + /** Find the tooltips that have been applied to the given element. */ + findTooltips(target: HTMLElement): Tooltip[]; +} + +/** + * ViewRegistry handles the association between model and view types in Atom. + * We call this association a View Provider. As in, for a given model, this class + * can provide a view via ::getView, as long as the model/view association was + * registered via ::addViewProvider. + */ +export interface ViewRegistry { + /** + * Add a provider that will be used to construct views in the workspace's view + * layer based on model objects in its model layer. + */ + addViewProvider(createView: (model: object) => HTMLElement|undefined): Disposable; + /** + * Add a provider that will be used to construct views in the workspace's view + * layer based on model objects in its model layer. + */ + // tslint:disable-next-line:no-any + addViewProvider(modelConstructor: { new (...args: any[]): T }, createView: + (instance: T) => HTMLElement|undefined): Disposable; + + /** Get the view associated with an object in the workspace. */ + getView(obj: object): HTMLElement; +} + +/** Represents the state of the user interface for the entire window. */ +export interface Workspace { + // Event Subscription + /** + * Invoke the given callback with all current and future text editors in + * the workspace. + */ + observeTextEditors(callback: (editor: TextEditor) => void): Disposable; + + /** + * Invoke the given callback with all current and future panes items in the + * workspace. + */ + observePaneItems(callback: (item: object) => void): Disposable; + + /** Invoke the given callback when the active pane item changes. */ + onDidChangeActivePaneItem(callback: (item: object) => void): Disposable; + + /** Invoke the given callback when the active pane item stops changing. */ + onDidStopChangingActivePaneItem(callback: (item: object) => void): Disposable; + + /** + * Invoke the given callback when a text editor becomes the active text editor and + * when there is no longer an active text editor. + */ + onDidChangeActiveTextEditor(callback: (editor?: TextEditor) => void): Disposable; + + /** + * Invoke the given callback with the current active pane item and with all + * future active pane items in the workspace. + */ + observeActivePaneItem(callback: (item: object) => void): Disposable; + + /** + * Invoke the given callback with the current active text editor (if any), with all + * future active text editors, and when there is no longer an active text editor. + */ + observeActiveTextEditor(callback: (editor?: TextEditor) => void): Disposable; + + /** + * Invoke the given callback whenever an item is opened. Unlike ::onDidAddPaneItem, + * observers will be notified for items that are already present in the workspace + * when they are reopened. + */ + onDidOpen(callback: (event: PaneItemOpenedEvent) => void): Disposable; + + /** Invoke the given callback when a pane is added to the workspace. */ + onDidAddPane(callback: (event: { pane: Pane }) => void): Disposable; + + /** Invoke the given callback before a pane is destroyed in the workspace. */ + onWillDestroyPane(callback: (event: { pane: Pane }) => void): Disposable; + + /** Invoke the given callback when a pane is destroyed in the workspace. */ + onDidDestroyPane(callback: (event: { pane: Pane }) => void): Disposable; + + /** Invoke the given callback with all current and future panes in the workspace. */ + observePanes(callback: (pane: Pane) => void): Disposable; + + /** Invoke the given callback when the active pane changes. */ + onDidChangeActivePane(callback: (pane: Pane) => void): Disposable; + + /** + * Invoke the given callback with the current active pane and when the + * active pane changes. + */ + observeActivePane(callback: (pane: Pane) => void): Disposable; + + /** Invoke the given callback when a pane item is added to the workspace. */ + onDidAddPaneItem(callback: (event: PaneItemObservedEvent) => void): Disposable; + + /** + * Invoke the given callback when a pane item is about to be destroyed, + * before the user is prompted to save it. + * @param callback The function to be called before pane items are destroyed. + * If this function returns a Promise, then the item will not be destroyed + * until the promise resolves. + */ + onWillDestroyPaneItem(callback: (event: PaneItemObservedEvent) => void|Promise): + Disposable; + + /** Invoke the given callback when a pane item is destroyed. */ + onDidDestroyPaneItem(callback: (event: PaneItemObservedEvent) => void): Disposable; + + /** Invoke the given callback when a text editor is added to the workspace. */ + onDidAddTextEditor(callback: (event: TextEditorObservedEvent) => void): Disposable; + + // Opening + /** + * Opens the given URI in Atom asynchronously. If the URI is already open, + * the existing item for that URI will be activated. If no URI is given, or + * no registered opener can open the URI, a new empty TextEditor will be created. + */ + open(uri: string, options?: WorkspaceOpenOptions): Promise; + /** + * Opens the given item in Atom asynchronously. If the item is already open, + * the existing item will be activated. If no item is given, a new empty TextEditor + * will be created. + */ + open(item: T, options?: WorkspaceOpenOptions): + Promise; + /** + * Opens the given URI in Atom asynchronously. If the URI is already open, + * the existing item for that URI will be activated. If no URI is given, or + * no registered opener can open the URI, a new empty TextEditor will be created. + */ + open(): Promise; + + /** + * Search the workspace for items matching the given URI and hide them. + * Returns a boolean indicating whether any items were found (and hidden). + */ + hide(itemOrURI: object|string): boolean; + + /** + * Search the workspace for items matching the given URI. If any are found, + * hide them. Otherwise, open the URL. + * Returns a Promise that resolves when the item is shown or hidden. + */ + toggle(itemOrURI: object|string): Promise; + + /** + * Creates a new item that corresponds to the provided URI. + * If no URI is given, or no registered opener can open the URI, a new empty TextEditor + * will be created. + */ + createItemForURI(uri: string): Promise; + + /** Returns a boolean that is true if object is a TextEditor. */ + isTextEditor(object: object): boolean; + + /** + * Asynchronously reopens the last-closed item's URI if it hasn't already + * been reopened. + */ + reopenItem(): Promise; + + /** Register an opener for a URI. */ + addOpener(opener: (uri: string, options?: WorkspaceOpenOptions) => + ViewModel|undefined): Disposable; + + /** Create a new text editor. */ + buildTextEditor(params: object): TextEditor; + + // Pane Items + /** Get all pane items in the workspace. */ + getPaneItems(): object[]; + + /** Get the active Pane's active item. */ + getActivePaneItem(): object; + + /** Get all text editors in the workspace. */ + getTextEditors(): TextEditor[]; + + /** Get the workspace center's active item if it is a TextEditor. */ + getActiveTextEditor(): TextEditor|undefined; + + // Panes + /** Get the most recently focused pane container. */ + getActivePaneContainer(): Dock|WorkspaceCenter; + + /** Get all panes in the workspace. */ + getPanes(): Pane[]; + + /** Get the active Pane. */ + getActivePane(): Pane; + + /** Make the next pane active. */ + activateNextPane(): boolean; + + /** Make the previous pane active. */ + activatePreviousPane(): boolean; + + /** Get the first pane container that contains an item with the given URI. */ + paneContainerForURI(uri: string): Dock|WorkspaceCenter|undefined; + + /** Get the first pane container that contains the given item. */ + paneContainerForItem(item: object): Dock|WorkspaceCenter|undefined; + + /** Get the first Pane with an item for the given URI. */ + paneForURI(uri: string): Pane|undefined; + + /** Get the Pane containing the given item. */ + paneForItem(item: object): Pane|undefined; + + // Pane Locations + /** Get the WorkspaceCenter at the center of the editor window. */ + getCenter(): WorkspaceCenter; + + /** Get the Dock to the left of the editor window. */ + getLeftDock(): Dock; + + /** Get the Dock to the right of the editor window. */ + getRightDock(): Dock; + + /** Get the Dock below the editor window. */ + getBottomDock(): Dock; + + /** Returns all Pane containers. */ + getPaneContainers(): [WorkspaceCenter, Dock, Dock, Dock]; + + // Panels + /** Get an Array of all the panel items at the bottom of the editor window. */ + getBottomPanels(): Panel[]; + + /** Adds a panel item to the bottom of the editor window. */ + addBottomPanel(options: { + item: T, + visible?: boolean, + priority?: number, + }): Panel; + + /** Get an Array of all the panel items to the left of the editor window. */ + getLeftPanels(): Panel[]; + + /** Adds a panel item to the left of the editor window. */ + addLeftPanel(options: { + item: T, + visible?: boolean, + priority?: number, + }): Panel; + + /** Get an Array of all the panel items to the right of the editor window. */ + getRightPanels(): Panel[]; + + /** Adds a panel item to the right of the editor window. */ + addRightPanel(options: { + item: T, + visible?: boolean, + priority?: number, + }): Panel; + + /** Get an Array of all the panel items at the top of the editor window. */ + getTopPanels(): Panel[]; + + /** Adds a panel item to the top of the editor window above the tabs. */ + addTopPanel(options: { + item: T, + visible?: boolean, + priority?: number + }): Panel; + + /** Get an Array of all the panel items in the header. */ + getHeaderPanels(): Panel[]; + + /** Adds a panel item to the header. */ + addHeaderPanel(options: { + item: T, + visible?: boolean, + priority?: number, + }): Panel; + + /** Get an Array of all the panel items in the footer. */ + getFooterPanels(): Panel[]; + + /** Adds a panel item to the footer. */ + addFooterPanel(options: { + item: T, + visible?: boolean, + priority?: number, + }): Panel; + + /** Get an Array of all the modal panel items. */ + getModalPanels(): Panel[]; + + /** Adds a panel item as a modal dialog. */ + addModalPanel(options: { + item: T, + visible?: boolean, + priority?: number, + autoFocus?: boolean, + }): Panel; + + /** + * Returns the Panel associated with the given item or null when the item + * has no panel. + */ + panelForItem(item: T): Panel|null; + + // Searching and Replacing + /** Performs a search across all files in the workspace. */ + scan(regex: RegExp, iterator: (result: ScandalResult) => void): + CancellablePromise; + /** Performs a search across all files in the workspace. */ + scan(regex: RegExp, options: WorkspaceScanOptions, iterator: + (result: ScandalResult) => void): CancellablePromise; + + /** Performs a replace across all the specified files in the project. */ + replace(regex: RegExp, replacementText: string, filePaths: ReadonlyArray, + iterator: (result: { filePath: string|undefined, replacements: number }) => void): + Promise; +} + +// https://github.com/atom/atom/blob/master/src/workspace-center.js +/** The central container for the editor window capable of holding items. */ +export interface WorkspaceCenter { + // Event Subscription + /** + * Invoke the given callback with all current and future text editors in the + * workspace center. + */ + observeTextEditors(callback: (editor: TextEditor) => void): Disposable; + + /** + * Invoke the given callback with all current and future panes items in the + * workspace center. + */ + observePaneItems(callback: (item: object) => void): Disposable; + + /** Invoke the given callback when the active pane item changes. */ + onDidChangeActivePaneItem(callback: (item: object) => void): Disposable; + + /** Invoke the given callback when the active pane item stops changing. */ + onDidStopChangingActivePaneItem(callback: (item: object) => void): Disposable; + + /** + * Invoke the given callback with the current active pane item and with all future + * active pane items in the workspace center. + */ + observeActivePaneItem(callback: (item: object) => void): Disposable; + + /** Invoke the given callback when a pane is added to the workspace center. */ + onDidAddPane(callback: (event: { pane: Pane }) => void): Disposable; + + /** Invoke the given callback before a pane is destroyed in the workspace center. */ + onWillDestroyPane(callback: (event: { pane: Pane }) => void): Disposable; + + /** Invoke the given callback when a pane is destroyed in the workspace center. */ + onDidDestroyPane(callback: (event: { pane: Pane }) => void): Disposable; + + /** Invoke the given callback with all current and future panes in the workspace center. */ + observePanes(callback: (pane: Pane) => void): Disposable; + + /** Invoke the given callback when the active pane changes. */ + onDidChangeActivePane(callback: (pane: Pane) => void): Disposable; + + /** + * Invoke the given callback with the current active pane and when the active pane + * changes. + */ + observeActivePane(callback: (pane: Pane) => void): Disposable; + + /** Invoke the given callback when a pane item is added to the workspace center. */ + onDidAddPaneItem(callback: (event: PaneItemObservedEvent) => void): Disposable; + + /** + * Invoke the given callback when a pane item is about to be destroyed, before the user + * is prompted to save it. + * @param callback The function to be called before pane items are destroyed. + * If this function returns a Promise, then the item will not be destroyed + * until the promise resolves. + */ + onWillDestroyPaneItem(callback: (event: PaneItemObservedEvent) => void|Promise): + Disposable; + + /** Invoke the given callback when a pane item is destroyed. */ + onDidDestroyPaneItem(callback: (event: PaneItemObservedEvent) => void): Disposable; + + /** Invoke the given callback when a text editor is added to the workspace center. */ + onDidAddTextEditor(callback: (event: TextEditorObservedEvent) => void): Disposable; + + // Pane Items + /** Get all pane items in the workspace center. */ + getPaneItems(): object[]; + + /** Get the active Pane's active item. */ + getActivePaneItem(): object|undefined; + + /** Get all text editors in the workspace center. */ + getTextEditors(): TextEditor[]; + + /** Get the active item if it is an TextEditor. */ + getActiveTextEditor(): TextEditor|undefined; + + /** Save all pane items. */ + saveAll(): void; + + // Panes + /** Get all panes in the workspace center. */ + getPanes(): Pane[]; + + /** Get the active Pane. */ + getActivePane(): Pane; + + /** Make the next pane active. */ + activateNextPane(): void; + + /** Make the previous pane active. */ + activatePreviousPane(): void; + + /** Retrieve the Pane associated with the given URI. */ + paneForURI(uri: string): Pane|undefined; + + /** Retrieve the Pane associated with the given item. */ + paneForItem(item: object): Pane|undefined; + + /** Destroy (close) the active pane. */ + destroyActivePane(): void; +} + +// Extended Classes =========================================================== + +/** + * A wrapper which provides standard error/output line buffering for + * Node's ChildProcess. + */ +export class BufferedProcess { + process?: ChildProcess; + + constructor(options: ProcessOptions); + + // Event Subscription + /** + * Will call your callback when an error will be raised by the process. Usually + * this is due to the command not being available or not on the PATH. You can + * call handle() on the object passed to your callback to indicate that you + * have handled this error. + */ + onWillThrowError(callback: (errorObject: HandleableErrorEvent) => + void): Disposable; + + // Helper Methods + /** Terminate the process. */ + kill(): void; + + /** Runs the process. */ + start(): void; +} + +/** + * Like BufferedProcess, but accepts a Node script as the command to run. + * This is necessary on Windows since it doesn't support shebang #! lines. + */ +export class BufferedNodeProcess extends BufferedProcess { + /** Runs the given Node script by spawning a new child process. */ + constructor(options: NodeProcessOptions); +} + +/** Represents the clipboard used for copying and pasting in Atom. */ +export interface Clipboard { + /** Write the given text to the clipboard. */ + write(text: string, metadata?: object): void; + + /** Read the text from the clipboard. */ + read(): string; + + /** + * Read the text from the clipboard and return both the text and the associated + * metadata. + */ + readWithMetadata(): { text: string, metadata: object }; +} + +/** Provides a registry for commands that you'd like to appear in the context menu. */ +export interface ContextMenuManager { + /** Add context menu items scoped by CSS selectors. */ + add(itemsBySelector: { [key: string]: ReadonlyArray }): Disposable; +} + +/** + * The Cursor class represents the little blinking line identifying where text + * can be inserted. + */ +export interface Cursor { + // Event Subscription + /** Calls your callback when the cursor has been moved. */ + onDidChangePosition(callback: (event: CursorPositionChangedEvent) => void): Disposable; + + /** Calls your callback when the cursor is destroyed. */ + onDidDestroy(callback: () => void): Disposable; + + /** Calls your callback when the cursor's visibility has changed. */ + onDidChangeVisibility(callback: (visibility: boolean) => void): Disposable; + + // Managing Cursor Position + /** Moves a cursor to a given screen position. */ + setScreenPosition(screenPosition: PointCompatible, options?: { autoscroll?: boolean }): + void; + + /** Returns the screen position of the cursor as a Point. */ + getScreenPosition(): Point; + + /** Moves a cursor to a given buffer position. */ + setBufferPosition(bufferPosition: PointCompatible, options?: { autoscroll?: boolean }): + void; + + /** Returns the current buffer position as an Array. */ + getBufferPosition(): Point; + + /** Returns the cursor's current screen row. */ + getScreenRow(): number; + + /** Returns the cursor's current screen column. */ + getScreenColumn(): number; + + /** Retrieves the cursor's current buffer row. */ + getBufferRow(): number; + + /** Returns the cursor's current buffer column. */ + getBufferColumn(): number; + + /** Returns the cursor's current buffer row of text excluding its line ending. */ + getCurrentBufferLine(): string; + + /** Returns whether the cursor is at the start of a line. */ + isAtBeginningOfLine(): boolean; + + /** Returns whether the cursor is on the line return character. */ + isAtEndOfLine(): boolean; + + // Cursor Position Details + /** + * Returns the underlying DisplayMarker for the cursor. Useful with overlay + * Decorations. + */ + getMarker(): DisplayMarker; + + /** + * Identifies if the cursor is surrounded by whitespace. + * "Surrounded" here means that the character directly before and after the cursor + * are both whitespace. + */ + isSurroundedByWhitespace(): boolean; + + /** This method returns false if the character before or after the cursor is whitespace. */ + isBetweenWordAndNonWord(): boolean; + + /** Returns whether this cursor is between a word's start and end. */ + isInsideWord(options?: { wordRegex?: RegExp }): boolean; + + /** Returns the indentation level of the current line. */ + getIndentLevel(): number; + + /** Retrieves the scope descriptor for the cursor's current position. */ + getScopeDescriptor(): ScopeDescriptor; + + /** + * Returns true if this cursor has no non-whitespace characters before its + * current position. + */ + hasPrecedingCharactersOnLine(): boolean; + + /** + * Identifies if this cursor is the last in the TextEditor. + * "Last" is defined as the most recently added cursor. + */ + isLastCursor(): boolean; + + // Moving the Cursor + /** Moves the cursor up one screen row. */ + moveUp(rowCount?: number, options?: { moveToEndOfSelection?: boolean }): void; + + /** Moves the cursor down one screen row. */ + moveDown(rowCount?: number, options?: { moveToEndOfSelection?: boolean }): void; + + /** Moves the cursor left one screen column. */ + moveLeft(columnCount?: number, options?: { moveToEndOfSelection?: boolean }): void; + + /** Moves the cursor right one screen column. */ + moveRight(columnCount?: number, options?: { moveToEndOfSelection?: boolean }): void; + + /** Moves the cursor to the top of the buffer. */ + moveToTop(): void; + + /** Moves the cursor to the bottom of the buffer. */ + moveToBottom(): void; + + /** Moves the cursor to the beginning of the line. */ + moveToBeginningOfScreenLine(): void; + + /** Moves the cursor to the beginning of the buffer line. */ + moveToBeginningOfLine(): void; + + /** Moves the cursor to the beginning of the first character in the line. */ + moveToFirstCharacterOfLine(): void; + + /** Moves the cursor to the end of the line. */ + moveToEndOfScreenLine(): void; + + /** Moves the cursor to the end of the buffer line. */ + moveToEndOfLine(): void; + + /** Moves the cursor to the beginning of the word. */ + moveToBeginningOfWord(): void; + + /** Moves the cursor to the end of the word. */ + moveToEndOfWord(): void; + + /** Moves the cursor to the beginning of the next word. */ + moveToBeginningOfNextWord(): void; + + /** Moves the cursor to the previous word boundary. */ + moveToPreviousWordBoundary(): void; + + /** Moves the cursor to the next word boundary. */ + moveToNextWordBoundary(): void; + + /** Moves the cursor to the previous subword boundary. */ + moveToPreviousSubwordBoundary(): void; + + /** Moves the cursor to the next subword boundary. */ + moveToNextSubwordBoundary(): void; + + /** Moves the cursor to the beginning of the buffer line, skipping all whitespace. */ + skipLeadingWhitespace(): void; + + /** Moves the cursor to the beginning of the next paragraph. */ + moveToBeginningOfNextParagraph(): void; + + /** Moves the cursor to the beginning of the previous paragraph. */ + moveToBeginningOfPreviousParagraph(): void; + + // Local Positions and Ranges + /** + * Returns buffer position of previous word boundary. It might be on the current + * word, or the previous word. + */ + getPreviousWordBoundaryBufferPosition(options?: { wordRegex?: RegExp }): Point; + + /** + * Returns buffer position of the next word boundary. It might be on the current + * word, or the previous word. + */ + getNextWordBoundaryBufferPosition(options?: { wordRegex?: RegExp }): Point; + + /** Retrieves the buffer position of where the current word starts. */ + getBeginningOfCurrentWordBufferPosition(options?: { + wordRegex?: RegExp, + includeNonWordCharacters?: boolean, + allowPrevious?: boolean + }): Point; + + /** Retrieves the buffer position of where the current word ends. */ + getEndOfCurrentWordBufferPosition(options?: { + wordRegex?: RegExp, + includeNonWordCharacters?: boolean + }): Point; + + /** Retrieves the buffer position of where the next word starts. */ + getBeginningOfNextWordBufferPosition(options?: { wordRegex?: RegExp }): Point; + + /** Returns the buffer Range occupied by the word located under the cursor. */ + getCurrentWordBufferRange(options?: { wordRegex?: RegExp }): Range; + + /** Returns the buffer Range for the current line. */ + getCurrentLineBufferRange(options?: { includeNewline?: boolean }): Range; + + /** + * Retrieves the range for the current paragraph. + * A paragraph is defined as a block of text surrounded by empty lines or comments. + */ + getCurrentParagraphBufferRange(): Range; + + /** Returns the characters preceding the cursor in the current word. */ + getCurrentWordPrefix(): string; + + // Visibility + /** Sets whether the cursor is visible. */ + setVisible(visible: boolean): void; + + /** Returns the visibility of the cursor. */ + isVisible(): boolean; + + // Comparing to another cursor + /** + * Compare this cursor's buffer position to another cursor's buffer position. + * See Point::compare for more details. + */ + compare(otherCursor: Cursor): number; + + // Utilities + /** Prevents this cursor from causing scrolling. */ + clearAutoscroll(): void; + + /** Deselects the current selection. */ + clearSelection(): void; + + /** Get the RegExp used by the cursor to determine what a "word" is. */ + wordRegExp(options?: { includeNonWordCharacters?: boolean }): RegExp; + + /** Get the RegExp used by the cursor to determine what a "subword" is. */ + subwordRegExp(options?: { backwards?: boolean }): RegExp; +} + +/** Manages the deserializers used for serialized state. */ +export interface DeserializerManager { + /** Register the given class(es) as deserializers. */ + add(...deserializers: Deserializer[]): Disposable; + + /** Deserialize the state and params. */ + deserialize(state: object): object|undefined; +} + +/** Represents a directory on disk that can be watched for changes. */ +export class Directory { + // Construction + /** Configures a new Directory instance, no files are accessed. */ + constructor(directoryPath: string, symlink?: boolean); + + /** + * Creates the directory on disk that corresponds to ::getPath() if no such + * directory already exists. + */ + create(mode?: number): Promise; + + // Event Subscription + /** Invoke the given callback when the directory's contents change. */ + onDidChange(callback: () => void): Disposable; + + // Directory Metadata + /** Returns a boolean, always false. */ + isFile(): boolean; + + /** Returns a roolean, always true. */ + isDirectory(): boolean; + + /** Returns a boolean indicating whether or not this is a symbolic link. */ + isSymbolicLink(): boolean; + + /** + * Returns a promise that resolves to a boolean, true if the directory + * exists, false otherwise. + */ + exists(): Promise; + + /** Returns a boolean, true if the directory exists, false otherwise. */ + existsSync(): boolean; + + /** + * Return a boolean, true if this Directory is the root directory of the + * filesystem, or false if it isn't. + */ + isRoot(): boolean; + + // Managing Paths + /** + * This may include unfollowed symlinks or relative directory entries. + * Or it may be fully resolved, it depends on what you give it. + */ + getPath(): string; + + /** + * All relative directory entries are removed and symlinks are resolved to + * their final destination. + */ + getRealPathSync(): string; + + /** Returns the string basename of the directory. */ + getBaseName(): string; + + /** Returns the relative string path to the given path from this directory. */ + relativize(fullPath: string): string; + + // Traversing + /** Traverse to the parent directory. */ + getParent(): Directory; + + /** + * Traverse within this Directory to a child File. This method doesn't actually + * check to see if the File exists, it just creates the File object. + */ + getFile(filename: string): File; + + /** + * Traverse within this a Directory to a child Directory. This method doesn't actually + * check to see if the Directory exists, it just creates the Directory object. + */ + getSubdirectory(dirname: string): Directory; + + /** Reads file entries in this directory from disk synchronously. */ + getEntriesSync(): Array; + + /** Reads file entries in this directory from disk asynchronously. */ + getEntries(callback: (error: Error, entries: Array) => void): void; + + /** + * Determines if the given path (real or symbolic) is inside this directory. This + * method does not actually check if the path exists, it just checks if the path + * is under this directory. + */ + contains(pathToCheck: string): boolean; +} + +/** A container at the edges of the editor window capable of holding items. */ +export interface Dock { + // Methods + /** Show the dock and focus its active Pane. */ + activate(): void; + + /** Show the dock without focusing it. */ + show(): void; + + /** + * Hide the dock and activate the WorkspaceCenter if the dock was was previously + * focused. + */ + hide(): void; + + /** + * Toggle the dock's visibility without changing the Workspace's active pane + * container. + */ + toggle(): void; + + /** Check if the dock is visible. */ + isVisible(): boolean; + + // Event Subscription + /** Invoke the given callback when the visibility of the dock changes. */ + onDidChangeVisible(callback: (visible: boolean) => void): Disposable; + + /** + * Invoke the given callback with the current and all future visibilities of + * the dock. + */ + observeVisible(callback: (visible: boolean) => void): Disposable; + + /** Invoke the given callback with all current and future panes items in the dock. */ + observePaneItems(callback: (item: object) => void): Disposable; + + /** + * Invoke the given callback when the active pane item changes. + * + * Because observers are invoked synchronously, it's important not to perform any + * expensive operations via this method. Consider ::onDidStopChangingActivePaneItem + * to delay operations until after changes stop occurring. + */ + onDidChangeActivePaneItem(callback: (item: object) => void): Disposable; + + /** Invoke the given callback when the active pane item stops changing. */ + onDidStopChangingActivePaneItem(callback: (item: object) => void): Disposable; + + /** + * Invoke the given callback with the current active pane item and with all future + * active pane items in the dock. + */ + observeActivePaneItem(callback: (item: object) => void): Disposable; + + /** Invoke the given callback when a pane is added to the dock. */ + onDidAddPane(callback: (event: { pane: Pane }) => void): Disposable; + + /** Invoke the given callback before a pane is destroyed in the dock. */ + onWillDestroyPane(callback: (event: { pane: Pane }) => void): Disposable; + + /** Invoke the given callback when a pane is destroyed in the dock. */ + onDidDestroyPane(callback: (event: { pane: Pane }) => void): Disposable; + + /** Invoke the given callback with all current and future panes in the dock. */ + observePanes(callback: (pane: Pane) => void): Disposable; + + /** Invoke the given callback when the active pane changes. */ + onDidChangeActivePane(callback: (pane: Pane) => void): Disposable; + + /** + * Invoke the given callback with the current active pane and when the active + * pane changes. + */ + observeActivePane(callback: (pane: Pane) => void): Disposable; + + /** Invoke the given callback when a pane item is added to the dock. */ + onDidAddPaneItem(callback: (event: PaneItemObservedEvent) => void): Disposable; + + /** + * Invoke the given callback when a pane item is about to be destroyed, before the user is + * prompted to save it. + * @param callback The function to be called before pane items are destroyed. + * If this function returns a Promise, then the item will not be destroyed + * until the promise resolves. + */ + onWillDestroyPaneItem(callback: (event: PaneItemObservedEvent) => void|Promise): + Disposable; + + /** Invoke the given callback when a pane item is destroyed. */ + onDidDestroyPaneItem(callback: (event: PaneItemObservedEvent) => void): Disposable; + + // Pane Items + /** Get all pane items in the dock. */ + getPaneItems(): object[]; + + /** Get the active Pane's active item. */ + getActivePaneItem(): object; + + // Panes + /** Returns an Array of Panes. */ + getPanes(): Pane[]; + + /** Get the active Pane. */ + getActivePane(): Pane; + + /** Make the next pane active. */ + activateNextPane(): boolean; + + /** Make the previous pane active. */ + activatePreviousPane(): boolean; +} + +/** Represents an individual file that can be watched, read from, and written to. */ +export class File { + // Construction + /** Configures a new File instance, no files are accessed. */ + constructor(filePath: string, symlink?: boolean); + + /** + * Creates the file on disk that corresponds to ::getPath() if no such file + * already exists. + */ + create(): Promise; + + // Event Subscription + /** Invoke the given callback when the file's contents change. */ + onDidChange(callback: () => void): Disposable; + + /** Invoke the given callback when the file's path changes. */ + onDidRename(callback: () => void): Disposable; + + /** Invoke the given callback when the file is deleted. */ + onDidDelete(callback: () => void): Disposable; + + /** + * Invoke the given callback when there is an error with the watch. When + * your callback has been invoked, the file will have unsubscribed from the + * file watches. + */ + onWillThrowWatchError(callback: (event: PathWatchErrorThrownEvent) => + void): Disposable; + + // File Metadata + /** Returns a boolean, always true. */ + isFile(): boolean; + + /** Returns a boolean, always false. */ + isDirectory(): boolean; + + /** Returns a boolean indicating whether or not this is a symbolic link. */ + isSymbolicLink(): boolean; + + /** + * Returns a promise that resolves to a boolean, true if the file exists, + * false otherwise. + */ + exists(): Promise; + + /** Returns a boolean, true if the file exists, false otherwise. */ + existsSync(): boolean; + + /** Get the SHA-1 digest of this file. */ + getDigest(): Promise; + + /** Get the SHA-1 digest of this file. */ + getDigestSync(): string; + + /** Sets the file's character set encoding name. */ + setEncoding(encoding: string): void; + + /** Returns the string encoding name for this file (default: "utf8"). */ + getEncoding(): string; + + // Managing Paths + /** Returns the string path for the file. */ + getPath(): string; + + /** Returns this file's completely resolved string path. */ + getRealPathSync(): string; + + /** + * Returns a promise that resolves to the file's completely resolved + * string path. + */ + getRealPath(): Promise; + + /** Return the string filename without any directory information. */ + getBaseName(): string; + + // Traversing + /** Return the Directory that contains this file. */ + getParent(): Directory; + + // Reading and Writing + /** Reads the contents of the file. */ + read(flushCache?: boolean): Promise; + + /** Returns a stream to read the content of the file. */ + createReadStream(): ReadStream; + + /** Overwrites the file with the given text. */ + write(text: string): Promise; + + /** Returns a stream to write content to the file. */ + createWriteStream(): WriteStream; + + /** Overwrites the file with the given text. */ + writeSync(text: string): undefined; +} + +/** Represents the underlying git operations performed by Atom. */ +export class GitRepository { + // Construction + /** Creates a new GitRepository instance. */ + static open(path: string, options?: { refreshOnWindowFocus?: boolean }): GitRepository; + + constructor(path: string, options?: { refreshOnWindowFocus?: boolean, config?: Config, + project?: Project }); + + // Lifecycle + /** Destroy this GitRepository object. */ + destroy(): void; + + /** Returns a boolean indicating if this repository has been destroyed. */ + isDestroyed(): boolean; + + // Event Subscription + /** + * Invoke the given callback when this GitRepository's destroy() method is + * invoked. + */ + onDidDestroy(callback: () => void): Disposable; + + /** + * Invoke the given callback when a specific file's status has changed. When + * a file is updated, reloaded, etc, and the status changes, this will be fired. + */ + onDidChangeStatus(callback: (event: RepoStatusChangedEvent) => void): Disposable; + + /** Invoke the given callback when a multiple files' statuses have changed. */ + onDidChangeStatuses(callback: () => void): Disposable; + + // Repository Details + /** A string indicating the type of version control system used by this repository. */ + getType(): "git"; + + /** Returns the string path of the repository. */ + getPath(): string; + + /** Returns the string working directory path of the repository. */ + getWorkingDirectory(): string; + + /** Returns true if at the root, false if in a subfolder of the repository. */ + isProjectAtRoot(): boolean; + + /** Makes a path relative to the repository's working directory. */ + relativize(): string; + + /** Returns true if the given branch exists. */ + hasBranch(branch: string): boolean; + + /** Retrieves a shortened version of the HEAD reference value. */ + getShortHead(path?: string): string; + + /** Is the given path a submodule in the repository? */ + isSubmodule(path: string): boolean; + + /** + * Returns the number of commits behind the current branch is from the its + * upstream remote branch. The default reference is the HEAD. + * @param reference The branch reference name. + * @param path The path in the repository to get this ifnromation for, only + * needed if the repository contains submodules. + * @return Returns the number of commits behind the current branch is from its + * upstream remote branch. + */ + getAheadBehindCount(reference: string, path?: string): { ahead: number, behind: number }; + + /** + * Get the cached ahead/behind commit counts for the current branch's + * upstream branch. + */ + getCachedUpstreamAheadBehindCount(path?: string): { ahead: number, behind: number }; + + /** Returns the git configuration value specified by the key. */ + getConfigValue(key: string, path?: string): string; + + /** Returns the origin url of the repository. */ + getOriginURL(path?: string): string; + + /** + * Returns the upstream branch for the current HEAD, or null if there is no + * upstream branch for the current HEAD. + */ + getUpstreamBranch(path?: string): string|null; + + /** Gets all the local and remote references. */ + getReferences(path?: string): { heads: string[], remotes: string[], tags: string[] }; + + /** Returns the current string SHA for the given reference. */ + getReferenceTarget(reference: string, path?: string): string; + + // Reading Status + /** Returns true if the given path is modified. */ + isPathModified(path: string): boolean; + + /** Returns true if the given path is new. */ + isPathNew(path: string): boolean; + + /** Is the given path ignored? */ + isPathIgnored(path: string): boolean; + + /** Get the status of a directory in the repository's working directory. */ + getDirectoryStatus(path: string): number; + + /** Get the status of a single path in the repository. */ + getPathStatus(path: string): number; + + /** Get the cached status for the given path. */ + getCachedPathStatus(path: string): number|null; + + /** Returns true if the given status indicates modification. */ + isStatusModified(status: number): boolean; + + /** Returns true if the given status indicates a new path. */ + isStatusNew(status: number): boolean; + + // Retrieving Diffs + /** + * Retrieves the number of lines added and removed to a path. + * This compares the working directory contents of the path to the HEAD version. + */ + getDiffStats(path: string): { added: number, deleted: number }; + + /** + * Retrieves the line diffs comparing the HEAD version of the given path + * and the given text. + */ + getLineDiffs(path: string, text: string): Array<{ oldStart: number, + newStart: number, oldLines: number, newLines: number }>; + + // Checking Out + /** + * Restore the contents of a path in the working directory and index to the + * version at HEAD. + */ + checkoutHead(path: string): boolean; + + /** Checks out a branch in your repository. */ + checkoutReference(reference: string, create: boolean): boolean; +} + +/** Grammar that tokenizes lines of text. */ +export interface Grammar { + /** The name of the Grammar. */ + name: string; + + // Event Subscription + onDidUpdate(callback: () => void): Disposable; + + // Tokenizing + /** + * Tokenize all lines in the given text. + * @param text A string containing one or more lines. + * @return An array of token arrays for each line tokenized. + */ + tokenizeLines(text: string): GrammarToken[][]; + + /** + * Tokenizes the line of text. + * @param line A string of text to tokenize. + * @param ruleStack An optional array of rules previously returned from this + * method. This should be null when tokenizing the first line in the file. + * @param firstLine A optional boolean denoting whether this is the first line + * in the file which defaults to `false`. + * @return An object representing the result of the tokenize. + */ + tokenizeLine(line: string, ruleStack?: null, firstLine?: boolean): TokenizeLineResult; + /** + * Tokenizes the line of text. + * @param line A string of text to tokenize. + * @param ruleStack An optional array of rules previously returned from this + * method. This should be null when tokenizing the first line in the file. + * @param firstLine A optional boolean denoting whether this is the first line + * in the file which defaults to `false`. + * @return An object representing the result of the tokenize. + */ + tokenizeLine(line: string, ruleStack: GrammarRule[], firstLine?: false): + TokenizeLineResult; +} + +/** Registry containing one or more grammars. */ +export interface GrammarRegistry { + // Event Subscription + /** + * Invoke the given callback when a grammar is added to the registry. + * @param callback The callback to be invoked whenever a grammar is added. + * @return A Disposable on which `.dispose()` can be called to unsubscribe. + */ + onDidAddGrammar(callback: (grammar: Grammar) => void): Disposable; + + /** + * Invoke the given callback when a grammar is updated due to a grammar it + * depends on being added or removed from the registry. + * @param callback The callback to be invoked whenever a grammar is updated. + * @return A Disposable on which `.dispose()` can be called to unsubscribe. + */ + onDidUpdateGrammar(callback: (grammar: Grammar) => void): Disposable; + + // Managing Grammars + /** + * Get all the grammars in this registry. + * @return A non-empty array of Grammar instances. + */ + getGrammars(): Grammar[]; + + /** + * Get a grammar with the given scope name. + * @param scopeName A string such as `source.js`. + * @return A Grammar or undefined. + */ + grammarForScopeName(scopeName: string): Grammar|undefined; + + /** + * Add a grammar to this registry. + * A 'grammar-added' event is emitted after the grammar is added. + * @param grammar The Grammar to add. This should be a value previously returned + * from ::readGrammar or ::readGrammarSync. + * @return Returns a Disposable on which `.dispose()` can be called to remove + * the grammar. + */ + addGrammar(grammar: Grammar): Disposable; + + /** + * Remove the given grammar from this registry. + * @param grammar The grammar to remove. This should be a grammar previously + * added to the registry from ::addGrammar. + */ + removeGrammar(grammar: Grammar): void; + + /** + * Remove the grammar with the given scope name. + * @param scopeName A string such as `source.js`. + * @return Returns the removed Grammar or undefined. + */ + removeGrammarForScopeName(scopeName: string): Grammar|undefined; + + /** + * Read a grammar synchronously but don't add it to the registry. + * @param grammarPath The absolute file path to a grammar. + * @return The newly loaded Grammar. + */ + readGrammarSync(grammarPath: string): Grammar; + + /** + * Read a grammar asynchronously but don't add it to the registry. + * @param grammarPath The absolute file path to the grammar. + * @param callback The function to be invoked once the Grammar has been read in. + */ + readGrammar(grammarPath: string, callback: (error: Error|null, grammar?: Grammar) => + void): void; + + /** + * Read a grammar synchronously and add it to this registry. + * @param grammarPath The absolute file path to the grammar. + * @return The newly loaded Grammar. + */ + loadGrammarSync(grammarPath: string): Grammar; + + /** + * Read a grammar asynchronously and add it to the registry. + * @param grammarPath The absolute file path to the grammar. + * @param callback The function to be invoked once the Grammar has been read in + * and added to the registry. + */ + loadGrammar(grammarPath: string, callback: (error: Error|null, grammar?: Grammar) => + void): void; + + /** + * Convert compact tags representation into convenient, space-inefficient tokens. + * @param lineText The text of the tokenized line. + * @param tags The tags returned from a call to Grammar::tokenizeLine(). + * @return An array of Token instances decoded from the given tags. + */ + decodeTokens(lineText: string, tags: Array): GrammarToken[]; +} + +/** Represents a gutter within a TextEditor. */ +export interface Gutter { + // Gutter Destruction + /** Destroys the gutter. */ + destroy(): void; + + // Event Subscription + /** Calls your callback when the gutter's visibility changes. */ + onDidChangeVisible(callback: (gutter: Gutter) => void): Disposable; + + /** Calls your callback when the gutter is destroyed. */ + onDidDestroy(callback: () => void): Disposable; + + // Visibility + /** Hide the gutter. */ + hide(): void; + + /** Show the gutter. */ + show(): void; + + /** Determine whether the gutter is visible. */ + isVisible(): boolean; + + /** + * Add a decoration that tracks a DisplayMarker. When the marker moves, is + * invalidated, or is destroyed, the decoration will be updated to reflect + * the marker's state. + */ + decorateMarker(marker: DisplayMarker, decorationParams: DecorationOptions): Decoration; +} + +/** + * History manager for remembering which projects have been opened. + * An instance of this class is always available as the atom.history global. + * The project history is used to enable the 'Reopen Project' menu. + */ +export interface HistoryManager { + /** Obtain a list of previously opened projects. */ + getProjects(): ProjectHistory[]; + + /** + * Clear all projects from the history. + * Note: This is not a privacy function - other traces will still exist, e.g. + * window state. + */ + clearProjects(): void; + + /** Invoke the given callback when the list of projects changes. */ + onDidChangeProjects(callback: (args: { reloaded: boolean }) => void): Disposable; +} + +/** + * Allows commands to be associated with keystrokes in a context-sensitive way. + * In Atom, you can access a global instance of this object via `atom.keymaps`. + */ +export interface KeymapManager { + /** Clear all registered key bindings and enqueued keystrokes. For use in tests. */ + clear(): void; + + /** Unwatch all watched paths. */ + destroy(): void; + + // Event Subscription + /** Invoke the given callback when one or more keystrokes completely match a key binding. */ + onDidMatchBinding(callback: (event: FullKeybindingMatchEvent) => void): Disposable; + + /** Invoke the given callback when one or more keystrokes partially match a binding. */ + onDidPartiallyMatchBindings(callback: (event: PartialKeybindingMatchEvent) => + void): Disposable; + + /** Invoke the given callback when one or more keystrokes fail to match any bindings. */ + onDidFailToMatchBinding(callback: (event: FailedKeybindingMatchEvent) => + void): Disposable; + + /** Invoke the given callback when a keymap file is reloaded. */ + onDidReloadKeymap(callback: (event: KeymapLoadedEvent) => void): Disposable; + + /** Invoke the given callback when a keymap file is unloaded. */ + onDidUnloadKeymap(callback: (event: KeymapLoadedEvent) => void): Disposable; + + /** Invoke the given callback when a keymap file not able to be loaded. */ + onDidFailToReadFile(callback: (error: FailedKeymapFileReadEvent) => void): Disposable; + + // Adding and Removing Bindings + /** Construct KeyBindings from an object grouping them by CSS selector. */ + build(source: string, bindings: { [key: string]: { [key: string]: string }}, + priority?: number): KeyBinding[]; + + /** Add sets of key bindings grouped by CSS selector. */ + add(source: string, bindings: { [key: string]: { [key: string]: string }}, + priority?: number): Disposable; + + // Accessing Bindings + /** Get all current key bindings. */ + getKeyBindings(): KeyBinding[]; + + /** Get the key bindings for a given command and optional target. */ + findKeyBindings(params?: { + keystrokes?: string, // e.g. 'ctrl-x ctrl-s' + command?: string, // e.g. 'editor:backspace' + target?: Element, + }): KeyBinding[]; + + // Managing Keymap Files + /** Load the key bindings from the given path. */ + loadKeymap(bindingsPath: string, options?: { watch?: boolean, priority?: number }): + void; + + /** + * Cause the keymap to reload the key bindings file at the given path whenever + * it changes. + */ + watchKeymap(filePath: string, options?: { priority: number }): void; + + // Managing Keyboard Events + /** + * Dispatch a custom event associated with the matching key binding for the + * given `KeyboardEvent` if one can be found. + */ + handleKeyboardEvent(event: KeyboardEvent): void; + + /** Translates a keydown event to a keystroke string. */ + keystrokeForKeyboardEvent(event: KeyboardEvent): string; + + /** Customize translation of raw keyboard events to keystroke strings. */ + addKeystrokeResolver(resolver: (event: AddedKeystrokeResolverEvent) => string): Disposable; + + /** + * Get the number of milliseconds allowed before pending states caused by + * partial matches of multi-keystroke bindings are terminated. + */ + getPartialMatchTimeout(): number; +} + +/** Provides a registry for menu items that you'd like to appear in the application menu. */ +export interface MenuManager { + /** Adds the given items to the application menu. */ + add(items: ReadonlyArray): Disposable; + + /** Refreshes the currently visible menu. */ + update(): void; +} + +/** + * Loads and activates a package's main module and resources such as stylesheets, + * keymaps, grammar, editor properties, and menus. + */ +export interface Package { + /** The name of the Package. */ + name: string; + + /** The path to the Package on disk. */ + path: string; + + // Event Subscription + /** Invoke the given callback when all packages have been activated. */ + onDidDeactivate(callback: () => void): Disposable; + + // Native Module Compatibility + /** + * Are all native modules depended on by this package correctly compiled + * against the current version of Atom? + */ + isCompatible(): boolean; + + /** + * Rebuild native modules in this package's dependencies for the current + * version of Atom. + */ + rebuild(): Promise<{ code: number, stdout: string, stderr: string }>; + + /** If a previous rebuild failed, get the contents of stderr. */ + getBuildFailureOutput(): string|null; +} + +/** Package manager for coordinating the lifecycle of Atom packages. */ +export interface PackageManager { + // Event Subscription + /** Invoke the given callback when all packages have been loaded. */ + onDidLoadInitialPackages(callback: () => void): Disposable; + + /** Invoke the given callback when all packages have been activated. */ + onDidActivateInitialPackages(callback: () => void): Disposable; + + /** Invoke the given callback when a package is activated. */ + onDidActivatePackage(callback: (package: Package) => void): Disposable; + + /** Invoke the given callback when a package is deactivated. */ + onDidDeactivatePackage(callback: (package: Package) => void): Disposable; + + /** Invoke the given callback when a package is loaded. */ + onDidLoadPackage(callback: (package: Package) => void): Disposable; + + /** Invoke the given callback when a package is unloaded. */ + onDidUnloadPackage(callback: (package: Package) => void): Disposable; + + // Package System Data + /** Get the path to the apm command. */ + getApmPath(): string; + + /** Get the paths being used to look for packages. */ + getPackageDirPaths(): string[]; + + // General Package Data + /** Resolve the given package name to a path on disk. */ + resolvePackagePath(name: string): string|undefined; + + /** Is the package with the given name bundled with Atom? */ + isBundledPackage(name: string): boolean; + + // Enabling and Disabling Packages + /** Enable the package with the given name. */ + enablePackage(name: string): Package|undefined; + + /** Disable the package with the given name. */ + disablePackage(name: string): Package|undefined; + + /** Is the package with the given name disabled? */ + isPackageDisabled(name: string): boolean; + + // Accessing Active Packages + /** Get an Array of all the active Packages. */ + getActivePackages(): Package[]; + + /** Get the active Package with the given name. */ + getActivePackage(name: string): Package|undefined; + + /** Is the Package with the given name active? */ + isPackageActive(name: string): boolean; + + /** Returns a boolean indicating whether package activation has occurred. */ + hasActivatedInitialPackages(): boolean; + + // Accessing Loaded Packages + /** Get an Array of all the loaded Packages. */ + getLoadedPackages(): Package[]; + + /** Get the loaded Package with the given name. */ + getLoadedPackage(name: string): Package|undefined; + + /** Is the package with the given name loaded? */ + isPackageLoaded(name: string): boolean; + + /** Returns a boolean indicating whether package loading has occurred. */ + hasLoadedInitialPackages(): boolean; + + // Accessing Available Packages + /** Returns an Array of strings of all the available package paths. */ + getAvailablePackagePaths(): string[]; + + /** Returns an Array of strings of all the available package names. */ + getAvailablePackageNames(): string[]; + + /** Returns an Array of strings of all the available package metadata. */ + getAvailablePackageMetadata(): string[]; + + /** Activate a single package by name or path. */ + activatePackage(nameOrPath: string): Promise; + + /** Triggers the given package activation hook. */ + triggerActivationHook(hook: string): void; + + /** Trigger all queued activation hooks immediately. */ + triggerDeferredActivationHooks(): void; +} + +/** A container for presenting content in the center of the workspace. */ +export interface Pane { + // Event Subscription + /** Invoke the given callback when the pane resizes. */ + onDidChangeFlexScale(callback: (flexScale: number) => void): Disposable; + + /** Invoke the given callback with the current and future values of ::getFlexScale. */ + observeFlexScale(callback: (flexScale: number) => void): Disposable; + + /** Invoke the given callback when the pane is activated. */ + onDidActivate(callback: () => void): Disposable; + + /** Invoke the given callback before the pane is destroyed. */ + onWillDestroy(callback: () => void): Disposable; + + /** Invoke the given callback when the pane is destroyed. */ + onDidDestroy(callback: () => void): Disposable; + + /** Invoke the given callback when the value of the ::isActive property changes. */ + onDidChangeActive(callback: (active: boolean) => void): Disposable; + + /** + * Invoke the given callback with the current and future values of the ::isActive + * property. + */ + observeActive(callback: (active: boolean) => void): Disposable; + + /** Invoke the given callback when an item is added to the pane. */ + onDidAddItem(callback: (event: PaneListItemShiftedEvent) => void): Disposable; + + /** Invoke the given callback when an item is removed from the pane. */ + onDidRemoveItem(callback: (event: PaneListItemShiftedEvent) => void): Disposable; + + /** Invoke the given callback before an item is removed from the pane. */ + onWillRemoveItem(callback: (event: PaneListItemShiftedEvent) => void): Disposable; + + /** Invoke the given callback when an item is moved within the pane. */ + onDidMoveItem(callback: (event: PaneItemMovedEvent) => void): Disposable; + + /** Invoke the given callback with all current and future items. */ + observeItems(callback: (item: object) => void): Disposable; + + /** Invoke the given callback when the value of ::getActiveItem changes. */ + onDidChangeActiveItem(callback: (activeItem: object) => void): Disposable; + + /** + * Invoke the given callback when ::activateNextRecentlyUsedItem has been called, + * either initiating or continuing a forward MRU traversal of pane items. + */ + onChooseNextMRUItem(callback: (nextRecentlyUsedItem: object) => void): Disposable; + + /** + * Invoke the given callback when ::activatePreviousRecentlyUsedItem has been called, + * either initiating or continuing a reverse MRU traversal of pane items. + */ + onChooseLastMRUItem(callback: (previousRecentlyUsedItem: object) => void): Disposable; + + /** + * Invoke the given callback when ::moveActiveItemToTopOfStack has been called, + * terminating an MRU traversal of pane items and moving the current active item + * to the top of the stack. Typically bound to a modifier (e.g. CTRL) key up event. + */ + onDoneChoosingMRUItem(callback: () => void): Disposable; + + /** Invoke the given callback with the current and future values of ::getActiveItem. */ + observeActiveItem(callback: (activeItem: object) => void): Disposable; + + /** Invoke the given callback before items are destroyed. */ + onWillDestroyItem(callback: (event: PaneListItemShiftedEvent) => void): Disposable; + + // Items + /** Get the items in this pane. */ + getItems(): object[]; + + /** Get the active pane item in this pane. */ + getActiveItem(): object; + + /** Return the item at the given index. */ + itemAtIndex(index: number): object|undefined; + + /** Makes the next item active. */ + activateNextItem(): void; + + /** Makes the previous item active. */ + activatePreviousItem(): void; + + /** Move the active tab to the right. */ + moveItemRight(): void; + + /** Move the active tab to the left. */ + moveItemLeft(): void; + + /** Get the index of the active item. */ + getActiveItemIndex(): number; + + /** Activate the item at the given index. */ + activateItemAtIndex(index: number): void; + + /** Make the given item active, causing it to be displayed by the pane's view. */ + activateItem(item: object, options?: { pending: boolean }): void; + + /** Add the given item to the pane. */ + addItem(item: object, options?: { index?: number, pending?: boolean }): object; + + /** Add the given items to the pane. */ + addItems(items: object[], index?: number): object[]; + + /** Move the given item to the given index. */ + moveItem(item: object, index: number): void; + + /** Move the given item to the given index on another pane. */ + moveItemToPane(item: object, pane: Pane, index: number): void; + + /** Destroy the active item and activate the next item. */ + destroyActiveItem(): Promise; + + /** Destroy the given item. */ + destroyItem(item: object, force?: boolean): Promise; + + /** Destroy all items. */ + destroyItems(): Promise; + + /** Destroy all items except for the active item. */ + destroyInactiveItems(): Promise; + + /** Save the active item. */ + saveActiveItem(nextAction?: (error?: Error) => T): + Promise|undefined; + + /** + * Prompt the user for a location and save the active item with the path + * they select. + */ + saveActiveItemAs(nextAction?: (error?: Error) => T): + Promise|undefined; + + /** Save the given item. */ + saveItem(item: object, nextAction?: (error?: Error) => T): + Promise|undefined; + + /** + * Prompt the user for a location and save the active item with the path + * they select. + */ + saveItemAs(item: object, nextAction?: (error?: Error) => T): + Promise|undefined; + + /** Save all items. */ + saveItems(): void; + + /** Return the first item that matches the given URI or undefined if none exists. */ + itemForURI(uri: string): object|undefined; + + /** Activate the first item that matches the given URI. */ + activateItemForURI(uri: string): boolean; + + // Lifecycle + /** Determine whether the pane is active. */ + isActive(): boolean; + + /** Makes this pane the active pane, causing it to gain focus. */ + activate(): void; + + /** Close the pane and destroy all its items. */ + destroy(): void; + + /** Determine whether this pane has been destroyed. */ + isDestroyed(): boolean; + + // Splitting + /** Create a new pane to the left of this pane. */ + splitLeft(params?: { + items?: object[], + copyActiveItem?: boolean, + }): Pane; + + /** Create a new pane to the right of this pane. */ + splitRight(params?: { + items?: object[], + copyActiveItem?: boolean, + }): Pane; + + /** Creates a new pane above the receiver. */ + splitUp(params?: { + items?: object[], + copyActiveItem?: boolean, + }): Pane; + + /** Creates a new pane below the receiver. */ + splitDown(params?: { + items?: object[], + copyActiveItem?: boolean, + }): Pane; +} + +/** + * A container representing a panel on the edges of the editor window. You + * should not create a Panel directly, instead use Workspace::addTopPanel and + * friends to add panels. + */ +export interface Panel { + /** Whether or not the Panel is visible. */ + visible: boolean; + + // Construction and Destruction + /** Destroy and remove this panel from the UI. */ + destroy(): void; + + // Event Subscription + /** Invoke the given callback when the pane hidden or shown. */ + onDidChangeVisible(callback: (visible: boolean) => void): Disposable; + + /** Invoke the given callback when the pane is destroyed. */ + onDidDestroy(callback: (panel: Panel) => void): Disposable; + + // Panel Details + /** Returns the panel's item. */ + getItem(): T; + + /** Returns a number indicating this panel's priority. */ + getPriority(): number; + + /** Returns a boolean true when the panel is visible. */ + isVisible(): boolean; + + /** Hide this panel. */ + hide(): void; + + /** Show this panel. */ + show(): void; +} + +/** Manage a subscription to filesystem events that occur beneath a root directory. */ +export interface PathWatcher extends DisposableLike { + /** + * Return a Promise that will resolve when the underlying native watcher is + * ready to begin sending events. + */ + getStartPromise(): Promise; + + /** Invokes a function when any errors related to this watcher are reported. */ + onDidError(callback: (error: Error) => void): Disposable; + + /** + * Unsubscribe all subscribers from filesystem events. Native resources will be + * release asynchronously, but this watcher will stop broadcasting events + * immediately. + */ + dispose(): void; +} + +/** Represents a project that's opened in Atom. */ +export interface Project { + // Event Subscription + /** Invoke the given callback when the project paths change. */ + onDidChangePaths(callback: (projectPaths: string[]) => void): Disposable; + + /** Invoke the given callback when a text buffer is added to the project. */ + onDidAddBuffer(callback: (buffer: TextBuffer) => void): Disposable; + + /** + * Invoke the given callback with all current and future text buffers in + * the project. + */ + observeBuffers(callback: (buffer: TextBuffer) => void): Disposable; + + /** Invoke a callback when a filesystem change occurs within any open project path. */ + onDidChangeFiles(callback: (events: FilesystemChangeEvent) => void): Disposable; + + // Accessing the Git Repository + /** Get an Array of GitRepositorys associated with the project's directories. */ + getRepositories(): GitRepository[]; + + /** Get the repository for a given directory asynchronously. */ + repositoryForDirectory(directory: Directory): Promise; + + // Managing Paths + /** Get an Array of strings containing the paths of the project's directories. */ + getPaths(): string[]; + + /** Set the paths of the project's directories. */ + setPaths(projectPaths: string[]): void; + + /** Add a path to the project's list of root paths. */ + addPath(projectPath: string): void; + + /** + * Access a promise that resolves when the filesystem watcher associated with a + * project root directory is ready to begin receiving events. + */ + getWatcherPromise(projectPath: string): Promise; + + /** Remove a path from the project's list of root paths. */ + removePath(projectPath: string): void; + + /** Get an Array of Directorys associated with this project. */ + getDirectories(): Directory[]; + + /** Get the relative path from the project directory to the given path. */ + relativize(fullPath: string): string; + + /** + * Get the path to the project directory that contains the given path, and + * the relative path from that project directory to the given path. + */ + relativizePath(fullPath: string): [string|null, string]; + + /** + * Determines whether the given path (real or symbolic) is inside the + * project's directory. + */ + contains(pathToCheck: string): boolean; +} + +/** + * Wraps an array of strings. The Array describes a path from the root of the + * syntax tree to a token including all scope names for the entire path. + */ +export interface ScopeDescriptor { + scopes: string[]; + + /** Returns all scopes for this descriptor. */ + getScopesArray(): string[]; +} + +/** Represents a selection in the TextEditor. */ +export interface Selection { + // Event Subscription + /** Calls your callback when the selection was moved. */ + onDidChangeRange(callback: (event: SelectionChangedEvent) => void): Disposable; + + /** Calls your callback when the selection was destroyed. */ + onDidDestroy(callback: () => void): Disposable; + + // Managing the selection range + /** Returns the screen Range for the selection. */ + getScreenRange(): Range; + + /** Modifies the screen range for the selection. */ + setScreenRange(screenRange: RangeCompatible, options?: { + preserveFolds?: boolean, + autoscroll?: boolean + }): void; + + /** Returns the buffer Range for the selection. */ + getBufferRange(): Range; + + /** Modifies the buffer Range for the selection. */ + setBufferRange(bufferRange: RangeCompatible, options?: { + preserveFolds?: boolean, + autoscroll?: boolean, + }): void; + + /** Returns the starting and ending buffer rows the selection is highlighting. */ + getBufferRowRange(): [number, number]; + + // Info about the selection + /** Determines if the selection contains anything. */ + isEmpty(): boolean; + + /** + * Determines if the ending position of a marker is greater than the starting position. + * This can happen when, for example, you highlight text "up" in a TextBuffer. + */ + isReversed(): boolean; + + /** Returns whether the selection is a single line or not. */ + isSingleScreenLine(): boolean; + + /** Returns the text in the selection. */ + getText(): string; + + // NOTE: this calls into Range.intersectsWith(), which is one of the few functions + // that doesn't take a range-compatible range, despite what the API says. + /** Identifies if a selection intersects with a given buffer range. */ + intersectsBufferRange(bufferRange: RangeLike): boolean; + + /** Identifies if a selection intersects with another selection. */ + intersectsWith(otherSelection: Selection): boolean; + + // Modifying the selected range + /** Clears the selection, moving the marker to the head. */ + clear(options?: { autoscroll?: boolean }): void; + + /** Selects the text from the current cursor position to a given screen position. */ + selectToScreenPosition(position: PointCompatible): void; + + /** Selects the text from the current cursor position to a given buffer position. */ + selectToBufferPosition(position: PointCompatible): void; + + /** Selects the text one position right of the cursor. */ + selectRight(columnCount?: number): void; + + /** Selects the text one position left of the cursor. */ + selectLeft(columnCount?: number): void; + + /** Selects all the text one position above the cursor. */ + selectUp(rowCount?: number): void; + + /** Selects all the text one position below the cursor. */ + selectDown(rowCount?: number): void; + + /** + * Selects all the text from the current cursor position to the top of the + * buffer. + */ + selectToTop(): void; + + /** + * Selects all the text from the current cursor position to the bottom of + * the buffer. + */ + selectToBottom(): void; + + /** Selects all the text in the buffer. */ + selectAll(): void; + + /** + * Selects all the text from the current cursor position to the beginning of + * the line. + */ + selectToBeginningOfLine(): void; + + /** + * Selects all the text from the current cursor position to the first character + * of the line. + */ + selectToFirstCharacterOfLine(): void; + + /** + * Selects all the text from the current cursor position to the end of the + * screen line. + */ + selectToEndOfLine(): void; + + /** + * Selects all the text from the current cursor position to the end of the + * buffer line. + */ + selectToEndOfBufferLine(): void; + + /** + * Selects all the text from the current cursor position to the beginning + * of the word. + */ + selectToBeginningOfWord(): void; + + /** Selects all the text from the current cursor position to the end of the word. */ + selectToEndOfWord(): void; + + /** + * Selects all the text from the current cursor position to the beginning of + * the next word. + */ + selectToBeginningOfNextWord(): void; + + /** Selects text to the previous word boundary. */ + selectToPreviousWordBoundary(): void; + + /** Selects text to the next word boundary. */ + selectToNextWordBoundary(): void; + + /** Selects text to the previous subword boundary. */ + selectToPreviousSubwordBoundary(): void; + + /** Selects text to the next subword boundary. */ + selectToNextSubwordBoundary(): void; + + /** + * Selects all the text from the current cursor position to the beginning of + * the next paragraph. + */ + selectToBeginningOfNextParagraph(): void; + + /** + * Selects all the text from the current cursor position to the beginning of + * the previous paragraph. + */ + selectToBeginningOfPreviousParagraph(): void; + + /** Modifies the selection to encompass the current word. */ + selectWord(): void; + + /** + * Expands the newest selection to include the entire word on which the + * cursors rests. + */ + expandOverWord(): void; + + /** Selects an entire line in the buffer. */ + selectLine(row: number): void; + + /** + * Expands the newest selection to include the entire line on which the cursor + * currently rests. + * It also includes the newline character. + */ + expandOverLine(): void; + + // Modifying the selected text + /** Replaces text at the current selection. */ + insertText(text: string, options?: TextInsertionOptions): void; + + /** + * Removes the first character before the selection if the selection is empty + * otherwise it deletes the selection. + */ + backspace(): 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; + + /** + * 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; + + /** + * 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; + + /** + * Removes from the beginning of the line which the selection begins on all + * the way through to the end of the selection. + */ + deleteToBeginningOfLine(): void; + + /** + * Removes the selection or the next character after the start of the selection + * if the selection is empty. + */ + delete(): 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** Removes only the selected text. */ + deleteSelectedText(): 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; + + /** + * 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; + + /** Removes one level of indent from the currently selected rows. */ + outdentSelectedRows(): void; + + /** + * Sets the indentation level of all selected rows to values suggested by the + * relevant grammars. + */ + autoIndentSelectedRows(): 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; + + /** Cuts the selection until the end of the screen line. */ + cutToEndOfLine(): void; + + /** Cuts the selection until the end of the buffer line. */ + cutToEndOfBufferLine(): void; + + /** Copies the selection to the clipboard and then deletes it. */ + cut(maintainClipboard?: boolean, fullLine?: boolean): void; + + /** Copies the current selection to the clipboard. */ + copy(maintainClipboard?: boolean, fullLine?: boolean): void; + + /** Creates a fold containing the current selection. */ + fold(): void; + + /** If the selection spans multiple rows, indent all of them. */ + indentSelectedRows(): void; + + // Managing multiple selections + /** Moves the selection down one row. */ + addSelectionBelow(): void; + + /** Moves the selection up one row. */ + addSelectionAbove(): void; + + /** + * Combines the given selection into this selection and then destroys the + * given selection. + */ + merge(otherSelection: Selection, options?: { preserveFolds?: boolean, + autoscroll?: boolean }): void; + + // Comparing to other selections + /** + * Compare this selection's buffer range to another selection's buffer range. + * See Range::compare for more details. + */ + compare(otherSelection: Selection): number; +} + +/** + * A singleton instance of this class available via atom.styles, which you can + * use to globally query and observe the set of active style sheets. + */ +export interface StyleManager { + // Event Subscription + /** Invoke callback for all current and future style elements. */ + observeStyleElements(callback: (styleElement: StyleElementObservedEvent) => + void): Disposable; + + /** Invoke callback when a style element is added. */ + onDidAddStyleElement(callback: (styleElement: StyleElementObservedEvent) => + void): Disposable; + + /** Invoke callback when a style element is removed. */ + onDidRemoveStyleElement(callback: (styleElement: HTMLStyleElement) => void): Disposable; + + /** Invoke callback when an existing style element is updated. */ + onDidUpdateStyleElement(callback: (styleElement: StyleElementObservedEvent) => + void): Disposable; + + // Reading Style Elements + /** Get all loaded style elements. */ + getStyleElements(): HTMLStyleElement[]; + + // Paths + /** Get the path of the user style sheet in ~/.atom. */ + getUserStyleSheetPath(): string; +} + +/** Run a node script in a separate process. */ +export class Task { + // NOTE: this is actually the best we can do here with the REST parameter for + // this appearing in the middle of the parameter list, which isn't aligned with + // the ES6 spec. Maybe when they rewrite it in JavaScript this will change. + /** A helper method to easily launch and run a task once. */ + // tslint:disable-next-line:no-any + static once(taskPath: string, ...args: any[]): Task; + + /** Creates a task. You should probably use .once */ + constructor(taskPath: string); + + // NOTE: this is actually the best we can do here with the REST parameter + // for this appearing in the beginning of the parameter list, which isn't + // aligned with the ES6 spec. + /** + * Starts the task. + * Throws an error if this task has already been terminated or if sending a + * message to the child process fails. + */ + // tslint:disable-next-line:no-any + start(...args: any[]): void; + + /** + * Send message to the task. + * Throws an error if this task has already been terminated or if sending a + * message to the child process fails. + */ + send(message: string): void; + + /** Call a function when an event is emitted by the child process. */ + // tslint:disable-next-line:no-any + on(eventName: string, callback: (param: any) => void): Disposable; + + /** + * Forcefully stop the running task. + * No more events are emitted once this method is called. + */ + terminate(): void; + + /** Cancel the running task and emit an event if it was canceled. */ + cancel(): boolean; +} + +/** + * A mutable text container with undo/redo support and the ability to + * annotate logical regions in the text. + */ +export class TextBuffer { + /** The unique identifier for this buffer. */ + id: string; + + /** The number of retainers for the buffer. */ + refcount: number; + + /** Whether or not the bufffer has been destroyed. */ + destroyed: boolean; + + /** Create a new buffer backed by the given file path. */ + static load(filePath: string, params?: BufferLoadOptions): Promise; + + /** + * Create a new buffer backed by the given file path. For better performance, + * use TextBuffer.load instead. + */ + static loadSync(filePath: string, params?: BufferLoadOptions): TextBuffer; + + /** + * Restore a TextBuffer based on an earlier state created using the + * TextBuffer::serialize method. + */ + static deserialize(params: object): Promise; + + /** Create a new buffer with the given starting text. */ + constructor(text: string); + /** Create a new buffer with the given params. */ + constructor(params?: { + /** The initial string text of the buffer. */ + text?: string + /** + * A function that returns a Boolean indicating whether the buffer should + * be destroyed if its file is deleted. + */ + shouldDestroyOnFileDelete?(): boolean + }); + + /** Returns a plain javascript object representation of the TextBuffer. */ + serialize(options?: { markerLayers?: boolean, history?: boolean }): object; + + /** Returns the unique identifier for this buffer. */ + getId(): string; + + // Event Subscription + /** + * Invoke the given callback synchronously before the content of the buffer + * changes. + */ + onWillChange(callback: (event: BufferChangingEvent) => void): Disposable; + + /** + * Invoke the given callback synchronously when the content of the buffer + * changes. You should probably not be using this in packages. + */ + onDidChange(callback: (event: BufferChangedEvent) => void): Disposable; + + /** + * Invoke the given callback synchronously when a transaction finishes with + * a list of all the changes in the transaction. + */ + onDidChangeText(callback: (event: BufferStoppedChangingEvent) => void): Disposable; + + /** + * Invoke the given callback asynchronously following one or more changes after + * ::getStoppedChangingDelay milliseconds elapse without an additional change. + */ + onDidStopChanging(callback: (event: BufferStoppedChangingEvent) => void): + Disposable; + + /** + * Invoke the given callback when the in-memory contents of the buffer become + * in conflict with the contents of the file on disk. + */ + onDidConflict(callback: () => void): Disposable; + + /** Invoke the given callback if the value of ::isModified changes. */ + onDidChangeModified(callback: (modified: boolean) => void): Disposable; + + /** + * Invoke the given callback when all marker ::onDidChange observers have been + * notified following a change to the buffer. + */ + onDidUpdateMarkers(callback: () => void): Disposable; + + onDidCreateMarker(callback: (marker: Marker) => void): Disposable; + + /** Invoke the given callback when the value of ::getPath changes. */ + onDidChangePath(callback: (path: string) => void): Disposable; + + /** Invoke the given callback when the value of ::getEncoding changes. */ + onDidChangeEncoding(callback: (encoding: string) => void): Disposable; + + /** + * Invoke the given callback before the buffer is saved to disk. If the + * given callback returns a promise, then the buffer will not be saved until + * the promise resolves. + */ + onWillSave(callback: () => Promise|void): Disposable; + + /** Invoke the given callback after the buffer is saved to disk. */ + onDidSave(callback: (event: FileSavedEvent) => void): Disposable; + + /** Invoke the given callback after the file backing the buffer is deleted. */ + onDidDelete(callback: () => void): Disposable; + + /** + * Invoke the given callback before the buffer is reloaded from the contents + * of its file on disk. + */ + onWillReload(callback: () => void): Disposable; + + /** + * Invoke the given callback after the buffer is reloaded from the contents + * of its file on disk. + */ + onDidReload(callback: () => void): Disposable; + + /** Invoke the given callback when the buffer is destroyed. */ + onDidDestroy(callback: () => void): Disposable; + + /** Invoke the given callback when there is an error in watching the file. */ + onWillThrowWatchError(callback: (errorObject: HandleableErrorEvent) => void): + Disposable; + + /** + * Get the number of milliseconds that will elapse without a change before + * ::onDidStopChanging observers are invoked following a change. + */ + getStoppedChangingDelay(): number; + + // File Details + /** + * Determine if the in-memory contents of the buffer differ from its contents + * on disk. + * If the buffer is unsaved, always returns true unless the buffer is empty. + */ + isModified(): boolean; + + /** + * Determine if the in-memory contents of the buffer conflict with the on-disk + * contents of its associated file. + */ + isInConflict(): boolean; + + /** Get the path of the associated file. */ + getPath(): string|undefined; + + /** Set the path for the buffer's associated file. */ + setPath(filePath: string): void; + + /** Sets the character set encoding for this buffer. */ + setEncoding(encoding: string): void; + + /** Returns the string encoding of this buffer. */ + getEncoding(): string; + + /** Get the path of the associated file. */ + getUri(): string; + + // Reading Text + /** Determine whether the buffer is empty. */ + isEmpty(): boolean; + + /** Get the entire text of the buffer. */ + getText(): string; + + /** Get the text in a range. */ + getTextInRange(range: RangeCompatible): string; + + /** Get the text of all lines in the buffer, without their line endings. */ + getLines(): string[]; + + /** Get the text of the last line of the buffer, without its line ending. */ + getLastLine(): string; + + /** Get the text of the line at the given row, without its line ending. */ + lineForRow(row: number): string|undefined; + + /** Get the line ending for the given 0-indexed row. */ + lineEndingForRow(row: number): string|undefined; + + /** + * Get the length of the line for the given 0-indexed row, without its line + * ending. + */ + lineLengthForRow(row: number): number; + + /** Determine if the given row contains only whitespace. */ + isRowBlank(row: number): boolean; + + /** + * Given a row, find the first preceding row that's not blank. + * Returns a number or null if there's no preceding non-blank row. + */ + previousNonBlankRow(startRow: number): number|null; + + /** + * Given a row, find the next row that's not blank. + * Returns a number or null if there's no next non-blank row. + */ + nextNonBlankRow(startRow: number): number|null; + + // Mutating Text + /** Replace the entire contents of the buffer with the given text. */ + setText(text: string): Range; + + /** + * Replace the current buffer contents by applying a diff based on the + * given text. + */ + setTextViaDiff(text: string): void; + + /** Set the text in the given range. */ + setTextInRange(range: RangeCompatible, text: string, options?: + { normalizeLineEndings?: boolean, undo?: "skip" }): Range; + + /** Insert text at the given position. */ + insert(position: PointCompatible, text: string, options?: + { normalizeLineEndings?: boolean, undo?: "skip" }): Range; + + /** Append text to the end of the buffer. */ + append(text: string, options?: { normalizeLineEndings?: boolean, undo?: + "skip" }): Range; + + /** Delete the text in the given range. */ + delete(range: RangeCompatible): Range; + + /** Delete the line associated with a specified row. */ + deleteRow(row: number): Range; + + /** Delete the lines associated with the specified row range. */ + deleteRows(startRow: number, endRow: number): Range; + + // Markers + /** Create a layer to contain a set of related markers. */ + addMarkerLayer(options?: { maintainHistory?: boolean, persistent?: boolean }): + MarkerLayer; + + /** + * Get a MarkerLayer by id. + * Returns a MarkerLayer or `` if no layer exists with the given id. + */ + getMarkerLayer(id: string): MarkerLayer|undefined; + + /** Get the default MarkerLayer. */ + getDefaultMarkerLayer(): MarkerLayer; + + /** Create a marker with the given range in the default marker layer. */ + markRange(range: RangeCompatible, properties?: { reversed?: boolean, + invalidate?: "never"|"surround"|"overlap"|"inside"|"touch", + exclusive?: boolean }): Marker; + + /** Create a marker at the given position with no tail in the default marker layer. */ + markPosition(position: PointCompatible, options?: { invalidate?: "never"|"surround" + |"overlap"|"inside"|"touch", exclusive?: boolean }): Marker; + + /** Get all existing markers on the default marker layer. */ + getMarkers(): Marker[]; + + /** Get an existing marker by its id from the default marker layer. */ + getMarker(id: number): Marker; + + /** Find markers conforming to the given parameters in the default marker layer. */ + findMarkers(params: FindMarkerOptions): Marker[]; + + /** Get the number of markers in the default marker layer. */ + getMarkerCount(): number; + + // History + /** Undo the last operation. If a transaction is in progress, aborts it. */ + undo(): boolean; + + /** Redo the last operation. */ + redo(): boolean; + + /** Batch multiple operations as a single undo/redo step. */ + transact(groupingInterval: number, fn: () => T): T; + transact(fn: () => T): T; + + /** + * Call within a transaction to terminate the function's execution and + * revert any changes performed up to the abortion. + */ + abortTransaction(): void; + + /** + * Clear the undo stack. When calling this method within a transaction, + * the ::onDidChangeText event will not be triggered because the information + * describing the changes is lost. + */ + clearUndoStack(): void; + + /** + * Create a pointer to the current state of the buffer for use with + * ::revertToCheckpoint and ::groupChangesSinceCheckpoint. + */ + createCheckpoint(): number; + + /** + * Revert the buffer to the state it was in when the given checkpoint was created. + * Returns a boolean indicating whether the operation succeeded. + */ + revertToCheckpoint(checkpoint: number): boolean; + + /** + * Group all changes since the given checkpoint into a single transaction for + * purposes of undo/redo. + * Returns a boolean indicating whether the operation succeeded. + */ + groupChangesSinceCheckpoint(checkpoint: number): boolean; + + /** + * Returns a list of changes since the given checkpoint. + * If the given checkpoint is no longer present in the undo history, this method + * will return an empty Array. + */ + getChangesSinceCheckpoint(checkpoint: number): Array<{ + /** A Point representing where the change started. */ + start: Point, + + /** A Point representing the replaced extent. */ + oldExtent: Point, + + /** A Point representing the replacement extent. */ + newExtent: Point, + + /** A String representing the replacement text. */ + newText: string + }>; + + // Search and Replace + /** + * Scan regular expression matches in the entire buffer, calling the given + * iterator function on each match. + */ + scan(regex: RegExp, iterator: (params: BufferScanResult) => void): void; + /** + * Scan regular expression matches in the entire buffer, calling the given + * iterator function on each match. + */ + scan(regex: RegExp, options: ScanContextOptions, iterator: (params: + ContextualBufferScanResult) => void): void; + + /** + * Scan regular expression matches in the entire buffer in reverse order, + * calling the given iterator function on each match. + */ + backwardsScan(regex: RegExp, iterator: (params: BufferScanResult) => void): void; + /** + * Scan regular expression matches in the entire buffer in reverse order, + * calling the given iterator function on each match. + */ + backwardsScan(regex: RegExp, options: ScanContextOptions, iterator: (params: + ContextualBufferScanResult) => void): void; + + /** + * Scan regular expression matches in a given range , calling the given + * iterator function on each match. + */ + scanInRange(regex: RegExp, range: RangeCompatible, iterator: + (params: BufferScanResult) => void): void; + /** + * Scan regular expression matches in a given range , calling the given + * iterator function on each match. + */ + scanInRange(regex: RegExp, range: RangeCompatible, options: ScanContextOptions, + iterator: (params: ContextualBufferScanResult) => void): void; + + /** + * Scan regular expression matches in a given range in reverse order, + * calling the given iterator function on each match. + */ + backwardsScanInRange(regex: RegExp, range: RangeCompatible, iterator: + (params: BufferScanResult) => void): void; + /** + * Scan regular expression matches in a given range in reverse order, + * calling the given iterator function on each match. + */ + backwardsScanInRange(regex: RegExp, range: RangeCompatible, options: ScanContextOptions, + iterator: (params: ContextualBufferScanResult) => void): void; + + /** Replace all regular expression matches in the entire buffer. */ + replace(regex: RegExp, replacementText: string): number; + + // Buffer Range Details + /** Get the range spanning from [0, 0] to ::getEndPosition. */ + getRange(): Range; + + /** Get the number of lines in the buffer. */ + getLineCount(): number; + + /** Get the last 0-indexed row in the buffer. */ + getLastRow(): number; + + /** Get the first position in the buffer, which is always [0, 0]. */ + getFirstPosition(): Point; + + /** Get the maximal position in the buffer, where new text would be appended. */ + getEndPosition(): Point; + + /** Get the length of the buffer in characters. */ + getMaxCharacterIndex(): number; + + /** Get the range for the given row. */ + rangeForRow(row: number, includeNewline: boolean): Range; + + /** + * Convert a position in the buffer in row/column coordinates to an absolute + * character offset, inclusive of line ending characters. + */ + characterIndexForPosition(position: Point|[number, number]): number; + + /** + * Convert an absolute character offset, inclusive of newlines, to a position + * in the buffer in row/column coordinates. + */ + positionForCharacterIndex(offset: number): Point; + + /** Clip the given range so it starts and ends at valid positions. */ + clipRange(range: RangeCompatible): Range; + + /** Clip the given point so it is at a valid position in the buffer. */ + clipPosition(position: PointCompatible): Point; + + // Buffer Operations + /** Save the buffer. */ + save(): Promise; + + /** Save the buffer at a specific path. */ + saveAs(filePath: string): Promise; + + /** Reload the buffer's contents from disk. */ + reload(): void; + + /** Destroy the buffer, even if there are retainers for it. */ + destroy(): void; + + /** Returns whether or not this buffer is alive. */ + isAlive(): boolean; + + /** Returns whether or not this buffer has been destroyed. */ + isDestroyed(): boolean; + + /** Returns whether or not this buffer has a retainer. */ + isRetained(): boolean; + + /** + * Places a retainer on the buffer, preventing its destruction until the + * final retainer has called ::release(). + */ + retain(): TextBuffer; + + /** + * Releases a retainer on the buffer, destroying the buffer if there are + * no additional retainers. + */ + release(): TextBuffer; + + /** Identifies if the buffer belongs to multiple editors. */ + hasMultipleEditors(): boolean; +} + +/** Handles loading and activating available themes. */ +export interface ThemeManager { + // Event Subscription + /** + * Invoke callback when style sheet changes associated with updating the + * list of active themes have completed. + */ + onDidChangeActiveThemes(callback: () => void): Disposable; + + // Accessing Loaded Themes + /** Returns an Array of strings of all the loaded theme names. */ + getLoadedThemeNames(): string[]|undefined; + + /** Returns an Array of all the loaded themes. */ + getLoadedThemes(): Package[]|undefined; + + // Accessing Active Themes + /** Returns an Array of strings all the active theme names. */ + getActiveThemeNames(): string[]|undefined; + + /** Returns an Array of all the active themes. */ + getActiveThemes(): Package[]|undefined; + + // Managing Enabled Themes + /** Get the enabled theme names from the config. */ + getEnabledThemeNames(): string[]; +} + +// Events ===================================================================== +// The event objects that are passed into the callbacks which the user provides to +// specific API calls. + +export interface AddedKeystrokeResolverEvent { + /** + * The currently resolved keystroke string. If your function returns a falsy + * value, this is how Atom will resolve your keystroke. + */ + keystroke: string; + + /** + * The raw DOM 3 `KeyboardEvent` being resolved. See the DOM API documentation + * for more details. + */ + event: KeyboardEvent; + + /** The OS-specific name of the current keyboard layout. */ + layoutName: string; + + /** + * An object mapping DOM 3 `KeyboardEvent.code` values to objects with the + * typed character for that key in each modifier state, based on the current + * operating system layout. + */ + keymap: object; +} + +export interface BufferChangingEvent { + /** Range of the old text. */ + oldRange: Range; +} + +export interface BufferChangedEvent { + /** Range of the old text. */ + oldRange: Range; + + /** Range of the new text. */ + newRange: Range; + + /** String containing the text that was replaced. */ + oldText: string; + + /** String containing the text that was inserted. */ + newText: string; +} + +export interface BufferStoppedChangingEvent { + changes: TextChange[]; +} + +/** + * This custom subclass of CustomEvent exists to provide the ::abortKeyBinding + * method, as well as versions of the ::stopPropagation methods that record the + * intent to stop propagation so event bubbling can be properly simulated for + * detached elements. + */ +export interface CommandEvent extends CustomEvent { + keyBindingAborted: boolean; + propagationStopped: boolean; + + abortKeyBinding(): void; + stopPropagation(): CustomEvent; + stopImmediatePropagation(): CustomEvent; +} + +export interface CursorPositionChangedEvent { + oldBufferPosition: Point; + oldScreenPosition: Point; + newBufferPosition: Point; + newScreenPosition: Point; + textChanged: boolean; + cursor: Cursor; +} + +export interface DecorationPropsChangedEvent { + /** Object the old parameters the decoration used to have. */ + oldProperties: DecorationOptions; + + /** Object the new parameters the decoration now has */ + newProperties: DecorationOptions; +} + +export interface DisplayMarkerChangedEvent { + /** Point representing the former head buffer position. */ + oldHeadBufferPosition: Point; + + /** Point representing the new head buffer position. */ + newHeadBufferPosition: Point; + + // Point representing the former tail buffer position. */ + oldTailBufferPosition: Point; + + /** Point representing the new tail buffer position. */ + newTailBufferPosition: Point; + + /** Point representing the former head screen position. */ + oldHeadScreenPosition: Point; + + /** Point representing the new head screen position. */ + newHeadScreenPosition: Point; + + /** Point representing the former tail screen position. */ + oldTailScreenPosition: Point; + + /** Point representing the new tail screen position. */ + newTailScreenPosition: Point; + + /** Boolean indicating whether the marker was valid before the change. */ + wasValid: boolean; + + /** Boolean indicating whether the marker is now valid. */ + isValid: boolean; + + /** Boolean indicating whether the marker had a tail before the change. */ + hadTail: boolean; + + /** Boolean indicating whether the marker now has a tail */ + hasTail: boolean; + + /** + * -DEPRECATED- Object containing the marker's custom properties before the change. + * @deprecated + */ + oldProperties: object; + + /** + * -DEPRECATED- Object containing the marker's custom properties after the change. + * @deprecated + */ + newProperties: object; + + /** + * Boolean indicating whether this change was caused by a textual change to the + * buffer or whether the marker was manipulated directly via its public API. + */ + textChanged: boolean; +} + +export interface EditorChangedEvent { + /** A Point representing where the change started. */ + start: Point; + + /** A Point representing the replaced extent. */ + oldExtent: Point; + + /** A Point representing the replacement extent. */ + newExtent: Point; +} + +export interface ExceptionThrownEvent { + originalError: Error; + message: string; + url: string; + line: number; + column: number; +} + +export interface FailedKeybindingMatchEvent { + /** The string of keystrokes that failed to match the binding. */ + keystrokes: string; + + /** The DOM element that was the target of the most recent keyboard event. */ + keyboardEventTarget: Element; +} + +export interface FailedKeymapFileReadEvent { + /** The error message. */ + message: string; + + /** The error stack trace. */ + stack: string; +} + +export interface FileSavedEvent { + /** The path to which the buffer was saved. */ + path: string; +} + +export type FilesystemChangeEvent = Array<{ + /** A string describing the filesystem action that occurred. */ + action: "created"|"modified"|"deleted"|"renamed"; + + /** The absolute path to the filesystem entry that was acted upon. */ + path: string; + + /** + * For rename events, a string containing the filesystem entry's former + * absolute path. + */ + oldPath?: string; +}>; + +export interface FullKeybindingMatchEvent { + /** The string of keystrokes that matched the binding. */ + keystrokes: string; + + /** The KeyBinding that the keystrokes matched. */ + binding: KeyBinding; + + /** The DOM element that was the target of the most recent keyboard event. */ + keyboardEventTarget: Element; +} + +export interface HandleableErrorEvent { + /** The error object. */ + error: Error; + + /** + * Call this function to indicate you have handled the error. + * The error will not be thrown if this function is called. + */ + handle(): void; +} + +export interface KeymapLoadedEvent { + /** The path of the keymap file. */ + path: string; +} + +export interface MarkerChangedEvent { + /** Point representing the former head position. */ + oldHeadPosition: Point; + + /** Point representing the new head position. */ + newHeadPosition: Point; + + /** Point representing the former tail position. */ + oldTailPosition: Point; + + /** Point representing the new tail position. */ + newTailPosition: Point; + + /** Boolean indicating whether the marker was valid before the change. */ + wasValid: boolean; + + /** Boolean indicating whether the marker is now valid. */ + isValid: boolean; + + /** Boolean indicating whether the marker had a tail before the change. */ + hadTail: boolean; + + /** Boolean indicating whether the marker now has a tail. */ + hasTail: boolean; + + /** + * -DEPRECATED- Object containing the marker's custom properties before the change. + * @deprecated + */ + oldProperties: object; + + /** + * -DEPRECATED- Object containing the marker's custom properties after the change. + * @deprecated + */ + newProperties: object; + + /** + * Boolean indicating whether this change was caused by a textual + * change to the buffer or whether the marker was manipulated directly + * via its public API. + */ + textChanged: boolean; +} + +export interface PaneItemObservedEvent { + item: object; + pane: Pane; + index: number; +} + +export interface PaneListItemShiftedEvent { + /** The pane item that was added or removed. */ + item: object; + + /** A number indicating where the item is located. */ + index: number; +} + +export interface PaneItemMovedEvent { + /** The removed pane item. */ + item: object; + + /** A number indicating where the item was located. */ + oldIndex: number; + + /** A number indicating where the item is now located. */ + newIndex: number; +} + +export interface PaneItemOpenedEvent extends PaneItemObservedEvent { + uri: string; +} + +export interface PartialKeybindingMatchEvent { + /** The string of keystrokes that matched the binding. */ + keystrokes: string; + + /** The KeyBindings that the keystrokes partially matched. */ + partiallyMatchedBindings: KeyBinding[]; + + /** DOM element that was the target of the most recent keyboard event. */ + keyboardEventTarget: Element; +} + +export interface PathWatchErrorThrownEvent { + /** The error object. */ + error: Error; + + /** + * Call this function to indicate you have handled the error. + * The error will not be thrown if this function is called. + */ + handle(): void; +} + +export interface PreventableExceptionThrownEvent extends ExceptionThrownEvent { + preventDefault(): void; +} + +export interface RepoStatusChangedEvent { + path: string; + + /** + * This value can be passed to ::isStatusModified or ::isStatusNew to get more + * information. + */ + pathStatus: number; +} + +export interface SelectionChangedEvent { + oldBufferRange: Range; + oldScreenRange: Range; + newBufferRange: Range; + newScreenRange: Range; + selection: Selection; +} + +export interface StyleElementObservedEvent extends HTMLStyleElement { + sourcePath: string; + context: string; +} + +export interface TextEditorObservedEvent { + textEditor: TextEditor; + pane: Pane; + index: number; +} + +// Extendables ================================================================ +// Interfaces which can be augmented in order to provide additional type +// information under certain contexts. + +// NOTE: the config schema with these defaults can be found here: +// https://github.com/atom/atom/blob/v1.22.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 + * the value of each key being templated by the type of the associated value. + */ +export interface ConfigValues { + /** + * List of glob patterns. Files and directories matching these patterns will be + * ignored by some packages, such as the fuzzy finder and tree view. Individual + * packages might have additional config settings for ignoring names. + */ + "core.ignoredNames": string[]; + + /** + * Files and directories ignored by the current project's VCS system will be ignored + * by some packages, such as the fuzzy finder and find and replace. For example, + * projects using Git have these paths defined in the .gitignore file. Individual + * packages might have additional config settings for ignoring VCS ignored files and + * folders. + */ + "core.excludeVcsIgnoredPaths": boolean; + + /** + * Follow symbolic links when searching files and when opening files with the fuzzy + * finder. + */ + "core.followSymlinks": boolean; + + /** List of names of installed packages which are not loaded at startup. */ + "core.disabledPackages": string[]; + + /** List of names of installed packages which are not automatically updated. */ + "core.versionPinnedPackages": string[]; + + /** + * Associates scope names (e.g. "source.coffee") with arrays of file extensions + * and file names (e.g. ["Cakefile", ".coffee2"]). + */ + "core.customFileTypes": { + [key: string]: string[]; + }; + + /** Names of UI and syntax themes which will be used when Atom starts. */ + "core.themes": string[]; + + /** + * Trigger the system's beep sound when certain actions cannot be executed or + * there are no results. + */ + "core.audioBeep": boolean; + + /** Close corresponding editors when a file is deleted outside Atom. */ + "core.closeDeletedFileTabs": boolean; + + /** When the last tab of a pane is closed, remove that pane as well. */ + "core.destroyEmptyPanes": boolean; + + /** + * When a window with no open tabs or panes is given the 'Close Tab' command, + * close that window. + */ + "core.closeEmptyWindows": boolean; + + /** Default character set encoding to use when reading and writing files. */ + "core.fileEncoding": FileEncoding; + + /** + * When checked opens an untitled editor when loading a blank environment (such as + * with 'File > New Window' or when "Restore Previous Windows On Start" is unchecked); + * otherwise, no editor is opened when loading a blank environment. + * This setting has no effect when restoring a previous state. + */ + "core.openEmptyEditorOnStart": boolean; + + /** + * When selected 'no', a blank environment is loaded. When selected 'yes' and Atom + * is started from the icon or `atom` by itself from the command line, restores the + * last state of all Atom windows; otherwise a blank environment is loaded. When + * selected 'always', restores the last state of all Atom windows always, no matter + * how Atom is started. + */ + "core.restorePreviousWindowsOnStart": "no"|"yes"|"always"; + + /** How many recent projects to show in the Reopen Project menu. */ + "core.reopenProjectMenuCount": number; + + /** Automatically update Atom when a new release is available. */ + "core.automaticallyUpdate": boolean; + + /** Use detected proxy settings when calling the `apm` command-line tool. */ + "core.useProxySettingsWhenCallingApm": boolean; + + /** + * Allow items to be previewed without adding them to a pane permanently, such as + * when single clicking files in the tree view. + */ + "core.allowPendingPaneItems": boolean; + + /** + * Allow usage statistics and exception reports to be sent to the Atom team to help + * improve the product. + */ + "core.telemetryConsent": "limited"|"no"|"undecided"; + + /** Warn before opening files larger than this number of megabytes. */ + "core.warnOnLargeFileLimit": number; + + /** + * Choose the underlying implementation used to watch for filesystem changes. Emulating + * changes will miss any events caused by applications other than Atom, but may help + * prevent crashes or freezes. + */ + "core.fileSystemWatcher": "native"|"atom"; + + "editor.commentStart": string|null; + + "editor.commentEnd": string|null; + + "editor.increaseIndentPattern": string|null; + + "editor.decreaseIndentPattern": string|null; + + "editor.foldEndPattern": string|null; + + /** The name of the font family used for editor text. */ + "editor.fontFamily": string; + + /** Height in pixels of editor text. */ + "editor.fontSize": number; + + /** Height of editor lines, as a multiplier of font size. */ + "editor.lineHeight": string|number; + + /** Show cursor while there is a selection. */ + "editor.showCursorOnSelection": boolean; + + /** Render placeholders for invisible characters, such as tabs, spaces and newlines. */ + "editor.showInvisibles": boolean; + + /** Show indentation indicators in the editor. */ + "editor.showIndentGuide": boolean; + + /** Show line numbers in the editor's gutter. */ + "editor.showLineNumbers": boolean; + + /** Skip over tab-length runs of leading whitespace when moving the cursor. */ + "editor.atomicSoftTabs": boolean; + + /** Automatically indent the cursor when inserting a newline. */ + "editor.autoIndent": boolean; + + /** Automatically indent pasted text based on the indentation of the previous line. */ + "editor.autoIndentOnPaste": boolean; + + /** A string of non-word characters to define word boundaries. */ + "editor.nonWordCharacters": string; + + /** + * Identifies the length of a line which is used when wrapping text with the + * `Soft Wrap At Preferred Line Length` setting enabled, in number of characters. + */ + "editor.preferredLineLength": number; + + /** + * Defines the maximum width of the editor window before soft wrapping is enforced, + * in number of characters. + */ + "editor.maxScreenLineLength": number; + + /** Number of spaces used to represent a tab. */ + "editor.tabLength": number; + + /** + * Wraps lines that exceed the width of the window. When `Soft Wrap At Preferred + * Line Length` is set, it will wrap to the number of characters defined by the + * `Preferred Line Length` setting. + */ + "editor.softWrap": boolean; + + /** + * If the `Tab Type` config setting is set to "auto" and autodetection of tab type + * from buffer content fails, then this config setting determines whether a soft tab + * or a hard tab will be inserted when the Tab key is pressed. + */ + "editor.softTabs": boolean; + + /** + * Determine character inserted when Tab key is pressed. Possible values: "auto", + * "soft" and "hard". When set to "soft" or "hard", soft tabs (spaces) or hard tabs + * (tab characters) are used. When set to "auto", the editor auto-detects the tab + * type based on the contents of the buffer (it uses the first leading whitespace + * on a non-comment line), or uses the value of the Soft Tabs config setting if + * auto-detection fails. + */ + "editor.tabType": "auto"|"soft"|"hard"; + + /** + * Instead of wrapping lines to the window's width, wrap lines to the number of + * characters defined by the `Preferred Line Length` setting. This will only take + * effect when the soft wrap config setting is enabled globally or for the current + * language. + * **Note:** If you want to hide the wrap guide (the vertical line) you can disable + * the `wrap-guide` package. + */ + "editor.softWrapAtPreferredLineLength": boolean; + + /** + * When soft wrap is enabled, defines length of additional indentation applied to + * wrapped lines, in number of characters. + */ + "editor.softWrapHangingIndent": number; + + /** Determines how fast the editor scrolls when using a mouse or trackpad. */ + "editor.scrollSensitivity": number; + + /** Allow the editor to be scrolled past the end of the last line. */ + "editor.scrollPastEnd": boolean; + + /** + * Time interval in milliseconds within which text editing operations will be + * grouped together in the undo history. + */ + "editor.undoGroupingInterval": number; + + /** + * Show confirmation dialog when checking out the HEAD revision and discarding + * changes to current file since last commit. + */ + "editor.confirmCheckoutHeadRevision": boolean; + + /** + * A hash of characters Atom will use to render whitespace characters. Keys are + * whitespace character types, values are rendered characters (use value false to + * turn off individual whitespace character types). + */ + "editor.invisibles": Invisibles; + + /** + * Change the editor font size when pressing the Ctrl key and scrolling the mouse + * up/down. + */ + "editor.zoomFontWhenCtrlScrolling": boolean; + + // tslint:disable-next-line:no-any + [key: string]: any; +} + +/** + * Allows you to strongly type event emissions across your codebase. Additional + * key:value pairings merged into this interface will result in emissions under + * the value of each key being templated by the type of the associated value. + */ +export interface Emissions { + // tslint:disable-next-line:no-any + [key: string]: any; +} + +// Options ==================================================================== +// The option objects that the user is expected to fill out and provide to +// specific API call. + +export interface BufferLoadOptions { + /** The file's encoding. */ + encoding?: string; + + /** + * A function that returns a boolean indicating whether the buffer should + * be destroyed if its file is deleted. + */ + shouldDestroyOnFileDelete?(): boolean; +} + +export interface BuildEnvironmentOptions { + /** + * An object responsible for Atom's interaction with the browser process and host OS. + * Use buildDefaultApplicationDelegate for a default instance. + */ + applicationDelegate?: object; + + /** A window global. */ + window?: Window; + + /** A document global. */ + document?: Document; + + /** A path to the configuration directory (usually ~/.atom). */ + configDirPath?: string; + + /** + * A boolean indicating whether the Atom environment should save or load state + * from the file system. You probably want this to be false. + */ + enablePersistence?: boolean; +} + +export interface ContextMenuOptions { + /** The menu item's label. */ + label?: string; + + /** + * The command to invoke on the target of the right click that invoked the + * context menu. + */ + command?: string; + + /** + * Whether the menu item should be clickable. Disabled menu items typically + * appear grayed out. Defaults to true. + */ + enabled?: boolean; + + /** An array of additional items. */ + submenu?: ReadonlyArray; + + /** + * If you want to create a separator, provide an item with type: 'separator' + * and no other keys. + */ + type?: "separator"; + + /** Whether the menu item should appear in the menu. Defaults to true. */ + visible?: boolean; + + /** + * A function that is called on the item each time a context menu is created + * via a right click. + */ + created?(event: Event): void; + + /** + * A function that is called to determine whether to display this item on a + * given context menu deployment. + */ + shouldDisplay?(event: Event): void; +} + +export interface CopyMarkerOptions { + /** Whether or not the marker should be tailed. */ + tailed?: boolean; + + /** Creates the marker in a reversed orientation. */ + reversed?: boolean; + + /** Determines the rules by which changes to the buffer invalidate the marker. */ + invalidate?: "never"|"surround"|"overlap"|"inside"|"touch"; + + /** + * Indicates whether insertions at the start or end of the marked range should + * be interpreted as happening outside the marker. + */ + exclusive?: boolean; + + /** -DEPRECATED- Custom properties to be associated with the marker. */ + properties?: object; +} + +export interface DecorationLayerOptions extends SharedDecorationOptions { + /** One of several supported decoration types. */ + type?: "line"|"line-number"|"highlight"|"block"; +} + +export interface DecorationOptions extends SharedDecorationOptions { + /** One of several supported decoration types. */ + type?: "line"|"line-number"|"highlight"|"overlay"|"gutter"|"block"; + + /** The name of the gutter we're decorating, if type is "gutter". */ + gutterName?: string; +} + +export interface ErrorNotificationOptions extends NotificationOptions { + stack?: string; +} + +export interface FindDisplayMarkerOptions { + /** Only include markers starting at this Point in buffer coordinates. */ + startBufferPosition?: PointCompatible; + + /** Only include markers ending at this Point in buffer coordinates. */ + endBufferPosition?: PointCompatible; + + /** Only include markers starting at this Point in screen coordinates. */ + startScreenPosition?: PointCompatible; + + /** Only include markers ending at this Point in screen coordinates. */ + endScreenPosition?: PointCompatible; + + /** Only include markers starting inside this Range in buffer coordinates. */ + startsInBufferRange?: RangeCompatible; + + /** Only include markers ending inside this Range in buffer coordinates. */ + endsInBufferRange?: RangeCompatible; + + /** Only include markers starting inside this Range in screen coordinates. */ + startsInScreenRange?: RangeCompatible; + + /** Only include markers ending inside this Range in screen coordinates. */ + endsInScreenRange?: RangeCompatible; + + /** Only include markers starting at this row in buffer coordinates. */ + startBufferRow?: number; + + /** Only include markers ending at this row in buffer coordinates. */ + endBufferRow?: number; + + /** Only include markers starting at this row in screen coordinates. */ + startScreenRow?: number; + + /** Only include markers ending at this row in screen coordinates. */ + endScreenRow?: number; + + /** + * Only include markers intersecting this Array of [startRow, endRow] in + * buffer coordinates. + */ + intersectsBufferRowRange?: [number, number]; + + /** + * Only include markers intersecting this Array of [startRow, endRow] in + * screen coordinates. + */ + intersectsScreenRowRange?: [number, number]; + + /** Only include markers containing this Range in buffer coordinates. */ + containsBufferRange?: RangeCompatible; + + /** Only include markers containing this Point in buffer coordinates. */ + containsBufferPosition?: PointCompatible; + + /** Only include markers contained in this Range in buffer coordinates. */ + containedInBufferRange?: RangeCompatible; + + /** Only include markers contained in this Range in screen coordinates. */ + containedInScreenRange?: RangeCompatible; + + /** Only include markers intersecting this Range in buffer coordinates. */ + intersectsBufferRange?: RangeCompatible; + + /** Only include markers intersecting this Range in screen coordinates. */ + intersectsScreenRange?: RangeCompatible; +} + +export interface FindMarkerOptions { + /** Only include markers that start at the given Point. */ + startPosition?: PointCompatible; + + /** Only include markers that end at the given Point. */ + endPosition?: PointCompatible; + + /** Only include markers that start inside the given Range. */ + startsInRange?: RangeCompatible; + + /** Only include markers that end inside the given Range. */ + endsInRange?: RangeCompatible; + + /** Only include markers that contain the given Point, inclusive. */ + containsPoint?: PointCompatible; + + /** Only include markers that contain the given Range, inclusive. */ + containsRange?: RangeCompatible; + + /** Only include markers that start at the given row number. */ + startRow?: number; + + /** Only include markers that end at the given row number. */ + endRow?: number; + + /** Only include markers that intersect the given row number. */ + intersectsRow?: number; +} + +export interface MenuOptions { + /** The menu itme's label. */ + label: string; + + /** An array of sub menus. */ + submenu?: ReadonlyArray; + + /** The command to trigger when the item is clicked. */ + command?: string; +} + +export interface NodeProcessOptions { + /** The command to execute. */ + command: string; + + /** The array of arguments to pass to the command. */ + args?: ReadonlyArray; + + /** The options object to pass to Node's ChildProcess.spawn method. */ + options?: SpawnProcessOptions; + + /** + * The callback that receives a single argument which contains the standard + * output from the command. + */ + stdout?(data: string): void; + + /** + * The callback that receives a single argument which contains the standard + * error output from the command. + */ + stderr?(data: string): void; + + /** The callback which receives a single argument containing the exit status. */ + exit?(code: number): void; +} + +export interface NotificationOptions { + buttons?: Array<{ + className?: string; + onDidClick?(event: MouseEvent): void; + text?: string; + }>; + description?: string; + detail?: string; + dismissable?: boolean; + icon?: string; +} + +export interface ProcessOptions extends NodeProcessOptions { + /** + * Whether the command will automatically start when this BufferedProcess is + * created. + */ + autoStart?: boolean; +} + +export interface ScanContextOptions { + /** The number of lines before the matched line to include in the results object. */ + leadingContextLineCount?: number; + + /** The number of lines after the matched line to include in the results object. */ + trailingContextLineCount?: number; +} + +export interface SharedDecorationOptions { + /** + * This CSS class will be applied to the decorated line number, line, highlight, + * or overlay. + */ + class?: string; + + /** + * An HTMLElement or a model Object with a corresponding view registered. Only + * applicable to the gutter, overlay and block types. + */ + item?: HTMLElement; + + /** + * If true, the decoration will only be applied to the head of the DisplayMarker. + * Only applicable to the line and line-number types. + */ + onlyHead?: boolean; + + /** + * If true, the decoration will only be applied if the associated DisplayMarker + * is empty. Only applicable to the gutter, line, and line-number types. + */ + onlyEmpty?: boolean; + + /** + * If true, the decoration will only be applied if the associated DisplayMarker + * is non-empty. Only applicable to the gutter, line, and line-number types. + */ + onlyNonEmpty?: boolean; + + /** + * Only applicable to decorations of type overlay and block. Controls where the + * view is positioned relative to the TextEditorMarker. Values can be + * 'head' (the default) or 'tail' for overlay decorations, and 'before' (the default) + * or 'after' for block decorations. + */ + position?: "head"|"tail"|"before"|"after"; + + /** + * Only applicable to decorations of type overlay. Determines whether the decoration + * adjusts its horizontal or vertical position to remain fully visible when it would + * otherwise overflow the editor. Defaults to true. + */ + avoidOverflow?: boolean; +} + +export interface SpawnProcessOptions { + /** Current working directory of the child process. */ + cwd?: string; + + /** Environment key-value pairs. */ + env?: { [key: string]: string }; + + /** The child's stdio configuration. */ + stdio?: string|Array; + + /** Prepare child to run independently of its parent process. */ + detached?: boolean; + + /** Sets the user identity of the process. */ + uid?: number; + + /** Sets the group identity of the process. */ + gid?: number; + + /** + * If true, runs command inside of a shell. Uses "/bin/sh" on UNIX, and process.env.ComSpec + * on Windows. A different shell can be specified as a string. + */ + shell?: boolean | string; +} + +export interface TextInsertionOptions { + select?: boolean; + autoIndent?: boolean; + autoIndentNewline?: boolean; + autoDecreaseIndent?: boolean; + normalizeLineEndings?: boolean; + undo?: "skip"; +} + +/** The options for a Bootstrap 3 Tooltip class, which Atom uses a variant of. */ +export interface TooltipOptions { + /** Apply a CSS fade transition to the tooltip. */ + animation?: boolean; + + /** Appends the tooltip to a specific element. */ + container?: string|HTMLElement|false; + + /** + * Delay showing and hiding the tooltip (ms) - does not apply to manual + * trigger type. + */ + delay?: number|{ show: number, hide: number }; + + /** Allow HTML in the tooltip. */ + html?: boolean; + + /** How to position the tooltip. */ + placement?: "top"|"bottom"|"left"|"right"|"auto"; + + /** + * If a selector is provided, tooltip objects will be delegated to the + * specified targets. + */ + selector?: string; + + /** Base HTML to use when creating the tooltip. */ + template?: string; + + /** + * Default title value if title attribute isn't present. + * If a function is given, it will be called with its this reference set to + * the element that the tooltip is attached to. + */ + title?: string|HTMLElement|(() => string); + + /** + * How tooltip is triggered - click | hover | focus | manual. + * You may pass multiple triggers; separate them with a space. + */ + trigger?: string; +} + +export interface WorkspaceOpenOptions { + /** A number indicating which row to move the cursor to initially. Defaults to 0. */ + initialLine?: number; + + /** A number indicating which column to move the cursor to initially. Defaults to 0. */ + initialColumn?: number; + + /** + * Either 'left', 'right', 'up' or 'down'. If 'left', the item will be opened in + * leftmost pane of the current active pane's row. If 'right', the item will be + * opened in the rightmost pane of the current active pane's row. If only one pane + * exists in the row, a new pane will be created. If 'up', the item will be opened + * in topmost pane of the current active pane's column. If 'down', the item will be + * opened in the bottommost pane of the current active pane's column. If only one pane + * exists in the column, a new pane will be created. + */ + split?: "left"|"right"|"up"|"down"; + + /** + * A boolean indicating whether to call Pane::activate on containing pane. + * Defaults to true. + */ + activatePane?: boolean; + + /** + * A boolean indicating whether to call Pane::activateItem on containing pane. + * Defaults to true. + */ + activateItem?: boolean; + + /** + * A Boolean indicating whether or not the item should be opened in a pending state. + * Existing pending items in a pane are replaced with new pending items when they + * are opened. + */ + pending?: boolean; + + /** + * A boolean. If true, the workspace will attempt to activate an existing item for + * the given URI on any pane. If false, only the active pane will be searched for + * an existing item for the same URI. Defaults to false. + */ + searchAllPanes?: boolean; + + /** + * A String containing the name of the location in which this item should be opened. + * If omitted, Atom will fall back to the last location in which a user has placed + * an item with the same URI or, if this is a new URI, the default location specified + * by the item. + * NOTE: This option should almost always be omitted to honor user preference. + */ + location?: "left"|"right"|"bottom"|"center"; +} + +export interface WorkspaceScanOptions { + /** An array of glob patterns to search within. */ + paths?: ReadonlyArray; + + /** A function to be periodically called with the number of paths searched. */ + onPathsSearched?(pathsSearched: number): void; + + /** The number of lines before the matched line to include in the results object. */ + leadingContextLineCount?: number; + + /** The number of lines after the matched line to include in the results object. */ + trailingContextLineCount?: number; +} + +// Interfaces ================================================================= +// The requirements placed on object parameters for specific API calls. + +export interface Deserializer { + name: string; + deserialize(state: object): object; +} + +export interface DisposableLike { + dispose(): void; +} + +/** The types usable when constructing a point via the Point::fromObject method. */ +export type PointCompatible = PointLike|[number, number]; + +/** The interface that should be implemented for all "point-compatible" objects. */ +export interface PointLike { + /** A zero-indexed number representing the row of the Point. */ + row: number; + + /** A zero-indexed number representing the column of the Point. */ + column: number; +} + +/** The types usable when constructing a range via the Range::fromObject method. */ +export type RangeCompatible = + | RangeLike + | [PointLike, PointLike] + | [PointLike, [number, number]] + | [[number, number], PointLike] + | [[number, number], [number, number]]; + +/** The interface that should be implemented for all "range-compatible" objects. */ +export interface RangeLike { + /** A Point representing the start of the Range. */ + start: PointLike; + + /** A Point representing the end of the Range. */ + end: PointLike; +} + +/** An interface which all custom test runners should implement. */ +export type TestRunner = (params: TestRunnerParams) => Promise; + +// Structures ================================================================= +// The structures that are passed to the user by Atom following specific API calls. + +export interface BufferScanResult { + buffer: TextBuffer; + lineText: string; + match: RegExpExecArray; + matchText: string; + range: Range; + replace(replacementText: string): void; + stop(): void; + stopped: boolean; +} + +export interface CancellablePromise extends Promise { + cancel(): void; +} + +export interface ContextualBufferScanResult extends BufferScanResult { + leadingContextLines: string[]; + trailingContextLines: string[]; +} + +export type FileEncoding = + | "iso88596" // Arabic (ISO 8859-6) + | "windows1256" // Arabic (Windows 1256) + | "iso88594" // Baltic (ISO 8859-4) + | "windows1257" // Baltic (Windows 1257) + | "iso885914" // Celtic (ISO 8859-14) + | "iso88592" // Central European (ISO 8859-2) + | "windows1250" // Central European (Windows 1250) + | "gb18030" // Chinese (GB18030) + | "gbk" // Chinese (GBK) + | "cp950" // Traditional Chinese (Big5) + | "big5hkscs" // Traditional Chinese (Big5-HKSCS) + | "cp866" // Cyrillic (CP 866) + | "iso88595" // Cyrillic (ISO 8859-5) + | "koi8r" // Cyrillic (KOI8-R) + | "koi8u" // Cyrillic (KOI8-U) + | "windows1251" // Cyrillic (Windows 1251) + | "cp437" // DOS (CP 437) + | "cp850" // DOS (CP 850) + | "iso885913" // Estonian (ISO 8859-13) + | "iso88597" // Greek (ISO 8859-7) + | "windows1253" // Greek (Windows 1253) + | "iso88598" // Hebrew (ISO 8859-8) + | "windows1255" // Hebrew (Windows 1255) + | "cp932" // Japanese (CP 932) + | "eucjp" // Japanese (EUC-JP) + | "shiftjis" // Japanese (Shift JIS) + | "euckr" // Korean (EUC-KR) + | "iso885910" // Nordic (ISO 8859-10) + | "iso885916" // Romanian (ISO 8859-16) + | "iso88599" // Turkish (ISO 8859-9) + | "windows1254" // Turkish (Windows 1254) + | "utf8" // Unicode (UTF-8) + | "utf16le" // Unicode (UTF-16 LE) + | "utf16be" // Unicode (UTF-16 BE) + | "windows1258" // Vietnamese (Windows 1258) + | "iso88591" // Western (ISO 8859-1) + | "iso88593" // Western (ISO 8859-3) + | "iso885915" // Western (ISO 8859-15) + | "macroman" // Western (Mac Roman) + | "windows1252"; // Western (Windows 1252) + +export interface GrammarRule { + // https://github.com/atom/first-mate/blob/v7.0.7/src/rule.coffee + // This is private. Don't go down the rabbit hole. + rule: object; + scopeName: string; + contentScopeName: string; +} + +export interface GrammarToken { + value: string; + scopes: string[]; +} + +export interface Invisibles { + /** + * Character used to render newline characters (\n) when the `Show Invisibles` + * setting is enabled. + */ + eol?: boolean|string; + + /** + * Character used to render leading and trailing space characters when the + * `Show Invisibles` setting is enabled. + */ + space?: boolean|string; + + /** + * Character used to render hard tab characters (\t) when the `Show Invisibles` + * setting is enabled. + */ + tab?: boolean|string; + + /** + * Character used to render carriage return characters (for Microsoft-style line + * endings) when the `Show Invisibles` setting is enabled. + */ + cr?: boolean|string; +} + +export interface KeyBinding { + // Properties + enabled: boolean; + source: string; + command: string; + keystrokes: string; + keystrokeArray: string[]; + keystrokeCount: number; + selector: string; + specificity: number; + + // Comparison + /** Determines whether the given keystroke matches any contained within this binding. */ + matches(keystroke: string): boolean; + + /** + * Compare another KeyBinding to this instance. + * Returns <= -1 if the argument is considered lesser or of lower priority. + * Returns 0 if this binding is equivalent to the argument. + * Returns >= 1 if the argument is considered greater or of higher priority. + */ + compare(other: KeyBinding): number; +} + +export interface ProjectHistory { + paths: string[]; + lastOpened: Date; +} + +export interface ScandalResult { + filePath: string; + matches: Array<{ + matchText: string; + lineText: string; + lineTextOffset: number; + range: [[number, number], [number, number]]; + leadingContextLines: string[]; + trailingContextLines: string[]; + }>; +} + +export interface TestRunnerParams { + /** An array of paths to tests to run. Could be paths to files or directories. */ + testPaths: string[]; + + /** + * A function that can be called to construct an instance of the atom global. + * No atom global will be explicitly assigned, but you can assign one in your + * runner if desired. + */ + buildAtomEnvironment(options: BuildEnvironmentOptions): AtomEnvironment; + + /** + * A function that builds a default instance of the application delegate, suitable + * to be passed as the applicationDelegate parameter to buildAtomEnvironment. + */ + buildDefaultApplicationDelegate(): object; + + /** An optional path to a log file to which test output should be logged. */ + logFile: string; + + /** + * A boolean indicating whether or not the tests are being run from the command + * line via atom --test. + */ + headless: boolean; +} + +export interface TextChange { + newExtent: Point; + oldExtent: Point; + newRange: Range; + oldRange: Range; + newText: string; + oldText: string; + start: Point; +} + +/** Result returned by `Grammar.tokenizeLine`. */ +export interface TokenizeLineResult { + /** The string of text that was tokenized. */ + line: string; + + /** + * An array of integer scope ids and strings. Positive ids indicate the + * beginning of a scope, and negative tags indicate the end. To resolve ids + * to scope names, call GrammarRegistry::scopeForId with the absolute + * value of the id. + */ + tags: Array; + + /** + * This is a dynamic property. Invoking it will incur additional overhead, + * but will automatically translate the `tags` into token objects with `value` + * and `scopes` properties. + */ + tokens: GrammarToken[]; + + /** + * An array of rules representing the tokenized state at the end of the line. + * These should be passed back into this method when tokenizing the next line + * in the file. + */ + ruleStack: GrammarRule[]; +} + +/** + * This tooltip class is derived from Bootstrap 3, but modified to not require + * jQuery, which is an expensive dependency we want to eliminate. + */ +export interface Tooltip { + options: TooltipOptions; + enabled: boolean; + timeout: number; + hoverState: "in"|"out"|null; + element: JQuery|HTMLElement; + + getTitle(): string; + getTooltipElement(): HTMLElement; + getArrowElement(): HTMLElement; + enable(): void; + disable(): void; + toggleEnabled(): void; + toggle(): void; + recalculatePosition(): void; +} + +export interface ViewModel { + getTitle: () => string; +} + +export interface WindowLoadSettings { + appVersion: string; + atomHome: string; + devMode: boolean; + resourcePath: string; + safeMode: boolean; + env?: { [key: string]: string|undefined }; + profileStartup?: boolean; +} diff --git a/types/atom/linter/config.d.ts b/types/atom/linter/config.d.ts new file mode 100644 index 0000000000..c70728fff5 --- /dev/null +++ b/types/atom/linter/config.d.ts @@ -0,0 +1,26 @@ +import "../index"; + +declare module "atom" { + interface ConfigValues { + /** Lint tabs while they are still in preview status. */ + "linter.lintPreviewTabs": boolean; + + /** Lint files automatically when they are opened. */ + "linter.lintOnOpen": boolean; + + /** + * Lint files while typing, without the need to save (only for supported + * providers). + */ + "linter.lintOnChange": boolean; + + /** Interval at which linting is done as you type (in ms). */ + "linter.lintOnChangeInterval": number; + + /** Ignore files matching this Glob. */ + "linter.ignoreGlob": string; + + /** Disabled providers. */ + "linter.disabledProviders": string[]; + } +} diff --git a/types/atom/linter/index.d.ts b/types/atom/linter/index.d.ts new file mode 100644 index 0000000000..bf085d9859 --- /dev/null +++ b/types/atom/linter/index.d.ts @@ -0,0 +1,82 @@ +// Linter 2.x +// https://atom.io/packages/linter + +/// + +import { Disposable, Point, Range, TextEditor } from "../index"; + +export interface ReplacementSolution { + title?: string; + position: Range; + priority?: number; + currentText?: string; + replaceWith: string; +} + +export interface CallbackSolution { + title?: string; + position: Range; + priority?: number; + // tslint:disable-next-line:no-any + apply(): any; +} + +export interface Message { + /** The location of the issue (aka where to highlight). */ + location: { + /** The path to the file to which the message applies. */ + file: string; + + /** The range of the message in the editor. */ + position: Range; + }; + + /** A reference to a different location in the editor. */ + reference?: { + /** The path to the file being referenced. */ + file: string; + + /** The point being referenced in that file. */ + position?: Point; + }; + + /** An HTTP link to a resource explaining the issue. Default is a google search. */ + url?: string; + + /** The name of the octicon to show in the gutter. */ + icon?: string; + + /** The text for the message. */ + excerpt: string; + + /** The severity level for the message. */ + severity: "error"|"warning"|"info"; + + /** Possible solutions (which the user can invoke at will). */ + solutions?: Array; + + /** + * Markdown long description of the error. Accepts a callback so that you can + * do things like HTTP requests. + */ + description?: string|(() => Promise|string); +} + +export interface IndieDelegate { + name: string; + getMessages(): Message[]; + clearMessages(): void; + setMessages(filePath: string, messages: Message[]): void; + setAllMessages(messages: Message[]): void; + onDidUpdate(callback: () => void): Disposable; + onDidDestroy(callback: () => void): Disposable; + dispose(): void; +} + +export interface LinterProvider { + name: string; + scope: "file"|"project"; + lintsOnChange: boolean; + grammarScopes: string[]; + lint(textEditor: TextEditor): Message[]|void|Promise; +} diff --git a/types/atom/services/index.d.ts b/types/atom/services/index.d.ts deleted file mode 100644 index 33b85ff511..0000000000 --- a/types/atom/services/index.d.ts +++ /dev/null @@ -1,190 +0,0 @@ -/* tslint:disable:no-unnecessary-qualifier */ -declare namespace Atom { - namespace Services { - /** Type definitions for autocomplete+ 2 */ - namespace Autocomplete { - /** Objects that appear as parameters to callbacks. */ - namespace Events { - /** The parameters passed into getSuggestions by Autocomplete+. */ - interface SuggestionsRequested { - /** The current TextEditor. */ - editor: Atom.TextEditor; - - /** The position of the cursor. */ - bufferPosition: Atom.Point; - - /** The scope descriptor for the current cursor position. */ - scopeDescriptor: Atom.ScopeDescriptor; - - /** The prefix for the word immediately preceding the current cursor position. */ - prefix: string; - - /** Whether the autocomplete request was initiated by the user. */ - activatedManually: boolean; - } - - /** The parameters passed into onDidInsertSuggestion by Autocomplete+. */ - interface SuggestionInserted { - editor: Atom.TextEditor; - triggerPosition: Atom.Point; - suggestion: TextSuggestion|SnippetSuggestion; - } - } - - /** An autocompletion suggestion for the user. - * Primary data type for the Atom Autocomplete+ service. - */ - interface Suggestion { - /** A string that will show in the UI for this suggestion. - * When not set, snippet || text is displayed. - */ - displayText?: string; - - /** The text immediately preceding the cursor, which will be replaced by the text. - * If not provided, the prefix passed into getSuggestions will be used. - */ - replacementPrefix?: string; - - /** The suggestion type. It will be converted into an icon shown against the suggestion. */ - type?: string; - - /** This is shown before the suggestion. Useful for return values. */ - leftLabel?: string; - - /** Use this instead of leftLabel if you want to use html for the left label. */ - leftLabelHTML?: string; - - /** An indicator (e.g. function, variable) denoting the "kind" of suggestion this represents. */ - rightLabel?: string; - - /** Use this instead of rightLabel if you want to use html for the right label. */ - rightLabelHTML?: string; - - /** Class name for the suggestion in the suggestion list. Allows you to style your suggestion - * via CSS, if desired. - */ - className?: string; - - /** If you want complete control over the icon shown against the suggestion. e.g. iconHTML: - * - */ - iconHTML?: string; - - /** A doc-string summary or short description of the suggestion. When specified, it will be - * displayed at the bottom of the suggestions list. - */ - description?: string; - - /** A url to the documentation or more information about this suggestion. When specified, - * a More.. link will be displayed in the description area. - */ - descriptionMoreURL?: string; - } - - interface TextSuggestion extends Suggestion { - /** The text which will be inserted into the editor, in place of the prefix. */ - text: string; - } - - interface SnippetSuggestion extends Suggestion { - /** A snippet string. This will allow users to tab through function arguments or other - * options. - */ - snippet: string; - } - - type Suggestions = Array; - - interface Provider { - /** Defines the scope selector(s) (can be comma-separated) for which your provider - * should receive suggestion requests. - */ - selector: string; - - /** Is called when a suggestion request has been dispatched by autocomplete+ to your - * provider. Return an array of suggestions (if any) in the order you would like them - * displayed to the user. Returning a Promise of an array of suggestions is also - * supported. - */ - getSuggestions(params: Events.SuggestionsRequested): Suggestions|Promise; - - /** Defines the scope selector(s) (can be comma-separated) for which your provider - * should not be used. - */ - disableForSelector?: string; - - /** A number to indicate its priority to be included in a suggestions request. - * The default provider has an inclusion priority of 0. Higher priority providers - * can suppress lower priority providers with excludeLowerPriority. - */ - inclusionPriority?: number; - - /** Will not use lower priority providers when this provider is used. */ - excludeLowerPriority?: boolean; - - /** A number to determine the sort order of suggestions. The default provider has - * an suggestion priority of 1. - */ - suggestionPriority?: number; - - /** Function that is called when a suggestion from your provider was inserted - * into the buffer. - */ - onDidInsertSuggestion?(params: Events.SuggestionInserted): void; - - /** Will be called if your provider is being destroyed by autocomplete+ */ - dispose?(): void; - } - } - - /** Type definitions for status-bar 1.8 */ - namespace StatusBar { - /** Objects that appear as parameters to functions. */ - namespace Options { - interface AddTile { - /** A DOM element, a jQuery object, or a model object for which a view provider - * has been registered in the the view registry. - */ - item: object; - - /** Determines the placement of the tile within the status bar. Lower priority - * will result in closer placement to the anchor. - */ - priority: number; - } - } - - interface Tile { - /** Retrieve the priority that was assigned to the Tile when it was created. */ - getPriority(): number; - - /** Retrieve the Tile's item. */ - getItem(): object; - - /** Remove the Tile from the status bar. */ - destroy(): void; - } - - interface StatusBar { - /** Add a tile to the left side of the status bar. Lower priority tiles are placed - * further to the left. - */ - addLeftTile(options: Options.AddTile): Tile; - - /** Add a tile to the right side of the status bar. Lower priority tiles are placed - * further to the right. - */ - addRightTile(options: Options.AddTile): Tile; - - /** Retrieve all of the tiles on the left side of the status bar. */ - getLeftTiles(): Tile[]; - - /** Retrieve all of the tiles on the right side of the status bar. */ - getRightTiles(): Tile[]; - } - - type Consumer = (statusBar: StatusBar) => void; - } - } -} -/* tslint:enable:no-unnecessary-qualifier */ diff --git a/types/atom/status-bar/config.d.ts b/types/atom/status-bar/config.d.ts new file mode 100644 index 0000000000..1561030a84 --- /dev/null +++ b/types/atom/status-bar/config.d.ts @@ -0,0 +1,23 @@ +import "../index"; + +declare module "atom" { + interface ConfigValues { + /** Show status bar at the bottom of the workspace. */ + "status-bar.isVisible": boolean; + + /** Fit the status-bar to the window's full-width. */ + "status-bar.fullWidth": boolean; + + /** + * Format for the cursor position status bar element, where %L is the line + * number and %C is the column number. + */ + "status-bar.cursorPositionFormat": string; + + /** + * Format for the selection count status bar element, where %L is the line + * count and %C is the character count. + */ + "status-bar.selectionCountFormat": string; + } +} diff --git a/types/atom/status-bar/index.d.ts b/types/atom/status-bar/index.d.ts new file mode 100644 index 0000000000..3cc4a99a59 --- /dev/null +++ b/types/atom/status-bar/index.d.ts @@ -0,0 +1,49 @@ +// Status Bar 1.x +// https://atom.io/packages/status-bar + +/// + +export interface AddTileOptions { + /** + * A DOM element, a jQuery object, or a model object for which a view provider + * has been registered in the the view registry. + */ + item: object; + + /** + * Determines the placement of the tile within the status bar. Lower priority + * will result in closer placement to the anchor. + */ + priority: number; +} + +export interface Tile { + /** Retrieve the priority that was assigned to the Tile when it was created. */ + getPriority(): number; + + /** Retrieve the Tile's item. */ + getItem(): object; + + /** Remove the Tile from the status bar. */ + destroy(): void; +} + +export interface StatusBar { + /** + * Add a tile to the left side of the status bar. Lower priority tiles are placed + * further to the left. + */ + addLeftTile(options: AddTileOptions): Tile; + + /** + * Add a tile to the right side of the status bar. Lower priority tiles are placed + * further to the right. + */ + addRightTile(options: AddTileOptions): Tile; + + /** Retrieve all of the tiles on the left side of the status bar. */ + getLeftTiles(): Tile[]; + + /** Retrieve all of the tiles on the right side of the status bar. */ + getRightTiles(): Tile[]; +} diff --git a/types/atom/tsconfig.json b/types/atom/tsconfig.json index 794b99eadc..a58ec7b74c 100644 --- a/types/atom/tsconfig.json +++ b/types/atom/tsconfig.json @@ -8,7 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,6 +20,8 @@ "files": [ "index.d.ts", "atom-tests.ts", - "services/index.d.ts" + "autocomplete-plus/index.d.ts", + "linter/index.d.ts", + "status-bar/index.d.ts" ] -} \ No newline at end of file +} diff --git a/types/atom/tslint.json b/types/atom/tslint.json index a36bbd3600..4c3e6e9036 100644 --- a/types/atom/tslint.json +++ b/types/atom/tslint.json @@ -1,39 +1,9 @@ { "extends": "dtslint/dt.json", "rules": { - // Custom rules. "await-promise": [true, "CancellablePromise"], - "class-name": true, - "indent": [true, "tabs"], - "jsdoc-format": true, - "linebreak-style": [true, "LF"], + "indent": [true, "spaces", 4], "max-line-length": [true, 100], - "no-any": false, - "quotemark": [true, "double", "avoid-escape"], - "trailing-comma": [true, { - "multiline": { "objects": "always", "arrays": "always", "functions": "never" }, - "singleline": { "objects": "never", "arrays": "never", "functions": "never" } - }], - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-module", - "check-separator", - "check-type", - "check-typecast", - "check-rest-spread", - "check-preblock" - ], - // Soon to be defaults. - "arrow-return-shorthand": [true, "multiline"], - "no-floating-promises": true, - "no-unbound-method": true, - "no-unsafe-any": true, - "number-literal-format": true, - "restrict-plus-operands": true, - "return-undefined": true, - "switch-final-break": true + "no-any": true } } diff --git a/types/atom/v0/api-docs.d.ts b/types/atom/v0/api-docs.d.ts deleted file mode 100644 index 41ea32a277..0000000000 --- a/types/atom/v0/api-docs.d.ts +++ /dev/null @@ -1,107 +0,0 @@ -// Type definitions for Atom API docs -// Project: https://github.com/atom/atom/blob/master/build/tasks/docs-task.coffee -// Definitions by: vvakame -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/* - How to generate. - $ git clone git@github.com:atom/atom.git - $ cd atom - $ npm install - $ cd build - $ npm install - $ grunt build-docs - $ cd ../ - $ ls -la la docs/output/api.json - api.json example https://gist.github.com/vvakame/10f8d2f3884affc32476 - */ - -declare namespace AtomDocTypes { - interface Metadata { - classes: { [className: string]: ClassInfo; }; - } - - interface ClassInfo { - name: string; - superClass: string; - visibility: string; - - filename: string; - srcUrl: string; - summary: string; - description: string; - examples: Example[]; - sections: Section[]; - - classMethods: ClassMethod[]; - classProperties: ClassProperty[]; - instanceMethods: InstanceMethod[]; - instanceProperties: InstanceProperty[]; - } - - interface Example { - description: string; - lang: string; - code: string; - raw: string; - } - - interface Section { - name: string; - description: string; - } - - interface ClassMethod { - name: string; - sectionName: string; - srcUrl: string; - visibility: string; - summary: string; - description: string; - arguments: Argument[]; - returnValues: ReturnValue[]; - } - - interface ClassProperty { - } - - interface InstanceMethod { - name: string; - sectionName: string; - srcUrl: string; - visibility: string; - summary: string; - description: string; - arguments: Argument[]; - returnValues: ReturnValue[]; - titledArguments: TitledArgument[]; - } - - interface InstanceProperty { - name: string; - sectionName: string; - srcUrl: string; - visibility: string; - summary: string; - description: string; - } - - interface Argument { - name: string; - description: string; - type: string; - isOptional: boolean; - children: Argument[]; - } - - interface TitledArgument { - title: string; - description: string; - arguments: Argument[]; - } - - interface ReturnValue { - type: string; - description: string; - } -} diff --git a/types/atom/v0/atom-tests.ts b/types/atom/v0/atom-tests.ts deleted file mode 100644 index 5987f4901d..0000000000 --- a/types/atom/v0/atom-tests.ts +++ /dev/null @@ -1,70 +0,0 @@ -import path = require("path"); -import _atom = require("atom"); - -import PathWatcher = require("pathwatcher"); -var File = PathWatcher.File; - -const jq: JQuery = $("selector"); - -class SampleView extends _atom.ScrollView { - - editorId:string; - file:PathWatcher.IFile; - editor:AtomCore.IEditor; - - static deserialize(state:any):SampleView { - return new SampleView(state); - } - - static content():any { - return this.div({class: 'sample native-key-bindings', tabindex: -1}); - } - - constructor(params:{editorId?:string; filePath?:string;} = {}) { - super(); - - this.editorId = params.editorId; - - if (this.editorId) { - this.resolveEditor(this.editorId); - } else { - this.file = new File(params.filePath); - } - } - - serialize() { - return { - deserializer: 'SampleView', - editorId: this.editorId - }; - } - - destroy() { - this.unsubscribe(); - } - - resolveEditor(editorId:string) { - var resolve = ()=> { - if (this.editor) { - jq.trigger("title-changed"); - } else { - var view = jq.parents('.pane').view(); - if (view) { - view.destroyItem(this); - } - } - }; - - if (atom.workspace) { - resolve(); - } else { - atom.packages.once("activated", ()=> { - resolve(); - }); - } - } -} - -atom.deserializers.add(SampleView); - -export = SampleView; diff --git a/types/atom/v0/index.d.ts b/types/atom/v0/index.d.ts deleted file mode 100644 index 7dba05663c..0000000000 --- a/types/atom/v0/index.d.ts +++ /dev/null @@ -1,1977 +0,0 @@ -// Type definitions for Atom -// Project: https://atom.io/ -// Definitions by: vvakame , smhxx -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -/// -/// -/// -/// -/// -/// - -// Policy: this definition file only declare element related to `atom`. -// if js file include to another npm package (e.g. "space-pen", "mixto" and "emissary"). -// you should create a separate file. - -// API documentation : https://atom.io/docs/api/v1.20.1 - -interface Window { - atom: AtomCore.IAtom; - measure(description:string, fn:Function):any; // return fn result - profile(description:string, fn:Function):any; // return fn result -} - -declare namespace AtomCore { - - // https://atom.io/docs/v0.84.0/advanced/view-system - interface IWorkspaceViewStatic { - new ():IWorkspaceView; - version: number; - configDefaults:any; - content():any; - } - - interface Decoration { - destroy(): void; - } - - /** - * Represents a buffer annotation that remains logically stationary even as the buffer changes. This is used - * to represent cursors, folds, snippet targets, misspelled words, any anything else that needs to track a - * logical location in the buffer over time. - */ - interface Marker { - /** - * Destroys the marker, causing it to emit the 'destroyed' event. Once destroyed, a marker cannot be - * restored by undo/redo operations. - */ - destroy(): void; - - /** - * Gets the screen range of the display marker. - */ - getScreenRange(): Range; - } - - interface IWorkspaceView extends View { - // Delegator.includeInto(WorkspaceView); - - // delegate to model property's property - fullScreen:boolean; - - // delegate to model property's method - open(uri:string, options:any):Q.Promise; - openSync(uri:string, options?:any):any; - saveActivePaneItem():any; - saveActivePaneItemAs():any; - saveAll():void; - destroyActivePaneItem():any; - destroyActivePane():any; - increaseFontSize():void; - decreaseFontSize():void; - - // own property & methods - initialize(model:IWorkspace):any; - initialize(view:View, args:any):void; // do not use - model:IWorkspace; - panes: IPaneContainerView; - getModel():IWorkspace; - installShellCommands():any; - handleFocus():any; - afterAttach(onDom?:any):any; - confirmClose():boolean; - updateTitle():any; - setTitle(title:string):any; - getEditorViews():any[]; // atom.EditorView - prependToTop(element:any):any; - appendToTop(element:any):any; - prependToBottom(element:any):any; - appendToBottom(element:any):any; - prependToLeft(element:any):any; - appendToLeft(element:any):any; - prependToRight(element:any):any; - appendToRight(element:any):any; - getActivePaneView():IPaneView; - getActiveView():View; - focusPreviousPaneView():any; - focusNextPaneView():any; - focusPaneViewAbove():any; - focusPaneViewBelow():any; - focusPaneViewOnLeft():any; - focusPaneViewOnRight():any; - eachPaneView(callback:(paneView:IPaneView)=>any):{ off():any; }; - getPaneViews():IPaneView[]; - eachEditorView(callback:(editorView:any /* EditorView */)=>any):{ off():any; }; - beforeRemove():any; - - command(eventName:string, handler:Function):any; - command(eventName:string, selector:Function, handler:Function):any; - command(eventName:string, options:any, handler:Function):any; - command(eventName:string, selector:Function, options:any, handler:Function):any; - - statusBar:StatusBar.IStatusBarView; - } - - interface IPanes { - // TBD - } - - interface IPaneView { - // TBD - } - - interface IPaneContainerView { - // TBD - } - - interface ITreeView { - // TBD - } - - interface IGutterViewStatic { - new(): IGutterView; - content():any; - } - - interface IGutterView extends View { - firstScreenRow:any; - lastScreenRow:any; - initialize():void; - initialize(view:View, args:any):void; // do not use - afterAttach(onDom?:any):any; - beforeRemove():any; - handleMouseEvents(e:JQueryMouseEventObject):any; - getEditorView():any; /* EditorView */ - getEditor():IEditor; - getLineNumberElements():HTMLCollection; - getLineNumberElementsForClass(klass:string):NodeList; - getLineNumberElement(bufferRow:number):NodeList; - addClassToAllLines(klass:string):boolean; - removeClassFromAllLines(klass:string):boolean; - addClassToLine(bufferRow:number, klass:string):boolean; - removeClassFromLine(bufferRow:number, klass:string):boolean; - updateLineNumbers(changes:any[], startScreenRow?:number, endScreenRow?:number):any; - prependLineElements(lineElements:any):void; - appendLineElements(lineElements:any):void; - removeLineElements(numberOfElements:number):void; - buildLineElements(startScreenRow:any, endScreenRow:any):any; - buildLineElementsHtml(startScreenRow:any, endScreenRow:any):any; - updateFoldableClasses(changes:any[]):any; - removeLineHighlights():void; - addLineHighlight(row:number, emptySelection?:boolean):any; - highlightLines():boolean; - } - - interface ICommandRegistry { - add(target: string, commandName: Object, callback?: (event: any) => void): any; // selector:'atom-editor'|'atom-workspace' - findCommands(params: Object): Object[]; - dispatch(selector: any, name:string): void; - } - - interface ICommandPanel { - // TBD - } - - interface IDisplayBufferStatic { - new(_arg?:any):IDisplayBuffer; - } - - interface IDisplayBuffer /* extends Theorist.Model */ { - // Serializable.includeInto(Editor); - - constructor:IDisplayBufferStatic; - - verticalScrollMargin:number; - horizontalScrollMargin:number; - - declaredPropertyValues:any; - tokenizedBuffer: ITokenizedBuffer; - buffer: TextBuffer.ITextBuffer; - charWidthsByScope:any; - markers:{ [index:number]:IDisplayBufferMarker; }; - foldsByMarkerId:any; - maxLineLength:number; - screenLines:ITokenizedLine[]; - rowMap:any; // return type are RowMap - longestScreenRow:number; - subscriptions:Emissary.ISubscription[]; - subscriptionsByObject:any; // return type are WeakMap - behaviors:any; - subscriptionCounts:any; - eventHandlersByEventName:any; - pendingChangeEvent:any; - - softWrap:boolean; - - serializeParams():{id:number; softWrap:boolean; editorWidthInChars: number; scrollTop: number; scrollLeft: number; tokenizedBuffer: any; }; - deserializeParams(params:any):any; - copy():IDisplayBuffer; - updateAllScreenLines():any; - emitChanged(eventProperties:any, refreshMarkers?:boolean):any; - updateWrappedScreenLines():any; - setVisible(visible:any):any; - getVerticalScrollMargin():number; - setVerticalScrollMargin(verticalScrollMargin:number):number; - getHorizontalScrollMargin():number; - setHorizontalScrollMargin(horizontalScrollMargin:number):number; - getHeight():any; - setHeight(height:any):any; - getWidth():any; - setWidth(newWidth:any):any; - getScrollTop():number; - setScrollTop(scrollTop:number):number; - getScrollBottom():number; - setScrollBottom(scrollBottom:number):number; - getScrollLeft():number; - setScrollLeft(scrollLeft:number):number; - getScrollRight():number; - setScrollRight(scrollRight:number):number; - getLineHeight():any; - setLineHeight(lineHeight:any):any; - getDefaultCharWidth():any; - setDefaultCharWidth(defaultCharWidth:any):any; - getScopedCharWidth(scopeNames:any, char:any):any; - getScopedCharWidths(scopeNames:any):any; - setScopedCharWidth(scopeNames:any, char:any, width:any):any; - setScopedCharWidths(scopeNames:any, charWidths:any):any; - clearScopedCharWidths():any; - getScrollHeight():number; - getScrollWidth():number; - getVisibleRowRange():number[]; - intersectsVisibleRowRange(startRow:any, endRow:any):any; - selectionIntersectsVisibleRowRange(selection:any):any; - scrollToScreenRange(screenRange:any):any; - scrollToScreenPosition(screenPosition:any):any; - scrollToBufferPosition(bufferPosition:any):any; - pixelRectForScreenRange(screenRange:TextBuffer.IRange):any; - getTabLength():number; - setTabLength(tabLength:number):any; - setSoftWrap(softWrap:boolean):boolean; - getSoftWrap():boolean; - setEditorWidthInChars(editorWidthInChars:number):any; - getEditorWidthInChars():number; - getSoftWrapColumn():number; - lineForRow(row:number):any; - linesForRows(startRow:number, endRow:number):any; - getLines():any[]; - indentLevelForLine(line:any):any; - bufferRowsForScreenRows(startScreenRow:any, endScreenRow:any):any; - createFold(startRow:number, endRow:number):IFold; - isFoldedAtBufferRow(bufferRow:number):boolean; - isFoldedAtScreenRow(screenRow:number):boolean; - destroyFoldWithId(id:number):any; - unfoldBufferRow(bufferRow:number):any[]; - largestFoldStartingAtBufferRow(bufferRow:number):any; - foldsStartingAtBufferRow(bufferRow:number):any; - largestFoldStartingAtScreenRow(screenRow:any):any; - largestFoldContainingBufferRow(bufferRow:any):any; - outermostFoldsInBufferRowRange(startRow:any, endRow:any):any[]; - foldsContainingBufferRow(bufferRow:any):any[]; - screenRowForBufferRow(bufferRow:number):number; - lastScreenRowForBufferRow(bufferRow:number):number; - bufferRowForScreenRow(screenRow:number):number; - - screenRangeForBufferRange(bufferRange:TextBuffer.IPoint[]):TextBuffer.IRange; - - screenRangeForBufferRange(bufferRange:TextBuffer.IRange):TextBuffer.IRange; - - screenRangeForBufferRange(bufferRange:{start: TextBuffer.IPoint; end: TextBuffer.IPoint}):TextBuffer.IRange; - screenRangeForBufferRange(bufferRange:{start: number[]; end: TextBuffer.IPoint}):TextBuffer.IRange; - screenRangeForBufferRange(bufferRange:{start: {row:number; col:number;}; end: TextBuffer.IPoint}):TextBuffer.IRange; - - screenRangeForBufferRange(bufferRange:{start: TextBuffer.IPoint; end: number[]}):TextBuffer.IRange; - screenRangeForBufferRange(bufferRange:{start: number[]; end: number[]}):TextBuffer.IRange; - screenRangeForBufferRange(bufferRange:{start: {row:number; col:number;}; end: number[]}):TextBuffer.IRange; - - screenRangeForBufferRange(bufferRange:{start: TextBuffer.IPoint; end: {row:number; col:number;}}):TextBuffer.IRange; - screenRangeForBufferRange(bufferRange:{start: number[]; end: {row:number; col:number;}}):TextBuffer.IRange; - screenRangeForBufferRange(bufferRange:{start: {row:number; col:number;}; end: {row:number; col:number;}}):TextBuffer.IRange; - - bufferRangeForScreenRange(screenRange:TextBuffer.IPoint[]):TextBuffer.IRange; - - bufferRangeForScreenRange(screenRange:TextBuffer.IRange):TextBuffer.IRange; - - bufferRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: TextBuffer.IPoint}):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:{start: number[]; end: TextBuffer.IPoint}):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: TextBuffer.IPoint}):TextBuffer.IRange; - - bufferRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: number[]}):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:{start: number[]; end: number[]}):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: number[]}):TextBuffer.IRange; - - bufferRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: {row:number; col:number;}}):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:{start: number[]; end: {row:number; col:number;}}):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: {row:number; col:number;}}):TextBuffer.IRange; - - pixelRangeForScreenRange(screenRange:TextBuffer.IPoint[], clip?:boolean):TextBuffer.IRange; - - pixelRangeForScreenRange(screenRange:TextBuffer.IRange, clip?:boolean):TextBuffer.IRange; - - pixelRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: TextBuffer.IPoint}, clip?:boolean):TextBuffer.IRange; - pixelRangeForScreenRange(screenRange:{start: number[]; end: TextBuffer.IPoint}, clip?:boolean):TextBuffer.IRange; - pixelRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: TextBuffer.IPoint}, clip?:boolean):TextBuffer.IRange; - - pixelRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: number[]}, clip?:boolean):TextBuffer.IRange; - pixelRangeForScreenRange(screenRange:{start: number[]; end: number[]}, clip?:boolean):TextBuffer.IRange; - pixelRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: number[]}, clip?:boolean):TextBuffer.IRange; - - pixelRangeForScreenRange(screenRange:{start: TextBuffer.IPoint; end: {row:number; col:number;}}, clip?:boolean):TextBuffer.IRange; - pixelRangeForScreenRange(screenRange:{start: number[]; end: {row:number; col:number;}}, clip?:boolean):TextBuffer.IRange; - pixelRangeForScreenRange(screenRange:{start: {row:number; col:number;}; end: {row:number; col:number;}}, clip?:boolean):TextBuffer.IRange; - - pixelPositionForScreenPosition(screenPosition:TextBuffer.IPoint, clip?:boolean):TextBuffer.IPoint; - pixelPositionForScreenPosition(screenPosition:number[], clip?:boolean):TextBuffer.IPoint; - pixelPositionForScreenPosition(screenPosition:{row:number; col:number;}, clip?:boolean):TextBuffer.IPoint; - - screenPositionForPixelPosition(pixelPosition:any):TextBuffer.IPoint; - - pixelPositionForBufferPosition(bufferPosition:any):any; - getLineCount():number; - getLastRow():number; - getMaxLineLength():number; - screenPositionForBufferPosition(bufferPosition:any, options:any):any; - bufferPositionForScreenPosition(bufferPosition:any, options:any):any; - scopesForBufferPosition(bufferPosition:any):any; - bufferRangeForScopeAtPosition(selector:any, position:any):any; - tokenForBufferPosition(bufferPosition:any):any; - getGrammar():IGrammar; - setGrammar(grammar:IGrammar):any; - reloadGrammar():any; - clipScreenPosition(screenPosition:any, options:any):any; - findWrapColumn(line:any, softWrapColumn:any):any; - rangeForAllLines():TextBuffer.IRange; - getMarker(id:number):IDisplayBufferMarker; - getMarkers():IDisplayBufferMarker[]; - getMarkerCount():number; - markScreenRange(range:TextBuffer.IRange, ...args:any[]):IDisplayBufferMarker; - markBufferRange(range:TextBuffer.IRange, options?:any):IDisplayBufferMarker; - markScreenPosition(screenPosition:TextBuffer.IPoint, options?:any):IDisplayBufferMarker; - markBufferPosition(bufferPosition:TextBuffer.IPoint, options?:any):IDisplayBufferMarker; - destroyMarker(id:number):any; - findMarker(params?:any):IDisplayBufferMarker; - findMarkers(params?:any):IDisplayBufferMarker[]; - translateToBufferMarkerParams(params?:any):any; - findFoldMarker(attributes:any):IMarker; - findFoldMarkers(attributes:any):IMarker[]; - getFoldMarkerAttributes(attributes?:any):any; - pauseMarkerObservers():any; - resumeMarkerObservers():any; - refreshMarkerScreenPositions():any; - destroy():any; - logLines(start:number, end:number):any[]; - handleTokenizedBufferChange(tokenizedBufferChange:any):any; - updateScreenLines(startBufferRow:any, endBufferRow:any, bufferDelta?:number, options?:any):any; - buildScreenLines(startBufferRow:any, endBufferRow:any):any; - findMaxLineLength(startScreenRow:any, endScreenRow:any, newScreenLines:any):any; - handleBufferMarkersUpdated():any; - handleBufferMarkerCreated(marker:any):any; - createFoldForMarker(maker:any):IFold; - foldForMarker(marker:any):any; - } - - interface IViewRegistry { - getView(selector:any):any; - } - - interface ICursorStatic { - new (arg:{editor:IEditor; marker:IDisplayBufferMarker; id: number;}):ICursor; - } - - interface ScopeDescriptor { - scopes: string[]; - } - - interface ICursor /* extends Theorist.Model */ { - getScopeDescriptor(): ScopeDescriptor; - screenPosition:any; - bufferPosition:any; - goalColumn:any; - visible:boolean; - needsAutoscroll:boolean; - - editor:IEditor; - marker:IDisplayBufferMarker; - id: number; - - destroy():any; - changePosition(options:any, fn:Function):any; - getPixelRect():any; - setScreenPosition(screenPosition:any, options?:any):any; - getScreenPosition():TextBuffer.IPoint; - getScreenRange():TextBuffer.IRange; - setBufferPosition(bufferPosition:any, options?:any):any; - getBufferPosition():TextBuffer.IPoint; - autoscroll():any; - updateVisibility():any; - setVisible(visible:boolean):any; - isVisible():boolean; - wordRegExp(arg?:any):any; - isLastCursor():boolean; - isSurroundedByWhitespace():boolean; - isBetweenWordAndNonWord():boolean; - isInsideWord():boolean; - clearAutoscroll():void; - clearSelection():void; - getScreenRow():number; - getScreenColumn():number; - getBufferRow():number; - getBufferColumn():number; - getCurrentBufferLine():string; - moveUp(rowCount:number, arg?:any):any; - moveDown(rowCount:number, arg?:any):any; - moveLeft(arg?:any):any; - moveRight(arg?:any):any; - moveToTop():any; - moveToBottom():void; - moveToBeginningOfScreenLine():void; - moveToBeginningOfLine():void; - moveToFirstCharacterOfLine():void; - moveToEndOfScreenLine():void; - moveToEndOfLine():void; - moveToBeginningOfWord():void; - moveToEndOfWord():void; - moveToBeginningOfNextWord():void; - moveToPreviousWordBoundary():void; - moveToNextWordBoundary():void; - getBeginningOfCurrentWordBufferPosition(options?:any):TextBuffer.IPoint; - getPreviousWordBoundaryBufferPosition(options?:any):TextBuffer.IPoint; - getMoveNextWordBoundaryBufferPosition(options?:any):TextBuffer.IPoint; - getEndOfCurrentWordBufferPosition(options?:any):TextBuffer.IPoint; - getBeginningOfNextWordBufferPosition(options?:any):TextBuffer.IPoint; - getCurrentWordBufferRange(options?:any):TextBuffer.IPoint; - getCurrentLineBufferRange(options?:any):TextBuffer.IPoint; - getCurrentParagraphBufferRange():any; - getCurrentWordPrefix():string; - isAtBeginningOfLine():boolean; - getIndentLevel():number; - isAtEndOfLine():boolean; - getScopes():string[]; - hasPrecedingCharactersOnLine():boolean; - getMarker(): Marker; - } - - interface ILanguageMode { - // TBD - } - - interface ISelection { - // https://atom.io/docs/api/v1.7.3/Selection - - // Event Subscription - onDidChangeRange(callback: (event: { - oldBufferRange: TextBuffer.IRange; - oldScreenRange: TextBuffer.IRange; - newBufferRange: TextBuffer.IRange; - newScreenRange: TextBuffer.IRange; - selection: ISelection; - }) => {}): Disposable; - onDidDestroy(callback: () => {}): Disposable; - - // Managing the selection range - getScreenRange(): TextBuffer.IRange; - setScreenRange(screenRange: TextBuffer.IRange, options?: { - preserveFolds?: boolean; - autoscroll?: boolean; - }): void; - getBufferRange(): TextBuffer.IRange; - setBufferRange(bufferRange: TextBuffer.IRange, options?: { - preserveFolds?: boolean; - autoscroll?: boolean; - }): void; - getBufferRowRange(): [number]; - - // Info about the selection - isEmpty(): boolean; - isReversed(): boolean; - isSingleScreenLine(): boolean; - getText(): string; - intersectsBufferRange(bufferRange: TextBuffer.IRange): boolean; - intersectsWith(otherSelection: ISelection): boolean; - - // Modifying the selected range - clear(options?: {autoscroll?: boolean}): void; - selectToScreenPosition(position: any): void; - selectToBufferPosition(position: any): void; - selectRight(columnCount?: number): void; - selectLeft(columnCount?: number): void; - selectUp(rowCount: number): void; - selectDown(rowCount: number): void; - selectToTop(): void; - selectToBottom(): void; - selectAll(): void; - selectToBeginningOfLine(): void; - selectToFirstCharacterOfLine(): void; - selectToEndOfLine(): void; - selectToEndOfBufferLine(): void; - selectToBeginningOfWord(): void; - selectToEndOfWord(): void; - selectToBeginningOfNextWord(): void; - selectToPreviousWordBoundary(): void; - selectToNextWordBoundary(): void; - selectToPreviousSubwordBoundary(): void; - selectToNextSubwordBoundary(): void; - selectToBeginningOfNextParagraph(): void; - selectToBeginningOfPreviousParagraph(): void; - selectWord(): TextBuffer.IRange; - expandOverWord(): void; - selectLine(row?: number): void; - expandOverLine(): void; - - // Modifying the selected text - insertText(text: string, options?: { - select: boolean; - autoIndent: boolean; - autoIndentNewline: boolean; - autoDecreaseIndent: boolean; - normalizeLineEndings?: boolean; - undo?: 'skip'; - }): void; - backspace(): void; - deleteToPreviousWordBoundary(): void; - deleteToNextWordBoundary(): void; - deleteToBeginningOfWord(): void; - deleteToBeginningOfLine(): void; - delete(): void; - deleteToEndOfLine(): void; - deleteToEndOfWord(): void; - deleteToBeginningOfSubword(): void; - deleteToEndOfSubword(): void; - deleteSelectedText(): void; - deleteLine(): void; - joinLines(): void; - outdentSelectedRows(): void; - autoIndentSelectedRows(): void; - toggleLineComments(): void; - cutToEndOfLine(): void; - cutToEndOfBufferLine(): void; - cut(maintainClipboard?: boolean, fullLine?: boolean): void; - copy(maintainClipboard?: boolean, fullLine?: boolean): void; - fold(): void; - indentSelectedRows(): void; - - // Managing multiple selections - addSelectionBelow(): void; - addSelectionAbove(): void; - merge(otherSelection: ISelection, options?: { - preserveFolds?: boolean; - autoscroll?: boolean; - }): void; - - // Comparing to other selections - compare(otherSelection: ISelection): any; - } - - interface IDecorationParams { - id?: number; - class: string; - type: any /* string or string[] */; - } - - interface IDecorationStatic { - isType(decorationParams:IDecorationParams, type:any /* string or string[] */):boolean; - new (marker:IDisplayBufferMarker, displayBuffer:IDisplayBuffer, params: IDecorationParams): IDecoration; - } - - interface IDecoration extends Emissary.IEmitter { - marker: IDisplayBufferMarker; - displayBuffer: IDisplayBuffer; - params: IDecorationParams - id: number; - flashQueue: any[]; - isDestroyed: boolean; - - destroy():void; - update(newParams:IDecorationParams):void; - getMarker():IDisplayBufferMarker; - getParams():IDecorationParams; - isType(type:string):boolean; - matchesPattern(decorationPattern:{[key:string]:IDecorationParams;}):boolean; - flash(klass:string, duration?:number):void; - consumeNextFlash():any; - } - - interface IEditor { - // Serializable.includeInto(Editor); - // Delegator.includeInto(Editor); - - deserializing:boolean; - callDisplayBufferCreatedHook:boolean; - registerEditor:boolean; - buffer:TextBuffer.ITextBuffer; - languageMode: ILanguageMode; - cursors:ICursor[]; - selections: ISelection[]; - suppressSelectionMerging:boolean; - updateBatchDepth: number; - selectionFlashDuration: number; - softTabs: boolean; - displayBuffer: IDisplayBuffer; - - id:number; - behaviors:any; - declaredPropertyValues: any; - eventHandlersByEventName: any; - eventHandlersByNamespace: any; - lastOpened: number; - subscriptionCounts: any; - subscriptionsByObject: any; /* WeakMap */ - subscriptions: Emissary.ISubscription[]; - destroy():void; - - mini: any; - - serializeParams():{id:number; softTabs:boolean; scrollTop:number; scrollLeft:number; displayBuffer:any;}; - deserializeParams(params:any):any; - subscribeToBuffer():void; - subscribeToDisplayBuffer():void; - getViewClass():any; // return type are EditorView - destroyed():void; - isDestroyed():boolean; - copy():IEditor; - getTitle():string; - getLongTitle():string; - setVisible(visible:boolean):void; - setMini(mini:any):void; - setScrollTop(scrollTop:any):void; - getScrollTop():number; - setScrollLeft(scrollLeft:any):void; - getScrollLeft():number; - setEditorWidthInChars(editorWidthInChars:any):void; - getSoftWrapColumn():number; - getSoftTabs():boolean; - setSoftTabs(softTabs:boolean):void; - getSoftWrap():boolean; - setSoftWrap(softWrap:any):void; - getTabText():string; - getTabLength():number; - setTabLength(tabLength:any):void; - usesSoftTabs():boolean; - clipBufferPosition(bufferPosition:any):void; - clipBufferRange(range:any):void; - indentationForBufferRow(bufferRow:any):void; - setIndentationForBufferRow(bufferRow:any, newLevel:any, _arg:any):void; - indentLevelForLine(line:any):number; - buildIndentString(number:any):string; - save():void; - saveAs(filePath:any):void; - copyPathToClipboard():void; - getPath():string; - getText():string; - setText(text:any):void; - getTextInRange(range:any):any; - getLineCount():number; - getBuffer():TextBuffer.ITextBuffer; - getURI():string; - isBufferRowBlank(bufferRow:any):boolean; - isBufferRowCommented(bufferRow:any):void; - nextNonBlankBufferRow(bufferRow:any):void; - getEofBufferPosition():TextBuffer.IPoint; - getLastBufferRow():number; - bufferRangeForBufferRow(row:any, options:any):TextBuffer.IRange; - lineForBufferRow(row:number):string; - lineLengthForBufferRow(row:number):number; - scan():any; - scanInBufferRange():any; - backwardsScanInBufferRange():any; - isModified():boolean; - isEmpty():boolean; - shouldPromptToSave():boolean; - screenPositionForBufferPosition(bufferPosition:any, options?:any):TextBuffer.IPoint; - bufferPositionForScreenPosition(screenPosition:any, options?:any):TextBuffer.IPoint; - screenRangeForBufferRange(bufferRange:any):TextBuffer.IRange; - bufferRangeForScreenRange(screenRange:any):TextBuffer.IRange; - clipScreenPosition(screenPosition:any, options:any):TextBuffer.IRange; - lineForScreenRow(row:any):ITokenizedLine; - linesForScreenRows(start?:any, end?:any):ITokenizedLine[]; - getScreenLineCount():number; - getMaxScreenLineLength():number; - getLastScreenRow():number; - bufferRowsForScreenRows(startRow:any, endRow:any):any[]; - bufferRowForScreenRow(row:any):number; - scopesForBufferPosition(bufferPosition:any):string[]; - bufferRangeForScopeAtCursor(selector:string):any; - tokenForBufferPosition(bufferPosition:any):IToken; - getCursorScopes():string[]; - logCursorScope():void; - insertText(text:string, options?:any):TextBuffer.IRange[]; - insertNewline():TextBuffer.IRange[]; - insertNewlineBelow():TextBuffer.IRange[]; - insertNewlineAbove():any; - indent(options?:any):any; - backspace():any[]; - // deprecated backspaceToBeginningOfWord():any[]; - // deprecated backspaceToBeginningOfLine():any[]; - deleteToBeginningOfWord():any[]; - deleteToBeginningOfLine():any[]; - delete():any[]; - deleteToEndOfLine():any[]; - deleteToEndOfWord():any[]; - deleteLine():TextBuffer.IRange[]; - indentSelectedRows():TextBuffer.IRange[][]; - outdentSelectedRows():TextBuffer.IRange[][]; - toggleLineCommentsInSelection():TextBuffer.IRange[]; - autoIndentSelectedRows():TextBuffer.IRange[][]; - normalizeTabsInBufferRange(bufferRange:any):any; - cutToEndOfLine():boolean[]; - cutSelectedText():boolean[]; - copySelectedText():boolean[]; - pasteText(options?:any):TextBuffer.IRange[]; - undo():any[]; - redo():any[]; - foldCurrentRow():any; - unfoldCurrentRow():any[]; - foldSelectedLines():any[]; - foldAll():any[]; - unfoldAll():any[]; - foldAllAtIndentLevel(level:any):any; - foldBufferRow(bufferRow:any):any; - unfoldBufferRow(bufferRow:any):any; - isFoldableAtBufferRow(bufferRow:any):boolean; - isFoldableAtScreenRow(screenRow:any):boolean; - createFold(startRow:any, endRow:any):IFold; - destroyFoldWithId(id:any):any; - destroyFoldsIntersectingBufferRange(bufferRange:any):any; - toggleFoldAtBufferRow(bufferRow:any):any; - isFoldedAtCursorRow():boolean; - isFoldedAtBufferRow(bufferRow:any):boolean; - isFoldedAtScreenRow(screenRow:any):boolean; - largestFoldContainingBufferRow(bufferRow:any):boolean; - largestFoldStartingAtScreenRow(screenRow:any):any; - outermostFoldsInBufferRowRange(startRow:any, endRow:any):any[]; - moveLineUp():ISelection[]; - moveLineDown():ISelection[]; - duplicateLines():any[][]; - // duprecated duplicateLine():any[][]; - mutateSelectedText(fn:(selection:ISelection)=>any):any; - replaceSelectedText(options:any, fn:(selection:string)=>any):any; - decorationsForScreenRowRange(startScreenRow:any, endScreenRow:any):{[id:number]: IDecoration[]}; - decorateMarker(marker:IDisplayBufferMarker, decorationParams: {type:string; class: string;}):IDecoration; - decorationForId(id:number):IDecoration; - getMarker(id:number):IDisplayBufferMarker; - getMarkers():IDisplayBufferMarker[]; - findMarkers(...args:any[]):IDisplayBufferMarker[]; - markScreenRange(...args:any[]):IDisplayBufferMarker; - markBufferRange(...args:any[]):IDisplayBufferMarker; - markScreenPosition(...args:any[]):IDisplayBufferMarker; - markBufferPosition(...args:any[]):IDisplayBufferMarker; - destroyMarker(...args:any[]):boolean; - getMarkerCount():number; - hasMultipleCursors():boolean; - getCursors():ICursor[]; - getCursor():ICursor; - addCursorAtScreenPosition(screenPosition:any):ICursor; - addCursorAtBufferPosition(bufferPosition:any):ICursor; - addCursor(marker:any):ICursor; - removeCursor(cursor:any):ICursor[]; - addSelection(marker:any, options:any):ISelection; - addSelectionForBufferRange(bufferRange:any, options:any):ISelection; - setSelectedBufferRange(bufferRange:any, options:any):any; - setSelectedBufferRanges(bufferRanges:any, options:any):any; - removeSelection(selection:ISelection):any; - clearSelections():boolean; - consolidateSelections():boolean; - selectionScreenRangeChanged(selection:any):void; - getSelections():ISelection[]; - getSelection(index?:number):ISelection; - getLastSelection():ISelection; - getSelectionsOrderedByBufferPosition():ISelection[]; - getLastSelectionInBuffer():ISelection; - selectionIntersectsBufferRange(bufferRange:any):any; - setCursorScreenPosition(position:TextBuffer.IPoint, options?:any):any; - getCursorScreenPosition():TextBuffer.IPoint; - getCursorScreenRow():number; - setCursorBufferPosition(position:any, options?:any):any; - getCursorBufferPosition():TextBuffer.IPoint; - getSelectedScreenRange():TextBuffer.IRange; - getSelectedBufferRange():TextBuffer.IRange; - getSelectedBufferRanges():TextBuffer.IRange[]; - getSelectedText():string; - getTextInBufferRange(range:TextBuffer.IRange):string; - setTextInBufferRange(range:TextBuffer.IRange | any[], text:string):any; - getCurrentParagraphBufferRange():TextBuffer.IRange; - getWordUnderCursor(options?:any):string; - moveCursorUp(lineCount?:number):void; - moveCursorDown(lineCount?:number):void; - moveCursorLeft():void; - moveCursorRight():void; - moveCursorToTop():void; - moveCursorToBottom():void; - moveCursorToBeginningOfScreenLine():void; - moveCursorToBeginningOfLine():void; - moveCursorToFirstCharacterOfLine():void; - moveCursorToEndOfScreenLine():void; - moveCursorToEndOfLine():void; - moveCursorToBeginningOfWord():void; - moveCursorToEndOfWord():void; - moveCursorToBeginningOfNextWord():void; - moveCursorToPreviousWordBoundary():void; - moveCursorToNextWordBoundary():void; - moveCursorToBeginningOfNextParagraph():void; - moveCursorToBeginningOfPreviousParagraph():void; - moveToBottom():void; - scrollToCursorPosition(options:any):any; - pageUp():void; - pageDown():void; - selectPageUp():void; - selectPageDown():void; - getRowsPerPage():number; - moveCursors(fn:(cursor:ICursor)=>any):any; - cursorMoved(event:any):void; - selectToScreenPosition(position:TextBuffer.IPoint):any; - selectRight():ISelection[]; - selectLeft():ISelection[]; - selectUp(rowCount?:number):ISelection[]; - selectDown(rowCount?:number):ISelection[]; - selectToTop():ISelection[]; - selectAll():ISelection[]; - selectToBottom():ISelection[]; - selectToBeginningOfLine():ISelection[]; - selectToFirstCharacterOfLine():ISelection[]; - selectToEndOfLine():ISelection[]; - selectToPreviousWordBoundary():ISelection[]; - selectToNextWordBoundary():ISelection[]; - selectLine():ISelection[]; - selectLinesContainingCursors():ISelection[]; - addSelectionBelow():ISelection[]; - addSelectionAbove():ISelection[]; - splitSelectionsIntoLines():any[]; - transpose():TextBuffer.IRange[]; - upperCase():boolean[]; - lowerCase():boolean[]; - joinLines():any[]; - selectToBeginningOfWord():ISelection[]; - selectToEndOfWord():ISelection[]; - selectToBeginningOfNextWord():ISelection[]; - selectWord():ISelection[]; - selectToBeginningOfNextParagraph():ISelection[]; - selectToBeginningOfPreviousParagraph():ISelection[]; - selectMarker(marker:any):any; - mergeCursors():number[]; - expandSelectionsForward():any; - expandSelectionsBackward(fn:(selection:ISelection)=>any):ISelection[]; - finalizeSelections():boolean[]; - mergeIntersectingSelections():any; - preserveCursorPositionOnBufferReload():Emissary.ISubscription; - getGrammar(): IGrammar; - setGrammar(grammer:IGrammar):void; - reloadGrammar():any; - shouldAutoIndent():boolean; - shouldShowInvisibles():boolean; - updateInvisibles():void; - transact(fn:Function):any; - beginTransaction():ITransaction; - commitTransaction():any; - abortTransaction():any[]; - inspect():string; - logScreenLines(start:number, end:number):any[]; - handleTokenization():void; - handleGrammarChange():void; - handleMarkerCreated(marker:any):any; - getSelectionMarkerAttributes():{type: string; editorId: number; invalidate: string; }; - getVerticalScrollMargin():number; - setVerticalScrollMargin(verticalScrollMargin:number):void; - getHorizontalScrollMargin():number; - setHorizontalScrollMargin(horizontalScrollMargin:number):void; - getLineHeightInPixels():number; - setLineHeightInPixels(lineHeightInPixels:number):void; - batchCharacterMeasurement(fn:Function):void; - getScopedCharWidth(scopeNames:any, char:any):any; - setScopedCharWidth(scopeNames:any, char:any, width:any):any; - getScopedCharWidths(scopeNames:any):any; - clearScopedCharWidths():any; - getDefaultCharWidth():number; - setDefaultCharWidth(defaultCharWidth:number):void; - setHeight(height:number):void; - getHeight():number; - getClientHeight():number; - setWidth(width:number):void; - getWidth():number; - getScrollTop():number; - setScrollTop(scrollTop:number):void; - getScrollBottom():number; - setScrollBottom(scrollBottom:number):void; - getScrollLeft():number; - setScrollLeft(scrollLeft:number):void; - getScrollRight():number; - setScrollRight(scrollRight:number):void; - getScrollHeight():number; - getScrollWidth():number; - getVisibleRowRange():number; - intersectsVisibleRowRange(startRow:any, endRow:any):any; - selectionIntersectsVisibleRowRange(selection:any):any; - pixelPositionForScreenPosition(screenPosition:any):any; - pixelPositionForBufferPosition(bufferPosition:any):any; - screenPositionForPixelPosition(pixelPosition:any):any; - pixelRectForScreenRange(screenRange:any):any; - scrollToScreenRange(screenRange:any, options:any):any; - scrollToScreenPosition(screenPosition:any, options:any):any; - scrollToBufferPosition(bufferPosition:any, options:any):any; - horizontallyScrollable():any; - verticallyScrollable():any; - getHorizontalScrollbarHeight():any; - setHorizontalScrollbarHeight(height:any):any; - getVerticalScrollbarWidth():any; - setVerticalScrollbarWidth(width:any):any; - // deprecated joinLine():any; - - onDidChange(callback: Function): Disposable; - onDidDestroy(callback: Function): Disposable; - onDidStopChanging(callback: Function): Disposable; - onDidChangeCursorPosition(callback: Function): Disposable; - onDidSave(callback: (event: { path: string }) => void): Disposable; - - decorateMarker(marker: Marker, options: any): Decoration; - getLastCursor(): ICursor; - } - - interface IGrammar { - bundledPackage: boolean; - emitter: any; - fileTypes: [string]; - firstLineRegex: any; - foldingStopMarker: any; - includedGrammarScopes: [any]; - initialRule: any; - injectionSelector: any; - injections: any; - maxTokensPerLine: Number; - name: string; - packageName: string; - path: string; - rawPatterns: [any]; - rawRepository: any; - registration: Disposable; - registry: any; - repository: Object; - scopeName: string; - tokenizeLines: (text: string) => any; - // TBD - - } - - interface IGrammars { - grammarForScopeName(scope: string): IGrammar; - } - - interface IPane /* extends Theorist.Model */ { - itemForURI: (uri:string)=>IEditor; - items:any[]; - activeItem:any; - - serializeParams():any; - deserializeParams(params:any):any; - getViewClass():any; // return type are PaneView - isActive():boolean; - isDestroyed():boolean; - focus():void; - blur():void; - activate():void; - getPanes():IPane[]; - getItems():any[]; - getActiveItem():any; - getActiveEditor():any; - itemAtIndex(index:number):any; - activateNextItem():any; - activatePreviousItem():any; - getActiveItemIndex():number; - activateItemAtIndex(index:number):any; - activateItem(item:any):any; - addItem(item:any, index:number):any; - addItems(items:any[], index:number):any[]; - removeItem(item:any, destroying:any):void; - moveItem(item:any, newIndex:number):void; - moveItemToPane(item:any, pane:IPane, index:number):void; - destroyActiveItem():boolean; // always return false - destroyItem(item:any):boolean; - destroyItems():any[]; - destroyInactiveItems():any[]; - destroy():void; - destroyed():any[]; - promptToSaveItem(item:any):boolean; - saveActiveItem():void; - saveActiveItemAs():void; - saveItem(item:any, nextAction:Function):void; - saveItemAs(item:any, nextAction:Function):void; - saveItems():any[]; - activateItemForURI(uri:any):any; - copyActiveItem():void; - splitLeft(params:any):IPane; - splitRight(params:any):IPane; - splitUp(params:any):IPane; - splitDown(params:any):IPane; - split(orientation:string, side:string, params:any):IPane; - findLeftmostSibling():IPane; - findOrCreateRightmostSibling():IPane; - } - - // https://atom.io/docs/v0.84.0/advanced/serialization - interface ISerializationStatic { - deserialize(data:ISerializationInfo):T; - new (data:T): ISerialization; - } - - interface ISerialization { - serialize():ISerializationInfo; - } - - interface ISerializationInfo { - deserializer: string; - } - - interface IBrowserWindow { - getPosition():number[]; - getSize():number[]; - } - - interface IAtomWindowDimentions { - x:number; - y:number; - width:number; - height:number; - } - - interface IProjectStatic { - pathForRepositoryUrl(repoUrl:string):string; - - new (arg?:{path:any; buffers:any[];}):IProject; - } - - interface IProject /* extends Theorist.Model */ { - // Serializable.includeInto(Project); - - path:string; - /** deprecated */ - rootDirectory?:PathWatcher.IDirectory; - rootDirectories:PathWatcher.IDirectory[]; - - serializeParams():any; - deserializeParams(params:any):any; - destroyed():any; - destroyRepo():any; - destroyUnretainedBuffers():any; - getRepo():IGit; - getPath():string; - setPath(projectPath:string):any; - getRootDirectory():PathWatcher.IDirectory; - resolve(uri:string):string; - relativize(fullPath:string):string; - contains(pathToCheck:string):boolean; - open(filePath:string, options?:any):Q.Promise; - openSync(filePath:string, options?:any):IEditor; - getBuffers():TextBuffer.ITextBuffer; - isPathModified(filePath:string):boolean; - findBufferForPath(filePath:string):TextBuffer.ITextBuffer; - bufferForPathSync(filePath:string):TextBuffer.ITextBuffer; - bufferForPath(filePath:string):Q.Promise; - bufferForId(id:any):TextBuffer.ITextBuffer; - buildBufferSync(absoluteFilePath:string):TextBuffer.ITextBuffer; - buildBuffer(absoluteFilePath:string):Q.Promise; - addBuffer(buffer:TextBuffer.ITextBuffer, options?:any):any; - addBufferAtIndex(buffer:TextBuffer.ITextBuffer, index:number, options?:any):any; - scan(regex:any, options:any, iterator:any):Q.Promise; - replace(regex:any, replacementText:any, filePaths:any, iterator:any):Q.Promise; - buildEditorForBuffer(buffer:any, editorOptions:any):IEditor; - eachBuffer(...args:any[]):any; - - onDidChangePaths(callback: Function): Disposable; - } - - interface IWorkspaceStatic { - new():IWorkspace; - } - - interface IWorkspacePanelOptions{ - item:any; - visible?:boolean; - priority?:number; - } - - interface Panel{ - getItem():any; - getPriority():any; - isVisible():boolean; - show():void; - hide():void; - } - - interface IWorkspace { - addBottomPanel(options:IWorkspacePanelOptions):Panel; - addLeftPanel(options:IWorkspacePanelOptions):Panel; - addRightPanel(options:IWorkspacePanelOptions):Panel; - addTopPanel(options:IWorkspacePanelOptions):Panel; - addModalPanel(options:IWorkspacePanelOptions):Panel; - addOpener(opener: Function): any; - - deserializeParams(params:any):any; - serializeParams():{paneContainer:any;fullScreen:boolean;}; - eachEditor(callback: Function): void; - getTextEditors():IEditor[]; - open(uri:string, options:any):Q.Promise; - openLicense():void; - openSync(uri:string, options:any):any; - openUriInPane(uri: string, pane: any, options: any): Q.Promise; - observeTextEditors(callback: Function): Disposable; - reopenItemSync():any; - registerOpener(opener:(urlToOpen:string)=>any):void; - unregisterOpener(opener:Function):void; - getOpeners():any; - getActivePane(): IPane; - getActivePaneItem(): IPane; - getActiveTextEditor(): IEditor; - getPanes():any; - saveAll():void; - activateNextPane():any; - activatePreviousPane():any; - paneForURI: (uri:string) => IPane; - saveActivePaneItem():any; - saveActivePaneItemAs():any; - destroyActivePaneItem():any; - destroyActivePane():any; - getActiveEditor():IEditor; - increaseFontSize():void; - decreaseFontSize():void; - resetFontSize():void; - itemOpened(item:any):void; - onPaneItemDestroyed(item:any):void; - destroyed():void; - isTextEditor(object: any): boolean; - - onDidChangeActivePaneItem(item:any):Disposable; - } - - interface IAtomSettings { - appVersion: string; - bootstrapScript: string; - devMode: boolean; - initialPath: string; - pathToOpen: string; - resourcePath: string; - shellLoadTime: number; - windowState:string; - } - - interface IAtomState { - mode:string; - packageStates:any; - project:any; - syntax:any; - version:number; - windowDimensions:any; - workspace:any; - } - - interface IDeserializerManager { - deserializers:Function; - add:Function; - remove:Function; - deserialize:Function; - get:Function; - } - - interface IColorlike { - red: number; - green: number; - blue: number; - alpha: number; - } - - class Color { - public static parse(value:string): Color - public static parse(value:IColorlike): Color - public toHexString(): string - public toRGBAString(): string - } - - interface IConfigGetOptions { - sources?:Array; - excludeSources?:Array; - scope?:ScopeDescriptor; - } - - interface IConfigSetOptions { - scopeSelector?:string; - source?:string; - } - - interface IConfigObserveOptions { - scope?:ScopeDescriptor; - } - - interface IConfigChangeEvent { - newValue:T; - oldValue:T; - } - - type ConfigSetting = string | number | boolean | Color | IConfigArray | IConfigObject - - interface IConfigArray extends Array { } - - interface IConfigObject { [key: string]: ConfigSetting } - - interface IConfig { - get(keyPath:string, options?:IConfigGetOptions):ConfigSetting; - set(keyPath:string, value:ConfigSetting, options?:IConfigSetOptions):boolean; - unset(keyPath:string, options?:IConfigSetOptions):void; - observe(keyPath:string, options?:IConfigObserveOptions, callback?:(value:ConfigSetting) => void):Disposable; - onDidChange(keyPath?:string, options?:IConfigObserveOptions, callback?:(event:IConfigChangeEvent) => void):Disposable; - } - - interface IKeymapManager { - defaultTarget:HTMLElement; - // TBD - } - - interface IPackage { - mainModulePath: string; - mainModule: any; - enable(): void; - disable(): void; - isTheme(): boolean; - getType(): string; - getStylesheetType(): string; - load(): IPackage; - reset(): void; - activate(): Q.Promise; - activateNow(): void; - // TBD - } - - interface IPackageManager extends Emissary.IEmitter { - packageDirPaths:string[]; - loadedPackages:any; - activePackages:any; - packageStates:any; - packageActivators:any[]; - - getApmPath():string; - getPackageDirPaths():string; - getPackageState(name:string):any; - setPackageState(name:string, state:any):void; - enablePackage(name:string):any; - disablePackage(name:string):any; - activate():void; - registerPackageActivator(activator:any, types:any):void; - activatePackages(packages:any):void; - activatePackage(name:string):Q.Promise; - deactivatePackages():void; - deactivatePackage(name:string):void; - getActivePackages():any; - getActivePackage(name:string):any; - isPackageActive(name:string):boolean; - unobserveDisabledPackages():void; - observeDisabledPackages():void; - loadPackages():void; - loadPackage(nameOrPath:string):void; - unloadPackages():void; - unloadPackage(name:string):void; - getLoadedPackage(name:string):any; - isPackageLoaded(name:string):boolean; - getLoadedPackages():any; - getLoadedPackagesForTypes(types:any):any[]; - resolvePackagePath(name:string):string; - isPackageDisabled(name:string):boolean; - hasAtomEngine(packagePath:string):boolean; - isBundledPackage(name:string):boolean; - getPackageDependencies():any; - getAvailablePackagePaths():any[]; - getAvailablePackageNames():any[]; - getAvailablePackageMetadata():any[]; - } - - interface INotifications { - addInfo: Function; - addError: Function; - addSuccess: Function; - addWarning: Function; - } - - interface IThemeManager { - // TBD - } - - interface IContextMenuManager { - // TBD - } - - interface IMenuManager { - // TBD - } - - interface IClipboard { - write(text:string, metadata?:any):any; - read():string; - } - - interface ISyntax { - // TBD - } - - interface IWindowEventHandler { - // TBD - } - - interface IAtomStatic extends ISerializationStatic { - version: number; - loadSettings: IAtomSettings; - - /* Load or create the Atom environment in the given mode */ - loadOrCreate(mode:'editor'):IAtom; - /* Load or create the Atom environment in the given mode */ - loadOrCreate(mode:'spec'):IAtom; - /* Load or create the Atom environment in the given mode */ - loadOrCreate(mode:string):IAtom; - - loadState(mode:any):void; - getStatePath(mode:any):string; - getConfigDirPath():string; - getStorageDirPath():string; - getLoadSettings():IAtomSettings; - getCurrentWindow():IBrowserWindow; - getVersion():string; - isReleasedVersion():boolean; - - new(state:IAtomState):IAtom; - } - - class Disposable { - constructor(disposalAction:any) - static isDisposable(object: any): boolean - dispose():void - } - - class CompositeDisposable { - constructor(... disposables: Array) - clear():void - dispose():void - add(... disposables: Array): void - remove(disposable: Disposable): void - delete(disposable: Disposable): void - } - - // https://atom.io/docs/api/v0.106.0/api/classes/Atom.html - /* Global Atom class : instance members */ - interface IAtom { - constructor:IAtomStatic; - - state:IAtomState; - mode:string; - deserializers:IDeserializerManager; - config: IConfig; - commands: ICommandRegistry; - grammars: IGrammars; - keymaps: IKeymapManager; - keymap: IKeymapManager; - packages: IPackageManager; - themes: IThemeManager; - contextManu: IContextMenuManager; - menu: IMenuManager; - notifications: INotifications; // https://github.com/atom/notifications - clipboard:IClipboard; - syntax:ISyntax; - views: IViewRegistry; - windowEventHandler: IWindowEventHandler; - - // really exists? start - subscribe:Function; - unsubscribe:Function; - loadTime:number; - workspaceViewParentSelector:string; - - project: IProject; - workspaceView: IWorkspaceView; - workspace: IWorkspace; - // really exists? end - - initialize:Function; - // registerRepresentationClass:Function; - // registerRepresentationClasses:Function; - setBodyPlatformClass:Function; - getCurrentWindow():IBrowserWindow; - getWindowDimensions:Function; - setWindowDimensions:Function; - restoreWindowDimensions:Function; - storeWindowDimensions:Function; - getLoadSettings:Function; - deserializeProject: Function; - deserializeWorkspaceView:Function; - deserializePackageStates:Function; - deserializeEditorWindow:Function; - startEditorWindow:Function; - unloadEditorWindow:Function; - loadThemes:Function; - watchThemes:Function; - open:Function; - confirm:Function; - showSaveDialog:Function; - showSaveDialogSync:Function; - openDevTools:Function; - toggleDevTools:Function; - executeJavaScriptInDevTools:Function; - reload:Function; - focus:Function; - show:Function; - hide:Function; - setSize:Function; - setPosition:Function; - center:Function; - displayWindow:Function; - close:Function; - exit:Function; - inDevMode:Function; - inSpecMode:Function; - toggleFullScreen:Function; - setFullScreen:Function; - isFullScreen:Function; - getVersion:Function; - isReleasedVersion:Function; - getGitHubAuthTokenName:Function; - setGitHubAuthToken:Function; - getGitHubAuthToken:Function; - getConfigDirPath:Function; - saveSync:Function; - getWindowLoadTime():number; - crashMainProcess:Function; - crashRenderProcess:Function; - beep:Function; - getUserInitScriptPath:Function; - requireUserInitScript:Function; - requireWithGlobals:Function; - - services: any; // TODO: New services api - } - - interface IBufferedNodeProcessStatic { - new (arg:any):IBufferedNodeProcess; - } - - interface IBufferedNodeProcess extends IBufferedProcess { - } - - interface IBufferedProcessStatic { - new (arg:any):IBufferedProcess; - } - - interface IBufferedProcess { - process:Function; - killed:boolean; - - bufferStream:Function; - kill:Function; - } - - interface IGitStatic { - new(path:any, options:any):IGit; - } - - interface IGit { - } - - interface ITokenizedBuffer { - // TBD - } - - interface ITokenizedLine { - // TBD - } - - interface IToken { - // TBD - } - - interface IFoldStatic { - new (displayBuffer:IDisplayBuffer, marker:IMarker):IFold; - // TBD - } - - interface IFold { - id:number; - displayBuffer:IDisplayBuffer; - marker:IMarker; - - // TBD - } - - interface IDisplayBufferMarkerStatic { - new (_arg:{bufferMarker:IMarker; displayBuffer: IDisplayBuffer}):IDisplayBufferMarker; - } - - interface IDisplayBufferMarker extends Emissary.IEmitter, Emissary.ISubscriber { - constructor:IDisplayBufferMarkerStatic; - - id: number; - - bufferMarkerSubscription:any; - oldHeadBufferPosition:TextBuffer.IPoint; - oldHeadScreenPosition:TextBuffer.IPoint; - oldTailBufferPosition:TextBuffer.IPoint; - oldTailScreenPosition:TextBuffer.IPoint; - wasValid:boolean; - - bufferMarker: IMarker; - displayBuffer: IDisplayBuffer; - globalPauseCount:number; - globalQueuedEvents:any; - - subscriptions:Emissary.ISubscription[]; - subscriptionsByObject:any; // WeakMap - - copy(attributes?:any /* maybe IMarker */):IDisplayBufferMarker; - getScreenRange():TextBuffer.IRange; - setScreenRange(screenRange:any, options:any):any; - getBufferRange():TextBuffer.IRange; - setBufferRange(bufferRange:any, options:any):any; - getPixelRange():any; - getHeadScreenPosition():TextBuffer.IPoint; - setHeadScreenPosition(screenPosition:any, options:any):any; - getHeadBufferPosition():TextBuffer.IPoint; - setHeadBufferPosition(bufferPosition:any):any; - getTailScreenPosition():TextBuffer.IPoint; - setTailScreenPosition(screenPosition:any, options:any):any; - getTailBufferPosition():TextBuffer.IPoint; - setTailBufferPosition(bufferPosition:any):any; - plantTail():boolean; - clearTail():boolean; - hasTail():boolean; - isReversed():boolean; - isValid():boolean; - isDestroyed():boolean; - getAttributes():any; - setAttributes(attributes:any):any; - matchesAttributes(attributes:any):any; - destroy():any; - isEqual(other:IDisplayBufferMarker):boolean; - compare(other:IDisplayBufferMarker):boolean; - inspect():string; - destroyed():any; - notifyObservers(_arg:any):any; - } - - interface ITransaction { - // TBD - } - - interface IMarker extends Emissary.IEmitter { - // Serializable.includeInto(Editor); - // Delegator.includeInto(Editor); - - // TBD - } - - interface ITaskStatic { - new(taskPath:any):ITask; - } - - interface ITask { - // TBD - } -} - -declare var atom:AtomCore.IAtom; - -declare module "atom" { - import spacePen = require("space-pen"); - import Q = require("q"); - - var $:typeof spacePen.$; - var $$:typeof spacePen.$$; - var $$$:typeof spacePen.$$$; - - var BufferedNodeProcess:AtomCore.IBufferedNodeProcessStatic; - var BufferedProcess:AtomCore.IBufferedProcessStatic; - var Git:AtomCore.IGitStatic; - var Point:TextBuffer.IPointStatic; - var Range:TextBuffer.IRangeStatic; - - class View extends spacePen.View implements Emissary.ISubscriber { - // Subscriber.includeInto(spacePen.View); - - // inherit from Subscriber - subscribeWith(eventEmitter:any, methodName:string, args:any):any; - - addSubscription(subscription:any):any; - - subscribe(eventEmitterOrSubscription:any, ...args:any[]):any; - - subscribeToCommand(eventEmitter:any, ...args:any[]):any; - - unsubscribe(object?:any):any; - } - - class EditorView extends View { - static characterWidthCache:any; - static configDefaults:any; - static nextEditorId:number; - - static content(params:any):void; - - static classes(_arg?:{mini?:any}):string; - - vScrollMargin:number; - hScrollMargin:number; - lineHeight:any; - charWidth:any; - charHeight:any; - cursorViews:any[]; - selectionViews:any[]; - lineCache:any[]; - isFocused:any; - editor:AtomCore.IEditor; - attached:any; - lineOverdraw:number; - pendingChanges:any[]; - newCursors:any[]; - newSelections:any[]; - redrawOnReattach:any; - bottomPaddingInLines:number; - active:boolean; - - id:number; - - gutter:AtomCore.IGutterView; - overlayer:JQuery; - scrollView:JQuery; - renderedLines:JQuery; - underlayer:JQuery; - hiddenInput:JQuery; - verticalScrollbar:JQuery; - verticalScrollbarContent:JQuery; - - constructor(editor:AtomCore.IEditor); - - initialize(editorOrOptions:AtomCore.IEditor):void; // return type are same as editor method. - initialize(editorOrOptions?:{editor: AtomCore.IEditor; mini:any; placeholderText:any}):void; - - initialize(editorOrOptions:{}):void; // compatible for spacePen.View - - bindKeys():void; - - getEditor():AtomCore.IEditor; - - getText():string; - - setText(text:string):void; - - insertText(text:string, options?:any):TextBuffer.IRange[]; - - setHeightInLines(heightInLines:number):number; - - setWidthInChars(widthInChars:number):number; - - pageDown():void; - - pageUp():void; - - getPageRows():number; - - setShowInvisibles(showInvisibles:boolean):void; - - setInvisibles(invisibles:{ eol:string; space: string; tab: string; cr: string; }):void; - - setShowIndentGuide(showIndentGuide:boolean):void; - - setPlaceholderText(placeholderText:string):void; - - getPlaceholderText():string; - - checkoutHead():boolean; - - configure():Emissary.ISubscription; - - handleEvents():void; - - handleInputEvents():void; - - bringHiddenInputIntoView():JQuery; - - selectOnMousemoveUntilMouseup():any; - - afterAttach(onDom:any):any; - - edit(editor:AtomCore.IEditor):any; - - getModel():AtomCore.IEditor; - - setModel(editor:AtomCore.IEditor):any; - - showBufferConflictAlert(editor:AtomCore.IEditor):any; - - scrollTop(scrollTop:number, options?:any):any; - - scrollBottom(scrollBottom?:number):any; - - scrollLeft(scrollLeft?:number):number; - - scrollRight(scrollRight?:number):any; - - scrollToBottom():any; - - scrollToCursorPosition():any; - - scrollToBufferPosition(bufferPosition:any, options:any):any; - - scrollToScreenPosition(screenPosition:any, options:any):any; - - scrollToPixelPosition(pixelPosition:any, options:any):any; - - highlightFoldsContainingBufferRange(bufferRange:any):any; - - saveScrollPositionForEditor():any; - - toggleSoftTabs():any; - - toggleSoftWrap():any; - - calculateWidthInChars():number; - - calculateHeightInLines():number; - - getScrollbarWidth():number; - - setSoftWrap(softWrap:boolean):any; - - setFontSize(fontSize:number):any; - - getFontSize():number; - - setFontFamily(fontFamily?:string):any; - - getFontFamily():string; - - setLineHeight(lineHeight:number):any; - - redraw():any; - - splitLeft():any; - - splitRight():any; - - splitUp():any; - - splitDown():any; - - getPane():any; // return type are PaneView - - remove(selector:any, keepData:any):any; - - beforeRemove():any; - - getCursorView(index?:number):any; // return type are CursorView - - getCursorViews():any[]; // return type are CursorView[] - - addCursorView(cursor:any, options:any):any; // return type are CursorView - - removeCursorView(cursorView:any):any; - - getSelectionView(index?:number):any; // return type are SelectionView - - getSelectionViews():any[]; // return type are SelectionView[] - - addSelectionView(selection:any):any; - - removeSelectionView(selectionView:any):any; - - removeAllCursorAndSelectionViews():any[]; - - appendToLinesView(view:any):any; - - scrollVertically(pixelPosition:any, _arg:any):any; - - scrollHorizontally(pixelPosition:any):any; - - calculateDimensions():number; - - recalculateDimensions():any; - - updateLayerDimensions():any; - - isHidden():boolean; - - clearRenderedLines():void; - - resetDisplay():any; - - requestDisplayUpdate():any; - - updateDisplay(options?:any):any; - - updateCursorViews():any; - - shouldUpdateCursor(cursorView:any):any; - - updateSelectionViews():any[]; - - shouldUpdateSelection(selectionView:any):any; - - syncCursorAnimations():any[]; - - autoscroll(suppressAutoscroll?:any):any[]; - - updatePlaceholderText():any; - - updateRenderedLines(scrollViewWidth:any):any; - - computeSurroundingEmptyLineChanges(change:any):any; - - computeIntactRanges(renderFrom:any, renderTo:any):any; - - truncateIntactRanges(intactRanges:any, renderFrom:any, renderTo:any):any; - - clearDirtyRanges(intactRanges:any):any; - - clearLine(lineElement:any):any; - - fillDirtyRanges(intactRanges:any, renderFrom:any, renderTo:any):any; - - updatePaddingOfRenderedLines():any; - - getFirstVisibleScreenRow():number; - - getLastVisibleScreenRow():number; - - isScreenRowVisible():boolean; - - handleScreenLinesChange(change:any):any; - - buildLineElementForScreenRow(screenRow:any):any; - - buildLineElementsForScreenRows(startRow:any, endRow:any):any; - - htmlForScreenRows(startRow:any, endRow:any):any; - - htmlForScreenLine(screenLine:any, screenRow:any):any; - - buildIndentation(screenRow:any, editor:any):any; - - buildHtmlEndOfLineInvisibles(screenLine:any):any; - - getEndOfLineInvisibles(screenLine:any):any; - - lineElementForScreenRow(screenRow:any):any; - - toggleLineCommentsInSelection():any; - - pixelPositionForBufferPosition(position:any):any; - - pixelPositionForScreenPosition(position:any):any; - - positionLeftForLineAndColumn(lineElement:any, screenRow:any, screenColumn:any):any; - - measureToColumn(lineElement:any, tokenizedLine:any, screenColumn:any):any; - - getCharacterWidthCache(scopes:any, char:any):any; - - setCharacterWidthCache(scopes:any, char:any, val:any):any; - - clearCharacterWidthCache():any; - - pixelOffsetForScreenPosition(position:any):any; - - screenPositionFromMouseEvent(e:any):any; - - highlightCursorLine():any; - - copyPathToClipboard():any; - - buildLineHtml(_arg:any):any; - - updateScopeStack(line:any, scopeStack:any, desiredScopes:any):any; - - pushScope(line:any, scopeStack:any, scope:any):any; - - popScope(line:any, scopeStack:any):any; - - buildEmptyLineHtml(showIndentGuide:any, eolInvisibles:any, htmlEolInvisibles:any, indentation:any, editor:any, mini:any):any; - - replaceSelectedText(replaceFn:(str:string)=>string):any; - - consolidateSelections(e:any):any; - - logCursorScope():any; - - logScreenLines(start:any, end:any):any; - - logRenderedLines():any; - } - - class ScrollView extends View { - // TBD - } - - interface ISelectListItem { - /** e.g. application:about */ - eventName:string; - /** e.g. Application: About */ - eventDescription:string; - } - - class SelectListView extends View { - static content():any; - - maxItems:number; - scheduleTimeout:any; - inputThrottle:number; - cancelling:boolean; - items:any[]; - list:JQuery; - filterEditorView: JQuery; - - previouslyFocusedElement:JQuery; - - initialize():any; - - schedulePopulateList():number; - - setItems(items:any[]):any; - - setError(message?:string):any; - - setLoading(message?:string):any; - - getFilterQuery():string; - - populateList():any; - - getEmptyMessage(itemCount?:any, filteredItemCount?:any):string; - - setMaxItems(maxItems:number):void; - - selectPreviousItemView():any; - - selectNextItemView():any; - - selectItemView(view:any):any; - - scrollToItemView(view:any):any; - - getSelectedItemView():any; - - getSelectedItem():any; - - confirmSelection():any; - - viewForItem(item:any):JQuery|string|HTMLElement|View; // You must override this method! - confirmed(item:any):any; // You must override this method! - getFilterKey():any; - - focusFilterEditor():any; - - storeFocusedElement():any; - - restoreFocus():any; - - cancelled():any; - - cancel():any; - } - - class Disposable extends AtomCore.Disposable { } - class CompositeDisposable extends AtomCore.CompositeDisposable { } - - var WorkspaceView:AtomCore.IWorkspaceViewStatic; - - var Task:AtomCore.ITaskStatic; - var Workspace:AtomCore.IWorkspaceStatic; -} diff --git a/types/atom/v0/tsconfig.json b/types/atom/v0/tsconfig.json deleted file mode 100644 index 1330ba894b..0000000000 --- a/types/atom/v0/tsconfig.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": false, - "baseUrl": "../../", - "typeRoots": [ - "../../" - ], - "paths": { - "atom": [ - "atom/v0" - ], - "pathwatcher": [ - "pathwatcher/v0" - ], - "q": [ - "q/v0" - ] - }, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "api-docs.d.ts", - "atom-tests.ts" - ] -} \ No newline at end of file diff --git a/types/atpl/tslint.json b/types/atpl/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/atpl/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/auth0-angular/tslint.json b/types/auth0-angular/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/auth0-angular/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/auth0-js/auth0-js-tests.ts b/types/auth0-js/auth0-js-tests.ts index 73426dbd37..06d428de20 100644 --- a/types/auth0-js/auth0-js-tests.ts +++ b/types/auth0-js/auth0-js-tests.ts @@ -1,6 +1,6 @@ import * as auth0 from 'auth0-js'; -let webAuth = new auth0.WebAuth({ +const webAuth = new auth0.WebAuth({ domain: 'mine.auth0.com', clientID: 'dsa7d77dsa7d7' }); @@ -14,7 +14,7 @@ webAuth.authorize({ webAuth.parseHash((err, authResult) => { if (err) { - return console.log(err); + console.log(err); } // The contents of authResult depend on which authentication parameters were used. @@ -30,7 +30,7 @@ webAuth.parseHash((err, authResult) => { webAuth.parseHash((err, authResult) => { if (err) { - return console.log(err); + console.log(err); } // The contents of authResult depend on which authentication parameters were used. @@ -47,11 +47,18 @@ webAuth.parseHash((err, authResult) => { webAuth.parseHash( { nonce: 'asfd', - hash: '#access_token=VjubIMBmpgQ2W2&id_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlF6RTROMFpCTTBWRFF6RTJSVVUwTnpJMVF6WTFNelE0UVRrMU16QXdNRUk0UkRneE56RTRSZyJ9.eyJpc3MiOiJodHRwczovL3dwdGVzdC5hdXRoMC5jb20vIiwic3ViIjoiYXV0aDB8NTVkNDhjNTdkNWIwYWQwMjIzYzQwOGQ3IiwiYXVkIjoiZ1lTTmxVNFlDNFYxWVBkcXE4elBRY3VwNnJKdzFNYnQiLCJleHAiOjE0ODI5NjkwMzEsImlhdCI6MTQ4MjkzMzAzMSwibm9uY2UiOiJhc2ZkIn0.PPoh-pITcZ8qbF5l5rMZwXiwk5efbESuqZ0IfMUcamB6jdgLwTxq-HpOT_x5q6-sO1PBHchpSo1WHeDYMlRrOFd9bh741sUuBuXdPQZ3Zb0i2sNOAC2RFB1E11mZn7uNvVPGdPTg-Y5xppz30GSXoOJLbeBszfrVDCmPhpHKGGMPL1N6HV-3EEF77L34YNAi2JQ-b70nFK_dnYmmv0cYTGUxtGTHkl64UEDLi3u7bV-kbGky3iOOCzXKzDDY6BBKpCRTc2KlbrkO2A2PuDn27WVv1QCNEFHvJN7HxiDDzXOsaUmjrQ3sfrHhzD7S9BcCRkekRfD9g95SKD5J0Fj8NA&token_type=Bearer&state=theState&refresh_token=kajshdgfkasdjhgfas&scope=foo' + hash: "#access_token=VjubIMBmpgQ2W2& \ + id_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlF6RTROMFpCTTBWRFF6RTJSVVUwTnpJMVF6WTFNelE0UVRrMU16QXdNRUk0UkRneE56RTRSZyJ9. \ + eyJpc3MiOiJodHRwczovL3dwdGVzdC5hdXRoMC5jb20vIiwic3ViIjoiYXV0aDB8NTVkNDhjNTdkNWIwYWQwMjIzYzQwOGQ3IiwiYXVkIjoiZ1lTTmxVNFlDNFYxWVBkcXE \ + 4elBRY3VwNnJKdzFNYnQiLCJleHAiOjE0ODI5NjkwMzEsImlhdCI6MTQ4MjkzMzAzMSwibm9uY2UiOiJhc2ZkIn0. \ + PPoh-pITcZ8qbF5l5rMZwXiwk5efbESuqZ0IfMUcamB6jdgLwTxq-HpOT_x5q6-sO1PBHchpSo1WHeDYMlRrOFd9bh741sUuBuXdPQZ3Zb0i2sNOAC2RFB \ + 1E11mZn7uNvVPGdPTg-Y5xppz30GSXoOJLbeBszfrVDCmPhpHKGGMPL1N6HV-3EEF77L34YNAi2JQ-b70nFK_dnYmmv0cYTGUxtGTHkl64UEDLi3u7bV- \ + kbGky3iOOCzXKzDDY6BBKpCRTc2KlbrkO2A2PuDn27WVv1QCNEFHvJN7HxiDDzXOsaUmjrQ3sfrHhzD7S9BcCRkekRfD9g95SKD5J0Fj8NA& \ + token_type=Bearer&state=theState&refresh_token=kajshdgfkasdjhgfas&scope=foo" }, (err, authResult) => { if (err) { - return console.log(err); + console.log(err); } // The contents of authResult depend on which authentication parameters were used. @@ -71,7 +78,7 @@ webAuth.parseHash( }, (err, authResult) => { if (err) { - return console.log(err); + console.log(err); } // The contents of authResult depend on which authentication parameters were used. @@ -86,14 +93,14 @@ webAuth.parseHash( }); webAuth.renewAuth({ -}, function (err, authResult) { +}, (err, authResult) => { // Renewed tokens or error }); webAuth.renewAuth({ nonce: '123', state: '456' -}, function (err, authResult) { +}, (err, authResult) => { // Renewed tokens or error }); @@ -103,7 +110,7 @@ webAuth.renewAuth({ nonce: '123', state: '456', postMessageDataType: 'auth0:silent-authentication' -}, function (err, authResult) { +}, (err, authResult) => { // Renewed tokens or error }); @@ -111,9 +118,7 @@ webAuth.renewAuth({ audience: 'urn:site:demo:blog', redirectUri: 'http://page.com/callback', usePostMessage: true -}, (err, authResult) => { - -}); +}, (err, authResult) => {}); webAuth.changePassword({connection: 'the_connection', email: 'me@example.com', @@ -134,23 +139,19 @@ webAuth.signupAndAuthorize({ user_metadata: { foo: 'bar' } -}, function (err, data) { - -}); +}, (err, data) => {}); webAuth.client.login({ - realm: 'Username-Password-Authentication', //connection name or HRD domain + realm: 'Username-Password-Authentication', // connection name or HRD domain username: 'info@auth0.com', password: 'areallystrongpassword', audience: 'https://mystore.com/api/v2', scope: 'read:order write:order', -}, function(err, authResult) { - // Auth tokens in the result or an error -}); +}, (err, authResult) => {/*Auth tokens in the result or an error*/}); webAuth.popup.buildPopupHandler(); webAuth.popup.preload({}); -webAuth.popup.authorize({}, (err, data) => { +webAuth.popup.authorize({ domain: "", redirectUri: "", responseType: "code" }, (err, data) => { if (err) /* handle error */ return; // do something with data }); @@ -158,11 +159,11 @@ webAuth.popup.loginWithCredentials({}, (err, data) => { if (err) /* handle error */ return; // do something with data }); -webAuth.popup.passwordlessVerify({}, (err, data) => { +webAuth.popup.passwordlessVerify({ type: "sms", phoneNumber: "", connection: "", verificationCode: "" }, (err, data) => { if (err) /* handle error */ return; // do something with data }); -webAuth.popup.signupAndLogin({}, (err, data) => { +webAuth.popup.signupAndLogin({ email: "", password: "", connection: "" }, (err, data) => { if (err) /* handle error */ return; // do something with data }); @@ -171,7 +172,7 @@ webAuth.login({username: 'bar', password: 'foo'}, (err, data) => {}); webAuth.crossOriginAuthenticationCallback(); -let authentication = new auth0.Authentication({ +const authentication = new auth0.Authentication({ domain: 'me.auth0.com', clientID: '...', redirectUri: 'http://page.com/callback', @@ -179,7 +180,7 @@ let authentication = new auth0.Authentication({ _sendTelemetry: false }); -authentication.buildAuthorizeUrl({state:'1234'}); +authentication.buildAuthorizeUrl({state: '1234'}); authentication.buildAuthorizeUrl({ responseType: 'token', redirectUri: 'http://anotherpage.com/callback2', @@ -191,7 +192,7 @@ authentication.buildAuthorizeUrl({ authentication.buildLogoutUrl({ clientID: 'asdfasdfds' }); authentication.buildLogoutUrl(); authentication.userInfo('abcd1234', (err, data) => { - //user info retrieved + // user info retrieved }); authentication.delegation({ @@ -200,28 +201,22 @@ authentication.delegation({ api_type: 'app' }, (err, data) => { if (!err) { - localStorage.setItem('token', data.idToken) + localStorage.setItem('token', data.idToken); } }); authentication.loginWithDefaultDirectory({ username: 'someUsername', password: '123456' -}, (err, data) => { - -}); +}, (err, data) => {}); authentication.oauthToken({ username: 'someUsername', password: '123456', grantType: 'password' -}, (err, data) => { +}, (err, data) => {}); -}); - -authentication.getUserCountry((err, data) => { - -}); +authentication.getUserCountry((err, data) => {}); authentication.getSSOData(); authentication.getSSOData(true, (err, data) => {}); @@ -239,7 +234,7 @@ authentication.loginWithResourceOwner({ scope: 'openid' }, (err, data) => {}); -let management = new auth0.Management({ +const management = new auth0.Management({ domain: 'me.auth0.com', token: 'token' }); diff --git a/types/auth0-js/index.d.ts b/types/auth0-js/index.d.ts index fa6d6d85bf..76a2c5f319 100644 --- a/types/auth0-js/index.d.ts +++ b/types/auth0-js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Auth0.js 8.6 +// Type definitions for Auth0.js 8.10 // Project: https://github.com/auth0/auth0.js // Definitions by: Adrian Chia // Matt Durrant @@ -6,7 +6,6 @@ export as namespace auth0; - export class Authentication { constructor(options: AuthOptions); @@ -16,82 +15,68 @@ export class Authentication { /** * Builds and returns the `/authorize` url in order to initialize a new authN/authZ transaction * - * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--authorize_db + * @param options: https://auth0.com/docs/api/authentication#!#get--authorize_db */ buildAuthorizeUrl(options: any): string; /** * Builds and returns the Logout url in order to initialize a new authN/authZ transaction * - * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--v2-logout + * @param options: https://auth0.com/docs/api/authentication#!#get--v2-logout */ buildLogoutUrl(options?: LogoutOptions): string; /** * Makes a call to the `oauth/token` endpoint with `password` grant type * - * @param {DefaultDirectoryLoginOptions} options: https://auth0.com/docs/api-auth/grant/password - * @param {Function} callback + * @param options: https://auth0.com/docs/api-auth/grant/password */ loginWithDefaultDirectory(options: DefaultDirectoryLoginOptions, callback: Auth0Callback): void; /** * Makes a call to the `/ro` endpoint - * @param {ResourceOwnerLoginOptions} options - * @param {Function} callback * @deprecated `loginWithResourceOwner` will be soon deprecated, user `login` instead. */ loginWithResourceOwner(options: ResourceOwnerLoginOptions, callback: Auth0Callback): void; /** * Makes a call to the `oauth/token` endpoint with `password-realm` grant type - * @param {DefaultLoginOptions} options - * @param {Function} callback */ login(options: DefaultLoginOptions, callback: Auth0Callback): void; /** * Makes a call to the `oauth/token` endpoint - * @param {any} options - * @param {Function} callback */ oauthToken(options: any, callback: Auth0Callback): void; /** * Makes a call to the `/ssodata` endpoint * - * @param {Function} callback */ getSSOData(callback?: Auth0Callback): void; /** * Makes a call to the `/ssodata` endpoint * - * @param {Boolean} withActiveDirectories - * @param {Function} callback */ getSSOData(withActiveDirectories: boolean, callback?: Auth0Callback): void; /** * Makes a call to the `/userinfo` endpoint and returns the user profile * - * @param {String} accessToken - * @param {Function} callback */ userInfo(accessToken: string, callback: Auth0Callback): void; /** * Makes a call to the `/delegation` endpoint * - * @param {DelegationOptions} options: https://auth0.com/docs/api/authentication#!#post--delegation - * @param {Function} callback + * @param options: https://auth0.com/docs/api/authentication#!#post--delegation */ delegation(options: DelegationOptions, callback: Auth0Callback): any; /** * Fetches the user country based on the ip. * - * @param {Function} callback */ getUserCountry(callback: Auth0Callback<{ countryCode: string }>): void; } @@ -102,24 +87,19 @@ export class PasswordlessAuthentication { /** * Builds and returns the passwordless TOTP verify url in order to initialize a new authN/authZ transaction * - * @param {PasswordlessVerifyOptions} options - * @param {Function} callback */ buildVerifyUrl(options: PasswordlessVerifyOptions): string; /** * Initializes a new passwordless authN/authZ transaction * - * @param {Object} options: https://auth0.com/docs/api/authentication#passwordless - * @param {Function} callback + * @param options: https://auth0.com/docs/api/authentication#passwordless */ start(options: PasswordlessStartOptions, callback: Auth0Callback): void; /** * Verifies the passwordless TOTP and returns an error if any. * - * @param {PasswordlessVerifyOptions} options - * @param {Function} callback */ verify(options: PasswordlessVerifyOptions, callback: Auth0Callback): void; } @@ -130,28 +110,27 @@ export class DBConnection { /** * Signup a new user * - * @param {DbSignUpOptions} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup - * @param {Function} calback + * @param options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup */ signup(options: DbSignUpOptions, callback: Auth0Callback): void; /** * Initializes the change password flow * - * @param {ChangePasswordOptions} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password - * @param {Function} callback + * @param options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password */ changePassword(options: ChangePasswordOptions, callback: Auth0Callback): void; } export class Management { + /** + * Initialize your client class, by using a Non Interactive Client to fetch an access_token via the Client Credentials Grant. + */ constructor(options: ManagementOptions); /** * Returns the user profile. https://auth0.com/docs/api/management/v2#!/Users/get_users_by_id * - * @param {String} userId - * @param {Function} callback */ getUser(userId: string, callback: Auth0Callback): void; @@ -159,18 +138,12 @@ export class Management { * Updates the user metdata. It will patch the user metdata with the attributes sent. * https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id * - * @param {String} userId - * @param {Object} userMetadata - * @param {Function} callback */ patchUserMetadata(userId: string, userMetadata: any, callback: Auth0Callback): void; /** * Link two users. https://auth0.com/docs/api/management/v2#!/Users/post_identities * - * @param {String} userId - * @param {String} secondaryUserToken - * @param {Function} callback */ linkUser(userId: string, secondaryUserToken: string, callback: Auth0Callback): void; } @@ -185,7 +158,7 @@ export class WebAuth { /** * Redirects to the hosted login page (`/authorize`) in order to initialize a new authN/authZ transaction * - * @param {AuthorizeOptions} options: https://auth0.com/docs/api/authentication#!#get--authorize_db + * @param options: https://auth0.com/docs/api/authentication#!#get--authorize_db */ authorize(options?: AuthorizeOptions): void; @@ -196,8 +169,7 @@ export class WebAuth { * by the `/.well-known/jwks.json` endpoint. Id tokens signed with other algorithms will not be * accepted. * - * @param {ParseHashOptions} options - * @param {Function} callback: any(err, token_payload) + * @param callback: any(err, token_payload) */ parseHash(callback: Auth0Callback): void; @@ -208,43 +180,38 @@ export class WebAuth { * by the `/.well-known/jwks.json` endpoint. Id tokens signed with other algorithms will not be * accepted. * - * @param {ParseHashOptions} options - * @param {Function} callback: any(err, token_payload) + * @param callback: any(err, token_payload) */ parseHash(options: ParseHashOptions, callback: Auth0Callback): void; /** * Decodes the id_token and verifies the nonce. * - * @param {String} token - * @param {String} nonce - * @param {Function} callback: function(err, {payload, transaction}) + * @param callback: function(err, {payload, transaction}) */ validateToken(token: string, nonce: string, callback: Auth0Callback): void; /** * Executes a silent authentication transaction under the hood in order to fetch a new tokens for the current session. * This method requires that all Auth is performed with {@link authorize} - * Watch out! If you're not using the hosted login page to do social logins, you have to use your own [social connection keys](https://manage.auth0.com/#/connections/social). If you use Auth0's dev keys, you'll always get `login_required` as an error when calling this method. + * Watch out! If you're not using the hosted login page to do social logins, you have to use your own [social connection keys](https://manage.auth0.com/#/connections/social). + * If you use Auth0's dev keys, you'll always get `login_required` as an error when calling this method. * - * @param {RenewAuthOptions} options: any valid oauth2 parameter to be sent to the `/authorize` endpoint - * @param {Function} callback + * @param options: any valid oauth2 parameter to be sent to the `/authorize` endpoint */ renewAuth(options: RenewAuthOptions, callback: Auth0Callback): void; /** * Initialices a change password transaction * - * @param {ChangePasswordOptions} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password - * @param {Function} callback + * @param options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password */ changePassword(options: ChangePasswordOptions, callback: Auth0Callback): void; /** * Signs up a new user * - * @param {DbSignUpOptions} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup - * @param {Function} callback + * @param options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup */ signup(options: DbSignUpOptions, callback: Auth0Callback): void; @@ -252,17 +219,20 @@ export class WebAuth { * Signs up a new user, automatically logs the user in after the signup and returns the user token. * The login will be done using /oauth/token with password-realm grant type. * - * @param {DbSignUpOptions} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup - * @param {Function} callback + * @param options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup */ signupAndAuthorize(options: DbSignUpOptions, callback: Auth0Callback): void; /** - * Logs in the user with username and password using the cross origin authentication (/co/authenticate) flow. You can use either `username` or `email` to identify the user, but `username` will take precedence over `email`. - * This only works when 3rd party cookies are enabled in the browser. After the /co/authenticate call, you'll have to use the {@link parseHash} function at the `redirectUri` specified in the constructor. + * Logs in the user with username and password using the cross origin authentication (/co/authenticate) flow. + * You can use either `username` or `email` to identify the user, but `username` will take precedence over `email`. * - * @param {CrossOriginLoginOptions} options options used in the {@link authorize} call after the login_ticket is acquired - * @param {crossOriginLoginCallback} cb Callback function called only when an authentication error, like invalid username or password, occurs. For other types of errors, there will be a redirect to the `redirectUri`. + * This only works when 3rd party cookies are enabled in the browser. + * After the /co/authenticate call, you'll have to use the {@link parseHash} function at the `redirectUri` specified in the constructor. + * + * @param options options used in the {@link authorize} call after the login_ticket is acquired + * @param cb Callback function called only when an authentication error, like invalid username or password, occurs. + * For other types of errors, there will be a redirect to the `redirectUri`. */ login(options: CrossOriginLoginOptions, callback: Auth0Callback): void; @@ -280,7 +250,6 @@ export class WebAuth { * - If the client_id parameter is included, the returnTo URL must be listed in the Allowed Logout URLs set at the client level (see Setting Allowed Logout URLs at the App Level). * - If the client_id parameter is NOT included, the returnTo URL must be listed in the Allowed Logout URLs set at the account level (see Setting Allowed Logout URLs at the Account Level). * - * @param {LogoutOptions} options * @see {@link https://auth0.com/docs/api/authentication#logout} */ logout(options: LogoutOptions): void; @@ -288,17 +257,14 @@ export class WebAuth { /** * Initialices a passwordless authentication transaction * - * @param {PasswordlessStartOptions} options: https://auth0.com/docs/api/authentication#passwordless - * @param {Function} callback + * @param options: https://auth0.com/docs/api/authentication#passwordless */ passwordlessStart(options: PasswordlessStartOptions, callback: Auth0Callback): void; /** * Verifies the passwordless TOTP and redirects to finish the passwordless transaction * - * @method passwordlessVerify - * @param {PasswordlessVerifyOptions} options: - * @param {Function} callback + * @param options: */ passwordlessVerify(options: PasswordlessVerifyOptions, callback: Auth0Callback): void; } @@ -311,28 +277,35 @@ export class Redirect { * * This method is not compatible with API Auth so if you need to fetch API tokens with audience * you should use {@link authorize} or {@link login}. - * - * @method loginWithCredentials - * @param {Object} options - * @param {String} [options.redirectUri] url that the Auth0 will redirect after Auth with the Authorization Response - * @param {String} [options.responseType] type of the response used. It can be any of the values `code` and `token` - * @param {String} [options.responseMode] how the AuthN response is encoded and redirected back to the client. Supported values are `query` and `fragment` - * @param {String} [options.scope] scopes to be requested during AuthN. e.g. `openid email` - * @param {credentialsCallback} cb */ - loginWithCredentials(options: any, callback: Auth0Callback): void; + loginWithCredentials( + options: { + /** url that the Auth0 will redirect after Auth with the Authorization Response */ + redirectUri?: string, + /** type of the response used. It can be any of the values `code` and `token` */ + responseType?: string, + /** how the AuthN response is encoded and redirected back to the client. */ + responseMode?: "query" | "fragment", + /** scopes to be requested during AuthN. e.g. `openid email` */ + scope: string, + }, + callback: Auth0Callback, + ): void; /** * Signs up a new user and automatically logs the user in after the signup. - * - * @method signupAndLogin - * @param {Object} options - * @param {String} options.email user email address - * @param {String} options.password user password - * @param {String} options.connection name of the connection where the user will be created - * @param {credentialsCallback} cb */ - signupAndLogin(options: any, callback: Auth0Callback): void; + signupAndLogin( + options: { + /** user email address */ + email: string, + /** user password */ + password: string, + /** name of the connection where the user will be created */ + connection: string, + }, + callback: Auth0Callback, + ): void; } export class Popup { @@ -341,106 +314,155 @@ export class Popup { /** * Returns a new instance of the popup handler * - * @method buildPopupHandler */ buildPopupHandler(): any; /** * Initializes the popup window and returns the instance to be used later in order to avoid being blocked by the browser. * - * @method preload - * @param {Object} options: receives the window height and width and any other window feature to be sent to window.open + * @param options: receives the window height and width and any other window feature to be sent to window.open */ preload(options: any): any; /** * Handles the popup logic for the callback page. - * - * @method callback - * @param {Object} options - * @param {String} options.hash the url hash. If not provided it will extract from window.location.hash - * @param {String} [options.state] value originally sent in `state` parameter to {@link authorize} to mitigate XSRF - * @param {String} [options.nonce] value originally sent in `nonce` parameter to {@link authorize} to prevent replay attacks - * @param {String} [options._idTokenVerification] makes parseHash perform or skip `id_token` verification. We **strongly** recommend validating the `id_token` yourself if you disable the verification. - * @see {@link parseHash} + * @see {@link parseHash} */ - callback(options: any): void; + callback(options: { + /** + * the url hash. + * @default window.location.hash + */ + hash: string, + /** value originally sent in `state` parameter to {@link authorize} to mitigate XSRF */ + state?: string, + /** value originally sent in `nonce` parameter to {@link authorize} to prevent replay attacks */ + nonce?: string, + /** + * makes parseHash perform or skip `id_token` verification. + * We **strongly** recommend validating the `id_token` yourself if you disable the verification. + */ + _idTokenVerification?: string, + }): void; /** * Shows inside a new window the hosted login page (`/authorize`) in order to start a new authN/authZ transaction and post its result using `postMessage`. - * - * @method authorize - * @param {Object} options - * @param {String} [options.domain] your Auth0 domain - * @param {String} [options.clientID] your Auth0 client identifier obtained when creating the client in the Auth0 Dashboard - * @param {String} options.redirectUri url that the Auth0 will redirect after Auth with the Authorization Response - * @param {String} options.responseType type of the response used by OAuth 2.0 flow. It can be any space separated list of the values `code`, `token`, `id_token`. {@link https://openid.net/specs/oauth-v2-multiple-response-types-1_0} - * @param {String} [options.responseMode] how the Auth response is encoded and redirected back to the client. Supported values are `query`, `fragment` and `form_post`. {@link https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html#ResponseModes} - * @param {String} [options.state] value used to mitigate XSRF attacks. {@link https://auth0.com/docs/protocols/oauth2/oauth-state} - * @param {String} [options.nonce] value used to mitigate replay attacks when using Implicit Grant. {@link https://auth0.com/docs/api-auth/tutorials/nonce} - * @param {String} [options.scope] scopes to be requested during Auth. e.g. `openid email` - * @param {String} [options.audience] identifier of the resource server who will consume the access token issued after Auth - * @param {Boolean} [options.owp] determines if Auth0 should render the relay page or not and the caller is responsible of handling the response. - * @param {authorizeCallback} cb * @see {@link https://auth0.com/docs/api/authentication#authorize-client} */ - authorize(options: any, callback: Auth0Callback): void; + authorize( + options: { + /** your Auth0 domain */ + domain: string, + /** your Auth0 client identifier obtained when creating the client in the Auth0 Dashboard */ + clientId?: string, + /** + * identity provider whose login page will be displayed in the popup. + * If omitted the hosted login page is used. + * {@link https://auth0.com/docs/identityproviders} + */ + connection?: string, + /** url that the Auth0 will redirect after Auth with the Authorization Response */ + redirectUri: string, + /** + * type of the response used by OAuth 2.0 flow. + * It can be any space separated list of the values `code`, `token`, `id_token`. + * {@link https://openid.net/specs/oauth-v2-multiple-response-types-1_0} + */ + responseType: string, + /** + * how the Auth response is encoded and redirected back to the client. + * {@link https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html#ResponseModes} + */ + responseMode?: "query" | "fragment" | "form_post", + /** + * value used to mitigate XSRF attacks. + * {@link https://auth0.com/docs/protocols/oauth2/oauth-state} + */ + state?: string, + /** + * value used to mitigate replay attacks when using Implicit Grant. + * {@link https://auth0.com/docs/api-auth/tutorials/nonce} + */ + nonce?: string, + /** scopes to be requested during Auth. e.g. `openid email` */ + scope?: string, + /** identifier of the resource server who will consume the access token issued after Auth */ + audience?: string, + /** determines if Auth0 should render the relay page or not and the caller is responsible of handling the response. */ + owp?: boolean, + }, + callback: Auth0Callback, + ): void; /** * Performs authentication with username/email and password with a database connection inside a new window * * This method is not compatible with API Auth so if you need to fetch API tokens with audience * you should use {@link authorize} or {@link login}. - * - * @method loginWithCredentials - * @param {Object} options - * @param {String} [options.redirectUri] url that the Auth0 will redirect after Auth with the Authorization Response - * @param {String} [options.responseType] type of the response used. It can be any of the values `code` and `token` - * @param {String} [options.responseMode] how the AuthN response is encoded and redirected back to the client. Supported values are `query` and `fragment` - * @param {String} [options.scope] scopes to be requested during AuthN. e.g. `openid email` - * @param {credentialsCallback} cb */ - loginWithCredentials(options: any, callback: Auth0Callback): void; + loginWithCredentials( + options: { + /** url that the Auth0 will redirect after Auth with the Authorization Response */ + redirectUri?: string, + /** type of the response used. */ + responseType?: "code" | "token", + /** how the AuthN response is encoded and redirected back to the client. */ + responseMode?: "query" | "fragment", + /** scopes to be requested during AuthN. e.g. `openid email` */ + scope?: string, + }, + callback: Auth0Callback, + ): void; /** * Verifies the passwordless TOTP and returns the requested token - * - * @method passwordlessVerify - * @param {Object} options: - * @param {Object} options.type: `sms` or `email` - * @param {Object} options.phoneNumber: only if type = sms - * @param {Object} options.email: only if type = email - * @param {Object} options.connection: the connection name - * @param {Object} options.verificationCode: the TOTP code - * @param {Function} callback */ - passwordlessVerify(options: any, callback: Auth0Callback): void; + passwordlessVerify( + options: { + type: "sms" | "email", + /** only if type = sms */ + phoneNumber?: string, + /** only if type = email */ + email?: string, + /** the connection name */ + connection: string, + /** the TOTP code */ + verificationCode: string, + }, + callback: Auth0Callback, + ): void; /** * Signs up a new user and automatically logs the user in after the signup. * * This method is not compatible with API Auth so if you need to fetch API tokens with audience * you should use {@link authorize} or {@link signupAndAuthorize}. - * - * @method signupAndLogin - * @param {Object} options - * @param {String} options.email user email address - * @param {String} options.password user password - * @param {String} options.connection name of the connection where the user will be created - * @param {credentialsCallback} cb */ - signupAndLogin(options: any, callback: Auth0Callback): void; + signupAndLogin( + options: { + /** user email address */ + email: string, + /** user password */ + password: string, + /** name of the connection where the user will be created */ + connection: string, + }, + callback: Auth0Callback, + ): void; } export class CrossOriginAuthentication { constructor(webAuth: any, options: any); /** - * Logs in the user with username and password using the cross origin authentication (/co/authenticate) flow. You can use either `username` or `email` to identify the user, but `username` will take precedence over `email`. - * This only works when 3rd party cookies are enabled in the browser. After the /co/authenticate call, you'll have to use the {@link parseHash} function at the `redirectUri` specified in the constructor. + * Logs in the user with username and password using the cross origin authentication (/co/authenticate) flow. + * You can use either `username` or `email` to identify the user, but `username` will take precedence over `email`. + * This only works when 3rd party cookies are enabled in the browser. + * After the /co/authenticate call, you'll have to use the {@link parseHash} function at the `redirectUri` specified in the constructor. * - * @param {CrossOriginLoginOptions} options options used in the {@link authorize} call after the login_ticket is acquired - * @param {crossOriginLoginCallback} cb Callback function called only when an authentication error, like invalid username or password, occurs. For other types of errors, there will be a redirect to the `redirectUri`. + * @param options options used in the {@link authorize} call after the login_ticket is acquired + * @param cb Callback function called only when an authentication error, like invalid username or password, occurs. + * For other types of errors, there will be a redirect to the `redirectUri`. */ login(options: CrossOriginLoginOptions, callback: Auth0Callback): void; @@ -451,16 +473,25 @@ export class CrossOriginAuthentication { callback(): void; } -type Auth0Callback = (error: null | Auth0Error, result: T) => void; +export type Auth0Callback = (error: null | Auth0Error, result: T) => void; -interface ManagementOptions { - domain: string; - token: string; - _sendTelemetry?: boolean; - _telemetryInfo?: any; +export interface TokenProvider { + enableCache?: boolean; + cacheTTLInSeconds?: number; } -interface AuthOptions { +export interface ManagementOptions { + domain: string; + token?: string; + clientId?: string; + clientSecret?: string; + audience?: string; + scope?: string; + tokenProvider?: TokenProvider; + telemetry?: boolean; +} + +export interface AuthOptions { domain: string; clientID: string; responseType?: string; @@ -475,14 +506,14 @@ interface AuthOptions { _telemetryInfo?: any; } -interface PasswordlessAuthOptions { +export interface PasswordlessAuthOptions { connection: string; verificationCode: string; phoneNumber: string; email: string; } -interface Auth0Error { +export interface Auth0Error { error?: any; errorDescription?: string; code?: string; @@ -494,7 +525,7 @@ interface Auth0Error { statusText?: string; } -interface Auth0DecodedHash { +export interface Auth0DecodedHash { accessToken?: string; idToken?: string; idTokenPayload?: any; @@ -505,7 +536,7 @@ interface Auth0DecodedHash { } /** Represents the response from an API Token Delegation request. */ -interface Auth0DelegationToken { +export interface Auth0DelegationToken { /** The length of time in seconds the token is valid for. */ expiresIn: number; /** The JWT for delegated access. */ @@ -514,13 +545,13 @@ interface Auth0DelegationToken { tokenType: string; } -interface ChangePasswordOptions { +export interface ChangePasswordOptions { connection: string; email: string; password?: string; } -interface PasswordlessStartOptions { +export interface PasswordlessStartOptions { connection: string; send: string; phoneNumber?: string; @@ -528,7 +559,7 @@ interface PasswordlessStartOptions { authParams?: any; } -interface PasswordlessVerifyOptions { +export interface PasswordlessVerifyOptions { connection: string; verificationCode: string; phoneNumber?: string; @@ -536,7 +567,7 @@ interface PasswordlessVerifyOptions { send?: string; } -interface Auth0UserProfile { +export interface Auth0UserProfile { name: string; nickname: string; picture: string; @@ -557,60 +588,60 @@ interface Auth0UserProfile { app_metadata?: any; } -interface MicrosoftUserProfile extends Auth0UserProfile { - emails?: string[]; //optional depending on whether email addresses permission is granted +export interface MicrosoftUserProfile extends Auth0UserProfile { + emails?: string[]; // optional depending on whether email addresses permission is granted } -interface Office365UserProfile extends Auth0UserProfile { +export interface Office365UserProfile extends Auth0UserProfile { tenantid: string; upn: string; } -interface AdfsUserProfile extends Auth0UserProfile { +export interface AdfsUserProfile extends Auth0UserProfile { issuer?: string; } -interface Auth0Identity { +export interface Auth0Identity { connection: string; isSocial: boolean; provider: string; user_id: string; } -interface LoginOptions { +export interface LoginOptions { username: string; password: string; scope?: string; } -interface DefaultLoginOptions extends LoginOptions { +export interface DefaultLoginOptions extends LoginOptions { audience?: string; realm: string; } -interface DefaultDirectoryLoginOptions extends LoginOptions { +export interface DefaultDirectoryLoginOptions extends LoginOptions { audience?: string; } -interface ResourceOwnerLoginOptions extends LoginOptions { +export interface ResourceOwnerLoginOptions extends LoginOptions { connection: string; device?: string; } -interface CrossOriginLoginOptions { +export interface CrossOriginLoginOptions { username?: string; email?: string; password: string; realm?: string; } -interface LogoutOptions { +export interface LogoutOptions { clientID?: string; returnTo?: string; federated?: boolean; } -interface DelegationOptions { +export interface DelegationOptions { client_id?: string; grant_type: string; id_token?: string; @@ -620,7 +651,7 @@ interface DelegationOptions { api_type?: string; } -interface DbSignUpOptions { +export interface DbSignUpOptions { email: string; password: string; connection: string; @@ -628,14 +659,14 @@ interface DbSignUpOptions { user_metadata?: any; } -interface ParseHashOptions { +export interface ParseHashOptions { hash?: string; state?: string; nonce?: string; _idTokenVerification?: boolean; } -interface RenewAuthOptions { +export interface RenewAuthOptions { domain?: string; clientID?: string; redirectUri?: string; @@ -649,10 +680,10 @@ interface RenewAuthOptions { postMessageDataType?: string; } -interface AuthorizeOptions { +export interface AuthorizeOptions { domain?: string; clientID?: string; - connection?:string; + connection?: string; redirectUri?: string; responseType?: string; responseMode?: string; diff --git a/types/auth0-js/tslint.json b/types/auth0-js/tslint.json new file mode 100644 index 0000000000..5eb4948245 --- /dev/null +++ b/types/auth0-js/tslint.json @@ -0,0 +1,4 @@ +{ + "extends": "dtslint/dt.json" +} + \ No newline at end of file diff --git a/types/auth0-js/v7/tslint.json b/types/auth0-js/v7/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/auth0-js/v7/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/auth0.widget/tslint.json b/types/auth0.widget/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/auth0.widget/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/auth0/index.d.ts b/types/auth0/index.d.ts index cb84c7a6bd..d24cb40081 100644 --- a/types/auth0/index.d.ts +++ b/types/auth0/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for auth0 2.3 +// Type definitions for auth0 2.5 // Project: https://github.com/auth0/node-auth0 // Definitions by: Wilson Hobbs , Seth Westphal , Amiram Korach // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -7,8 +7,18 @@ import * as Promise from 'bluebird'; export interface ManagementClientOptions { - token: string; - domain?: string; + token?: string; + domain: string; + clientId?: string; + clientSecret?: string; + audience?: string; + scope?: string; + tokenProvider?: TokenProvider; +} + +export interface TokenProvider { + enableCache: boolean; + cacheTTLInSeconds?: number; } export interface UserMetadata { } @@ -50,6 +60,111 @@ export interface GetUsersData { search_engine?: string; } +export interface Rule { + /** + * The name of the rule. + */ + name?: string; + /** + * The rule's identifier. + */ + id?: string; + /** + * The code to be executed when the rule runs. + */ + script?: string; + /** + * The rule's execution stage. + */ + stage?: string; + /** + * `true` if the connection is enabled, `false` otherwise. + */ + enabled?: boolean; + /** + * The rule's order in relation to other rules. A rule with a lower order than another rule executes first. + */ + order?: number; +} + + +export interface Client { + /** + * The name of the client. + */ + name?: string; + /** + * Free text description of the purpose of the Client. (Max character length: `140`). + */ + description?: string; + /** + * The id of the client. + */ + client_id?: string; + /** + * The client secret, it must not be public. + */ + client_secret?: string; + /** + * The type of application this client represents. + */ + app_type?: string; + /** + * The URL of the client logo (recommended size: 150x150). + */ + logo_uri?: string; + /** + * Whether this client a first party client or not. + */ + is_first_party?: boolean; + /** + * Whether this client will conform to strict OIDC specifications. + */ + oidc_conformant?: boolean; + /** + * The URLs that Auth0 can use to as a callback for the client. + */ + callbacks?: string[]; + allowed_origins?: string[]; + web_origins?: string[]; + client_aliases?: string[]; + allowed_clients?: string[]; + allowed_logout_urls?: string[]; + jwt_configuration?: any; + /** + * Client signing keys. + */ + signing_keys?: string[]; + encryption_key?: any; + sso?: boolean; + /** + * `true` to disable Single Sign On, `false` otherwise (default: `false`) + */ + sso_disabled?: boolean; + /** + * `true` if this client can be used to make cross-origin authentication requests, `false` otherwise (default: `false`) + */ + cross_origin_auth?: boolean; + /** + * Url fo the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page. + */ + cross_origin_loc?: string; + /** + * `true` if the custom login page is to be used, `false` otherwise. (default: `true`) + */ + custom_login_page_on?: boolean; + custom_login_page?: string; + custom_login_page_preview?: string; + form_template?: string; + addons?: any; + /** + * Defines the requested authentication method for the token endpoint. Possible values are 'none' (public client without a client secret), 'client_secret_post' (client uses HTTP POST parameters) or 'client_secret_basic' (client uses HTTP Basic) ['none' or 'client_secret_post' or 'client_secret_basic'] + */ + token_endpoint_auth_method?: string; + client_metadata?: any; + mobile?: any; +} + export interface User { email?: string; email_verified?: boolean; @@ -301,21 +416,22 @@ export class ManagementClient { // Clients - getClients(): Promise; - getClients(cb: (err: Error, data: any) => void): void; + getClients(): Promise; + getClients(cb: (err: Error, clients: Client[]) => void): void; - getClient(params: ClientParams): Promise; - getClient(params: ClientParams, cb: (err: Error, data: any) => void): void; + getClient(params: ClientParams): Promise; + getClient(params: ClientParams, cb: (err: Error, client: Client) => void): void; - createClient(data: Data): Promise; - createClient(data: Data, cb: (err: Error, data: any) => void): void; + createClient(data: Data): Promise; + createClient(data: Data, cb: (err: Error, client: Client) => void): void; - updateClient(params: ClientParams, data: Data): Promise; - updateClient(params: ClientParams, data: Data, cb: (err: Error, data: any) => void): void; + updateClient(params: ClientParams, data: Data): Promise; + updateClient(params: ClientParams, data: Data, cb: (err: Error, client: Client) => void): void; - deleteClient(params: ClientParams): Promise; - deleteClient(params: ClientParams, cb: (err: Error, data: any) => void): void; + deleteClient(params: ClientParams): Promise; + deleteClient(params: ClientParams, cb: (err: Error) => void): void; + // Client Grants getClientGrants(): Promise; getClientGrants(cb: (err: Error, data: any) => void): void; @@ -342,20 +458,20 @@ export class ManagementClient { // Rules - getRules(): Promise; - getRules(cb: (err: Error, data: any) => void): void; + getRules(): Promise; + getRules(cb: (err: Error, rules: Rule[]) => void): void; - getRule(params: ClientParams): Promise; - getRule(params: ClientParams, cb: (err: Error, data: any) => void): void; + getRule(params: ClientParams): Promise; + getRule(params: ClientParams, cb: (err: Error, rule: Rule) => void): void; - createRules(data: Data): Promise; - createRules(data: Data, cb: (err: Error, data: any) => void): void; + createRule(data: Data): Promise; + createRule(data: Data, cb: (err: Error, rule: Rule) => void): void; - updateRule(params: ObjectWithId, data: Data): Promise; - updateRule(params: ObjectWithId, data: Data, cb: (err: Error, data: any) => void): void; + updateRule(params: ObjectWithId, data: Data): Promise; + updateRule(params: ObjectWithId, data: Data, cb: (err: Error, rule: Rule) => void): void; - deleteRule(params: ObjectWithId): Promise; - deleteRule(params: ObjectWithId, cb: (err: Error, data: any) => void): void; + deleteRule(params: ObjectWithId): Promise; + deleteRule(params: ObjectWithId, cb: (err: Error) => void): void; // Users @@ -367,7 +483,7 @@ export class ManagementClient { getUser(params: ObjectWithId, cb?: (err: Error, user: User) => void): void; createUser(data: CreateUserData): Promise; - createUser(data: CreateUserData, cb: (err: Error, data: User) => void): void; + createUser(data: CreateUserData, cb: (err: Error, user: User) => void): void; updateUser(params: ObjectWithId, data: UpdateUserData): Promise; updateUser(params: ObjectWithId, data: UpdateUserData, cb: (err: Error, data: User) => void): void; @@ -413,8 +529,8 @@ export class ManagementClient { deleteEmailProvider(): Promise; deleteEmailProvider(cb?: (err: Error, data: any) => void): void; - updateEmailProvider(data: Data): Promise; - updateEmailProvider(data: Data, cb?: (err: Error, data: any) => void): void; + updateEmailProvider(params: {}, data: Data): Promise; + updateEmailProvider(params: {}, data: Data, cb?: (err: Error, data: any) => void): void; // Statistics diff --git a/types/auth0/tslint.json b/types/auth0/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/auth0/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/autobahn/tslint.json b/types/autobahn/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/autobahn/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/autobind-decorator/tslint.json b/types/autobind-decorator/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/autobind-decorator/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/autolinker/tslint.json b/types/autolinker/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/autolinker/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/autoprefixer-core/tslint.json b/types/autoprefixer-core/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/autoprefixer-core/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/autosize/index.d.ts b/types/autosize/index.d.ts index a189b32817..b66dcc2aae 100644 --- a/types/autosize/index.d.ts +++ b/types/autosize/index.d.ts @@ -8,17 +8,14 @@ /** * Attach autosize to NodeList - * @param elements */ declare function autosize(elements: NodeList): NodeList; /** * Attach autosize to Element - * @param element */ declare function autosize(element: Element): Element; /** * Attach autosize to JQuery collection - * @param collection */ declare function autosize(collection: JQuery): JQuery; @@ -27,37 +24,31 @@ declare namespace autosize { * Triggers the height adjustment for an assigned textarea element. * Autosize will automatically adjust the textarea height on keyboard and window resize events. * There is no efficient way for Autosize to monitor for when another script has changed the textarea value or for changes in layout that impact the textarea element. - * @param elements */ function update(elements: NodeList): NodeList; /** * Triggers the height adjustment for an assigned textarea element. * Autosize will automatically adjust the textarea height on keyboard and window resize events. * There is no efficient way for Autosize to monitor for when another script has changed the textarea value or for changes in layout that impact the textarea element. - * @param element */ function update(element: Element): Element; /** * Triggers the height adjustment for an assigned textarea element. * Autosize will automatically adjust the textarea height on keyboard and window resize events. * There is no efficient way for Autosize to monitor for when another script has changed the textarea value or for changes in layout that impact the textarea element. - * @param collection */ function update(collection: JQuery): JQuery; /** * Removes Autosize and reverts any changes it made to the textarea element. - * @param elements */ function destroy(elements: NodeList): NodeList; /** * Removes Autosize and reverts any changes it made to the textarea element. - * @param element */ function destroy(element: Element): Element; /** * Removes Autosize and reverts any changes it made to the textarea element. - * @param collection */ function destroy(collection: JQuery): JQuery; } diff --git a/types/avoscloud-sdk/tslint.json b/types/avoscloud-sdk/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/avoscloud-sdk/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/aws-iot-device-sdk/aws-iot-device-sdk-tests.ts b/types/aws-iot-device-sdk/aws-iot-device-sdk-tests.ts index bcb407c352..66655f8dd3 100644 --- a/types/aws-iot-device-sdk/aws-iot-device-sdk-tests.ts +++ b/types/aws-iot-device-sdk/aws-iot-device-sdk-tests.ts @@ -13,7 +13,6 @@ const device = new awsIot.device({ clientId: "", region: "", baseReconnectTimeMs: 1000, - keepalive: 10, protocol: "wss", port: 443, host: "", @@ -39,7 +38,7 @@ device console.log("offline"); }); device - .on("error", function(error) { + .on("error", function(error: Error | string) { console.log("error", error); }); device @@ -55,7 +54,6 @@ const thingShadows = new awsIot.thingShadow({ clientId: "", region: "", baseReconnectTimeMs: 1000, - keepalive: 10, protocol: "mqtts", port: 0, host: "", @@ -65,10 +63,10 @@ const thingShadows = new awsIot.thingShadow({ thingShadows.register( "thingName", { ignoreDeltas: false }, - (err: Error, failedTopics: mqtt.Granted[]) => { } + (err: Error, failedTopics: mqtt.ISubscriptionGrant[]) => { } ); - thingShadows.subscribe("topic", {}, (error: any, granted: mqtt.Granted) => {}); + thingShadows.subscribe("topic", { qos: 1 }, (error: any, granted: mqtt.ISubscriptionGrant[]) => {}); thingShadows.on("connect", function() { console.log("connected to AWS IoT"); @@ -87,7 +85,7 @@ const thingShadows = new awsIot.thingShadow({ console.log("offline"); }); - thingShadows.on("error", function(error) { + thingShadows.on("error", function(error: Error) { console.log("error", error); }); @@ -98,8 +96,8 @@ const thingShadows = new awsIot.thingShadow({ thingShadows.on("status", function(thingName: string, stat: "accepted" | "rejected", clientToken: string, stateObject: any) { }); - thingShadows.on("delta", function(thingName, stateObject) { + thingShadows.on("delta", function(thingName: string, stateObject: any) { }); - thingShadows.on("timeout", function(thingName, clientToken) { + thingShadows.on("timeout", function(thingName: string, clientToken: string) { }); diff --git a/types/aws-iot-device-sdk/index.d.ts b/types/aws-iot-device-sdk/index.d.ts index 4844ae9012..f2bcab818c 100644 --- a/types/aws-iot-device-sdk/index.d.ts +++ b/types/aws-iot-device-sdk/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for aws-iot-device-sdk 1.0.13 +// Type definitions for aws-iot-device-sdk 2.1.0 // Project: https://github.com/aws/aws-iot-device-sdk-js // Definitions by: Markus Olsson // Margus Lamp @@ -9,7 +9,7 @@ import * as mqtt from "mqtt"; import * as WebSocket from "ws"; -export interface DeviceOptions extends mqtt.ClientOptions { +export interface DeviceOptions extends mqtt.IClientOptions { /** the AWS IoT region you will operate in (default "us-east-1") */ region?: string; @@ -32,19 +32,19 @@ export interface DeviceOptions extends mqtt.ClientOptions { * same as certPath, but can also accept a buffer containing client * certificate data */ - clientCert?: string; + clientCert?: string | Buffer; /** * same as keyPath, but can also accept a buffer containing private key * data */ - privateKey?: string; + privateKey?: string | Buffer; /** * same as caPath, but can also accept a buffer containing CA certificate * data */ - caCert?: string; + caCert?: string | Buffer; /** * set to "true" to automatically re-subscribe to topics after @@ -179,7 +179,7 @@ export class device extends NodeJS.EventEmitter { * @param publish options * @param called when publish succeeds or fails */ - publish(topic: string, message: Buffer | string, options?: mqtt.ClientPublishOptions, callback?: (error?: Error) => void): mqtt.Client; + publish(topic: string, message: Buffer | string, options?: mqtt.IClientPublishOptions, callback?: (error?: Error) => void): mqtt.Client; /** * Subscribe to a topic or topics @@ -187,7 +187,7 @@ export class device extends NodeJS.EventEmitter { * @param the options to subscribe with * @param callback fired on suback */ - subscribe(topic: string | string[] | mqtt.Topic, options?: mqtt.ClientSubscribeOptions, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; + subscribe(topic: string | string[], options?: mqtt.IClientSubscribeOptions, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; /** * Unsubscribe from a topic or topics @@ -196,7 +196,7 @@ export class device extends NodeJS.EventEmitter { * @param options * @param callback fired on unsuback */ - unsubscribe(topic: string | string[], options?: mqtt.ClientSubscribeOptions, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; + unsubscribe(topic: string | string[], options?: mqtt.IClientSubscribeOptions, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; /** * end - close connection @@ -257,7 +257,7 @@ export class thingShadow extends NodeJS.EventEmitter { * for all shadow topics). Applications should wait until shadow * registration is complete before performing update/get/delete operations. */ - register(thingName: string, options?: RegisterOptions, callback?: (error: Error, failedTopics: mqtt.Granted[]) => void): void + register(thingName: string, options?: RegisterOptions, callback?: (error: Error, failedTopics: mqtt.ISubscriptionGrant[]) => void): void /** * Unregister interest in the Thing Shadow named thingName. @@ -334,7 +334,7 @@ export class thingShadow extends NodeJS.EventEmitter { * @param options * @param callback */ - publish(topic: string, message: Buffer | string, options?: mqtt.ClientPublishOptions, callback?: Function): mqtt.Client; + publish(topic: string, message: Buffer | string, options?: mqtt.IClientPublishOptions, callback?: Function): mqtt.Client; /** * Subscribe to a topic or topics @@ -342,7 +342,7 @@ export class thingShadow extends NodeJS.EventEmitter { * @param the options to subscribe with * @param callback fired on suback */ - subscribe(topic: string | string[] | mqtt.Topic, options?: mqtt.ClientSubscribeOptions, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; + subscribe(topic: string | string[], options?: { qos: 0 | 1 }, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; /** * Unsubscribe from a topic or topics @@ -351,7 +351,7 @@ export class thingShadow extends NodeJS.EventEmitter { * @param options * @param callback fired on unsuback */ - unsubscribe(topic: string | string[], options?: mqtt.ClientSubscribeOptions, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; + unsubscribe(topic: string | string[], options?: mqtt.IClientSubscribeOptions, callback?: mqtt.ClientSubscribeCallback): mqtt.Client; /** * end - close connection diff --git a/types/aws-iot-device-sdk/package.json b/types/aws-iot-device-sdk/package.json new file mode 100644 index 0000000000..9aceff7832 --- /dev/null +++ b/types/aws-iot-device-sdk/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "mqtt": "^2.13.0" + } +} diff --git a/types/aws-iot-device-sdk/tslint.json b/types/aws-iot-device-sdk/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/aws-iot-device-sdk/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/aws-lambda-mock-context/index.d.ts b/types/aws-lambda-mock-context/index.d.ts index 0ccd43c876..6fc5fda67a 100644 --- a/types/aws-lambda-mock-context/index.d.ts +++ b/types/aws-lambda-mock-context/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/moskalyk/typed-aws-lambda-mock-context // Definitions by: Morgan Moskalyk , Anand Nimkar // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 declare function context(options?: Options): Context; diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index 4e404fcd55..ebd31429de 100644 --- a/types/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -4,6 +4,7 @@ var anyObj: any = { abc: 123 }; var num: number = 5; var error: Error = new Error(); var b: boolean = true; +var apiGwEvtReqCtx: AWSLambda.APIGatewayEventRequestContext; var apiGwEvt: AWSLambda.APIGatewayEvent; var customAuthorizerEvt: AWSLambda.CustomAuthorizerEvent; var clientCtx: AWSLambda.ClientContext; @@ -22,33 +23,33 @@ var snsEvtRec: AWSLambda.SNSEventRecord; var snsMsg: AWSLambda.SNSMessage; var snsMsgAttr: AWSLambda.SNSMessageAttribute; var snsMsgAttrs: AWSLambda.SNSMessageAttributes; -var S3EvtRec: AWSLambda.S3EventRecord = { +var S3EvtRec: AWSLambda.S3EventRecord = { eventVersion: '2.0', eventSource: 'aws:s3', awsRegion: 'us-east-1', eventTime: '1970-01-01T00:00:00.000Z', eventName: 'ObjectCreated:Put', - userIdentity: { + userIdentity: { principalId: 'AIDAJDPLRKLG7UEXAMPLE' }, - requestParameters:{ + requestParameters:{ sourceIPAddress: '127.0.0.1' }, - responseElements: { + responseElements: { 'x-amz-request-id': 'C3D13FE58DE4C810', 'x-amz-id-2': 'FMyUVURIY8/IgAtTv8xRjskZQpcIZ9KG4V5Wp6S7S/JRWeUWerMUE5JgHvANOjpD' }, - s3: { + s3: { s3SchemaVersion: '1.0', configurationId: 'testConfigRule', - bucket: { + bucket: { name: 'mybucket', - ownerIdentity: { + ownerIdentity: { principalId: 'A3NL1KOZZKExample' }, arn: 'arn:aws:s3:::mybucket' }, - object: { + object: { key: 'HappyFace.jpg', size: 1024, eTag: 'd41d8cd98f00b204e9800998ecf8427e', @@ -65,6 +66,28 @@ var cognitoUserPoolEvent: AWSLambda.CognitoUserPoolEvent; var cloudformationCustomResourceEvent: AWSLambda.CloudFormationCustomResourceEvent; var cloudformationCustomResourceResponse: AWSLambda.CloudFormationCustomResourceResponse; +/* API Gateway Event request context */ +str = apiGwEvtReqCtx.accountId; +str = apiGwEvtReqCtx.apiId; +authResponseContext = apiGwEvtReqCtx.authorizer; +str = apiGwEvtReqCtx.httpMethod; +str = apiGwEvtReqCtx.identity.accessKey; +str = apiGwEvtReqCtx.identity.accountId; +str = apiGwEvtReqCtx.identity.apiKey; +str = apiGwEvtReqCtx.identity.caller; +str = apiGwEvtReqCtx.identity.cognitoAuthenticationProvider; +str = apiGwEvtReqCtx.identity.cognitoAuthenticationType; +str = apiGwEvtReqCtx.identity.cognitoIdentityId; +str = apiGwEvtReqCtx.identity.cognitoIdentityPoolId; +str = apiGwEvtReqCtx.identity.sourceIp; +str = apiGwEvtReqCtx.identity.user; +str = apiGwEvtReqCtx.identity.userAgent; +str = apiGwEvtReqCtx.identity.userArn; +str = apiGwEvtReqCtx.stage; +str = apiGwEvtReqCtx.requestId; +str = apiGwEvtReqCtx.resourceId; +str = apiGwEvtReqCtx.resourcePath; + /* API Gateway Event */ str = apiGwEvt.body; str = apiGwEvt.headers["example"]; @@ -74,31 +97,17 @@ str = apiGwEvt.path; str = apiGwEvt.pathParameters["example"]; str = apiGwEvt.queryStringParameters["example"]; str = apiGwEvt.stageVariables["example"]; -str = apiGwEvt.requestContext.accountId; -str = apiGwEvt.requestContext.apiId; -str = apiGwEvt.requestContext.httpMethod; -str = apiGwEvt.requestContext.identity.accessKey; -str = apiGwEvt.requestContext.identity.accountId; -str = apiGwEvt.requestContext.identity.apiKey; -str = apiGwEvt.requestContext.identity.caller; -str = apiGwEvt.requestContext.identity.cognitoAuthenticationProvider; -str = apiGwEvt.requestContext.identity.cognitoAuthenticationType; -str = apiGwEvt.requestContext.identity.cognitoIdentityId; -str = apiGwEvt.requestContext.identity.cognitoIdentityPoolId; -str = apiGwEvt.requestContext.identity.sourceIp; -str = apiGwEvt.requestContext.identity.user; -str = apiGwEvt.requestContext.identity.userAgent; -str = apiGwEvt.requestContext.identity.userArn; -str = apiGwEvt.requestContext.stage; -str = apiGwEvt.requestContext.requestId; -str = apiGwEvt.requestContext.resourceId; -str = apiGwEvt.requestContext.resourcePath; +apiGwEvtReqCtx = apiGwEvt.requestContext; str = apiGwEvt.resource; /* API Gateway CustomAuthorizer Event */ str = customAuthorizerEvt.type; -str = customAuthorizerEvt.authorizationToken; str = customAuthorizerEvt.methodArn; +str = customAuthorizerEvt.authorizationToken; +str = apiGwEvt.pathParameters["example"]; +str = apiGwEvt.queryStringParameters["example"]; +str = apiGwEvt.stageVariables["example"]; +apiGwEvtReqCtx = apiGwEvt.requestContext; /* SNS Event */ snsEvtRecs = snsEvt.Records; diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index 0c8f0fc26d..3b9e31f14c 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -1,7 +1,42 @@ // Type definitions for AWS Lambda // Project: http://docs.aws.amazon.com/lambda -// Definitions by: James Darbyshire , Michael Skarum , Stef Heyenrath , Toby Hede , Rich Buggy , Yoriki Yamaguchi , wwwy3y3 +// Definitions by: James Darbyshire +// Michael Skarum +// Stef Heyenrath +// Toby Hede +// Rich Buggy +// Yoriki Yamaguchi +// wwwy3y3 +// Ishaan Malhi +// Daniel Cottone // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +// API Gateway "event" request context +interface APIGatewayEventRequestContext { + accountId: string; + apiId: string; + authorizer?: AuthResponseContext | null | undefined; + httpMethod: string; + identity: { + accessKey: string | null; + accountId: string | null; + apiKey: string | null; + caller: string | null; + cognitoAuthenticationProvider: string | null; + cognitoAuthenticationType: string | null; + cognitoIdentityId: string | null; + cognitoIdentityPoolId: string | null; + sourceIp: string; + user: string | null; + userAgent: string | null; + userArn: string | null; + }, + stage: string; + requestId: string; + resourceId: string; + resourcePath: string; +} // API Gateway "event" interface APIGatewayEvent { @@ -13,37 +48,19 @@ interface APIGatewayEvent { pathParameters: { [name: string]: string } | null; queryStringParameters: { [name: string]: string } | null; stageVariables: { [name: string]: string } | null; - requestContext: { - accountId: string; - apiId: string; - httpMethod: string; - identity: { - accessKey: string | null; - accountId: string | null; - apiKey: string | null; - caller: string | null; - cognitoAuthenticationProvider: string | null; - cognitoAuthenticationType: string | null; - cognitoIdentityId: string | null; - cognitoIdentityPoolId: string | null; - sourceIp: string; - user: string | null; - userAgent: string | null; - userArn: string | null; - }, - stage: string; - requestId: string; - resourceId: string; - resourcePath: string; - }; + requestContext: APIGatewayEventRequestContext; resource: string; } // API Gateway CustomAuthorizer "event" interface CustomAuthorizerEvent { type: string; - authorizationToken: string; methodArn: string; + authorizationToken?: string; + headers?: { [name: string]: string }; + pathParameters?: { [name: string]: string } | null; + queryStringParameters?: { [name: string]: string } | null; + requestContext?: APIGatewayEventRequestContext; } // SNS "event" @@ -315,9 +332,9 @@ interface PolicyDocument { * http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output */ interface Statement { - Action: string | [string]; + Action: string | string[]; Effect: string; - Resource: string | [string]; + Resource: string | string[]; } /** @@ -347,8 +364,8 @@ export type CustomAuthorizerHandler = (event: CustomAuthorizerEvent, context: Co * @param error – an optional parameter that you can use to provide results of the failed Lambda function execution. * @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, result?: any) => void; -export type ProxyCallback = (error?: Error, result?: ProxyResult) => void; -export type CustomAuthorizerCallback = (error?: Error, result?: AuthResponse) => void; +export type Callback = (error?: Error | null, result?: object) => void; +export type ProxyCallback = (error?: Error | null, result?: ProxyResult) => void; +export type CustomAuthorizerCallback = (error?: Error | null, result?: AuthResponse) => void; export as namespace AWSLambda; diff --git a/types/aws-lambda/tslint.json b/types/aws-lambda/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/aws-lambda/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/aws-serverless-express/index.d.ts b/types/aws-serverless-express/index.d.ts index e612d5d8d6..02ef0d846a 100644 --- a/types/aws-serverless-express/index.d.ts +++ b/types/aws-serverless-express/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/awslabs/aws-serverless-express // Definitions by: Ben Speakman , Josh Caffey , Matthias Meyer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// import * as http from 'http'; diff --git a/types/aws4/tslint.json b/types/aws4/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/aws4/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/axel/tslint.json b/types/axel/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/axel/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/azure-mobile-services-client/tslint.json b/types/azure-mobile-services-client/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/azure-mobile-services-client/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/azure-sb/tslint.json b/types/azure-sb/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/azure-sb/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/azure/tslint.json b/types/azure/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/azure/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/babel-core/index.d.ts b/types/babel-core/index.d.ts index a2476245c1..3a41d2d252 100644 --- a/types/babel-core/index.d.ts +++ b/types/babel-core/index.d.ts @@ -162,8 +162,9 @@ export interface TransformOptions { /** Indicate the mode the code should be parsed in. Can be either “script” or “module”. Default: "module" */ sourceType?: "script" | "module"; - /** An optional callback that can be used to wrap visitor methods. - * NOTE: This is useful for things like introspection, and not really needed for implementing anything. + /** + * An optional callback that can be used to wrap visitor methods. + * NOTE: This is useful for things like introspection, and not really needed for implementing anything. */ wrapPluginVisitorMethod?(pluginAlias: string, visitorType: 'enter' | 'exit', callback: (path: NodePath, state: any) => void): (path: NodePath, state: any) => void ; } diff --git a/types/babel-generator/index.d.ts b/types/babel-generator/index.d.ts index 3b3d8126e9..2e34d158fc 100644 --- a/types/babel-generator/index.d.ts +++ b/types/babel-generator/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Troy Gerwien // Johnny Estilles // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import * as t from 'babel-types'; diff --git a/types/babel-webpack-plugin/babel-webpack-plugin-tests.ts b/types/babel-webpack-plugin/babel-webpack-plugin-tests.ts new file mode 100644 index 0000000000..89b8efc6e6 --- /dev/null +++ b/types/babel-webpack-plugin/babel-webpack-plugin-tests.ts @@ -0,0 +1,10 @@ +import BabelWebpackPlugin = require('babel-webpack-plugin'); + +new BabelWebpackPlugin(); +new BabelWebpackPlugin({}); +new BabelWebpackPlugin({ + test: /\.js$/, + presets: ['es2015'], + sourceMaps: false, + compact: false +}); diff --git a/types/babel-webpack-plugin/index.d.ts b/types/babel-webpack-plugin/index.d.ts new file mode 100644 index 0000000000..3f16d154ac --- /dev/null +++ b/types/babel-webpack-plugin/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for babel-webpack-plugin 0.1 +// Project: https://github.com/simlrh/babel-webpack-plugin +// Definitions by: Jed Fox +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Plugin } from 'webpack'; +import { TransformOptions } from 'babel-core'; + +export = BabelWebpackPlugin; + +declare class BabelWebpackPlugin extends Plugin { + constructor(options?: BabelWebpackPlugin.Options); +} + +declare namespace BabelWebpackPlugin { + type Matcher = RegExp | string | Array; + interface Options extends TransformOptions { + test?: Matcher; + include?: Matcher; + exclude?: Matcher; + } +} diff --git a/types/babel-webpack-plugin/tsconfig.json b/types/babel-webpack-plugin/tsconfig.json new file mode 100644 index 0000000000..3e73343283 --- /dev/null +++ b/types/babel-webpack-plugin/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "babel-webpack-plugin-tests.ts" + ] +} diff --git a/types/babel-webpack-plugin/tslint.json b/types/babel-webpack-plugin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/babel-webpack-plugin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/babelify/tslint.json b/types/babelify/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/babelify/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/babylon-walk/babylon-walk-tests.ts b/types/babylon-walk/babylon-walk-tests.ts new file mode 100644 index 0000000000..f9489941df --- /dev/null +++ b/types/babylon-walk/babylon-walk-tests.ts @@ -0,0 +1,37 @@ +import * as babelTypes from "babel-types"; +import * as walk from "babylon-walk"; +declare function assert(expr: boolean): void; + +const simpleVisitors: walk.visitors = { + File: (node: babelTypes.Node, state: any) => { + state.out = 1; + }, +}; + +const ancestorVisitors: walk.visitors = { + File: (node: babelTypes.Node, state: any, ancestors: babelTypes.Node[]) => { + state.out = 2; + }, +}; + +const recursiveVisitors: walk.visitors = { + File: (node: babelTypes.Node, state: any, next: (node: babelTypes.Node) => void) => { + state.out = 3; + }, +}; + +const node: any = { + type: "File", +}; + +const state: any = { + out: 0, +}; +walk.simple(node, simpleVisitors, state); +assert(state.out === 1); + +walk.ancestor(node, ancestorVisitors, state); +assert(state.out === 2); + +walk.recursive(node, recursiveVisitors, state); +assert(state.out === 3); diff --git a/types/babylon-walk/index.d.ts b/types/babylon-walk/index.d.ts new file mode 100644 index 0000000000..02c3f39d10 --- /dev/null +++ b/types/babylon-walk/index.d.ts @@ -0,0 +1,118 @@ +// Type definitions for babylon-walk 3.10 +// Project: https://github.com/pugjs/babylon-walk +// Definitions by: Marek Buchar +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as babelTypes from 'babel-types'; + +export type coreTypes = babelTypes.ArrayExpression | babelTypes.AssignmentExpression | babelTypes.BinaryExpression | + babelTypes.Directive | babelTypes.DirectiveLiteral | babelTypes.BlockStatement | babelTypes.BreakStatement | + babelTypes.CallExpression | babelTypes.CatchClause | babelTypes.ConditionalExpression | + babelTypes.ContinueStatement | babelTypes.DebuggerStatement | babelTypes.DoWhileStatement | + babelTypes.EmptyStatement | babelTypes.ExpressionStatement | babelTypes.File | babelTypes.ForInStatement | + babelTypes.ForStatement | babelTypes.FunctionDeclaration | babelTypes.FunctionExpression | babelTypes.Identifier | + babelTypes.IfStatement | babelTypes.LabeledStatement | babelTypes.StringLiteral | babelTypes.NumericLiteral | + babelTypes.NullLiteral | babelTypes.BooleanLiteral | babelTypes.RegExpLiteral | babelTypes.LogicalExpression | + babelTypes.MemberExpression | babelTypes.NewExpression | babelTypes.Program | babelTypes.ObjectExpression | + babelTypes.ObjectMethod | babelTypes.ObjectProperty | babelTypes.RestElement | babelTypes.ReturnStatement | + babelTypes.SequenceExpression | babelTypes.SwitchCase | babelTypes.SwitchStatement | babelTypes.ThisExpression | + babelTypes.ThrowStatement | babelTypes.TryStatement | babelTypes.UnaryExpression | babelTypes.UpdateExpression | + babelTypes.VariableDeclaration | babelTypes.VariableDeclarator | babelTypes.WhileStatement | + babelTypes.WithStatement; + +export type es2015Types = babelTypes.AssignmentPattern | babelTypes.ArrayPattern | babelTypes.ArrowFunctionExpression | + babelTypes.ClassBody | babelTypes.ClassDeclaration | babelTypes.ClassExpression | + babelTypes.ExportAllDeclaration | babelTypes.ExportDefaultDeclaration | babelTypes.ExportNamedDeclaration | + babelTypes.ExportSpecifier | babelTypes.ForOfStatement | babelTypes.ImportDeclaration | + babelTypes.ImportDefaultSpecifier | babelTypes.ImportNamespaceSpecifier | babelTypes.ImportSpecifier | + babelTypes.MetaProperty | babelTypes.ClassMethod | babelTypes.ObjectPattern | babelTypes.SpreadElement | + babelTypes.Super | babelTypes.TaggedTemplateExpression | babelTypes.TemplateElement | babelTypes.TemplateLiteral | + babelTypes.YieldExpression | babelTypes.AwaitExpression | babelTypes.BindExpression | babelTypes.ClassProperty | + babelTypes.Decorator | babelTypes.DoExpression | babelTypes.ExportDefaultSpecifier | + babelTypes.ExportNamespaceSpecifier; + +export type flowTypes = babelTypes.AnyTypeAnnotation | babelTypes.ArrayTypeAnnotation | babelTypes.BooleanTypeAnnotation | + babelTypes.BooleanLiteralTypeAnnotation | babelTypes.NullLiteralTypeAnnotation | babelTypes.ClassImplements | + babelTypes.DeclareClass | babelTypes.DeclareFunction | babelTypes.DeclareInterface | babelTypes.DeclareModule | + babelTypes.DeclareTypeAlias | babelTypes.DeclareVariable | babelTypes.FunctionTypeAnnotation | + babelTypes.FunctionTypeParam | babelTypes.GenericTypeAnnotation | babelTypes.InterfaceExtends | + babelTypes.InterfaceDeclaration | babelTypes.IntersectionTypeAnnotation | babelTypes.MixedTypeAnnotation | + babelTypes.NullableTypeAnnotation | babelTypes.NumberTypeAnnotation | babelTypes.ObjectTypeAnnotation | + babelTypes.ObjectTypeCallProperty | babelTypes.ObjectTypeIndexer | babelTypes.ObjectTypeProperty | + babelTypes.QualifiedTypeIdentifier | babelTypes.StringLiteralTypeAnnotation | babelTypes.StringTypeAnnotation | + babelTypes.ThisTypeAnnotation | babelTypes.TupleTypeAnnotation | babelTypes.TypeofTypeAnnotation | + babelTypes.TypeAlias | babelTypes.TypeAnnotation | babelTypes.TypeCastExpression | + babelTypes.TypeParameterDeclaration | babelTypes.TypeParameterInstantiation | babelTypes.UnionTypeAnnotation | + babelTypes.VoidTypeAnnotation; + +export type jsxTypes = babelTypes.JSXAttribute | babelTypes.JSXClosingElement | babelTypes.JSXElement | + babelTypes.JSXEmptyExpression | babelTypes.JSXExpressionContainer | babelTypes.JSXIdentifier | + babelTypes.JSXMemberExpression | babelTypes.JSXNamespacedName | babelTypes.JSXOpeningElement | + babelTypes.JSXSpreadAttribute | babelTypes.JSXText; + +export type miscTypes = babelTypes.Noop | babelTypes.ParenthesizedExpression; + +export type NodeTypes = coreTypes | es2015Types | flowTypes | jsxTypes | miscTypes; + +export interface coreVisitors { + ArrayExpression?: V; AssignmentExpression?: V; BinaryExpression?: V; Directive?: V; DirectiveLiteral?: V; + BlockStatement?: V; BreakStatement?: V; CallExpression?: V; CatchClause?: V; ConditionalExpression?: V; + ContinueStatement?: V; DebuggerStatement?: V; DoWhileStatement?: V; EmptyStatement?: V; ExpressionStatement?: V; + File?: V; ForInStatement?: V; ForStatement?: V; FunctionDeclaration?: V; FunctionExpression?: V; Identifier?: V; + IfStatement?: V; LabeledStatement?: V; StringLiteral?: V; NumericLiteral?: V; NullLiteral?: V; BooleanLiteral?: V; + RegExpLiteral?: V; LogicalExpression?: V; MemberExpression?: V; NewExpression?: V; Program?: V; + ObjectExpression?: V; ObjectMethod?: V; ObjectProperty?: V; RestElement?: V; ReturnStatement?: V; + SequenceExpression?: V; SwitchCase?: V; SwitchStatement?: V; ThisExpression?: V; ThrowStatement?: V; + TryStatement?: V; UnaryExpression?: V; UpdateExpression?: V; VariableDeclaration?: V; VariableDeclarator?: V; + WhileStatement?: V; WithStatement?: V; +} + +export interface es2015Visitors { + AssignmentPattern?: V; ArrayPattern?: V; ArrowFunctionExpression?: V; ClassBody?: V; ClassDeclaration?: V; + ClassExpression?: V; ExportAllDeclaration?: V; ExportDefaultDeclaration?: V; ExportNamedDeclaration?: V; + ExportSpecifier?: V; ForOfStatement?: V; ImportDeclaration?: V; ImportDefaultSpecifier?: V; + ImportNamespaceSpecifier?: V; ImportSpecifier?: V; MetaProperty?: V; ClassMethod?: V; ObjectPattern?: V; + SpreadElement?: V; Super?: V; TaggedTemplateExpression?: V; TemplateElement?: V; TemplateLiteral?: V; + YieldExpression?: V; AwaitExpression?: V; BindExpression?: V; ClassProperty?: V; Decorator?: V; DoExpression?: V; + ExportDefaultSpecifier?: V; ExportNamespaceSpecifier?: V; +} + +export interface flowVisitors { + AnyTypeAnnotation?: V; ArrayTypeAnnotation?: V; BooleanTypeAnnotation?: V; BooleanLiteralTypeAnnotation?: V; + NullLiteralTypeAnnotation?: V; ClassImplements?: V; DeclareClass?: V; DeclareFunction?: V; DeclareInterface?: V; + DeclareModule?: V; DeclareTypeAlias?: V; DeclareVariable?: V; FunctionTypeAnnotation?: V; FunctionTypeParam?: V; + GenericTypeAnnotation?: V; InterfaceExtends?: V; InterfaceDeclaration?: V; IntersectionTypeAnnotation?: V; + MixedTypeAnnotation?: V; NullableTypeAnnotation?: V; NumberTypeAnnotation?: V; ObjectTypeAnnotation?: V; + ObjectTypeCallProperty?: V; ObjectTypeIndexer?: V; ObjectTypeProperty?: V; QualifiedTypeIdentifier?: V; + StringLiteralTypeAnnotation?: V; StringTypeAnnotation?: V; ThisTypeAnnotation?: V; TupleTypeAnnotation?: V; + TypeofTypeAnnotation?: V; TypeAlias?: V; TypeAnnotation?: V; TypeCastExpression?: V; TypeParameterDeclaration?: V; + TypeParameterInstantiation?: V; UnionTypeAnnotation?: V; VoidTypeAnnotation?: V; +} + +export interface jsxVisitors { + JSXAttribute?: V; JSXClosingElement?: V; JSXElement?: V; JSXEmptyExpression?: V; JSXExpressionContainer?: V; + JSXIdentifier?: V; JSXMemberExpression?: V; JSXNamespacedName?: V; JSXOpeningElement?: V; JSXSpreadAttribute?: V; + JSXText?: V; +} + +export interface miscVisitors { + Noop?: V; ParenthesizedExpression?: V; +} + +export interface visitors extends coreVisitors, es2015Visitors, flowVisitors, jsxVisitors, miscVisitors { +} + +export type Visitor = (commentBlock: NodeTypes, state: any) => void; + +export type SimpleVisitor = (node: NodeTypes, state: any) => void; + +export type AncestorVisitor = (node: NodeTypes, state: any, ancestors: babelTypes.Node[]) => void; + +export type AncestorStatelessVisitor = (node: NodeTypes, state: any, ancestors: babelTypes.Node[]) => void; + +export type RecursiveVisitor = (node: NodeTypes, state: any, next: (node: babelTypes.Node) => void) => void; + +export function simple(node: NodeTypes, visitors: visitors, state: any): void; +export function ancestor(node: NodeTypes, visitors: visitors, state: any): void; +export function recursive(node: NodeTypes, visitors: visitors, state: any): void; diff --git a/types/error-stack-parser/tsconfig.json b/types/babylon-walk/tsconfig.json similarity index 75% rename from types/error-stack-parser/tsconfig.json rename to types/babylon-walk/tsconfig.json index 98f3beb1a5..9e1d7c33b7 100644 --- a/types/error-stack-parser/tsconfig.json +++ b/types/babylon-walk/tsconfig.json @@ -7,17 +7,17 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, - "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true }, "files": [ "index.d.ts", - "error-stack-parser-tests.ts" + "babylon-walk-tests.ts" ] } \ No newline at end of file diff --git a/types/babylon-walk/tslint.json b/types/babylon-walk/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/babylon-walk/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/babyparse/tslint.json b/types/babyparse/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/babyparse/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/backbone-associations/tslint.json b/types/backbone-associations/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/backbone-associations/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/backbone-fetch-cache/tslint.json b/types/backbone-fetch-cache/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/backbone-fetch-cache/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/backbone-relational/tslint.json b/types/backbone-relational/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/backbone-relational/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/backbone.layoutmanager/tslint.json b/types/backbone.layoutmanager/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/backbone.layoutmanager/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/backbone.localstorage/tslint.json b/types/backbone.localstorage/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/backbone.localstorage/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/backbone.marionette/index.d.ts b/types/backbone.marionette/index.d.ts index be3dfd8582..cd8ccd3821 100644 --- a/types/backbone.marionette/index.d.ts +++ b/types/backbone.marionette/index.d.ts @@ -691,7 +691,7 @@ export class Region extends Object implements DomMixin { * Render a template with data by passing in the template selector and the * data to render. This is the default renderer that is used by Marionette. */ -export class Renderer { +export namespace Renderer { /** * This method returns a string containing the result of applying the * template using the data object as the context. @@ -703,7 +703,7 @@ export class Renderer { * that returns valid HTML as a string from the data parameter passed to * the function. */ - static render(template: any, data: any): string; + function render(template: any, data: any): string; } export interface ViewOptions extends Backbone.ViewOptions, ViewMixinOptions { @@ -1614,11 +1614,11 @@ export class Behavior extends Object { /** * DEPRECATED */ -export class Behaviors { +export namespace Behaviors { /** * This method defines where your behavior classes are stored. Override this to provide another lookup. */ - static behaviorsLookup(): any; + function behaviorsLookup(): any; /** * This method has a default implementation that is simple to override. It @@ -1626,5 +1626,5 @@ export class Behaviors { * Behaviors.behaviorsLookup or elsewhere. Note that it should return the type of the * class to instantiate, not an instance of that class. */ - static getBehaviorClass(options: any, key: string): any; + function getBehaviorClass(options: any, key: string): any; } diff --git a/types/backbone.paginator/tslint.json b/types/backbone.paginator/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/backbone.paginator/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/backbone.radio/tslint.json b/types/backbone.radio/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/backbone.radio/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/backbone/backbone-tests.ts b/types/backbone/backbone-tests.ts index c074ac57e5..7b6fad9b56 100644 --- a/types/backbone/backbone-tests.ts +++ b/types/backbone/backbone-tests.ts @@ -115,6 +115,8 @@ class Employee extends Backbone.Model { super(options); this.reports = new EmployeeCollection(); this.reports.url = '../api/employees/' + this.id + '/reports'; + // Test that collection url property can be set as a function returning a string. + this.reports.url = () => { return ""; }; } more() { @@ -157,6 +159,9 @@ function test_collection() { var book1: Book = new Book({ title: "Title 1", author: "Mike" }); books.add(book1); + // Test adding sort option to add. + books.add(new Book(), { sort: true }); + // Objects can be added to collection by casting to model type. // Compiler will check if object properties are valid for the cast. // This gives better type checking than declaring an `any` overload. @@ -178,6 +183,8 @@ function test_collection() { var alphabetical = books.sortBy((book: Book): number => null); + var copy = books.clone(); + let one: Book; let models: Book[]; let bool: boolean; @@ -186,6 +193,7 @@ function test_collection() { let modelsDict: _.Dictionary; let num: number; + models = books.slice(); models = books.slice(1); models = books.slice(1, 3); @@ -401,6 +409,12 @@ namespace v1Changes { validate: false }); } + + function test_set() { + var collection = new EmployeeCollection(); + var model = new Employee(); + collection.set([model], { add: false, remove: true, merge: false }); + } } namespace Router { @@ -411,4 +425,10 @@ namespace v1Changes { router.navigate('/employees', true); } } + + namespace Sync { + // Test for Backbone.sync override. + Backbone.sync('create', new Employee()); + Backbone.sync('read', new EmployeeCollection()); + } } diff --git a/types/backbone/index.d.ts b/types/backbone/index.d.ts index 42a322e4c2..607f6413fc 100644 --- a/types/backbone/index.d.ts +++ b/types/backbone/index.d.ts @@ -16,6 +16,13 @@ declare namespace Backbone { interface AddOptions extends Silenceable { at?: number; merge?: boolean; + sort?: boolean; + } + + interface CollectionSetOptions extends Silenceable { + add?: boolean; + remove?: boolean; + merge?: boolean; } interface HistoryOptions extends Silenceable { @@ -100,7 +107,6 @@ declare namespace Backbone { } class ModelBase extends Events { - url: any; parse(response: any, options?: any): any; toJSON(options?: any): any; sync(...arg: any[]): JQueryXHR; @@ -133,6 +139,13 @@ declare namespace Backbone { id: any; idAttribute: string; validationError: any; + + /** + * Returns the relative URL where the model's resource would be located on the server. + * @memberof Model + */ + url: () => string; + urlRoot: any; constructor(attributes?: any, options?: any); @@ -229,6 +242,7 @@ declare namespace Backbone { **/ get(id: number|string|Model): TModel; has(key: number|string|Model): boolean; + clone(): this; create(attributes: any, options?: ModelSaveOptions): TModel; pluck(attribute: string): any[]; push(model: TModel, options?: AddOptions): TModel; @@ -236,7 +250,19 @@ declare namespace Backbone { remove(model: {}|TModel, options?: Silenceable): TModel; remove(models: ({}|TModel)[], options?: Silenceable): TModel[]; reset(models?: TModel[], options?: Silenceable): TModel[]; - set(models?: TModel[], options?: Silenceable): TModel[]; + + /** + * + * The set method performs a "smart" update of the collection with the passed list of models. + * If a model in the list isn't yet in the collection it will be added; if the model is already in the + * collection its attributes will be merged; and if the collection contains any models that aren't present + * in the list, they'll be removed. All of the appropriate "add", "remove", and "change" events are fired as + * this happens. Returns the touched models in the collection. If you'd like to customize the behavior, you can + * disable it with options: {add: false}, {remove: false}, or {merge: false}. + * @param models + * @param options + */ + set(models?: TModel[], options?: CollectionSetOptions): TModel[]; shift(options?: Silenceable): TModel; sort(options?: Silenceable): Collection; unshift(model: TModel, options?: AddOptions): TModel; @@ -252,7 +278,7 @@ declare namespace Backbone { /** * Return a shallow copy of this collection's models, using the same options as native Array#slice. */ - slice(min: number, max?: number): TModel[]; + slice(min?: number, max?: number): TModel[]; // mixins from underscore @@ -314,6 +340,14 @@ declare namespace Backbone { take(): TModel; take(n: number): TModel[]; toArray(): TModel[]; + + /** + * Sets the url property (or function) on a collection to reference its location on the server. + * + * @memberof Collection + */ + url: string | (() => string); + without(...values: TModel[]): TModel[]; } @@ -427,6 +461,7 @@ declare namespace Backbone { // SYNC function sync(method: string, model: Model, options?: JQueryAjaxSettings): any; + function sync(method: string, collection: Collection, options?: JQueryAjaxSettings): any; function ajax(options?: JQueryAjaxSettings): JQueryXHR; var emulateHTTP: boolean; var emulateJSON: boolean; diff --git a/types/backbone/tslint.json b/types/backbone/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/backbone/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/backgrid/tslint.json b/types/backgrid/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/backgrid/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/backlog-js/tslint.json b/types/backlog-js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/backlog-js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/baconjs/baconjs-tests.ts b/types/baconjs/baconjs-tests.ts index 75560d4e42..2755bec595 100644 --- a/types/baconjs/baconjs-tests.ts +++ b/types/baconjs/baconjs-tests.ts @@ -165,7 +165,12 @@ function CommonMethodsInEventStreamsAndProperties() { { // Calculator for grouped consecutive values until group is cancelled: - var events = [ + interface Event { + id:number; + type:string; + val?:number; + } + var events: Event[] = [ {id: 1, type: "add", val: 3}, {id: 2, type: "add", val: -1}, {id: 1, type: "add", val: 2}, @@ -177,16 +182,16 @@ function CommonMethodsInEventStreamsAndProperties() { {id: 1, type: "cancel"} ], keyF = (event:{id:number}) => event.id, - limitF = (groupedStream:Bacon.EventStream) => { + limitF = (groupedStream:Bacon.EventStream) => { var cancel = groupedStream.filter(x => x.type === "cancel").take(1), adds = groupedStream.filter(x => x.type === "add"); return adds.takeUntil(cancel).map(x => x.val); }; - Bacon.sequentially(2, events) + Bacon.sequentially(2, events) .groupBy(keyF, limitF) .flatMap(groupedStream => groupedStream.fold(0, (acc, x) => acc + x)) - .onValue(sum => { + .onValue((sum: number) => { console.log(sum); // returns [-1, 2, 8] in an order }); } diff --git a/types/baconjs/tsconfig.json b/types/baconjs/tsconfig.json index 162a364559..c9d82e16f7 100644 --- a/types/baconjs/tsconfig.json +++ b/types/baconjs/tsconfig.json @@ -8,7 +8,7 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, - "strictFunctionTypes": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/baconjs/tslint.json b/types/baconjs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/baconjs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bagpipes/index.d.ts b/types/bagpipes/index.d.ts index ec1d0cceb7..309ae38318 100755 --- a/types/bagpipes/index.d.ts +++ b/types/bagpipes/index.d.ts @@ -4,7 +4,8 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export interface FittingContext { - /** The input defined in the fitting definition + /** + * The input defined in the fitting definition * (string, number, object, array) */ input: any; @@ -56,7 +57,7 @@ export type Fitting = ( * Executed during parsing * @see {@link https://github.com/apigee-127/bagpipes#fittings|Docs} * - * @param {Object} fittingDef Fitting Definition + * @param fittingDef Fitting Definition */ export type FittingFactory = (fittingDef: FittingDef, bagpipes: any) => Fitting; diff --git a/types/barcode/tslint.json b/types/barcode/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/barcode/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bardjs/tslint.json b/types/bardjs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bardjs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/base-x/tslint.json b/types/base-x/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/base-x/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/base16/tslint.json b/types/base16/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/base16/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bases/tslint.json b/types/bases/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bases/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bash-glob/bash-glob-tests.ts b/types/bash-glob/bash-glob-tests.ts new file mode 100644 index 0000000000..cf63412653 --- /dev/null +++ b/types/bash-glob/bash-glob-tests.ts @@ -0,0 +1,21 @@ +import bashGlob = require('bash-glob'); + +bashGlob('pattern', (err, files) => {}); +bashGlob(['pattern'], (err, files) => {}); +bashGlob(['pattern'], {}, (err, files) => {}); +bashGlob(['pattern'], { cwd: 'cwd' }, (err, files) => { }); + +bashGlob.on('match', (match, cwd) => {}); +bashGlob.on('files', (files, cwd) => {}); +bashGlob.on('end', (files) => {}); + +bashGlob.each('pattern', (err, files) => {}); +bashGlob.each(['pattern'], (err, files) => {}); +bashGlob.each(['pattern'], {}, (err, files) => {}); +bashGlob.each(['pattern'], { cwd: 'cwd' }, (err, files) => {}); + +// $ExpectType string[] +bashGlob.sync('pattern'); +bashGlob.sync(['pattern']); +bashGlob.sync(['pattern'], {}); +bashGlob.sync(['pattern'], { cwd: 'cwd' }); diff --git a/types/bash-glob/index.d.ts b/types/bash-glob/index.d.ts new file mode 100644 index 0000000000..29582ea9bd --- /dev/null +++ b/types/bash-glob/index.d.ts @@ -0,0 +1,36 @@ +// Type definitions for bash-glob 2.0 +// Project: https://github.com/micromatch/bash-glob +// Definitions by: mrmlnc +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +type Patterns = string | string[]; +type Callback = (err: Error, files: string[]) => void; + +declare function bashGlob(pattern: Patterns, callback: Callback): void; +declare function bashGlob(pattern: Patterns, options: bashGlob.Options, callback: Callback): void; + +declare namespace bashGlob { + interface Options { + cwd?: string; + dot?: boolean; + dotglob?: boolean; + extglob?: boolean; + failglob?: boolean; + globstar?: boolean; + nocase?: boolean; + nocaseglob?: boolean; + nullglob?: boolean; + } + + function on(event: 'match' | 'files', callback: (files: string, cwd: string) => void): void; + function on(event: 'end', callback: (files: string) => void): void; + + function each(patterns: Patterns, callback: Callback): void; + function each(patterns: Patterns, options: Options, callback: Callback): void; + + function promise(patterns: Patterns, options?: Options): Promise; + + function sync(patterns: Patterns, options?: Options): string[]; +} + +export = bashGlob; diff --git a/types/bash-glob/tsconfig.json b/types/bash-glob/tsconfig.json new file mode 100644 index 0000000000..6a45a2d74d --- /dev/null +++ b/types/bash-glob/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", + "bash-glob-tests.ts" + ] +} diff --git a/types/bash-glob/tslint.json b/types/bash-glob/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/bash-glob/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/batch-stream/tslint.json b/types/batch-stream/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/batch-stream/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bazinga-translator/tslint.json b/types/bazinga-translator/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bazinga-translator/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bcrypt-nodejs/tslint.json b/types/bcrypt-nodejs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bcrypt-nodejs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bcrypt/tslint.json b/types/bcrypt/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bcrypt/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bcryptjs/tslint.json b/types/bcryptjs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bcryptjs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/benchmark/benchmark-tests.ts b/types/benchmark/benchmark-tests.ts index 8fbe2b1d92..cb02940b37 100644 --- a/types/benchmark/benchmark-tests.ts +++ b/types/benchmark/benchmark-tests.ts @@ -229,6 +229,27 @@ suite.add({ 'onComplete': onComplete }); +// unregister a listener for an event type +suite.off('cycle', listener) as Benchmark.Suite; + +// unregister a listener for multiple event types +suite.off('start cycle', listener) as Benchmark.Suite; + +// unregister all listeners for an event type +suite.off('cycle') as Benchmark.Suite; + +// unregister all listeners for multiple event types +suite.off('start cycle complete') as Benchmark.Suite; + +// unregister all listeners for all event types +suite.off() as Benchmark.Suite; + +// register a listener for an event type +suite.on('cycle', listener) as Benchmark.Suite; + +// register a listener for multiple event types +suite.on('start cycle', listener) as Benchmark.Suite; + // basic usage suite.run(); diff --git a/types/benchmark/index.d.ts b/types/benchmark/index.d.ts index 01bb379a48..d8c72aef68 100644 --- a/types/benchmark/index.d.ts +++ b/types/benchmark/index.d.ts @@ -170,10 +170,10 @@ declare namespace Benchmark { join(separator?: string): string; listeners(type: string): Function[]; map(callback: Function): any[]; - off(type?: string, callback?: Function): Benchmark; - off(types: string[]): Benchmark; - on(type?: string, callback?: Function): Benchmark; - on(types: string[]): Benchmark; + off(type?: string, callback?: Function): Suite; + off(types: string[]): Suite; + on(type?: string, callback?: Function): Suite; + on(types: string[]): Suite; pluck(property: string): any[]; pop(): Function; push(benchmark: Benchmark): number; diff --git a/types/benchmark/tslint.json b/types/benchmark/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/benchmark/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/better-curry/tslint.json b/types/better-curry/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/better-curry/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/better-scroll/better-scroll-tests.ts b/types/better-scroll/better-scroll-tests.ts new file mode 100644 index 0000000000..1c8f336f4f --- /dev/null +++ b/types/better-scroll/better-scroll-tests.ts @@ -0,0 +1,70 @@ +import BScroll = require("better-scroll"); + +const BScroll1 = new BScroll('#wrapper'); +const BScroll2 = new BScroll('#wrapper', { scrollX: false, scrollY: false }); +const BScroll3 = new BScroll('#wrapper', { + snap: true, + wheel: false, + scrollbar: false, + pullDownRefresh: false, +}); +const BScroll4 = new BScroll('#wrapper', { + wheel: { + selectedIndex: 0, + }, +}); +if (document.querySelector('div-test')) { + const BScroll6 = new BScroll('#wrapper', { + snap: { + loop: false, + el: document.querySelector('div-test')!, + threshold: 0.1, + stepX: 100, + stepY: 100, + listenFlick: true, + }, + }); +} +const BScroll7 = new BScroll('#wrapper', { + scrollbar: { + fade: true, + }, +}); + +const BScroll8 = new BScroll('#wrapper', { + pullDownRefresh: { + threshold: 50, + stop: 20, + }, +}); + +BScroll1.refresh(); +BScroll1.scrollTo(0, 100); +BScroll1.scrollTo(0, 100, 200); + +BScroll1.scrollToElement('selectedElement'); +BScroll1.scrollToElement('selectedElement', 250); + +BScroll1.scrollToElement(document.getElementById('selectedElement')!); +BScroll1.scrollToElement(document.getElementById('selectedElement')!, 250); + +BScroll2.on('scrollStart', () => { console.log('scroll started'); }); + +const BScroll9 = new BScroll(document.getElementById('wrapper')!); +const BScroll10 = new BScroll(document.getElementById('wrapper')!, { freeScroll: true }); +const BScroll11 = new BScroll(document.getElementById('wrapper')!, { + preventDefaultException: { + tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT)$/, + }, +}); +const BScroll12 = new BScroll(document.getElementById('wrapper')!, { + preventDefaultException: { + className: /(^|\s)test(\s|$)/, + }, +}); + +const BScroll13 = new BScroll(document.getElementById('wrapper')!, { + swipeBounceTime: 1000, +}); + +const BScroll14 = new BScroll('#wrapper', { disableMouse: true, disableTouch: false }); diff --git a/types/better-scroll/index.d.ts b/types/better-scroll/index.d.ts new file mode 100644 index 0000000000..559b21bba2 --- /dev/null +++ b/types/better-scroll/index.d.ts @@ -0,0 +1,148 @@ +// Type definitions for better-scroll.js 1.3 +// Project: https://github.com/ustbhuangyi/better-scroll +// Definitions by: linxiaowu66 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 +interface WheelOption { + selectedIndex?: number; + rotate?: number; + adjustTime?: number; +} + +interface SlideOption { + loop?: boolean; + el?: Element; + threshold?: number; + stepX?: number; + stepY?: number; + listenFlick?: boolean; +} +interface ScrollBarOption { + fade?: boolean; +} +interface PullDownOption { + threshold?: number; + stop?: number; +} +interface PullUpOption { + threshold?: number; +} +interface BsOption { + startX?: number; + startY?: number; + scrollX?: boolean; + scrollY?: boolean; + freeScroll?: boolean; + directionLockThreshold?: number; + eventPassthrough?: string | boolean; + click?: boolean; + tap?: boolean; + bounce?: boolean; + bounceTime?: number; + momentum?: boolean; + momentumLimitTime?: number; + momentumLimitDistance?: number; + swipeTime?: number; + swipeBounceTime?: number; + deceleration?: number; + flickLimitTime?: number; + flickLimitDistance?: number; + resizePolling?: number; + probeType?: number; + preventDefault?: boolean; + preventDefaultException?: object; + HWCompositing?: boolean; + useTransition?: boolean; + useTransform?: boolean; + bindToWrapper?: boolean; + disableMouse?: boolean; + disableTouch?: boolean; + /** + * for picker + * wheel: { + * selectedIndex: 0; + * rotate: 25; + * adjustTime: 400 + * } + */ + wheel?: WheelOption | boolean; + /** + * for slide + * snap: { + * loop?: boolean; + * el: domEl; + * threshold: 0.1; + * stepX: 100; + * stepY: 100; + * listenFlick: true + * } + */ + snap?: SlideOption | boolean; + /** + * for scrollbar + * scrollbar: { + * fade: true + * } + */ + scrollbar?: ScrollBarOption | boolean; + /** + * for pull down and refresh + * pullDownRefresh: { + * threshold: 50; + * stop: 20 + * } + */ + pullDownRefresh?: PullDownOption | boolean; + /** + * for pull up and load + * pullUpLoad: { + * threshold: 50 + * } + */ + pullUpLoad?: PullUpOption | boolean; +} +declare class BScroll { + constructor(element: Element | string, options?: BsOption); + // 重新计算 better-scroll,当 DOM 结构发生变化的时候务必要调用确保滚动的效果正常 + x: number; + y: number; + + refresh(): void; + // 启用 better-scroll; 默认 开启 + enable(): void; + // 禁用 better-scroll,DOM 事件(如 touchstart、touchmove、touchend)的回调函数不再响应 + disable(): void; + // 相对于当前位置偏移滚动 x;y 的距离 + scrollBy(x: number, y: number, time?: number, easing?: object): void; + // 滚动到指定的位置 + scrollTo(x: number, y: number, time?: number, easing?: object): void; + // 滚动到指定的目标元素 + scrollToElement(el: HTMLElement | string, time?: number, offsetX?: number | boolean, offsetY?: number | boolean, easing?: object): void; + // 立即停止当前运行的滚动动画 + stop(): void; + // 销毁 better-scroll,解绑事件 + destroy(): void; + + // 当我们做 slide 组件的时候,slide 通常会分成多个页面。调用此方法可以滚动到指定的页面。 + goToPage(x: number, y: number, time?: number, easing?: object): void; + // 滚动到下一个页面 + next(time: number, easing: object): void; + // 滚动到上一个页面 + prev(time: number, easing: object): void; + // 获取当前页面的信息 + getCurrentPage(): void; + // 当我们做 picker 组件的时候,调用该方法可以滚动到索引对应的位置 + wheelTo(index: number): void; + // 获取当前选中的索引值 + getSelectedIndex(): void; + // 当下拉刷新数据加载完毕后,需要调用此方法告诉 better-scroll 数据已加载 + finishPullDown(): void; + // 当上拉加载数据加载完毕后,需要调用此方法告诉 better-scroll 数据已加载 + finishPullUp(): void; + + // 监听事件 + on(type: string, fn: (evt?: any) => void): void; + off(type: string, fn?: (evt?: any) => void): void; +} + +export = BScroll; diff --git a/types/better-scroll/tsconfig.json b/types/better-scroll/tsconfig.json new file mode 100644 index 0000000000..774ffc076f --- /dev/null +++ b/types/better-scroll/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", + "better-scroll-tests.ts" + ] +} \ No newline at end of file diff --git a/types/better-scroll/tslint.json b/types/better-scroll/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/better-scroll/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/bezier-easing/bezier-easing-tests.ts b/types/bezier-easing/bezier-easing-tests.ts index 6cf2b28bf2..bf3e12bcc9 100644 --- a/types/bezier-easing/bezier-easing-tests.ts +++ b/types/bezier-easing/bezier-easing-tests.ts @@ -1,10 +1,4 @@ +import BezierEasing = require("bezier-easing"); - -function get_easing() { - let easing: Easing = BezierEasing(0, 0, 1, 0.5); -} - -function use_easing() { - let easing: Easing = BezierEasing(0, 0, 1, 0.5); - let eased: number = easing(1); -} \ No newline at end of file +const easing: BezierEasing.Easing = BezierEasing(0, 0, 1, 0.5); +const eased: number = easing(1); diff --git a/types/bezier-easing/index.d.ts b/types/bezier-easing/index.d.ts index e714e55535..d63eea8081 100644 --- a/types/bezier-easing/index.d.ts +++ b/types/bezier-easing/index.d.ts @@ -1,10 +1,12 @@ -// Type definitions for bezier-easing +// Type definitions for bezier-easing 2.0 // Project: https://github.com/gre/bezier-easing // Definitions by: brian ridley // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare interface Easing { - (x: number): number; +declare namespace BezierEasing { + type Easing = (x: number) => number; } -declare function BezierEasing(mX1: number, mY1: number, mX2: number, mY2: number): Easing; +declare function BezierEasing(mX1: number, mY1: number, mX2: number, mY2: number): BezierEasing.Easing; +export = BezierEasing; +export as namespace BezierEasing; diff --git a/types/bezier-easing/tslint.json b/types/bezier-easing/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/bezier-easing/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file diff --git a/types/bezier-js/index.d.ts b/types/bezier-js/index.d.ts index 7706a46472..b44b027dc2 100644 --- a/types/bezier-js/index.d.ts +++ b/types/bezier-js/index.d.ts @@ -203,5 +203,5 @@ declare namespace BezierJs { } declare module "bezier-js" { - export = BezierJs; + export = BezierJs.Bezier; } diff --git a/types/bezier-js/tslint.json b/types/bezier-js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bezier-js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bgiframe/tslint.json b/types/bgiframe/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bgiframe/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bigint/tslint.json b/types/bigint/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bigint/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bignum/tslint.json b/types/bignum/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bignum/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bigscreen/tslint.json b/types/bigscreen/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bigscreen/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/binary-parser/binary-parser-tests.ts b/types/binary-parser/binary-parser-tests.ts new file mode 100644 index 0000000000..d0d09e5ef7 --- /dev/null +++ b/types/binary-parser/binary-parser-tests.ts @@ -0,0 +1,95 @@ +import { Parser } from "binary-parser"; + +// Build an IP packet header Parser +const ipHeader = new Parser() + .endianess('big') + .bit4('version') + .bit4('headerLength') + .uint8('tos') + .uint16('packetLength') + .uint16('id') + .bit3('offset') + .bit13('fragOffset') + .uint8('ttl') + .uint8('protocol') + .uint16('checksum') + .array('src', { + type: 'uint8', + length: 4 + }) + .array('dst', { + type: 'uint8', + length: 4 + }); + +// Prepare buffer to parse. +const buf = new Buffer('450002c5939900002c06ef98adc24f6c850186d1', 'hex'); + +// Parse buffer and show result +ipHeader.parse(buf); + +const parser2 = new Parser() + // Signed 32-bit integer (little endian) + .int32le('a') + // Unsigned 8-bit integer + .uint8('b') + // Signed 16-bit integer (big endian) + .int16be('c'); + +const parser3 = new Parser() + // 32-bit floating value (big endian) + .floatbe('a') + // 64-bit floating value (little endian) + .doublele('b'); + +const parser4 = new Parser() + // Statically sized array + .array('data', { + type: 'int32', + length: 8 + }) + + // Dynamically sized array (references another variable) + .uint8('dataLength') + .array('data2', { + type: 'int32', + length: 'dataLength' + }) + + // Dynamically sized array (with some calculation) + .array('data3', { + type: 'int32', + length: () => 4 // other fields are available through this + }) + + // Statically sized array + .array('data4', { + type: 'int32', + lengthInBytes: 16 + }) + + // Dynamically sized array (references another variable) + .uint8('dataLengthInBytes') + .array('data5', { + type: 'int32', + lengthInBytes: 'dataLengthInBytes' + }) + + // Dynamically sized array (with some calculation) + .array('data6', { + type: 'int32', + lengthInBytes: () => 4, // other fields are available through this + }) + + // Dynamically sized array (with stop-check on parsed item) + .array('data7', { + type: 'int32', + readUntil: (item, buffer) => true // stop when specific item is parsed. buffer can be used to perform a read-ahead. + }); + +const parser5 = new Parser() + .array('ipv4', { + type: 'uint8', + length: '4', + formatter: (arr) => { } + }); diff --git a/types/binary-parser/index.d.ts b/types/binary-parser/index.d.ts new file mode 100644 index 0000000000..657996bd8d --- /dev/null +++ b/types/binary-parser/index.d.ts @@ -0,0 +1,147 @@ +// Type definitions for binary-parser 1.3 +// Project: https://github.com/keichi/binary-parser +// Definitions by: Benjamin Riggs , Dolan Miu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export interface Parser { + parse(buffer: Buffer, callback?: (err?: Error, result?: any) => void): Parser.Parsed; + + create(constructorFunction: ObjectConstructor): Parser; + + int8(name: string, options?: Parser.Options): Parser; + uint8(name: string, options?: Parser.Options): Parser; + + int16(name: string, options?: Parser.Options): Parser; + uint16(name: string, options?: Parser.Options): Parser; + int16le(name: string, options?: Parser.Options): Parser; + int16be(name: string, options?: Parser.Options): Parser; + uint16le(name: string, options?: Parser.Options): Parser; + uint16be(name: string, options?: Parser.Options): Parser; + + int32(name: string, options?: Parser.Options): Parser; + uint32(name: string, options?: Parser.Options): Parser; + int32le(name: string, options?: Parser.Options): Parser; + int32be(name: string, options?: Parser.Options): Parser; + uint32le(name: string, options?: Parser.Options): Parser; + uint32be(name: string, options?: Parser.Options): Parser; + + bit1(name: string, options?: Parser.Options): Parser; + bit2(name: string, options?: Parser.Options): Parser; + bit3(name: string, options?: Parser.Options): Parser; + bit4(name: string, options?: Parser.Options): Parser; + bit5(name: string, options?: Parser.Options): Parser; + bit6(name: string, options?: Parser.Options): Parser; + bit7(name: string, options?: Parser.Options): Parser; + bit8(name: string, options?: Parser.Options): Parser; + bit9(name: string, options?: Parser.Options): Parser; + bit10(name: string, options?: Parser.Options): Parser; + bit11(name: string, options?: Parser.Options): Parser; + bit12(name: string, options?: Parser.Options): Parser; + bit13(name: string, options?: Parser.Options): Parser; + bit14(name: string, options?: Parser.Options): Parser; + bit15(name: string, options?: Parser.Options): Parser; + bit16(name: string, options?: Parser.Options): Parser; + bit17(name: string, options?: Parser.Options): Parser; + bit18(name: string, options?: Parser.Options): Parser; + bit19(name: string, options?: Parser.Options): Parser; + bit20(name: string, options?: Parser.Options): Parser; + bit21(name: string, options?: Parser.Options): Parser; + bit22(name: string, options?: Parser.Options): Parser; + bit23(name: string, options?: Parser.Options): Parser; + bit24(name: string, options?: Parser.Options): Parser; + bit25(name: string, options?: Parser.Options): Parser; + bit26(name: string, options?: Parser.Options): Parser; + bit27(name: string, options?: Parser.Options): Parser; + bit28(name: string, options?: Parser.Options): Parser; + bit29(name: string, options?: Parser.Options): Parser; + bit30(name: string, options?: Parser.Options): Parser; + bit31(name: string, options?: Parser.Options): Parser; + bit32(name: string, options?: Parser.Options): Parser; + + float(name: string, options?: Parser.Options): Parser; + floatle(name: string, options?: Parser.Options): Parser; + floatbe(name: string, options?: Parser.Options): Parser; + + double(name: string, options?: Parser.Options): Parser; + doublele(name: string, options?: Parser.Options): Parser; + doublebe(name: string, options?: Parser.Options): Parser; + + string(name: string, options?: Parser.StringOptions): Parser; + + buffer(name: string, options: Parser.BufferOptions): Parser; + + array(name: string, options: Parser.ArrayOptions): Parser; + + choice(name: string, options: Parser.ChoiceOptions): Parser; + + nest(name: string, options: Parser.NestOptions): Parser; + + skip(length: number): Parser; + + endianess(endianess: Parser.Endianness): Parser; /* [sic] */ + + namely(alias: string): Parser; + + compile(): void; + + getCode(): string; +} + +export interface ParserConstructor { + new(): Parser; +} + +export const Parser: ParserConstructor; + +export namespace Parser { + type Data = number | string | Array | Parsed | Buffer; + interface Parsed { + [name: string]: Data; + } + + interface Options { + formatter?: ((value: Data) => any); + assert?: string | number | ((value: Data) => boolean); + } + + interface StringOptions extends Options { + encoding?: string; + length?: number | string | ((this: Parsed) => number); + zeroTerminated?: boolean; + greedy?: boolean; + stripNull?: boolean; + } + + interface BufferOptions extends Options { + clone?: boolean; + length?: number | string | ((this: Parsed) => number); + readUntil?: string | ((item: number, buffer: Buffer) => boolean); + } + + interface ArrayOptions extends Options { + type: string | Parser; + length?: number | string | ((this: Parsed) => number); + lengthInBytes?: number | string | ((this: Parsed) => number); + readUntil?: string | ((item: number, buffer: Buffer) => boolean); + } + + interface ChoiceOptions extends Options { + tag: string | ((this: Parsed) => number); + choices: { [item: number]: Parser | string }; + defaultChoice?: Parser | string; + } + + interface NestOptions extends Options { + type: Parser | string; + } + + type Endianness = + 'little' | + 'big'; + + interface Context { + [name: string]: Parsed; + } +} diff --git a/types/binary-parser/tsconfig.json b/types/binary-parser/tsconfig.json new file mode 100644 index 0000000000..cb361f52c5 --- /dev/null +++ b/types/binary-parser/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", + "binary-parser-tests.ts" + ] +} diff --git a/types/binary-parser/tslint.json b/types/binary-parser/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/binary-parser/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/bind-ponyfill/tslint.json b/types/bind-ponyfill/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bind-ponyfill/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bingmaps/tslint.json b/types/bingmaps/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bingmaps/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bintrees/tslint.json b/types/bintrees/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bintrees/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bip21/tslint.json b/types/bip21/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bip21/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bit-array/tslint.json b/types/bit-array/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bit-array/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts b/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts index 549de76507..868659e6b6 100644 --- a/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts +++ b/types/bitcoinjs-lib/bitcoinjs-lib-tests.ts @@ -53,7 +53,7 @@ describe('bitcoinjs-lib (basic)', () => { const tx = new bitcoin.TransactionBuilder(); tx.addInput('aa94ab02c182214f090e99a0d57021caffd0f195a81c24602b1028b130b63e31', 0); - tx.addOutput(Buffer.from('1Gokm82v6DmtwKEB8AiVhm82hyFSsEvBDK'), 15000); + tx.addOutput(Buffer.from('1Gokm82v6DmtwKEB8AiVhm82hyFSsEvBDK', 'utf8'), 15000); tx.sign(0, keyPair); // tslint:disable-next-line:max-line-length diff --git a/types/bitcoinjs-lib/index.d.ts b/types/bitcoinjs-lib/index.d.ts index 986bb75e0b..1f5abfd2f3 100644 --- a/types/bitcoinjs-lib/index.d.ts +++ b/types/bitcoinjs-lib/index.d.ts @@ -10,12 +10,12 @@ /// import BigInteger = require("bigi"); -export interface Output { +export interface Out { script: Buffer; value: number; } -export interface Input { +export interface In { script: Buffer; hash: Buffer; index: number; @@ -62,10 +62,12 @@ export class Block { } export class ECPair { - constructor(d: BigInteger, Q?: null | undefined, options?: { compressed?: boolean, network?: Network }); + constructor(d: BigInteger, Q?: null, options?: { compressed?: boolean, network?: Network }); constructor(d: null | undefined, Q: any, options?: { compressed?: boolean, network?: Network }); // Q should be ECPoint, but not sure how to define such type + d: BigInteger; + getAddress(): string; getNetwork(): Network; @@ -132,7 +134,7 @@ export class HDNode { toBase58(): string; - verify(hash: Buffer, signature: ECSignature): Buffer; + verify(hash: Buffer, signature: ECSignature): boolean; static HIGHEST_BIT: number; @@ -150,8 +152,8 @@ export class HDNode { export class Transaction { version: number; locktime: number; - ins: Input[]; - outs: Output[]; + ins: In[]; + outs: Out[]; constructor(); addInput(hash: Buffer, index: number, sequence?: number, scriptSig?: Buffer): number; @@ -203,12 +205,25 @@ export class Transaction { static isCoinbaseHash(buffer: Buffer): boolean; } +export interface Input { + pubKeys: Buffer[]; + signatures: Buffer[]; + prevOutScript: Buffer; + prevOutType: string; + signType: string; + signScript: Buffer; + witness: boolean; +} + export class TransactionBuilder { + tx: Transaction; + inputs: Input[]; + constructor(network?: Network, maximumFeeRate?: number); addInput(txhash: Buffer | string | Transaction, vout: number, sequence?: number, prevOutScript?: Buffer): number; - addOutput(scriptPubKey: Buffer, value: number): number; + addOutput(scriptPubKey: Buffer | string, value: number): number; build(): Transaction; @@ -526,7 +541,7 @@ export namespace script { output: { check(script: Buffer): boolean; decode(buffer: Buffer): Buffer; - encode(data: Buffer[]): Buffer; + encode(data: Buffer): Buffer; }; }; } diff --git a/types/bitwise-xor/tslint.json b/types/bitwise-xor/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bitwise-xor/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bl/tslint.json b/types/bl/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bl/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/blazy/tslint.json b/types/blazy/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/blazy/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/blessed/blessed-tests.ts b/types/blessed/blessed-tests.ts index b143703b18..c5f857146f 100644 --- a/types/blessed/blessed-tests.ts +++ b/types/blessed/blessed-tests.ts @@ -1,150 +1,138 @@ -import * as blessed from 'blessed' +import * as blessed from "blessed"; +import { readFileSync } from "fs"; let screen: blessed.Widgets.Screen = null; // https://github.com/chjj/blessed/blob/master/test/widget-autopad.js screen = blessed.screen({ - dump: __dirname + '/logs/autopad.log', + dump: __dirname + "/logs/autopad.log", smartCSR: true, autoPadding: true, warnings: true }); -var box1 = blessed.box({ +const box1 = blessed.box({ parent: screen, - top: 'center', - left: 'center', + top: "center", + left: "center", width: 20, height: 10, - border: 'line' + border: "line" }); -var box2 = blessed.box({ +const box2 = blessed.box({ parent: box1, top: 0, left: 0, width: 10, height: 5, - border: 'line' + border: "line" }); -screen.key('q', function() { - return screen.destroy(); -}); +screen.key("q", () => screen.destroy()); screen.render(); // https://github.com/chjj/blessed/blob/master/test/widget-bigtext.js screen = blessed.screen({ - dump: __dirname + '/logs/bigtext.log', + dump: __dirname + "/logs/bigtext.log", smartCSR: true, warnings: true }); -var box = blessed.bigtext({ +const box3 = blessed.bigtext({ parent: screen, - content: 'Hello', + content: "Hello", shrink: true, - width: '80%', + width: "80%", // height: '80%', - height: 'shrink', + height: "shrink", // width: 'shrink', - border: 'line', - fch: ' ', - ch: '\u2592', + border: "line", + fch: " ", + ch: "\u2592", style: { - fg: 'red', - bg: 'blue', + fg: "red", + bg: "blue", bold: false } }); -screen.key('q', function() { - return screen.destroy(); -}); +screen.key("q", () => screen.destroy()); screen.render(); // https://github.com/chjj/blessed/blob/master/test/widget-csr.js screen = blessed.screen({ - dump: __dirname + '/logs/csr.log', + dump: __dirname + "/logs/csr.log", smartCSR: true, warnings: true }); +const lorem = readFileSync(__dirname + "/git.diff", "utf8"); -var lorem = require('fs').readFileSync(__dirname + '/git.diff', 'utf8'); - -var cleanSides = screen.cleanSides; +const cleanSides = screen.cleanSides; function expectClean(value: any) { - screen.cleanSides = function(el: blessed.widget.Element) { - var ret = cleanSides.apply(this, arguments); + screen.cleanSides = function(el: blessed.Widgets.BlessedElement) { + const ret = cleanSides.apply(this, arguments); if (ret !== value) { - throw new Error('Failed. Expected ' - + value + ' from cleanSides. Got ' - + ret + '.'); + throw new Error(`Failed. Expected ${value} from cleanSides. Got ${ret}.`); } return ret; }; } -var btext = blessed.box({ +const btext = blessed.box({ parent: screen, - left: 'center', - top: 'center', - width: '80%', - height: '80%', + left: "center", + top: "center", + width: "80%", + height: "80%", style: { - bg: 'green' + bg: "green" }, - border: 'line', - content: 'CSR should still work.' + border: "line", + content: "CSR should still work." }); -let _oscroll = btext.scroll; -btext.scroll = function(offset, always) { +btext.scroll = (offset, always) => { expectClean(true); - return _oscroll(offset, always); }; -var text = blessed.scrollabletext({ +const text = blessed.scrollabletext({ parent: screen, content: lorem, - border: 'line', - left: 'center', - top: 'center', + border: "line", + left: "center", + top: "center", draggable: true, - width: '50%', - height: '50%', + width: "50%", + height: "50%", mouse: true, keys: true, vi: true }); -_oscroll = text.scroll; text.scroll = function(offset, always) { - var el = this; - var value = true; + const el = this; + let value = true; if (el.left < 0) value = true; if (el.top < 0) value = false; if (el.left + el.width > screen.width) value = true; if (el.top + el.height > screen.height) value = false; expectClean(value); - return _oscroll(offset, always); }; text.focus(); -screen.key('q', function() { - return screen.destroy(); -}); +screen.key("q", () => screen.destroy()); screen.render(); // https://github.com/chjj/blessed/blob/master/test/widget-dock-noborder.js screen = blessed.screen({ - dump: __dirname + '/logs/dock.log', + dump: __dirname + "/logs/dock.log", smartCSR: true, dockBorders: true, warnings: true @@ -154,85 +142,85 @@ blessed.box({ parent: screen, left: -1, top: -1, - width: '50%+1', - height: '50%+1', - border: 'line', - content: 'Foo' + width: "50%+1", + height: "50%+1", + border: "line", + content: "Foo" }); blessed.box({ parent: screen, - left: '50%-1', + left: "50%-1", top: -1, - width: '50%+3', - height: '50%+1', - content: 'Bar', - border: 'line' + width: "50%+3", + height: "50%+1", + content: "Bar", + border: "line" }); blessed.box({ parent: screen, left: -1, - top: '50%-1', - width: '50%+1', - height: '50%+3', - border: 'line', - content: 'Foo' + top: "50%-1", + width: "50%+1", + height: "50%+3", + border: "line", + content: "Foo" }); -blessed.listtable({ - parent: screen, - left: '50%-1', - top: '50%-1', - width: '50%+3', - height: '50%+3', - border: 'line', - align: 'center', - tags: true, - keys: true, - vi: true, - mouse: true, - style: { - header: { - fg: 'blue', - bold: true - }, - cell: { - fg: 'magenta', - selected: { - bg: 'blue' +blessed + .listtable({ + parent: screen, + left: "50%-1", + top: "50%-1", + width: "50%+3", + height: "50%+3", + border: "line", + align: "center", + tags: true, + keys: true, + vi: true, + mouse: true, + style: { + header: { + fg: "blue", + bold: true + }, + cell: { + fg: "magenta", + selected: { + bg: "blue" + } } - } - }, - data: [ - [ 'Animals', 'Foods', 'Times', 'Numbers' ], - [ 'Elephant', 'Apple', '1:00am', 'One' ], - [ 'Bird', 'Orange', '2:15pm', 'Two' ], - [ 'T-Rex', 'Taco', '8:45am', 'Three' ], - [ 'Mouse', 'Cheese', '9:05am', 'Four' ] - ] -}).focus(); + }, + data: [ + ["Animals", "Foods", "Times", "Numbers"], + ["Elephant", "Apple", "1:00am", "One"], + ["Bird", "Orange", "2:15pm", "Two"], + ["T-Rex", "Taco", "8:45am", "Three"], + ["Mouse", "Cheese", "9:05am", "Four"] + ] + }) + .focus(); -screen.key('q', function() { - return screen.destroy(); -}); +screen.key("q", () => screen.destroy()); screen.render(); // https://raw.githubusercontent.com/chjj/blessed/master/example/simple-form.js -var form = blessed.form({ +const form = blessed.form({ parent: screen, keys: true, left: 0, top: 0, width: 30, height: 4, - bg: 'green', - content: 'Submit or cancel?' + bg: "green", + content: "Submit or cancel?" }); -var submit = blessed.button({ +const submit = blessed.button({ parent: form, mouse: true, keys: true, @@ -243,20 +231,20 @@ var submit = blessed.button({ left: 10, top: 2, shrink: true, - name: 'submit', - content: 'submit', + name: "submit", + content: "submit", style: { - bg: 'blue', + bg: "blue", focus: { - bg: 'red' + bg: "red" }, hover: { - bg: 'red' + bg: "red" } } }); -var cancel = blessed.button({ +const cancel = blessed.button({ parent: form, mouse: true, keys: true, @@ -267,15 +255,15 @@ var cancel = blessed.button({ left: 20, top: 2, shrink: true, - name: 'cancel', - content: 'cancel', + name: "cancel", + content: "cancel", style: { - bg: 'blue', + bg: "blue", focus: { - bg: 'red' + bg: "red" }, hover: { - bg: 'red' + bg: "red" } } }); @@ -283,314 +271,306 @@ var cancel = blessed.button({ // https://github.com/chjj/blessed/blob/master/test/widget-layout.js screen = blessed.screen({ - dump: __dirname + '/logs/layout.log', + dump: __dirname + "/logs/layout.log", smartCSR: true, autoPadding: true, warnings: true }); -var layout = blessed.layout({ +const layout = blessed.layout({ parent: screen, - top: 'center', - left: 'center', - width: '50%', - height: '50%', - border: 'line', - layout: process.argv[2] === 'grid' ? 'grid' : 'inline', + top: "center", + left: "center", + width: "50%", + height: "50%", + border: "line", + layout: process.argv[2] === "grid" ? "grid" : "inline", style: { - bg: 'red', + bg: "red", border: { - fg: 'blue' + fg: "blue" } } }); -var box1 = blessed.box({ +blessed.box({ parent: layout, - top: 'center', - left: 'center', + top: "center", + left: "center", width: 20, height: 10, - border: 'line', - content: '1' + border: "line", + content: "1" }); -var box2 = blessed.box({ +blessed.box({ parent: layout, top: 0, left: 0, width: 10, height: 5, - border: 'line', - content: '2' + border: "line", + content: "2" }); -var box3 = blessed.box({ +blessed.box({ parent: layout, top: 0, left: 0, width: 10, height: 5, - border: 'line', - content: '3' + border: "line", + content: "3" }); -var box4 = blessed.box({ +blessed.box({ parent: layout, top: 0, left: 0, width: 10, height: 5, - border: 'line', - content: '4' + border: "line", + content: "4" }); -var box5 = blessed.box({ +blessed.box({ parent: layout, top: 0, left: 0, width: 10, height: 5, - border: 'line', - content: '5' + border: "line", + content: "5" }); -var box6 = blessed.box({ +blessed.box({ parent: layout, top: 0, left: 0, width: 10, height: 5, - border: 'line', - content: '6' + border: "line", + content: "6" }); -var box7 = blessed.box({ +blessed.box({ parent: layout, top: 0, left: 0, width: 10, height: 5, - border: 'line', - content: '7' + border: "line", + content: "7" }); -var box8 = blessed.box({ +blessed.box({ parent: layout, - top: 'center', - left: 'center', + top: "center", + left: "center", width: 20, height: 10, - border: 'line', - content: '8' + border: "line", + content: "8" }); -var box9 = blessed.box({ +blessed.box({ parent: layout, top: 0, left: 0, width: 10, height: 5, - border: 'line', - content: '9' + border: "line", + content: "9" }); -var box10 = blessed.box({ +blessed.box({ parent: layout, - top: 'center', - left: 'center', + top: "center", + left: "center", width: 20, height: 10, - border: 'line', - content: '10' + border: "line", + content: "10" }); -var box11 = blessed.box({ +blessed.box({ parent: layout, top: 0, left: 0, width: 10, height: 5, - border: 'line', - content: '11' + border: "line", + content: "11" }); -var box12 = blessed.box({ +const box12 = blessed.box({ parent: layout, - top: 'center', - left: 'center', + top: "center", + left: "center", width: 20, height: 10, - border: 'line', - content: '12' + border: "line", + content: "12" }); -if (process.argv[2] !== 'grid') { - for (var i = 0; i < 10; i++) { +if (process.argv[2] !== "grid") { + for (let i = 0; i < 10; i++) { blessed.box({ parent: layout, // width: i % 2 === 0 ? 10 : 20, // height: i % 2 === 0 ? 5 : 10, width: Math.random() > 0.5 ? 10 : 20, height: Math.random() > 0.5 ? 5 : 10, - border: 'line', - content: (i + 1 + 12) + '' + border: "line", + content: String(i + 1 + 12) }); } } -screen.key('q', function() { - return screen.destroy(); -}); +screen.key("q", () => screen.destroy()); screen.render(); // https://github.com/chjj/blessed/blob/master/test/widget-form.js screen = blessed.screen({ - dump: __dirname + '/logs/form.log', + dump: __dirname + "/logs/form.log", warnings: true }); -type FormData = { - radio1: boolean; - radio2: boolean; - text: string; - check: boolean; -}; +interface FormData { + radio1: boolean; + radio2: boolean; + text: string; + check: boolean; +} -var form2 = blessed.form({ +const form2 = blessed.form({ parent: screen, mouse: true, keys: true, vi: true, left: 0, top: 0, - width: '100%', - //height: 12, + width: "100%", style: { - bg: 'green', + bg: "green", border: { - inverse: true + inverse: true }, scrollbar: { inverse: true } }, - content: 'foobar', + content: "foobar", scrollable: true, scrollbar: { - ch: ' ' + ch: " " } - //alwaysScroll: true }); -form2.on('submit', (data) => { +form2.on("submit", data => { output.setContent(JSON.stringify(data, null, 2)); screen.render(); }); -form2.key('d', function() { +form2.key("d", () => { form2.scroll(1, true); screen.render(); }); -form2.key('u', function() { +form2.key("u", () => { form2.scroll(-1, true); screen.render(); }); -var set = blessed.radioset({ +const set = blessed.radioset({ parent: form2, left: 1, top: 1, shrink: true, - //padding: 1, - //content: 'f', style: { - bg: 'magenta' + bg: "magenta" } }); -var radio1 = blessed.radiobutton({ +const radio1 = blessed.radiobutton({ parent: set, mouse: true, keys: true, shrink: true, style: { - bg: 'magenta' + bg: "magenta" }, height: 1, left: 0, top: 0, - name: 'radio1', - content: 'radio1' + name: "radio1", + content: "radio1" }); -var radio2 = blessed.radiobutton({ +const radio2 = blessed.radiobutton({ parent: set, mouse: true, keys: true, shrink: true, style: { - bg: 'magenta' + bg: "magenta" }, height: 1, left: 15, top: 0, - name: 'radio2', - content: 'radio2' + name: "radio2", + content: "radio2" }); -var text2 = blessed.textbox({ +const text2 = blessed.textbox({ parent: form2, mouse: true, keys: true, style: { - bg: 'blue' + bg: "blue" }, height: 1, width: 20, left: 1, top: 3, - name: 'text' + name: "text" }); -text2.on('focus', function() { - text2.readInput(); -}); +text2.on("focus", () => text2.readInput()); -var check = blessed.checkbox({ +const check = blessed.checkbox({ parent: form2, mouse: true, keys: true, shrink: true, style: { - bg: 'magenta' + bg: "magenta" }, height: 1, left: 28, top: 1, - name: 'check', - content: 'check' + name: "check", + content: "check" }); -var check2 = blessed.checkbox({ +const check2 = blessed.checkbox({ parent: form2, mouse: true, keys: true, shrink: true, style: { - bg: 'magenta' + bg: "magenta" }, height: 1, left: 28, top: 14, - name: 'foooooooo2', - content: 'foooooooo2' + name: "foooooooo2", + content: "foooooooo2" }); -var submit = blessed.button({ +const submit2 = blessed.button({ parent: form2, mouse: true, keys: true, @@ -601,69 +581,67 @@ var submit = blessed.button({ }, left: 29, top: 3, - name: 'submit', - content: 'submit', + name: "submit", + content: "submit", style: { - bg: 'blue', + bg: "blue", focus: { - bg: 'red' + bg: "red" } } }); -submit.on('press', function() { - form2.submit(); -}); +submit.on("press", () => form2.submit()); -var box1 = blessed.box({ +const box5 = blessed.box({ parent: form2, left: 1, top: 10, height: 10, width: 10, - content: 'one', + content: "one", style: { - bg: 'cyan' + bg: "cyan" } }); -var box2 = blessed.box({ - parent: box1, +const box6 = blessed.box({ + parent: box5, left: 1, top: 2, height: 8, width: 9, - content: 'two', + content: "two", style: { - bg: 'magenta' + bg: "magenta" } }); -var box3 = blessed.box({ - parent: box2, +const box7 = blessed.box({ + parent: box6, left: 1, top: 2, height: 6, width: 8, - content: 'three', + content: "three", style: { - bg: 'yellow' + bg: "yellow" } }); -var box4 = blessed.box({ - parent: box3, +blessed.box({ + parent: box7, left: 1, top: 2, height: 4, width: 7, - content: 'four', + content: "four", style: { - bg: 'blue' + bg: "blue" } }); -var output = blessed.scrollabletext({ +const output = blessed.scrollabletext({ parent: form2, mouse: true, keys: true, @@ -672,26 +650,24 @@ var output = blessed.scrollabletext({ height: 5, right: 0, style: { - bg: 'red' + bg: "red" }, - content: 'foobar' + content: "foobar" }); -var bottom = blessed.line({ +const bottom = blessed.line({ parent: form2, - type: 'line', - orientation: 'horizontal', + type: "line", + orientation: "horizontal", left: 0, right: 0, top: 50, style: { - fg: 'blue' + fg: "blue" } }); -screen.key('q', function() { - return screen.destroy(); -}); +screen.key("q", () => screen.destroy()); form2.focus(); @@ -702,70 +678,68 @@ screen.render(); // https://github.com/chjj/blessed/blob/master/test/widget-table.js screen = blessed.screen({ - dump: __dirname + '/logs/table.log', + dump: __dirname + "/logs/table.log", autoPadding: false, fullUnicode: true, warnings: true }); -var DU = '杜'; -var JUAN = '鹃'; +const DU = "杜"; +const JUAN = "鹃"; -var table = blessed.table({ - //parent: screen, - top: 'center', - left: 'center', +const table = blessed.table({ + // parent: screen, + top: "center", + left: "center", data: null, - border: 'line', - align: 'center', + border: "line", + align: "center", tags: true, - //width: '80%', - width: 'shrink', + // width: '80%', + width: "shrink", style: { border: { - fg: 'red' + fg: "red" }, header: { - fg: 'blue', + fg: "blue", bold: true }, cell: { - fg: 'magenta' + fg: "magenta" } } }); -var data1 = [ - [ 'Animals', 'Foods', 'Times' ], - [ 'Elephant', 'Apple', '1:00am' ], - [ 'Bird', 'Orange', '2:15pm' ], - [ 'T-Rex', 'Taco', '8:45am' ], - [ 'Mouse', 'Cheese', '9:05am' ] +const data1 = [ + ["Animals", "Foods", "Times"], + ["Elephant", "Apple", "1:00am"], + ["Bird", "Orange", "2:15pm"], + ["T-Rex", "Taco", "8:45am"], + ["Mouse", "Cheese", "9:05am"] ]; -data1[1][0] = '{red-fg}' + data1[1][0] + '{/red-fg}'; -data1[2][0] += ' (' + DU + JUAN + ')'; +data1[1][0] = `{red-fg} ${data1[1][0]} {/red-fg}`; +data1[2][0] += ` (${DU}${JUAN})`; -var data2 = [ - [ 'Animals', 'Foods', 'Times', 'Numbers' ], - [ 'Elephant', 'Apple', '1:00am', 'One' ], - [ 'Bird', 'Orange', '2:15pm', 'Two' ], - [ 'T-Rex', 'Taco', '8:45am', 'Three' ], - [ 'Mouse', 'Cheese', '9:05am', 'Four' ] +const data2 = [ + ["Animals", "Foods", "Times", "Numbers"], + ["Elephant", "Apple", "1:00am", "One"], + ["Bird", "Orange", "2:15pm", "Two"], + ["T-Rex", "Taco", "8:45am", "Three"], + ["Mouse", "Cheese", "9:05am", "Four"] ]; -data2[1][0] = '{red-fg}' + data2[1][0] + '{/red-fg}'; -data2[2][0] += ' (' + DU + JUAN + ')'; +data2[1][0] = `{red-fg} ${data2[1][0]} {/red-fg}`; +data2[2][0] += ` (${DU}${JUAN})`; -screen.key('q', function() { - return screen.destroy(); -}); +screen.key("q", () => screen.destroy()); table.setData(data2); screen.append(table); screen.render(); -setTimeout(function() { +setTimeout(() => { table.setData(data1); screen.render(); }, 3000); diff --git a/types/blessed/index.d.ts b/types/blessed/index.d.ts index abbc31d295..9098648240 100644 --- a/types/blessed/index.d.ts +++ b/types/blessed/index.d.ts @@ -1,2836 +1,3033 @@ -// Type definitions for blessed 0.1.5 +// Type definitions for blessed 0.1 // Project: https://github.com/chjj/blessed -// Definitions by: bryn austin bellomy +// Definitions by: Bryn Austin Bellomy , Steve Kellock // Definitions: https://github.com/borisyankov/DefinitelyTyped +// TypeScript Version: 2.1 -/// +/// -import { EventEmitter } from 'events'; +import { EventEmitter } from "events"; import * as stream from "stream"; import * as child_process from "child_process"; -declare namespace Blessed { - export class BlessedProgram { - hideCursor: () => void; - move: any; - showCursor: any; - } +export class BlessedProgram { + hideCursor: () => void; + move: any; + showCursor: any; +} - export module Widgets { +export namespace Widgets { + namespace Types { + type TTopLeft = string | number | "center"; - export module Types { + type TPosition = string | number; - export type TTopLeft = string | number | "center"; + type TMouseAction = "mousedown" | "mouseup" | "mousemove"; - export type TPosition = string | number; - - export type TMouseAction = "mousedown" | "mouseup" | "mousemove"; - - export type TStyle = { - type?: string; - bg?: string; - fg?: string; - ch?: string; - bold?: boolean; - underline?: boolean; - blink?: boolean; - inverse?: boolean; - invisible?: boolean; - transparent?: boolean; - border?: "line" | "bg" | TBorder; - hover?: boolean; - focus?: boolean; - label?: string; - track?: {bg?: string; fg?: string;}; - scrollbar?: {bg?: string; fg?: string;}; - } - - export type TBorder = { - /** - * Type of border (line or bg). bg by default. - */ - type?: "line" | "bg"; - /** - * Character to use if bg type, default is space. - */ - ch?: string; - /** - * Border foreground and background, must be numbers (-1 for default). - */ - bg?: number; - fg?: number; - /** - * Border attributes. - */ - bold?: string; - underline?: string; - } - - export type TCursor = { - /** - * Have blessed draw a custom cursor and hide the terminal cursor (experimental). - */ - artificial: boolean; - /** - * Shape of the cursor. Can be: block, underline, or line. - */ - shape: boolean; - /** - * Whether the cursor blinks. - */ - blink: boolean; - /** - * Color of the color. Accepts any valid color value (null is default). - */ - color: string; - } - - export type TAlign = "left" | "center" | "right"; - - export type ListbarCommand = { - key: string; - callback: () => void; - }; - - export type TImage = { - /** - * Pixel width. - */ - width: number; - /** - * Pixel height. - */ - height: number; - /** - * Image bitmap. - * */ - bmp: any; - /** - * Image cellmap (bitmap scaled down to cell size). - */ - cellmap: any; - }; - - export type Cursor = { - /** - * Have blessed draw a custom cursor and hide the terminal cursor (experimental). - */ - artificial: boolean; - /** - * Shape of the cursor. Can be: block, underline, or line. - */ - shape: boolean; - /** - * Whether the cursor blinks. - */ - blink: boolean; - /** - * Color of the color. Accepts any valid color value (null is default). - */ - color: string; - } - } - - export module Events { - - export interface IMouseEventArg { - x: number; - y: number; - action: Types.TMouseAction; - } - - export interface IKeyEventArg { - full: string; - name: string; - shift: boolean; - ctrl: boolean; - meta: boolean; - sequence: string; - } - } - - export interface NodeChildProcessExecOptions { - cwd?: string; - stdio?: any; - customFds?: any; - env?: any; - encoding?: string; - timeout?: number; - maxBuffer?: number; - killSignal?: string; - } - - export interface IDestroyable { - destroy(): void; - } - - export interface IOptions { - } - - export interface IHasOptions { - options: T; - } - - export interface TputsOptions extends IOptions { - terminal?: string; - extended?: boolean; - debug?: boolean; - termcap?: string; - terminfoFile?: string; - terminfoPrefix?: string; - termcapFile?: string; - } - - export class Tput implements IHasOptions { - constructor(opts: TputsOptions); - - // ** properties ** // - - /** - * Original options object. - */ - options: TputsOptions; - - debug: boolean; - padding: boolean; - extended: boolean; - printf: boolean; - termcap: string; - terminfoPrefix: string; - terminfoFile: string; - termcapFile: string; - error: Error; - terminal: string; - - setup(): void; - term(is: any): boolean; - readTerminfo(term: string): string; - parseTerminfo(data: any, file: string): { - header: { - dataSize: number; - headerSize: number; - magicNumber: boolean; - namesSize: number; - boolCount: number; - numCount: number; - strCount: number; - strTableSize: number; - extended: { - dataSize: number; - headerSize: number; - boolCount: number; - numCount: number; - strCount: number; - strTableSize: number; - lastStrTableOffset: number; - } - } - name: string; - names: string[]; - desc: string; - bools: Object; - numbers: Object; - strings: Object; - }; - } - - export interface IDestroyable { - destroy(): void; - } - - export interface INodeOptions extends IOptions { - name?: string; - screen?: Screen; - parent?: Node; - children?: Node[]; - focusable?: boolean; - } - - export abstract class Node extends EventEmitter implements IHasOptions, IDestroyable { - constructor(options: INodeOptions); - - // ** properties ** // - - focusable: boolean; - - /** - * Original options object. - */ - options: INodeOptions; - - /** - * An object for any miscellanous user data. - */ - data: {[index: string]: any;}; - /** - * An object for any miscellanous user data. - */ - _: {[index: string]: any;}; - /** - * An object for any miscellanous user data. - */ - $: {[index: string]: any;}; - /** - * Type of the node (e.g. box). - */ - type: string; - /** - * Render index (document order index) of the last render call. - */ - index: number; - /** - * Parent screen. - */ - screen: Screen; - /** - * Parent node. - */ - parent: Node; - /** - * Array of node's children. - */ - children: Node[]; - - // ** methods ** // - - /** - * Prepend a node to this node's children. - */ - prepend(node: Node): void; - /** - * Append a node to this node's children. - */ - append(node: Node): void; - /** - * Remove child node from node. - */ - remove(node: Node): void; - /** - * Insert a node to this node's children at index i. - */ - insert(node: Node, index: number): void; - /** - * Insert a node to this node's children before the reference node. - */ - insertBefore(node: Node, refNode: Node): void; - /** - * Insert a node from node after the reference node. - */ - insertAfter(node: Node, refNode: Node): void; - /** - * Remove node from its parent. - */ - detach(): void; - /** - * Remove node from its parent. - */ - free(): void; - /** - * Remove node from its parent. - */ - forDescendants(iter: Function, s: any): void; - /** - * Remove node from its parent. - */ - forAncestors(iter: Function, s: any): void; - /** - * Remove node from its parent. - */ - collectDescendants(s: any): void; - /** - * Remove node from its parent. - */ - collectAncestors(s: any): void; - /** - * Remove node from its parent. - */ - emitDescendants(): void; - /** - * Remove node from its parent. - */ - emitAncestors(): void; - /** - * Remove node from its parent. - */ - hasDescendant(target: Node): void; - /** - * Remove node from its parent. - */ - hasAncestor(target: Node): boolean; - /** - * Remove node from its parent. - */ - destroy(): void; - /** - * Emit event for element, and recursively emit same event for all descendants. - */ - emitDescendants(type: string, ...args: any[]): void; - /** - * Get user property with a potential default value. - */ - get(name: string, def: T): T; - /** - * Set user property to value. - */ - set(name: string, value: T): void; - - // ** events ** // - - on(event: string, listener: Function): this; - /** - * Received when node is added to a parent. - */ - on(event: "adopt", callback: (arg: Node) => void): this; - /** - * Received when node is removed from it's current parent. - */ - on(event: "remove", callback: (arg: Node) => void): this; - /** - * Received when node gains a new parent. - */ - on(event: "reparent", callback: (arg: Node) => void): this; - /** - * Received when node is attached to the screen directly or somewhere in its ancestry. - */ - on(event: "attach", callback: (arg: Node) => void): this; - /** - * Received when node is detached from the screen directly or somewhere in its ancestry. - */ - on(event: "detach", callback: (arg: Node) => void): this; - } - - export class NodeWithEvents extends Node { - // ** methods ** // - - /** - * Bind a keypress listener for a specific key. - */ - key(name: string | string[], listener: Function): void; - /** - * Bind a keypress listener for a specific key once. - */ - onceKey(name: string, listener: Function): void; - /** - * Remove a keypress listener for a specific key. - */ - unkey(name: string, listener: Function): void; - removeKey(name: string, listener: Function): void; - - // ** events ** // - - on(event: string, listener: Function): this; - /** - * Received on screen resize. - */ - on(event: "resize", callback: () => void): this; - /** - * Received on mouse events. - */ - on(event: "mouse", callback: (arg: Events.IMouseEventArg) => void): this; - on(event: "mouseout", callback: (arg: Events.IMouseEventArg) => void): this; - on(event: "mouseover", callback: (arg: Events.IMouseEventArg) => void): this; - on(event: "mousedown", callback: (arg: Events.IMouseEventArg) => void): this; - on(event: "mouseup", callback: (arg: Events.IMouseEventArg) => void): this; - on(event: "mousewheel", callback: (arg: Events.IMouseEventArg) => void): this; - on(event: "wheeldown", callback: (arg: Events.IMouseEventArg) => void): this; - on(event: "wheelup", callback: (arg: Events.IMouseEventArg) => void): this; - on(event: "mousemove", callback: (arg: Events.IMouseEventArg) => void): this; - /** - * Received on key events. - */ - on(event: "keypress", callback: (ch: string, key: Events.IKeyEventArg) => void): this; - /** - * Global events received for all elements. - */ - on(event: "element click", callback: (arg: Screen) => void): this; - on(event: "element mouseover", callback: (arg: Screen) => void): this; - on(event: "element mouseout", callback: (arg: Screen) => void): this; - on(event: "element mouseup", callback: (arg: Screen) => void): this; - /** - * Received on key event for [name]. - */ - //on(event: "key", callback: (arg: BlessedScreen) => void): this; - /** - * Received when the terminal window focuses/blurs. Requires a terminal supporting the - * focus protocol and focus needs to be passed to program.enableMouse(). - */ - on(event: "focus", callback: (arg: Screen) => void): this; - /** - * Received when the terminal window focuses/blurs. Requires a terminal supporting the - * focus protocol and focus needs to be passed to program.enableMouse(). - */ - on(event: "blur", callback: (arg: Screen) => void): this; - /** - * Received before render. - */ - on(event: "prerender", callback: () => void): this; - /** - * Received on render. - */ - on(event: "render", callback: () => void): this; - /** - * Received when blessed notices something untoward (output is not a tty, terminfo not found, etc). - */ - on(event: "warning", callback: (text: string) => void): this; - /** - * Received when the screen is destroyed (only useful when using multiple screens). - */ - on(event: "destroy", callback: () => void): this; - /** - * Received when the element is moved. - */ - on(event: "move", callback: () => void): this; - /** - * Element was clicked (slightly smarter than mouseup). - */ - on(event: "click", callback: (arg: Screen) => void): this; - /** - * Received when element is shown. - */ - on(event: "show", callback: () => void): this; - /** - * Received when element becomes hidden. - */ - on(event: "hide", callback: () => void): this; - - on(event: "set content", callback: () => void): this; - on(event: "parsed content", callback: () => void): this; - } - - export interface IScreenOptions extends INodeOptions { - /** - * The blessed Program to be associated with. Will be automatically instantiated if none is provided. - */ - program?: BlessedProgram; - /** - * Attempt to perform CSR optimization on all possible elements (not just full-width ones, elements with - * uniform cells to their sides). This is known to cause flickering with elements that are not full-width, - * however, it is more optimal for terminal rendering. - */ - smartCSR?: boolean; - /** - * Do CSR on any element within 20 cols of the screen edge on either side. Faster than smartCSR, - * but may cause flickering depending on what is on each side of the element. - */ - fastCSR?: boolean; - /** - * Attempt to perform back_color_erase optimizations for terminals that support it. It will also work - * with terminals that don't support it, but only on lines with the default background color. As it - * stands with the current implementation, it's uncertain how much terminal performance this adds at - * the cost of overhead within node. - */ - useBCE?: boolean; - /** - * Amount of time (in ms) to redraw the screen after the terminal is resized (Default: 300). - */ - resizeTimeout?: number; - /** - * The width of tabs within an element's content. - */ - tabSize?: number; - /** - * Automatically position child elements with border and padding in mind (NOTE: this is a recommended - * option. It may become default in the future). - */ - autoPadding?: boolean; - - cursor?: Types.TCursor; - - /** - * Create a log file. See log method. - */ - log?: (...msg: any[]) => void; - /** - * Dump all output and input to desired file. Can be used together with log option if set as a boolean. - */ - dump?: string; - /** - * Debug mode. Enables usage of the debug method. Also creates a debug console which will display when - * pressing F12. It will display all log and debug messages. - */ - debug?: (...msg: string[]) => void; - /** - * Array of keys in their full format (e.g. C-c) to ignore when keys are locked or grabbed. Useful - * for creating a key that will always exit no matter whether the keys are locked. - */ - ignoreLocked?: boolean; - /** - * Automatically "dock" borders with other elements instead of overlapping, depending on position - * (experimental). For example: These border-overlapped elements: - */ - dockBorders?: boolean; - /** - * Normally, dockable borders will not dock if the colors or attributes are different. This option - * will allow them to dock regardless. It may produce some odd looking multi-colored borders though. - */ - ignoreDockContrast?: boolean; - /** - * Allow for rendering of East Asian double-width characters, utf-16 surrogate pairs, and unicode - * combining characters. This allows you to display text above the basic multilingual plane. This - * is behind an option because it may affect performance slightly negatively. Without this option - * enabled, all double-width, surrogate pair, and combining characters will be replaced by '??', - * '?', '' respectively. (NOTE: iTerm2 cannot display combining characters properly. Blessed simply - * removes them from an element's content if iTerm2 is detected). - */ - fullUnicode?: boolean; - /** - * Send focus events after mouse is enabled. - */ - sendFocus?: boolean; - /** - * Display warnings (such as the output not being a TTY, similar to ncurses). - */ - warnings?: boolean; - /** - * Force blessed to use unicode even if it is not detected via terminfo, env variables, or windows code page. - * If value is true unicode is forced. If value is false non-unicode is forced (default: null). - */ - forceUnicode?: boolean; - /** - * Input and output streams. process.stdin/process.stdout by default, however, it could be a - * net.Socket if you want to make a program that runs over telnet or something of that nature. - * */ - input?: stream.Writable; - /** - * Input and output streams. process.stdin/process.stdout by default, however, it could be a - * net.Socket if you want to make a program that runs over telnet or something of that nature. - * */ - output?: stream.Readable; - /** - * The blessed Tput object (only available if you passed tput: true to the Program constructor.) - */ - tput?: Tput; - /** - * Top of the focus history stack. - */ - focused?: BlessedElement; - /** - * Width of the screen (same as program.cols). - */ - width?: Types.TPosition; - /** - * Height of the screen (same as program.rows). - */ - height?: Types.TPosition; - /** - * Same as screen.width. - */ - cols?: number; - /** - * Same as screen.height. - */ - rows?: number; - /** - * Relative top offset, always zero. - */ - top?: Types.TTopLeft; - /** - * Relative left offset, always zero. - */ - left?: Types.TTopLeft; - /** - * Relative right offset, always zero. - */ - right?: Types.TPosition; - /** - * Relative bottom offset, always zero. - */ - bottom?: Types.TPosition; - /** - * Absolute top offset, always zero. - */ - atop?: Types.TTopLeft; - /** - * Absolute left offset, always zero. - */ - aleft?: Types.TTopLeft; - /** - * Absolute right offset, always zero. - */ - aright?: Types.TPosition; - /** - * Absolute bottom offset, always zero. - */ - abottom?: Types.TPosition; - /** - * Whether the focused element grabs all keypresses. - */ - grabKeys?: any; - /** - * Prevent keypresses from being received by any element. - */ - lockKeys?: boolean; - /** - * The currently hovered element. Only set if mouse events are bound. - */ - hover?: any; - /** - * Set or get terminal name. Set calls screen.setTerminal() internally. - */ - terminal?: string; - /** - * Set or get window title. - */ - title?: string; - } - - export class Screen extends NodeWithEvents implements IHasOptions { - constructor(opts: IScreenOptions); - - // ** properties ** // - cleanSides: any; - - /** - * Original options object. - */ - options: IScreenOptions; - - /** - * The blessed Program to be associated with. Will be automatically instantiated if none is provided. - */ - program: BlessedProgram; - /** - * Attempt to perform CSR optimization on all possible elements (not just full-width ones, elements with - * uniform cells to their sides). This is known to cause flickering with elements that are not full-width, - * however, it is more optimal for terminal rendering. - */ - smartCSR: boolean; - /** - * Do CSR on any element within 20 cols of the screen edge on either side. Faster than smartCSR, - * but may cause flickering depending on what is on each side of the element. - */ - fastCSR: boolean; - /** - * Attempt to perform back_color_erase optimizations for terminals that support it. It will also work - * with terminals that don't support it, but only on lines with the default background color. As it - * stands with the current implementation, it's uncertain how much terminal performance this adds at - * the cost of overhead within node. - */ - useBCE: boolean; - /** - * Amount of time (in ms) to redraw the screen after the terminal is resized (Default: 300). - */ - resizeTimeout: number; - /** - * The width of tabs within an element's content. - */ - tabSize: number; - /** - * Automatically position child elements with border and padding in mind (NOTE: this is a recommended - * option. It may become default in the future). - */ - autoPadding: boolean; - - cursor: Types.TCursor; - - /** - * Dump all output and input to desired file. Can be used together with log option if set as a boolean. - */ - dump: string; - /** - * Array of keys in their full format (e.g. C-c) to ignore when keys are locked or grabbed. Useful - * for creating a key that will always exit no matter whether the keys are locked. - */ - ignoreLocked: boolean; - /** - * Automatically "dock" borders with other elements instead of overlapping, depending on position - * (experimental). For example: These border-overlapped elements: - */ - dockBorders: boolean; - /** - * Normally, dockable borders will not dock if the colors or attributes are different. This option - * will allow them to dock regardless. It may produce some odd looking multi-colored borders though. - */ - ignoreDockContrast: boolean; - /** - * Allow for rendering of East Asian double-width characters, utf-16 surrogate pairs, and unicode - * combining characters. This allows you to display text above the basic multilingual plane. This - * is behind an option because it may affect performance slightly negatively. Without this option - * enabled, all double-width, surrogate pair, and combining characters will be replaced by '??', - * '?', '' respectively. (NOTE: iTerm2 cannot display combining characters properly. Blessed simply - * removes them from an element's content if iTerm2 is detected). - */ - fullUnicode: boolean; - /** - * Send focus events after mouse is enabled. - */ - sendFocus: boolean; - /** - * Display warnings (such as the output not being a TTY, similar to ncurses). - */ - warnings: boolean; - /** - * Force blessed to use unicode even if it is not detected via terminfo, env variables, or windows code page. - * If value is true unicode is forced. If value is false non-unicode is forced (default: null). - */ - forceUnicode: boolean; - /** - * Input and output streams. process.stdin/process.stdout by default, however, it could be a - * net.Socket if you want to make a program that runs over telnet or something of that nature. - * */ - input: stream.Writable; - /** - * Input and output streams. process.stdin/process.stdout by default, however, it could be a - * net.Socket if you want to make a program that runs over telnet or something of that nature. - * */ - output: stream.Readable; - /** - * The blessed Tput object (only available if you passed tput: true to the Program constructor.) - */ - tput: Tput; - /** - * Top of the focus history stack. - */ - focused: BlessedElement; - /** - * Width of the screen (same as program.cols). - */ - width: Types.TPosition; - /** - * Height of the screen (same as program.rows). - */ - height: Types.TPosition; - /** - * Same as screen.width. - */ - cols: number; - /** - * Same as screen.height. - */ - rows: number; - /** - * Relative top offset, always zero. - */ - top: Types.TTopLeft; - /** - * Relative left offset, always zero. - */ - left: Types.TTopLeft; - /** - * Relative right offset, always zero. - */ - right: Types.TPosition; - /** - * Relative bottom offset, always zero. - */ - bottom: Types.TPosition; - /** - * Absolute top offset, always zero. - */ - atop: Types.TTopLeft; - /** - * Absolute left offset, always zero. - */ - aleft: Types.TTopLeft; - /** - * Absolute right offset, always zero. - */ - aright: Types.TPosition; - /** - * Absolute bottom offset, always zero. - */ - abottom: Types.TPosition; - /** - * Whether the focused element grabs all keypresses. - */ - grabKeys: any; - /** - * Prevent keypresses from being received by any element. - */ - lockKeys: boolean; - /** - * The currently hovered element. Only set if mouse events are bound. - */ - hover: any; - /** - * Set or get terminal name. Set calls screen.setTerminal() internally. - */ - terminal: string; - /** - * Set or get window title. - */ - title: string; - - // ** methods ** // - - /** - * Write string to the log file if one was created. - */ - log(...msg: any[]): void; - /** - * Same as the log method, but only gets called if the debug option was set. - */ - debug(...msg: string[]): void; - /** - * Allocate a new pending screen buffer and a new output screen buffer. - */ - alloc(): void; - /** - * Reallocate the screen buffers and clear the screen. - */ - realloc(): void; - /** - * Draw the screen based on the contents of the screen buffer. - */ - draw(start: number, end: number): void; - /** - * Render all child elements, writing all data to the screen buffer and drawing the screen. - */ - render(): void; - /** - * Clear any region on the screen. - */ - clearRegion(x1: number, x2: number, y1: number, y2: number): void; - /** - * Fill any region with a character of a certain attribute. - */ - fillRegion(attr: string, ch: string, x1: number, x2: number, y1: number, y2: number): void; - /** - * Focus element by offset of focusable elements. - */ - focusOffset(offset: number): any; - /** - * Focus previous element in the index. - */ - focusPrevious(): void; - /** - * Focus next element in the index. - */ - focusNext(): void; - /** - * Push element on the focus stack (equivalent to screen.focused = el). - */ - focusPush(element: BlessedElement): void; - /** - * Pop element off the focus stack. - */ - focusPop(): BlessedElement; - /** - * Save the focused element. - */ - saveFocus(): BlessedElement; - /** - * Restore the saved focused element. - */ - restoreFocus(): BlessedElement; - /** - * "Rewind" focus to the last visible and attached element. - */ - rewindFocus(): BlessedElement; - /** - * Spawn a process in the foreground, return to blessed app after exit. - */ - spawn(file: string, args: string[], options: NodeChildProcessExecOptions): child_process.ChildProcess; - /** - * Spawn a process in the foreground, return to blessed app after exit. Executes callback on error or exit. - */ - exec(file: string, args: string[], options: NodeChildProcessExecOptions, callback: Function): child_process.ChildProcess; - /** - * Read data from text editor. - */ - readEditor(options: any, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; - readEditor(callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; - /** - * Set effects based on two events and attributes. - */ - setEffects(el: BlessedElement, fel: BlessedElement, over: any, out: any, effects: any, temp: any): void; - /** - * Insert a line into the screen (using csr: this bypasses the output buffer). - */ - insertLine(n: number, y: number, top: number, bottom: number): void; - /** - * Delete a line from the screen (using csr: this bypasses the output buffer). - */ - deleteLine(n: number, y: number, top: number, bottom: number): void; - /** - * Insert a line at the bottom of the screen. - */ - insertBottom(top: number, bottom: number): void; - /** - * Insert a line at the top of the screen. - */ - insertTop(top: number, bottom: number): void; - /** - * Delete a line at the bottom of the screen. - */ - deleteBottom(top: number, bottom: number): void; - /** - * Delete a line at the top of the screen. - */ - deleteTop(top: number, bottom: number): void; - /** - * Enable mouse events for the screen and optionally an element (automatically called when a form of - * on('mouse') is bound). - */ - enableMouse(el: BlessedElement): void; - enableMouse(): void; - /** - * Enable keypress events for the screen and optionally an element (automatically called when a form of - * on('keypress') is bound). - */ - enableKeys(el: BlessedElement): void; - enableKeys(): void; - /** - * Enable key and mouse events. Calls bot enableMouse and enableKeys. - */ - enableInput(el: BlessedElement): void; - enableInput(): void; - /** - * Attempt to copy text to clipboard using iTerm2's proprietary sequence. Returns true if successful. - */ - copyToClipboard(text: string): void; - /** - * Attempt to change cursor shape. Will not work in all terminals (see artificial cursors for a solution - * to this). Returns true if successful. - */ - cursorShape(shape: boolean, blink: boolean): any; - /** - * Attempt to change cursor color. Returns true if successful. - */ - cursorColor(color: string): void; - /** - * Attempt to reset cursor. Returns true if successful. - */ - cursorReset(): void; - /** - * Take an SGR screenshot of the screen within the region. Returns a string containing only - * characters and SGR codes. Can be displayed by simply echoing it in a terminal. - */ - screenshot(xi: number, xl: number, yi: number, yl: number): string; - screenshot(): void; - /** - * Destroy the screen object and remove it from the global list. Also remove all global events relevant - * to the screen object. If all screen objects are destroyed, the node process is essentially reset - * to its initial state. - */ - destroy(): void; - /** - * Reset the terminal to term. Reloads terminfo. - */ - setTerminal(term: string): void; - } - - export interface Padding { - left?: number; - right?: number; - top?: number; - bottom?: number; - } - - export class PositionCoords { - xi: number; - xl: number; - yi: number; - yl: number; - } - - export interface Position { - left: number | string; - right: number | string; - top: number | string; - bottom: number | string; - } - - export interface Border { - /** - * Type of border (line or bg). bg by default. - */ - type?: "line" | "bg"; - /** - * Character to use if bg type, default is space. - */ - ch?: string; - /** - * Border foreground and background, must be numbers (-1 for default). - */ - bg?: number; - fg?: number; - /** - * Border attributes. - */ - bold?: string; - underline?: string; - } - - export interface ElementOptions extends INodeOptions { - tags?: boolean; - - fg?: string; - bg?: string; - bold?: string; - underline?: string; - - style?: any; - /** - * Border object, see below. - */ - border?: Border | "line" | "bg"; - /** - * Element's text content. - */ - content?: string; - /** - * Element is clickable. - */ - clickable?: boolean; - /** - * Element is focusable and can receive key input. - */ - input?: boolean; - keyable?: boolean; - /** - * Element is focused. - */ - focused?: BlessedElement; - /** - * Whether the element is hidden. - */ - hidden?: boolean; - /** - * A simple text label for the element. - */ - label?: string; - /** - * A floating text label for the element which appears on mouseover. - */ - hoverText?: string; - /** - * Text alignment: left, center, or right. - */ - align?: "left" | "center" | "right"; - /** - * Vertical text alignment: top, middle, or bottom. - */ - valign?: "top" | "middle" | "bottom"; - /** - * Shrink/flex/grow to content and child elements. Width/height during render. - */ - shrink?: boolean; - /** - * Amount of padding on the inside of the element. Can be a number or an object containing - * the properties: left, right, top, and bottom. - */ - padding?: number | Padding; - - top?: Types.TTopLeft; - left?: Types.TTopLeft; - right?: Types.TPosition; - bottom?: Types.TPosition; - - /** - * Width/height of the element, can be a number, percentage (0-100%), or keyword (half or shrink). - * Percentages can also have offsets (50%+1, 50%-1). - */ - width?: number | string; - /** - * Offsets of the element relative to its parent. Can be a number, percentage (0-100%), or - * keyword (center). right and bottom do not accept keywords. Percentages can also have - * offsets (50%+1, 50%-1). - */ - height?: number | string; - /** - * Can contain the above options. - */ - position?: Position; - /** - * Whether the element is scrollable or not. - */ - scrollable?: boolean; - /** - * Background character (default is whitespace ). - */ - ch?: string; - /** - * Allow the element to be dragged with the mouse. - */ - draggable?: boolean; - /** - * Draw a translucent offset shadow behind the element. - */ - shadow?: boolean; - } - - export interface Coords { - xl: number; - xi: number; - yl: number; - yi: number; - base: number; - _contentEnd: {x: number; y: number;}; - notop: Types.TTopLeft; - noleft: Types.TTopLeft; - noright: Types.TPosition; - nobot: Types.TPosition; - } - - export interface LabelOptions { - text: string; - side: Types.TAlign; - } - - // TODO: scrollable - Note: If the scrollable option is enabled, Element inherits all methods from ScrollableBox. - export abstract class BlessedElement extends NodeWithEvents implements IHasOptions { - constructor(opts: ElementOptions); - - // ** properties ** // - - /** - * Original options object. - */ - options: ElementOptions; - /** - * Name of the element. Useful for form submission. - */ - name: string; - /** - * Border object. - */ - border: Border; - - style: any; - position: Position; - content: string; - hidden: boolean; - visible: boolean; - detached: boolean; - /** - * Border foreground and background, must be numbers (-1 for default). - */ - bg: number; - fg: number; - /** - * Border attributes. - */ - bold: string; - underline: string; - /** - * Calculated width. - */ - width: number | string; - /** - * Calculated height. - */ - height: number | string; - /** - * Calculated relative top offset.*/ - top: Types.TTopLeft; - /** - * Calculated relative left offset. - */ - left: Types.TTopLeft; - /** - * Calculated relative right offset. - */ - right: Types.TPosition; - /** - * Calculated relative bottom offset. - */ - bottom: Types.TPosition; - /** - * Calculated absolute top offset. - */ - atop: Types.TTopLeft; - /** - * Calculated absolute left offset. - */ - aleft: Types.TTopLeft; - /** - * Calculated absolute right offset. - */ - aright: Types.TPosition; - /** - * Calculated absolute bottom offset. - */ - abottom: Types.TPosition; - - /** - * Whether the element is draggable. Set to true to allow dragging. - */ - draggable: boolean; - - itop: Types.TTopLeft; - ileft: Types.TTopLeft; - iheight: Types.TPosition; - iwidth: Types.TPosition; - - /** - * Calculated relative top offset. - */ - rtop: Types.TTopLeft; - /** - * Calculated relative left offset. - */ - rleft: Types.TTopLeft; - /** - * Calculated relative right offset. - */ - rright: Types.TPosition; - /** - * Calculated relative bottom offset. - */ - rbottom: Types.TPosition; - - lpos: PositionCoords; - - // ** methods ** // - - /** - * Write content and children to the screen buffer. - */ - render(): Coords; - /** - * Hide element.*/ - hide(): void; - /** - * Show element. - */ - show(): void; - /** - * Toggle hidden/shown. - */ - toggle(): void; - /** - * Focus element. - */ - focus(): void; - /** - * Same asel.on('screen', ...) except this will automatically keep track of which listeners - * are bound to the screen object. For use with removeScreenEvent(), free(), and destroy(). - */ - onScreenEvent(type: string, handler: Function): void; - /** - * Same asel.removeListener('screen', ...) except this will automatically keep track of which - * listeners are bound to the screen object. For use with onScreenEvent(), free(), and destroy(). - */ - removeScreenEvent(type: string, handler: Function): void; - /** - * Free up the element. Automatically unbind all events that may have been bound to the screen - * object. This prevents memory leaks. For use with onScreenEvent(), removeScreenEvent(), - * and destroy(). - */ - free(): void; - /** - * Same as the detach() method, except this will automatically call free() and unbind any screen - * events to prevent memory leaks. for use with onScreenEvent(), removeScreenEvent(), and free(). - */ - destroy(): void; - /** - * Set the z-index of the element (changes rendering order). - */ - setIndex(z: number): void; - /** - * Put the element in front of its siblings.*/ - setFront(): void; - /** - * Put the element in back of its siblings. - */ - setBack(): void; - /** - * text/options - Set the label text for the top-left corner. Example options: {text:'foo',side:'left'} - */ - setLabel(arg: string | LabelOptions): void; - /** - * Remove the label completely. - */ - removeLabel(): any; - /** - * text/options - Set a hover text box to follow the cursor. Similar to the "title" DOM attribute - * in the browser. Example options: {text:'foo'} - */ - setHover(arg: string | LabelOptions): void; - /** - * Remove the hover label completely. - */ - removeHover(): void; - /** - * Enable mouse events for the element (automatically called when a form of on('mouse') is bound). - */ - enableMouse(): void; - /** - * Enable keypress events for the element (automatically called when a form of on('keypress') is bound). - */ - enableKeys(): void; - /** - * Enable key and mouse events. Calls bot enableMouse and enableKeys. - */ - enableInput(): void; - /** - * Enable dragging of the element. - */ - enableDrag(): void; - /** - * Disable dragging of the element. - */ - disableDrag(): void; - /** - * Take an SGR screenshot of the screen within the region. Returns a string containing only - * characters and SGR codes. Can be displayed by simply echoing it in a terminal. - */ - screenshot(xi: number, xl: number, yi: number, yl: number): string; - screenshot(): void; - - /* - Content Methods - - Methods for dealing with text content, line by line. Useful for writing a text editor, - irc client, etc. - - Note: All of these methods deal with pre-aligned, pre-wrapped text. If you use deleteTop() - on a box with a wrapped line at the top, it may remove 3-4 "real" lines (rows) depending - on how long the original line was. - - The lines parameter can be a string or an array of strings. The line parameter must - be a string. - */ - - /** - * Set the content. Note: When text is input, it will be stripped of all non-SGR - * escape codes, tabs will be replaced with 8 spaces, and tags will be replaced - * with SGR codes (if enabled). - */ - setContent(text: string): void; - /** - * Return content, slightly different from el.content. Assume the above formatting. - */ - getContent(): string; - /** - * Similar to setContent, but ignore tags and remove escape codes. - */ - setText(text: string): void; - /** - * Similar to getContent, but return content with tags and escape codes removed. - */ - getText(): string; - /** - * Insert a line into the box's content. - */ - insertLine(i: number, lines: string | string[]): void; - /** - * Delete a line from the box's content. - */ - deleteLine(i: number): void; - /** - * Get a line from the box's content. - */ - getLine(i: number): string; - /** - * Get a line from the box's content from the visible top. - */ - getBaseLine(i: number): string; - /** - * Set a line in the box's content. - */ - setLine(i: number, line: string | string[]): void; - /** - * Set a line in the box's content from the visible top. - */ - setBaseLine(i: number, line: string | string[]): void; - /** - * Clear a line from the box's content. - */ - clearLine(i: number): void; - /** - * Clear a line from the box's content from the visible top. - */ - clearBaseLine(i: number): void; - /** - * Insert a line at the top of the box. - */ - insertTop(lines: string | string[]): void; - /** - * Insert a line at the bottom of the box. - */ - insertBottom(lines: string | string[]): void; - /** - * Delete a line at the top of the box. - */ - deleteTop(): void; - /** - * Delete a line at the bottom of the box. - */ - deleteBottom(): void; - /** - * Unshift a line onto the top of the content. - */ - unshiftLine(lines: string | string[]): void; - /** - * Shift a line off the top of the content. - */ - shiftLine(i: number): void; - /** - * Push a line onto the bottom of the content. - */ - pushLine(lines: string | string[]): void; - /** - * Pop a line off the bottom of the content. - */ - popLine(i: number): string; - /** - * An array containing the content lines. - */ - getLines(): string[]; - /** - * An array containing the lines as they are displayed on the screen. - */ - getScreenLines(): string[]; - /** - * Get a string's displayed width, taking into account double-width, surrogate pairs, - * combining characters, tags, and SGR escape codes. - */ - strWidth(text: string): string; - - // ** events ** // - } - - export interface ScrollableBoxOptions extends ElementOptions { - /** - * A limit to the childBase. Default is Infinity. - */ - baseLimit?: number; - /** - * A option which causes the ignoring of childOffset. This in turn causes the - * childBase to change every time the element is scrolled. - */ - alwaysScroll?: boolean; - /** - * Object enabling a scrollbar. - * Style of the scrollbar track if present (takes regular style options). - */ - scrollbar?: { style?: any; track?: any; ch?: string; } - } - - export interface ScrollableTextOptions extends ScrollableBoxOptions { - /** - * Whether to enable automatic mouse support for this element. - * Use pre-defined mouse events (right-click for editor). - */ - mouse?: boolean | (() => void); - /** - * Use pre-defined keys (i or enter for insert, e for editor, C-e for editor while inserting). - */ - keys?: string | string[] | boolean; - /** - * Use vi keys with the keys option. - */ - vi?: boolean; - } - - export interface BoxOptions extends ScrollableTextOptions { - bindings?: any; - } - - /** - * DEPRECATED - Use Box with the scrollable option instead. A box with scrollable content. - */ - export class ScrollableBoxElement extends BlessedElement { - /** - * The offset of the top of the scroll content. - */ - childBase: number; - /** - * The offset of the chosen item/line. - */ - childOffset: number; - - /** - * Scroll the content by a relative offset. - */ - scroll(offset: number, always?: boolean): void; - /** - * Scroll the content to an absolute index. - */ - scrollTo(index: number): void; - /** - * Same as scrollTo. - */ - setScroll(index: number): void; - /** - * Set the current scroll index in percentage (0-100). - */ - setScrollPerc(perc: number): void; - /** - * Get the current scroll index in lines. - */ - getScroll(): number; - /** - * Get the actual height of the scrolling area. - */ - getScrollHeight(): number; - /** - * Get the current scroll index in percentage. - */ - getScrollPerc(): number; - /** - * Reset the scroll index to its initial state. - */ - resetScroll(): void; - - on(event: string, listener: Function): this; - /** - * Received when the element is scrolled. - */ - on(event: "scroll", callback: () => void): this; - } - - /** - * DEPRECATED - Use Box with the scrollable and alwaysScroll options instead. - * A scrollable text box which can display and scroll text, as well as handle - * pre-existing newlines and escape codes. - */ - export class ScrollableTextElement extends ScrollableBoxElement { - } - - /** - * A box element which draws a simple box containing content or other elements. - */ - export class BoxElement extends ScrollableTextElement implements IHasOptions { - constructor(opts: BoxOptions); - - /** - * Original options object. - */ - options: BoxOptions; - } - - export interface TextOptions extends ElementOptions { - /** - * Fill the entire line with chosen bg until parent bg ends, even if there - * is not enough text to fill the entire width. - */ - fill?: boolean; - /** - * Text alignment: left, center, or right. - */ - align?: Types.TAlign; - } - - /** - * An element similar to Box, but geared towards rendering simple text elements. - */ - export class TextElement extends BlessedElement implements IHasOptions { - constructor(opts: TextOptions); - - /** - * Original options object. - */ - options: TextOptions; - } - - /** - * A simple line which can be line or bg styled. - */ - export interface LineOptions extends BoxOptions { - /** - * Can be vertical or horizontal. - */ - orientation?: "vertical" | "horizontal"; - /** - * Treated the same as a border object. (attributes can be contained in style). - */ + interface TStyle { type?: string; bg?: string; fg?: string; ch?: string; + bold?: boolean; + underline?: boolean; + blink?: boolean; + inverse?: boolean; + invisible?: boolean; + transparent?: boolean; + border?: "line" | "bg" | TBorder; + hover?: boolean; + focus?: boolean; + label?: string; + track?: { bg?: string; fg?: string }; + scrollbar?: { bg?: string; fg?: string }; } - /** - * A simple line which can be line or bg styled. - */ - export class LineElement extends BoxElement implements IHasOptions { - constructor(opts: LineOptions); + interface TBorder { + /** + * Type of border (line or bg). bg by default. + */ + type?: "line" | "bg"; /** - * Original options object. - */ - options: LineOptions; + * Character to use if bg type, default is space. + */ + ch?: string; + + /** + * Border foreground and background, must be numbers (-1 for default). + */ + bg?: number; + fg?: number; + + /** + * Border attributes. + */ + bold?: string; + underline?: string; } - export interface BigTextOptions extends BoxOptions { + interface TCursor { /** - * bdf->json font file to use (see ttystudio for instructions on compiling BDFs to JSON). - */ - font?: string; + * Have blessed draw a custom cursor and hide the terminal cursor (experimental). + */ + artificial: boolean; + /** - * bdf->json bold font file to use (see ttystudio for instructions on compiling BDFs to JSON). - */ - fontBold?: string; + * Shape of the cursor. Can be: block, underline, or line. + */ + shape: "block" | "underline" | "line"; + /** - * foreground character. (default: ' ') - */ - fch?: string; + * Whether the cursor blinks. + */ + blink: boolean; + + /** + * Color of the color. Accepts any valid color value (null is default). + */ + color: string; } - /** - * A box which can render content drawn as 8x14 cell characters using the terminus font. - */ - export class BigTextElement extends BoxElement implements IHasOptions { - constructor(opts: BigTextOptions); + type TAlign = "left" | "center" | "right"; - /** - * Original options object. - */ - options: BigTextOptions; + interface ListbarCommand { + key: string; + callback(): void; } - export interface ListElementStyle { - selected?: any; - item?: any; + interface TImage { + /** + * Pixel width. + */ + width: number; + + /** + * Pixel height. + */ + height: number; + + /** + * Image bitmap. + */ + bmp: any; + + /** + * Image cellmap (bitmap scaled down to cell size). + */ + cellmap: any; } - export interface ListOptions extends BoxOptions { + interface Cursor { /** - * Style for a selected item. Style for an unselected item. - */ - style?: TStyle; - /** - * An array of strings which become the list's items. - */ - items?: string[]; - /** - * A function that is called when vi mode is enabled and the key / is pressed. This function accepts a - * callback function which should be called with the search string. The search string is then used to - * jump to an item that is found in items. - */ - search?: () => void; - /** - * Whether the list is interactive and can have items selected (Default: true). - */ - interactive?: boolean; - /** - * Whether to automatically override tags and invert fg of item when selected (Default: true). - */ - invertSelected?: boolean; - } - - export class ListElement extends BoxElement implements IHasOptions> { - constructor(opts: ListOptions); - - /** - * Original options object. - */ - options: ListOptions; - - /** - * Add an item based on a string. - */ - add(text: string): void; - /** - * Add an item based on a string. - */ - addItem(text: string): void; - /** - * Removes an item from the list. Child can be an element, index, or string. - */ - removeItem(child: BlessedElement): BlessedElement; - /** - * Push an item onto the list. - * */ - pushItem(child: BlessedElement): number; - /** - * Pop an item off the list. - * */ - popItem(): BlessedElement; - /** - * Unshift an item onto the list. - */ - unshiftItem(child: BlessedElement): number; - /** - * Shift an item off the list. - * */ - shiftItem(): BlessedElement; - /** - * Inserts an item to the list. Child can be an element, index, or string. - */ - insertItem(i: number, child: BlessedElement): void; - /** - * Returns the item element. Child can be an element, index, or string. - */ - getItem(child: BlessedElement): BlessedElement; - /** - * Set item to content. - */ - setItem(child: BlessedElement, content: BlessedElement | string): void; - /** - * Remove and insert items to the list. - * */ - spliceItem(i: number, n: number, ...items: BlessedElement[]): void; - /** - * Clears all items from the list. - * */ - clearItems(): void; - /** - * Sets the list items to multiple strings. - */ - setItems(items: BlessedElement[]): void; - /** - * Returns the item index from the list. Child can be an element, index, or string. - */ - getItemIndex(child: BlessedElement): number; - /** - * Select an index of an item. - * */ - select(index: number): void; - /** - * Select item based on current offset. - * */ - move(offset: number): void; - /** - * Select item above selected. - * */ - up(amount: number): void; - /** - * Select item below selected. - */ - down(amount: number): void; - /** - * Show/focus list and pick an item. The callback is executed with the result. - */ - pick(callback: () => void): void; - /** - * Find an item based on its text content. - */ - fuzzyFind(arg: string | RegExp | (() => void)): void; - - // ** events ** // + * Have blessed draw a custom cursor and hide the terminal cursor (experimental). + */ + artificial: boolean; - on(event: string, listener: Function): this; - /** - * Received when an item is selected. - */ - on(event: "select", callback: (item: BoxElement, index: number) => void): this; - /** - * List was canceled (when esc is pressed with the keys option). - */ - on(event: "cancel", callback: () => void): this; - /** - * Either a select or a cancel event was received. - */ - on(event: "action", callback: () => void): this; - - on(event: "create item", callback: () => void): this; - on(event: "add item", callback: () => void): this; - on(event: "remove item", callback: () => void): this; - on(event: "insert item", callback: () => void): this; - on(event: "set items", callback: () => void): this; - on(event: "select item", callback: (item: BlessedElement, index: number) => void): this; - } - - export interface FileManagerOptions extends ListOptions { - /** - * Current working directory. - */ - cwd?: string; - } - - export class FileManagerElement extends ListElement implements IHasOptions { - constructor(opts: FileManagerOptions); - - /** - * Original options object. - */ - options: FileManagerOptions; /** - * Current working directory. - */ - cwd: string; + * Shape of the cursor. Can be: block, underline, or line. + */ + shape: boolean; /** - * Refresh the file list (perform a readdir on cwd and update the list items). - */ - refresh(cwd:string, callback: () => void): void; - refresh(callback: () => void): void; - refresh(): void; - /** - * Pick a single file and return the path in the callback. - */ - pick(cwd:string, callback: () => void): void; - pick(callback: () => void): void; - /** - * Reset back to original cwd. - */ - reset(cwd:string, callback: () => void): void; - reset(callback: () => void): void; - reset(): void; - - // ** events ** // - - on(event: string, listener: Function): this; - /** - * Received when an item is selected. - */ - on(event: "cd", callback: (file: string, cwd: string) => void): this; - /** - * Received when an item is selected. - */ - on(event: "file", callback: (file: string) => void): this; - - on(event: "error", callback: (err: any, file: string) => void): this; - on(event: "refresh", callback: () => void): this; - } - - export interface StyleListTable extends ListElementStyle { - /** - * Header style. - */ - header?: any; - /** - * Cell style. - */ - cell?: any; - } - - export interface ListTableOptions extends ListOptions { - /** - * Array of array of strings representing rows. - */ - rows?: string[]; - data?: string[][]; - /** - * Spaces to attempt to pad on the sides of each cell. 2 by default: one space on each side - * (only useful if the width is shrunken). - */ - pad?: number; - /** - * Do not draw inner cells. - */ - noCellBorders?: boolean; - - style?: StyleListTable; - } - - export class ListTableElement extends ListElement implements IHasOptions { - constructor(opts: ListTableOptions); - - /** - * Original options object. - */ - options: ListTableOptions; - - /** - * Set rows in table. Array of arrays of strings. - * @example: - * - * table.setData([ - [ 'Animals', 'Foods' ], - [ 'Elephant', 'Apple' ], - [ 'Bird', 'Orange' ] - ]); - */ - setRows(rows: string[][]): void; - /** - * Set rows in table. Array of arrays of strings. - * @example: - * - * table.setData([ - [ 'Animals', 'Foods' ], - [ 'Elephant', 'Apple' ], - [ 'Bird', 'Orange' ] - ]); - */ - setData(rows: string[][]): void; - } - - export interface ListbarOptions extends BoxOptions { - style?: ListElementStyle; - /** - * Set buttons using an object with keys as titles of buttons, containing of objects - * containing keys of keys and callback. - */ - commands: Types.ListbarCommand[]; - items: Types.ListbarCommand[]; - /** - * Automatically bind list buttons to keys 0-9. - */ - autoCommandKeys: boolean; - } - - export class ListbarElement extends BoxElement implements IHasOptions { - constructor(opts: ListbarOptions); - - /** - * Original options object. - */ - options: ListbarOptions; - - /** - * Set commands (see commands option above). - */ - setItems(commands: Types.ListbarCommand[]): void; - /** - * Append an item to the bar. - */ - add(item: Types.ListbarCommand, callback: () => void): void; - /** - * Append an item to the bar. - */ - addItem(item: Types.ListbarCommand, callback: () => void): void; - /** - * Append an item to the bar. - */ - appendItem(item: Types.ListbarCommand, callback: () => void): void; - /** - * Select an item on the bar. - */ - select(offset: number): void; - /** - * Remove item from the bar. - */ - removeItem(child: BlessedElement): void; - /** - * Move relatively across the bar. - */ - move(offset: number): void; - /** - * Move left relatively across the bar. - */ - moveLeft(offset: number): void; - /** - * Move right relatively across the bar. - */ - moveRight(offset: number): void; - /** - * Select button and execute its callback. - */ - selectTab(index: number): void; - - // ** events ** // - - on(event: string, listener: Function): this; - - on(event: "set items", callback: () => void): this; - on(event: "remove item", callback: () => void): this; - on(event: "select tab", callback: () => void): this; - } - - export interface FormOptions extends BoxOptions { - /** - * Allow default keys (tab, vi keys, enter). - */ - keys?: any; - /** - * Allow vi keys. - */ - vi?: boolean; - } - - export class FormElement extends BoxElement implements IHasOptions { - constructor(opts: FormOptions); - - /** - * Original options object. - */ - options: FormOptions; - /** - * Last submitted data. - */ - submission: TFormData; - - /** - * Focus next form element. - */ - focusNext(): void; - /** - * Focus previous form element. - */ - focusPrevious(): void; - /** - * Submit the form. - */ - submit(): void; - /** - * Discard the form. - */ - cancel(): void; - /** - * Clear the form. - */ - reset(): void; - - // ** events ** // - - on(event: string, listener: Function): this; - /** - * Form is submitted. Receives a data object. - */ - on(event: "submit", callback: (out: TFormData) => void): this; - /** - * Form is discarded. - */ - on(event: "cancel", callback: () => void): this; - /** - * Form is cleared. - */ - on(event: "reset", callback: () => void): this; - } - - export interface InputOptions extends BoxOptions { } - - export abstract class InputElement extends BoxElement { - constructor(opts: InputOptions); - } - - /** - * A box which allows multiline text input. - */ - export interface TextareaOptions extends InputOptions { - /** - * Call readInput() when the element is focused. Automatically unfocus. - */ - inputOnFocus?: boolean; - } - - export class TextareaElement extends InputElement implements IHasOptions { - constructor(opts: TextareaOptions); - - /** - * Original options object. - */ - options: TextareaOptions; - - /** - * The input text. read-only. - */ - value: string; - - /** - * Submit the textarea (emits submit). - */ - submit(): void; - /** - * Cancel the textarea (emits cancel). - */ - cancel(): void; - /** - * Grab key events and start reading text from the keyboard. Takes a callback which receives - * the final value. - */ - readInput(callback?: (err: any, value?: string) => void): void; - /** - * Grab key events and start reading text from the keyboard. Takes a callback which receives - * the final value. - */ - input(callback: (err: any, value?: string) => void): void; - /** - * Grab key events and start reading text from the keyboard. Takes a callback which receives - * the final value. - */ - setInput(callback: (err: any, value?: string) => void): void; - /** - * Open text editor in $EDITOR, read the output from the resulting file. Takes a callback which - * receives the final value. - */ - readEditor(callback: (err: any, value?: string) => void): void; - /** - * Open text editor in $EDITOR, read the output from the resulting file. Takes a callback which - * receives the final value. - */ - editor(callback: (err: any, value?: string) => void): void; - /** - * Open text editor in $EDITOR, read the output from the resulting file. Takes a callback which - * receives the final value. - */ - setEditor(callback: (err: any, value?: string) => void): void; - /** - * The same as this.value, for now. - */ - getValue(): string; - /** - * Clear input. - */ - clearValue(): void; - /** - * Set value. - */ - setValue(text: string): void; - - // ** events ** // - - on(event: string, listener: Function): this; - - on(event: "error", callback: (err: any) => void): this; - - /** - * Value is submitted (enter). - */ - on(event: "submit", callback: (value: any) => void): this; - /** - * Value is discared (escape). - */ - on(event: "cancel", callback: (value: any) => void): this; - /** - * Either submit or cancel. - */ - on(event: "action", callback: (value: any) => void): this; - } - - export interface TextboxOptions extends TextareaOptions { - /** - * Completely hide text. - */ - secret?: boolean; - /** - * Replace text with asterisks (*). - */ - censor?: boolean; - } - - export class TextboxElement extends TextareaElement implements IHasOptions { - constructor(opts: TextboxOptions); - - /** - * Original options object. - */ - options: TextboxOptions; - - /** - * Completely hide text. - */ - secret: boolean; - /** - * Replace text with asterisks (*). - */ - censor: boolean; - } - - export interface ButtonOptions extends BoxOptions { } - - export class ButtonElement extends InputElement implements IHasOptions { - constructor(opts: ButtonOptions); - - /** - * Original options object. - */ - options: ButtonOptions; - - /** - * Press button. Emits press. - */ - press(): void; - - on(event: string, listener: Function): this; - - on(event: "press", callback: () => void): this; - } - - export interface CheckboxOptions extends BoxOptions { - /** - * whether the element is checked or not. - * */ - checked?: boolean; - /** - * enable mouse support. - * */ - mouse?: boolean; - } - - /** - * A checkbox which can be used in a form element. - * */ - export class CheckboxElement extends InputElement implements IHasOptions { - constructor(options?: CheckboxOptions); - - /** - * Original options object. - */ - options: CheckboxOptions; - - /** - * the text next to the checkbox (do not use setcontent, use `check.text = ''`). - * */ - text: string; - /** - * whether the element is checked or not. - * */ - checked: boolean; - /** - * same as `checked`. - * */ - value: boolean; - - /** - * check the element. - * */ - check(): void; - /** - * uncheck the element. - * */ - uncheck(): void; - /** - * toggle checked state. - * */ - toggle(): void; - } - - export interface RadioSetOptions extends BoxOptions { } - - /** - * An element wrapping RadioButtons. RadioButtons within this element will be mutually exclusive - * with each other. - * */ - export abstract class RadioSetElement extends BoxElement { - constructor(opts: RadioSetOptions); - } - - export interface RadioButtonOptions extends BoxOptions { } - - /** - * A radio button which can be used in a form element. - */ - export abstract class RadioButtonElement extends CheckboxElement { - constructor(opts: RadioButtonOptions); - } - - export interface PromptOptions extends BoxOptions { } - - /** - * A prompt box containing a text input, okay, and cancel buttons (automatically hidden). - */ - export class PromptElement extends BoxElement implements IHasOptions { - constructor(opts: PromptOptions); - - options: PromptOptions; - - /** - * Show the prompt and wait for the result of the textbox. Set text and initial value. - */ - input(text: string, value: string, callback: (err: any, value: string) => void): void; - setInput(text: string, value: string, callback: (err: any, value: string) => void): void; - readInput(text: string, value: string, callback: (err: any, value: string) => void): void; - } - - export interface QuestionOptions extends BoxOptions { } - - /** - * A question box containing okay and cancel buttons (automatically hidden). - */ - export class QuestionElement extends BoxElement implements IHasOptions { - constructor(opts: QuestionOptions); - - options: QuestionOptions; - - /** - * Ask a question. callback will yield the result. - */ - ask(question: string, callback: (err: any, value: string) => void): void; - } - - export interface MessageOptions extends BoxOptions { } - - /** - * A box containing a message to be displayed (automatically hidden). - */ - export class MessageElement extends BoxElement implements IHasOptions { - constructor(opts: MessageOptions); - - options: MessageOptions; - - /** - * Display a message for a time (default is 3 seconds). Set time to 0 for a perpetual message that is dismissed on keypress. - */ - log(text: string, time: number, callback: (err: any) => void): void; - log(text: string, callback: (err: any) => void): void; - display(text: string, time: number, callback: (err: any) => void): void; - display(text: string, callback: (err: any) => void): void; - - /** - * Display an error in the same way. - */ - error(text: string, time: number, callback: () => void): void; - error(text: string, callback: () => void): void; - } - - export interface LoadingOptions extends BoxOptions { } - - /** - * A box with a spinning line to denote loading (automatically hidden). - */ - export class LoadingElement extends BoxElement implements IHasOptions { - constructor(opts: LoadingOptions); - - options: LoadingOptions; - - /** - * Display the loading box with a message. Will lock keys until stop is called. - */ - load(text: string): void; - /** - * Hide loading box. Unlock keys. - */ - stop(): void; - } - - export interface ProgressBarOptions extends BoxOptions { - /** - * can be `horizontal` or `vertical`. - * */ - orientation: string; - /** - * the character to fill the bar with (default is space). - * */ - pch: string; - /** - * the amount filled (0 - 100). - * */ - filled: number; - /** - * same as `filled`. - * */ - value: number; - /** - * enable key support. - * */ - keys: boolean; - /** - * enable mouse support. - * */ - mouse: boolean; - } - - /** - * A progress bar allowing various styles. This can also be used as a form input. - */ - export class ProgressBarElement extends InputElement implements IHasOptions { - constructor(options?: ProgressBarOptions); - - options: ProgressBarOptions; - - /** - * progress the bar by a fill amount. - * */ - progress(amount:number): void; - /** - * set progress to specific amount. - * */ - setProgress(amount:number): void; - /** - * reset the bar. - * */ - reset(): void; - - on(event: string, listener: Function): this; - /** - * Bar was reset. - */ - on(event: "reset", callback: () => void): this; - /** - * Bar has completely filled. - */ - on(event: "complete", callback: () => void): this; - } - - export interface LogOptions extends ScrollableTextOptions { - /** - * amount of scrollback allowed. default: Infinity. - * */ - scrollback?: number; - /** - * scroll to bottom on input even if the user has scrolled up. default: false. - * */ - scrollOnInput?: boolean; - } - - /** - * A log permanently scrolled to the bottom. - * */ - export class Log extends ScrollableTextElement implements IHasOptions { - constructor(options?: LogOptions); - - options: LogOptions; - - /** - * amount of scrollback allowed. default: Infinity. - * */ - scrollback: number; - /** - * scroll to bottom on input even if the user has scrolled up. default: false. - * */ - scrollOnInput: boolean; - - /** - * add a log line. - * */ - log(text:string): void; - /** - * add a log line. - * */ - add(text:string): void; - } - - export interface TableOptions extends BoxOptions { - /** - * array of array of strings representing rows (same as `data`). - * */ - rows?: string[][]; - /** - * array of array of strings representing rows (same as `rows`). - * */ - data?: string[][]; - /** - * spaces to attempt to pad on the sides of each cell. `2` by default: one space on each side (only useful if the width is shrunken). - * */ - pad?: number; - /** - * do not draw inner cells. - * */ - noCellBorders?: boolean; - /** - * fill cell borders with the adjacent background color. - * */ - fillCellBorders?: boolean; - } - - /** - * A stylized table of text elements. - * */ - export class TableElement extends BoxElement implements IHasOptions { - constructor(opts: TableOptions); - - options: TableOptions; - - /** - * set rows in table. array of arrays of strings. - * */ - setData(rows: string[][]): void; - /** - * set rows in table. array of arrays of strings. - * */ - setRows(rows: string[][]): void; - } - - export interface TerminalOptions extends BoxOptions { - /** - * handler for input data. - * */ - handler?: (userInput:Buffer) => void; - /** - * name of shell. $SHELL by default. - * */ - shell?:string; - /** - * args for shell. - * */ - args?:any; - /** - * can be line, underline, and block. - * */ - cursor?: 'line'|'underline'|'block'; - - terminal?: string; - - /** - * Object for process env. - */ - env?: any; - } - - export class TerminalElement extends BoxElement implements IHasOptions { - constructor(opts: TerminalOptions); - - options: TerminalOptions; - - /** - * reference to the headless term.js terminal. - * */ - term: any; - /** - * reference to the pty.js pseudo terminal. - * */ - pty: any; - - /** - * write data to the terminal. - * */ - write(data:string): void; - - /** - * nearly identical to `element.screenshot`, however, the specified region includes the terminal's _entire_ scrollback, rather than just what is visible on the screen. - * */ - screenshot(xi?:number, xl?:number, yi?:number, yl?:number): string; - } - - export interface ImageOptions extends BoxOptions { - /** - * path to image. - * */ - file: string; - /** - * path to w3mimgdisplay. if a proper w3mimgdisplay path is not given, blessed will search the entire disk for the binary. - * */ - type: "ansi" | "overlay" | "w3m"; - } - - /** - * Display an image in the terminal (jpeg, png, gif) using w3mimgdisplay. Requires w3m to be installed. X11 required: works in xterm, urxvt, and possibly other terminals. - * */ - export class ImageElement extends BoxElement implements IHasOptions { - constructor(options?: ImageOptions); - - options: ImageOptions; - } - - export interface ANSIImageOptions extends BoxOptions { - /** - * URL or path to PNG/GIF file. Can also be a buffer. - * */ - file: string; - /** - * Scale cellmap down (0-1.0) from its original pixel width/height (Default: 1.0). - * */ - scale: number; - - /** - * This differs from other element's width or height in that only one of them is needed: blessed will maintain the aspect ratio of the image as it scales down to the proper number of cells. NOTE: PNG/GIF's are always automatically shrunken to size (based on scale) if a width or height is not given. - * */ - width: number | string; - height: number | string; - - /** - * Add various "density" ASCII characters over the rendering to give the image more detail, similar to libcaca/libcucul (the library mplayer uses to display videos in the terminal). - */ - ascii: string; - - /** - * Whether to animate if the image is an APNG/animating GIF. If false, only display the first frame or IDAT (Default: true). - */ - animate: boolean; - - /** - * Set the speed of animation. Slower: 0.0-1.0. Faster: 1-1000. It cannot go faster than 1 frame per millisecond, so 1000 is the fastest. (Default: 1.0) - */ - speed: number; - - /** - * mem or cpu. If optimizing for memory, animation frames will be rendered to bitmaps as the animation plays, using less memory. Optimizing for cpu will precompile all bitmaps beforehand, which may be faster, but might also OOM the process on large images. (Default: mem). - */ - optimization: "mem" | "cpu"; - } - - /** - * Convert any .png file (or .gif, see below) to an ANSI image and display it as an element. - * */ - export class ANSIImageElement extends BoxElement implements IHasOptions { - constructor(options?:ANSIImageOptions); - - options: ANSIImageOptions; - - /** - * Image object from the png reader. - */ - img: Types.TImage; - - /** - * set the image in the box to a new path. - * */ - setImage(img: string, callback: () => void): void; - /** - * clear the current image. - * */ - clearImage(callback: () => void): void; - /** - * Play animation if it has been paused or stopped. - */ - play(): void; - /** - * Pause animation. - */ - pause(): void; - /** - * Stop animation. - */ - stop(): void; - } - - export interface OverlayImageOptions extends BoxOptions { - /** - * Path to image. - */ - file: string; - /** - * Render the file as ANSI art instead of using w3m to overlay Internally uses the ANSIImage element. See the ANSIImage element for more information/options. (Default: true). - */ - ansi: boolean; - /** - * Path to w3mimgdisplay. If a proper w3mimgdisplay path is not given, blessed will search the entire disk for the binary. - */ - w3m: string; - /** - * Whether to search /usr, /bin, and /lib for w3mimgdisplay (Default: true). - */ - search: string; - } - - /** - * Convert any .png file (or .gif, see below) to an ANSI image and display it as an element. - * */ - export class OverlayImageElement extends BoxElement implements IHasOptions { - constructor(options?: OverlayImageOptions); - - options: OverlayImageOptions; - - /** - * set the image in the box to a new path. - * */ - setImage(img: string, callback: () => void): void; - /** - * clear the current image. - * */ - clearImage(callback: () => void): void; - /** - * get the size of an image file in pixels. - * */ - imageSize(img:string, callback: () => void): void; - /** - * get the size of the terminal in pixels. - * */ - termSize(callback: () => void): void; - /** - * get the pixel to cell ratio for the terminal. - * */ - getPixelRatio(callback: () => void): void; - } - - export interface VideoOptions extends BoxOptions { - /** - * Video to play. - */ - file: string; - /** - * Start time in seconds. - */ - start: number; - } - - export class VideoElement extends BoxElement implements IHasOptions { - constructor(options?: VideoOptions); - - options: VideoOptions; - - /** - * The terminal element running mplayer or mpv. - */ - tty: any; - } - - export interface LayoutOptions extends ElementOptions { - /** - * A callback which is called right before the children are iterated over to be rendered. Should return an - * iterator callback which is called on each child element: iterator(el, i). - */ - renderer?: () => void; - - /** - * Using the default renderer, it provides two layouts: inline, and grid. inline is the default and will render - * akin to inline-block. grid will create an automatic grid based on element dimensions. The grid cells' - * width and height are always determined by the largest children in the layout. - */ - layout: "inline" | "inline-block" | "grid"; - } - - export class LayoutElement extends BlessedElement implements IHasOptions { - constructor(options?: LayoutOptions); - - options: LayoutOptions; - - /** - * A callback which is called right before the children are iterated over to be rendered. Should return an - * iterator callback which is called on each child element: iterator(el, i). - */ - renderer(coords: PositionCoords): void; - /** - * Check to see if a previous child element has been rendered and is visible on screen. This is only useful - * for checking child elements that have already been attempted to be rendered! see the example below. - */ - isRendered(el: BlessedElement): boolean; - /** - * Get the last rendered and visible child element based on an index. This is useful for basing the position - * of the current child element on the position of the last child element. - */ - getLast(i: number): Element; - /** - * Get the last rendered and visible child element coords based on an index. This is useful for basing the position - * of the current child element on the position of the last child element. See the example below. - */ - getLastCoords(i: number): PositionCoords; - } + * Whether the cursor blinks. + */ + blink: boolean; - export class Program { /** - Wrap the given text in terminal formatting codes corresponding to the given attribute - name. The `attr` string can be of the form `red fg` or `52 bg` where `52` is a 0-255 - integer color number. - */ - text (text:string, attr:string): string; + * Color of the color. Accepts any valid color value (null is default). + */ + color: string; } } - export module widget { - export class Element extends Widgets.BlessedElement { } - export class Node extends Widgets.Node { } - export class Screen extends Widgets.Screen { } + namespace Events { + interface IMouseEventArg { + x: number; + y: number; + action: Types.TMouseAction; + } - export class Box extends Widgets.BoxElement { } - export class ScrollableBox extends Widgets.ScrollableBoxElement { } - export class ScrollableText extends Widgets.ScrollableTextElement { } - export class Text extends Widgets.BoxElement { } - export class Line extends Widgets.LineElement { } - export class BigText extends Widgets.BigTextElement { } - export class List extends Widgets.ListElement { } - export class FileManager extends Widgets.FileManagerElement { } - export class ListTable extends Widgets.ListTableElement { } - export class ListBar extends Widgets.ListbarElement { } - export class Form extends Widgets.FormElement { } - export class Textarea extends Widgets.TextareaElement { } - export class Button extends Widgets.ButtonElement { } - export class Checkbox extends Widgets.CheckboxElement { } - export class RadioSet extends Widgets.RadioSetElement { } - export class RadioButton extends Widgets.RadioButtonElement { } - - export class Prompt extends Widgets.PromptElement { } - export class question extends Widgets.QuestionElement { } - export class Message extends Widgets.MessageElement { } - export class Loading extends Widgets.LoadingElement { } - - export class ProgressBar extends Widgets.ProgressBarElement { } - export class Terminal extends Widgets.TerminalElement { } + interface IKeyEventArg { + full: string; + name: string; + shift: boolean; + ctrl: boolean; + meta: boolean; + sequence: string; + } } - export function screen(options?: Widgets.IScreenOptions): Widgets.Screen; + interface NodeChildProcessExecOptions { + cwd?: string; + stdio?: any; + customFds?: any; + env?: any; + encoding?: string; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + } - export function box(options?: Widgets.BoxOptions): Widgets.BoxElement; - export function text(options?: Widgets.TextOptions): Widgets.TextElement; - export function line(options?: Widgets.LineOptions): Widgets.LineElement; - export function scrollablebox(options?: Widgets.BoxOptions): Widgets.BoxElement; - export function scrollabletext(options?: Widgets.BoxOptions): Widgets.BoxElement; - export function bigtext(options?: Widgets.BigTextOptions): Widgets.BigTextElement; - export function list(options?: Widgets.ListOptions): Widgets.ListElement; - export function filemanager(options?: Widgets.FileManagerOptions): Widgets.FileManagerElement; - export function listtable(options?: Widgets.ListTableOptions): Widgets.ListTableElement; - export function listbar(options?: Widgets.ListbarOptions): Widgets.ListbarElement; - export function form(options?: Widgets.FormOptions): Widgets.FormElement; - export function input(options?: Widgets.InputOptions): Widgets.InputElement; - export function textarea(options?: Widgets.TextareaOptions): Widgets.TextareaElement; - export function textbox(options?: Widgets.TextboxOptions): Widgets.TextboxElement; - export function button(options?: Widgets.ButtonOptions): Widgets.ButtonElement; - export function checkbox(options?: Widgets.CheckboxOptions): Widgets.CheckboxElement; - export function radioset(options?: Widgets.RadioSetOptions): Widgets.RadioSetElement; - export function radiobutton(options?: Widgets.RadioButtonOptions): Widgets.RadioButtonElement; + interface IDestroyable { + destroy(): void; + } - export function table(options?: Widgets.TableOptions): Widgets.TableElement; + interface IOptions {} - export function prompt(options?: Widgets.PromptOptions): Widgets.PromptElement; - export function question(options?: Widgets.QuestionOptions): Widgets.QuestionElement; - export function message(options?: Widgets.MessageOptions): Widgets.MessageElement; - export function loading(options?: Widgets.LoadingOptions): Widgets.LoadingElement; + interface IHasOptions { + options: T; + } - export function progressbar(options?: Widgets.ProgressBarOptions): Widgets.ProgressBarElement; - export function terminal(options?: Widgets.TerminalOptions): Widgets.TerminalElement; + interface TputsOptions extends IOptions { + terminal?: string; + extended?: boolean; + debug?: boolean; + termcap?: string; + terminfoFile?: string; + terminfoPrefix?: string; + termcapFile?: string; + } - export function layout(options?: Widgets.LayoutOptions): Widgets.LayoutElement; + class Tput implements IHasOptions { + constructor(opts: TputsOptions); - export function escape(item: any): any; - export const colors: { - match: (hexColor: string) => string + /** + * Original options object. + */ + options: TputsOptions; + + debug: boolean; + padding: boolean; + extended: boolean; + printf: boolean; + termcap: string; + terminfoPrefix: string; + terminfoFile: string; + termcapFile: string; + error: Error; + terminal: string; + + setup(): void; + term(is: any): boolean; + readTerminfo(term: string): string; + parseTerminfo( + data: any, + file: string + ): { + header: { + dataSize: number; + headerSize: number; + magicNumber: boolean; + namesSize: number; + boolCount: number; + numCount: number; + strCount: number; + strTableSize: number; + extended: { + dataSize: number; + headerSize: number; + boolCount: number; + numCount: number; + strCount: number; + strTableSize: number; + lastStrTableOffset: number; + }; + }; + name: string; + names: string[]; + desc: string; + bools: any; + numbers: any; + strings: any; + }; + } + + interface IDestroyable { + destroy(): void; + } + + interface INodeOptions extends IOptions { + name?: string; + screen?: Screen; + parent?: Node; + children?: Node[]; + focusable?: boolean; + } + + type NodeEventType = + /** Received when node is added to a parent. */ + | "adopt" + /** Received when node is removed from it's current parent. */ + | "remove" + /** Received when node gains a new parent. */ + | "reparent" + /** Received when node is attached to the screen directly or somewhere in its ancestry. */ + | "attach" + /** Received when node is detached from the screen directly or somewhere in its ancestry. */ + | "detach"; + + abstract class Node extends EventEmitter implements IHasOptions, IDestroyable { + constructor(options: INodeOptions); + + focusable: boolean; + + /** + * Original options object. + */ + options: INodeOptions; + + /** + * An object for any miscellanous user data. + */ + data: { [index: string]: any }; + + /** + * An object for any miscellanous user data. + */ + _: { [index: string]: any }; + + /** + * An object for any miscellanous user data. + */ + $: { [index: string]: any }; + + /** + * Type of the node (e.g. box). + */ + type: string; + + /** + * Render index (document order index) of the last render call. + */ + index: number; + + /** + * Parent screen. + */ + screen: Screen; + + /** + * Parent node. + */ + parent: Node; + + /** + * Array of node's children. + */ + children: Node[]; + + /** + * Prepend a node to this node's children. + */ + prepend(node: Node): void; + + /** + * Append a node to this node's children. + */ + append(node: Node): void; + + /** + * Remove child node from node. + */ + remove(node: Node): void; + + /** + * Insert a node to this node's children at index i. + */ + insert(node: Node, index: number): void; + + /** + * Insert a node to this node's children before the reference node. + */ + insertBefore(node: Node, refNode: Node): void; + + /** + * Insert a node from node after the reference node. + */ + insertAfter(node: Node, refNode: Node): void; + + /** + * Remove node from its parent. + */ + detach(): void; + free(): void; + forDescendants(iter: (node: Node) => void, s: any): void; + forAncestors(iter: (node: Node) => void, s: any): void; + collectDescendants(s: any): void; + collectAncestors(s: any): void; + + /** + * Emit event for element, and recursively emit same event for all descendants. + */ + emitDescendants(type?: string, ...args: any[]): void; + emitAncestors(): void; + hasDescendant(target: Node): void; + hasAncestor(target: Node): boolean; + destroy(): void; + + /** + * Get user property with a potential default value. + */ + get(name: string, def: T): T; + + /** + * Set user property to value. + */ + set(name: string, value: any): void; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: NodeEventType, callback: (arg: Node) => void): this; + } + + type NodeScreenEventType = + /** + * Received when the terminal window focuses/blurs. Requires a terminal supporting the + * focus protocol and focus needs to be passed to program.enableMouse(). + */ + | "focus" + /** + * Received when the terminal window focuses/blurs. Requires a terminal supporting the + * focus protocol and focus needs to be passed to program.enableMouse(). + */ + | "blur" + /** + * Element was clicked (slightly smarter than mouseup). + */ + | "click" + | "element click" + | "element mouseover" + | "element mouseout" + | "element mouseup"; + + type NodeMouseEventType = + | "mouse" + | "mouseout" + | "mouseover" + | "mousedown" + | "mouseup" + | "mousewheel" + | "wheeldown" + | "wheelup" + | "mousemove"; + + type NodeGenericEventType = + /** Received on screen resize. */ + | "resize" + /** Received before render. */ + | "prerender" + /** Received on render. */ + | "render" + /** Received when the screen is destroyed (only useful when using multiple screens). */ + | "destroy" + /** Received when the element is moved. */ + | "move" + /** Received when element is shown. */ + | "show" + /** Received when element becomes hidden. */ + | "hide" + | "set content" + | "parsed content"; + + class NodeWithEvents extends Node { + /** + * Bind a keypress listener for a specific key. + */ + key(name: string | string[], listener: (ch: any, key: Events.IKeyEventArg) => void): void; + + /** + * Bind a keypress listener for a specific key once. + */ + onceKey(name: string, listener: (ch: any, key: Events.IKeyEventArg) => void): void; + + /** + * Remove a keypress listener for a specific key. + */ + unkey(name: string, listener: (ch: any, key: Events.IKeyEventArg) => void): void; + removeKey(name: string, listener: (ch: any, key: Events.IKeyEventArg) => void): void; + + on(event: string, listener: (ch: any, key: Events.IKeyEventArg) => void): this; + /** Received on mouse events. */ + on(event: NodeMouseEventType, callback: (arg: Events.IMouseEventArg) => void): this; + /** Received on key events. */ + on(event: "keypress", callback: (ch: string, key: Events.IKeyEventArg) => void): this; + on(event: NodeScreenEventType, callback: (arg: Screen) => void): this; + /** Received when blessed notices something untoward (output is not a tty, terminfo not found, etc). */ + on(event: "warning", callback: (text: string) => void): this; + on(event: NodeGenericEventType, callback: () => void): this; + } + + interface IScreenOptions extends INodeOptions { + /** + * The blessed Program to be associated with. Will be automatically instantiated if none is provided. + */ + program?: BlessedProgram; + + /** + * Attempt to perform CSR optimization on all possible elements (not just full-width ones, elements with + * uniform cells to their sides). This is known to cause flickering with elements that are not full-width, + * however, it is more optimal for terminal rendering. + */ + smartCSR?: boolean; + + /** + * Do CSR on any element within 20 cols of the screen edge on either side. Faster than smartCSR, + * but may cause flickering depending on what is on each side of the element. + */ + fastCSR?: boolean; + + /** + * Attempt to perform back_color_erase optimizations for terminals that support it. It will also work + * with terminals that don't support it, but only on lines with the default background color. As it + * stands with the current implementation, it's uncertain how much terminal performance this adds at + * the cost of overhead within node. + */ + useBCE?: boolean; + + /** + * Amount of time (in ms) to redraw the screen after the terminal is resized (Default: 300). + */ + resizeTimeout?: number; + + /** + * The width of tabs within an element's content. + */ + tabSize?: number; + + /** + * Automatically position child elements with border and padding in mind (NOTE: this is a recommended + * option. It may become default in the future). + */ + autoPadding?: boolean; + + cursor?: Types.TCursor; + + /** + * Create a log file. See log method. + */ + log?(...msg: any[]): void; + + /** + * Dump all output and input to desired file. Can be used together with log option if set as a boolean. + */ + dump?: string; + + /** + * Debug mode. Enables usage of the debug method. Also creates a debug console which will display when + * pressing F12. It will display all log and debug messages. + */ + debug?(...msg: string[]): void; + + /** + * Array of keys in their full format (e.g. C-c) to ignore when keys are locked or grabbed. Useful + * for creating a key that will always exit no matter whether the keys are locked. + */ + ignoreLocked?: boolean; + + /** + * Automatically "dock" borders with other elements instead of overlapping, depending on position + * (experimental). For example: These border-overlapped elements: + */ + dockBorders?: boolean; + + /** + * Normally, dockable borders will not dock if the colors or attributes are different. This option + * will allow them to dock regardless. It may produce some odd looking multi-colored borders though. + */ + ignoreDockContrast?: boolean; + + /** + * Allow for rendering of East Asian double-width characters, utf-16 surrogate pairs, and unicode + * combining characters. This allows you to display text above the basic multilingual plane. This + * is behind an option because it may affect performance slightly negatively. Without this option + * enabled, all double-width, surrogate pair, and combining characters will be replaced by '??', + * '?', '' respectively. (NOTE: iTerm2 cannot display combining characters properly. Blessed simply + * removes them from an element's content if iTerm2 is detected). + */ + fullUnicode?: boolean; + + /** + * Send focus events after mouse is enabled. + */ + sendFocus?: boolean; + + /** + * Display warnings (such as the output not being a TTY, similar to ncurses). + */ + warnings?: boolean; + + /** + * Force blessed to use unicode even if it is not detected via terminfo, env variables, or windows code page. + * If value is true unicode is forced. If value is false non-unicode is forced (default: null). + */ + forceUnicode?: boolean; + + /** + * Input and output streams. process.stdin/process.stdout by default, however, it could be a + * net.Socket if you want to make a program that runs over telnet or something of that nature. + */ + input?: stream.Writable; + + /** + * Input and output streams. process.stdin/process.stdout by default, however, it could be a + * net.Socket if you want to make a program that runs over telnet or something of that nature. + */ + output?: stream.Readable; + + /** + * The blessed Tput object (only available if you passed tput: true to the Program constructor.) + */ + tput?: Tput; + + /** + * Top of the focus history stack. + */ + focused?: BlessedElement; + + /** + * Width of the screen (same as program.cols). + */ + width?: Types.TPosition; + + /** + * Height of the screen (same as program.rows). + */ + height?: Types.TPosition; + + /** + * Same as screen.width. + */ + cols?: number; + + /** + * Same as screen.height. + */ + rows?: number; + + /** + * Relative top offset, always zero. + */ + top?: Types.TTopLeft; + + /** + * Relative left offset, always zero. + */ + left?: Types.TTopLeft; + + /** + * Relative right offset, always zero. + */ + right?: Types.TPosition; + + /** + * Relative bottom offset, always zero. + */ + bottom?: Types.TPosition; + + /** + * Absolute top offset, always zero. + */ + atop?: Types.TTopLeft; + + /** + * Absolute left offset, always zero. + */ + aleft?: Types.TTopLeft; + + /** + * Absolute right offset, always zero. + */ + aright?: Types.TPosition; + + /** + * Absolute bottom offset, always zero. + */ + abottom?: Types.TPosition; + + /** + * Whether the focused element grabs all keypresses. + */ + grabKeys?: any; + + /** + * Prevent keypresses from being received by any element. + */ + lockKeys?: boolean; + + /** + * The currently hovered element. Only set if mouse events are bound. + */ + hover?: any; + + /** + * Set or get terminal name. Set calls screen.setTerminal() internally. + */ + terminal?: string; + + /** + * Set or get window title. + */ + title?: string; + } + + class Screen extends NodeWithEvents implements IHasOptions { + constructor(opts: IScreenOptions); + + cleanSides: any; + + /** + * Original options object. + */ + options: IScreenOptions; + + /** + * The blessed Program to be associated with. Will be automatically instantiated if none is provided. + */ + program: BlessedProgram; + + /** + * Attempt to perform CSR optimization on all possible elements (not just full-width ones, elements with + * uniform cells to their sides). This is known to cause flickering with elements that are not full-width, + * however, it is more optimal for terminal rendering. + */ + smartCSR: boolean; + + /** + * Do CSR on any element within 20 cols of the screen edge on either side. Faster than smartCSR, + * but may cause flickering depending on what is on each side of the element. + */ + fastCSR: boolean; + + /** + * Attempt to perform back_color_erase optimizations for terminals that support it. It will also work + * with terminals that don't support it, but only on lines with the default background color. As it + * stands with the current implementation, it's uncertain how much terminal performance this adds at + * the cost of overhead within node. + */ + useBCE: boolean; + + /** + * Amount of time (in ms) to redraw the screen after the terminal is resized (Default: 300). + */ + resizeTimeout: number; + + /** + * The width of tabs within an element's content. + */ + tabSize: number; + + /** + * Automatically position child elements with border and padding in mind (NOTE: this is a recommended + * option. It may become default in the future). + */ + autoPadding: boolean; + + cursor: Types.TCursor; + + /** + * Dump all output and input to desired file. Can be used together with log option if set as a boolean. + */ + dump: string; + + /** + * Array of keys in their full format (e.g. C-c) to ignore when keys are locked or grabbed. Useful + * for creating a key that will always exit no matter whether the keys are locked. + */ + ignoreLocked: boolean; + + /** + * Automatically "dock" borders with other elements instead of overlapping, depending on position + * (experimental). For example: These border-overlapped elements: + */ + dockBorders: boolean; + + /** + * Normally, dockable borders will not dock if the colors or attributes are different. This option + * will allow them to dock regardless. It may produce some odd looking multi-colored borders though. + */ + ignoreDockContrast: boolean; + + /** + * Allow for rendering of East Asian double-width characters, utf-16 surrogate pairs, and unicode + * combining characters. This allows you to display text above the basic multilingual plane. This + * is behind an option because it may affect performance slightly negatively. Without this option + * enabled, all double-width, surrogate pair, and combining characters will be replaced by '??', + * '?', '' respectively. (NOTE: iTerm2 cannot display combining characters properly. Blessed simply + * removes them from an element's content if iTerm2 is detected). + */ + fullUnicode: boolean; + + /** + * Send focus events after mouse is enabled. + */ + sendFocus: boolean; + + /** + * Display warnings (such as the output not being a TTY, similar to ncurses). + */ + warnings: boolean; + + /** + * Force blessed to use unicode even if it is not detected via terminfo, env variables, or windows code page. + * If value is true unicode is forced. If value is false non-unicode is forced (default: null). + */ + forceUnicode: boolean; + + /** + * Input and output streams. process.stdin/process.stdout by default, however, it could be a + * net.Socket if you want to make a program that runs over telnet or something of that nature. + */ + input: stream.Writable; + + /** + * Input and output streams. process.stdin/process.stdout by default, however, it could be a + * net.Socket if you want to make a program that runs over telnet or something of that nature. + */ + output: stream.Readable; + + /** + * The blessed Tput object (only available if you passed tput: true to the Program constructor.) + */ + tput: Tput; + + /** + * Top of the focus history stack. + */ + focused: BlessedElement; + + /** + * Width of the screen (same as program.cols). + */ + width: Types.TPosition; + + /** + * Height of the screen (same as program.rows). + */ + height: Types.TPosition; + + /** + * Same as screen.width. + */ + cols: number; + + /** + * Same as screen.height. + */ + rows: number; + + /** + * Relative top offset, always zero. + */ + top: Types.TTopLeft; + + /** + * Relative left offset, always zero. + */ + left: Types.TTopLeft; + + /** + * Relative right offset, always zero. + */ + right: Types.TPosition; + + /** + * Relative bottom offset, always zero. + */ + bottom: Types.TPosition; + + /** + * Absolute top offset, always zero. + */ + atop: Types.TTopLeft; + + /** + * Absolute left offset, always zero. + */ + aleft: Types.TTopLeft; + + /** + * Absolute right offset, always zero. + */ + aright: Types.TPosition; + + /** + * Absolute bottom offset, always zero. + */ + abottom: Types.TPosition; + + /** + * Whether the focused element grabs all keypresses. + */ + grabKeys: any; + + /** + * Prevent keypresses from being received by any element. + */ + lockKeys: boolean; + + /** + * The currently hovered element. Only set if mouse events are bound. + */ + hover: any; + + /** + * Set or get terminal name. Set calls screen.setTerminal() internally. + */ + terminal: string; + + /** + * Set or get window title. + */ + title: string; + + /** + * Write string to the log file if one was created. + */ + log(...msg: any[]): void; + + /** + * Same as the log method, but only gets called if the debug option was set. + */ + debug(...msg: string[]): void; + + /** + * Allocate a new pending screen buffer and a new output screen buffer. + */ + alloc(): void; + + /** + * Reallocate the screen buffers and clear the screen. + */ + realloc(): void; + + /** + * Draw the screen based on the contents of the screen buffer. + */ + draw(start: number, end: number): void; + + /** + * Render all child elements, writing all data to the screen buffer and drawing the screen. + */ + render(): void; + + /** + * Clear any region on the screen. + */ + clearRegion(x1: number, x2: number, y1: number, y2: number): void; + + /** + * Fill any region with a character of a certain attribute. + */ + fillRegion(attr: string, ch: string, x1: number, x2: number, y1: number, y2: number): void; + + /** + * Focus element by offset of focusable elements. + */ + focusOffset(offset: number): any; + + /** + * Focus previous element in the index. + */ + focusPrevious(): void; + + /** + * Focus next element in the index. + */ + focusNext(): void; + + /** + * Push element on the focus stack (equivalent to screen.focused = el). + */ + focusPush(element: BlessedElement): void; + + /** + * Pop element off the focus stack. + */ + focusPop(): BlessedElement; + + /** + * Save the focused element. + */ + saveFocus(): BlessedElement; + + /** + * Restore the saved focused element. + */ + restoreFocus(): BlessedElement; + + /** + * "Rewind" focus to the last visible and attached element. + */ + rewindFocus(): BlessedElement; + + /** + * Spawn a process in the foreground, return to blessed app after exit. + */ + spawn(file: string, args: string[], options: NodeChildProcessExecOptions): child_process.ChildProcess; + + /** + * Spawn a process in the foreground, return to blessed app after exit. Executes callback on error or exit. + */ + exec( + file: string, + args: string[], + options: NodeChildProcessExecOptions, + callback: (...args: any[]) => void + ): child_process.ChildProcess; + + /** + * Read data from text editor. + */ + readEditor(options: any, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; + readEditor(callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; + + /** + * Set effects based on two events and attributes. + */ + setEffects(el: BlessedElement, fel: BlessedElement, over: any, out: any, effects: any, temp: any): void; + + /** + * Insert a line into the screen (using csr: this bypasses the output buffer). + */ + insertLine(n: number, y: number, top: number, bottom: number): void; + + /** + * Delete a line from the screen (using csr: this bypasses the output buffer). + */ + deleteLine(n: number, y: number, top: number, bottom: number): void; + + /** + * Insert a line at the bottom of the screen. + */ + insertBottom(top: number, bottom: number): void; + + /** + * Insert a line at the top of the screen. + */ + insertTop(top: number, bottom: number): void; + + /** + * Delete a line at the bottom of the screen. + */ + deleteBottom(top: number, bottom: number): void; + + /** + * Delete a line at the top of the screen. + */ + deleteTop(top: number, bottom: number): void; + + /** + * Enable mouse events for the screen and optionally an element (automatically called when a form of + * on('mouse') is bound). + */ + enableMouse(el?: BlessedElement): void; + + /** + * Enable keypress events for the screen and optionally an element (automatically called when a form of + * on('keypress') is bound). + */ + enableKeys(el?: BlessedElement): void; + + /** + * Enable key and mouse events. Calls bot enableMouse and enableKeys. + */ + enableInput(el?: BlessedElement): void; + + /** + * Attempt to copy text to clipboard using iTerm2's proprietary sequence. Returns true if successful. + */ + copyToClipboard(text: string): void; + + /** + * Attempt to change cursor shape. Will not work in all terminals (see artificial cursors for a solution + * to this). Returns true if successful. + */ + cursorShape(shape: boolean, blink: boolean): any; + + /** + * Attempt to change cursor color. Returns true if successful. + */ + cursorColor(color: string): void; + + /** + * Attempt to reset cursor. Returns true if successful. + */ + cursorReset(): void; + + /** + * Take an SGR screenshot of the screen within the region. Returns a string containing only + * characters and SGR codes. Can be displayed by simply echoing it in a terminal. + */ + screenshot(xi: number, xl: number, yi: number, yl: number): string; + screenshot(): void; + + /** + * Destroy the screen object and remove it from the global list. Also remove all global events relevant + * to the screen object. If all screen objects are destroyed, the node process is essentially reset + * to its initial state. + */ + destroy(): void; + + /** + * Reset the terminal to term. Reloads terminfo. + */ + setTerminal(term: string): void; + } + + interface Padding { + left?: number; + right?: number; + top?: number; + bottom?: number; + } + + class PositionCoords { + xi: number; + xl: number; + yi: number; + yl: number; + } + + interface Position { + left: number | string; + right: number | string; + top: number | string; + bottom: number | string; + } + + interface Border { + /** + * Type of border (line or bg). bg by default. + */ + type?: "line" | "bg"; + + /** + * Character to use if bg type, default is space. + */ + ch?: string; + + /** + * Border foreground and background, must be numbers (-1 for default). + */ + bg?: number; + fg?: number; + + /** + * Border attributes. + */ + bold?: string; + underline?: string; + } + + interface ElementOptions extends INodeOptions { + tags?: boolean; + + fg?: string; + bg?: string; + bold?: string; + underline?: string; + + style?: any; + + /** + * Border object, see below. + */ + border?: Border | "line" | "bg"; + + /** + * Element's text content. + */ + content?: string; + + /** + * Element is clickable. + */ + clickable?: boolean; + + /** + * Element is focusable and can receive key input. + */ + input?: boolean; + keyable?: boolean; + + /** + * Element is focused. + */ + focused?: BlessedElement; + + /** + * Whether the element is hidden. + */ + hidden?: boolean; + + /** + * A simple text label for the element. + */ + label?: string; + + /** + * A floating text label for the element which appears on mouseover. + */ + hoverText?: string; + + /** + * Text alignment: left, center, or right. + */ + align?: "left" | "center" | "right"; + + /** + * Vertical text alignment: top, middle, or bottom. + */ + valign?: "top" | "middle" | "bottom"; + + /** + * Shrink/flex/grow to content and child elements. Width/height during render. + */ + shrink?: boolean; + + /** + * Amount of padding on the inside of the element. Can be a number or an object containing + * the properties: left, right, top, and bottom. + */ + padding?: number | Padding; + + top?: Types.TTopLeft; + left?: Types.TTopLeft; + right?: Types.TPosition; + bottom?: Types.TPosition; + + /** + * Width/height of the element, can be a number, percentage (0-100%), or keyword (half or shrink). + * Percentages can also have offsets (50%+1, 50%-1). + */ + width?: number | string; + + /** + * Offsets of the element relative to its parent. Can be a number, percentage (0-100%), or + * keyword (center). right and bottom do not accept keywords. Percentages can also have + * offsets (50%+1, 50%-1). + */ + height?: number | string; + + /** + * Can contain the above options. + */ + position?: Position; + + /** + * Whether the element is scrollable or not. + */ + scrollable?: boolean; + + /** + * Background character (default is whitespace ). + */ + ch?: string; + + /** + * Allow the element to be dragged with the mouse. + */ + draggable?: boolean; + + /** + * Draw a translucent offset shadow behind the element. + */ + shadow?: boolean; + } + + interface Coords { + xl: number; + xi: number; + yl: number; + yi: number; + base: number; + _contentEnd: { x: number; y: number }; + notop: Types.TTopLeft; + noleft: Types.TTopLeft; + noright: Types.TPosition; + nobot: Types.TPosition; + } + + interface LabelOptions { + text: string; + side: Types.TAlign; + } + + // TODO: scrollable - Note: If the scrollable option is enabled, Element inherits all methods from ScrollableBox. + abstract class BlessedElement extends NodeWithEvents implements IHasOptions { + constructor(opts: ElementOptions); + + /** + * Original options object. + */ + options: ElementOptions; + + /** + * Name of the element. Useful for form submission. + */ + name: string; + + /** + * Border object. + */ + border: Border; + + style: any; + position: Position; + content: string; + hidden: boolean; + visible: boolean; + detached: boolean; + + /** + * Border foreground and background, must be numbers (-1 for default). + */ + bg: number; + fg: number; + + /** + * Border attributes. + */ + bold: string; + underline: string; + + /** + * Calculated width. + */ + width: number | string; + + /** + * Calculated height. + */ + height: number | string; + + /** + * Calculated relative top offset. + */ + top: Types.TTopLeft; + + /** + * Calculated relative left offset. + */ + left: Types.TTopLeft; + + /** + * Calculated relative right offset. + */ + right: Types.TPosition; + + /** + * Calculated relative bottom offset. + */ + bottom: Types.TPosition; + + /** + * Calculated absolute top offset. + */ + atop: Types.TTopLeft; + + /** + * Calculated absolute left offset. + */ + aleft: Types.TTopLeft; + + /** + * Calculated absolute right offset. + */ + aright: Types.TPosition; + + /** + * Calculated absolute bottom offset. + */ + abottom: Types.TPosition; + + /** + * Whether the element is draggable. Set to true to allow dragging. + */ + draggable: boolean; + + itop: Types.TTopLeft; + ileft: Types.TTopLeft; + iheight: Types.TPosition; + iwidth: Types.TPosition; + + /** + * Calculated relative top offset. + */ + rtop: Types.TTopLeft; + + /** + * Calculated relative left offset. + */ + rleft: Types.TTopLeft; + + /** + * Calculated relative right offset. + */ + rright: Types.TPosition; + + /** + * Calculated relative bottom offset. + */ + rbottom: Types.TPosition; + + lpos: PositionCoords; + + /** + * Write content and children to the screen buffer. + */ + render(): Coords; + + /** + * Hide element. + */ + hide(): void; + + /** + * Show element. + */ + show(): void; + + /** + * Toggle hidden/shown. + */ + toggle(): void; + + /** + * Focus element. + */ + focus(): void; + + /** + * Same asel.on('screen', ...) except this will automatically keep track of which listeners + * are bound to the screen object. For use with removeScreenEvent(), free(), and destroy(). + */ + onScreenEvent(type: string, handler: (...args: any[]) => void): void; + + /** + * Same asel.removeListener('screen', ...) except this will automatically keep track of which + * listeners are bound to the screen object. For use with onScreenEvent(), free(), and destroy(). + */ + removeScreenEvent(type: string, handler: (...args: any[]) => void): void; + + /** + * Free up the element. Automatically unbind all events that may have been bound to the screen + * object. This prevents memory leaks. For use with onScreenEvent(), removeScreenEvent(), + * and destroy(). + */ + free(): void; + + /** + * Same as the detach() method, except this will automatically call free() and unbind any screen + * events to prevent memory leaks. for use with onScreenEvent(), removeScreenEvent(), and free(). + */ + destroy(): void; + + /** + * Set the z-index of the element (changes rendering order). + */ + setIndex(z: number): void; + + /** + * Put the element in front of its siblings. + */ + setFront(): void; + + /** + * Put the element in back of its siblings. + */ + setBack(): void; + + /** + * text/options - Set the label text for the top-left corner. Example options: {text:'foo',side:'left'} + */ + setLabel(arg: string | LabelOptions): void; + + /** + * Remove the label completely. + */ + removeLabel(): any; + + /** + * text/options - Set a hover text box to follow the cursor. Similar to the "title" DOM attribute + * in the browser. Example options: {text:'foo'} + */ + setHover(arg: string | LabelOptions): void; + + /** + * Remove the hover label completely. + */ + removeHover(): void; + + /** + * Enable mouse events for the element (automatically called when a form of on('mouse') is bound). + */ + enableMouse(): void; + + /** + * Enable keypress events for the element (automatically called when a form of on('keypress') is bound). + */ + enableKeys(): void; + + /** + * Enable key and mouse events. Calls bot enableMouse and enableKeys. + */ + enableInput(): void; + + /** + * Enable dragging of the element. + */ + enableDrag(): void; + + /** + * Disable dragging of the element. + */ + disableDrag(): void; + + /** + * Take an SGR screenshot of the screen within the region. Returns a string containing only + * characters and SGR codes. Can be displayed by simply echoing it in a terminal. + */ + screenshot(xi: number, xl: number, yi: number, yl: number): string; + screenshot(): void; + + /* + Content Methods + + Methods for dealing with text content, line by line. Useful for writing a text editor, + irc client, etc. + + Note: All of these methods deal with pre-aligned, pre-wrapped text. If you use deleteTop() + on a box with a wrapped line at the top, it may remove 3-4 "real" lines (rows) depending + on how long the original line was. + + The lines parameter can be a string or an array of strings. The line parameter must + be a string. + */ + + /** + * Set the content. Note: When text is input, it will be stripped of all non-SGR + * escape codes, tabs will be replaced with 8 spaces, and tags will be replaced + * with SGR codes (if enabled). + */ + setContent(text: string): void; + + /** + * Return content, slightly different from el.content. Assume the above formatting. + */ + getContent(): string; + + /** + * Similar to setContent, but ignore tags and remove escape codes. + */ + setText(text: string): void; + + /** + * Similar to getContent, but return content with tags and escape codes removed. + */ + getText(): string; + + /** + * Insert a line into the box's content. + */ + insertLine(i: number, lines: string | string[]): void; + + /** + * Delete a line from the box's content. + */ + deleteLine(i: number): void; + + /** + * Get a line from the box's content. + */ + getLine(i: number): string; + + /** + * Get a line from the box's content from the visible top. + */ + getBaseLine(i: number): string; + + /** + * Set a line in the box's content. + */ + setLine(i: number, line: string | string[]): void; + + /** + * Set a line in the box's content from the visible top. + */ + setBaseLine(i: number, line: string | string[]): void; + + /** + * Clear a line from the box's content. + */ + clearLine(i: number): void; + + /** + * Clear a line from the box's content from the visible top. + */ + clearBaseLine(i: number): void; + + /** + * Insert a line at the top of the box. + */ + insertTop(lines: string | string[]): void; + + /** + * Insert a line at the bottom of the box. + */ + insertBottom(lines: string | string[]): void; + + /** + * Delete a line at the top of the box. + */ + deleteTop(): void; + + /** + * Delete a line at the bottom of the box. + */ + deleteBottom(): void; + + /** + * Unshift a line onto the top of the content. + */ + unshiftLine(lines: string | string[]): void; + + /** + * Shift a line off the top of the content. + */ + shiftLine(i: number): void; + + /** + * Push a line onto the bottom of the content. + */ + pushLine(lines: string | string[]): void; + + /** + * Pop a line off the bottom of the content. + */ + popLine(i: number): string; + + /** + * An array containing the content lines. + */ + getLines(): string[]; + + /** + * An array containing the lines as they are displayed on the screen. + */ + getScreenLines(): string[]; + + /** + * Get a string's displayed width, taking into account double-width, surrogate pairs, + * combining characters, tags, and SGR escape codes. + */ + strWidth(text: string): string; + } + + interface ScrollableBoxOptions extends ElementOptions { + /** + * A limit to the childBase. Default is Infinity. + */ + baseLimit?: number; + + /** + * A option which causes the ignoring of childOffset. This in turn causes the + * childBase to change every time the element is scrolled. + */ + alwaysScroll?: boolean; + + /** + * Object enabling a scrollbar. + * Style of the scrollbar track if present (takes regular style options). + */ + scrollbar?: { style?: any; track?: any; ch?: string }; + } + + interface ScrollableTextOptions extends ScrollableBoxOptions { + /** + * Whether to enable automatic mouse support for this element. + * Use pre-defined mouse events (right-click for editor). + */ + mouse?: boolean | (() => void); + + /** + * Use pre-defined keys (i or enter for insert, e for editor, C-e for editor while inserting). + */ + keys?: string | string[] | boolean; + + /** + * Use vi keys with the keys option. + */ + vi?: boolean; + } + + interface BoxOptions extends ScrollableTextOptions { + bindings?: any; + } + + /** + * DEPRECATED - Use Box with the scrollable option instead. A box with scrollable content. + */ + class ScrollableBoxElement extends BlessedElement { + /** + * The offset of the top of the scroll content. + */ + childBase: number; + + /** + * The offset of the chosen item/line. + */ + childOffset: number; + + /** + * Scroll the content by a relative offset. + */ + scroll(offset: number, always?: boolean): void; + + /** + * Scroll the content to an absolute index. + */ + scrollTo(index: number): void; + + /** + * Same as scrollTo. + */ + setScroll(index: number): void; + + /** + * Set the current scroll index in percentage (0-100). + */ + setScrollPerc(perc: number): void; + + /** + * Get the current scroll index in lines. + */ + getScroll(): number; + + /** + * Get the actual height of the scrolling area. + */ + getScrollHeight(): number; + + /** + * Get the current scroll index in percentage. + */ + getScrollPerc(): number; + + /** + * Reset the scroll index to its initial state. + */ + resetScroll(): void; + + on(event: string, listener: (...args: any[]) => void): this; + + /** + * Received when the element is scrolled. + */ + on(event: "scroll", callback: () => void): this; + } + + /** + * DEPRECATED - Use Box with the scrollable and alwaysScroll options instead. + * A scrollable text box which can display and scroll text, as well as handle + * pre-existing newlines and escape codes. + */ + class ScrollableTextElement extends ScrollableBoxElement {} + + /** + * A box element which draws a simple box containing content or other elements. + */ + class BoxElement extends ScrollableTextElement implements IHasOptions { + constructor(opts: BoxOptions); + + /** + * Original options object. + */ + options: BoxOptions; + } + + interface TextOptions extends ElementOptions { + /** + * Fill the entire line with chosen bg until parent bg ends, even if there + * is not enough text to fill the entire width. + */ + fill?: boolean; + + /** + * Text alignment: left, center, or right. + */ + align?: Types.TAlign; + } + + /** + * An element similar to Box, but geared towards rendering simple text elements. + */ + class TextElement extends BlessedElement implements IHasOptions { + constructor(opts: TextOptions); + + /** + * Original options object. + */ + options: TextOptions; + } + + /** + * A simple line which can be line or bg styled. + */ + interface LineOptions extends BoxOptions { + /** + * Can be vertical or horizontal. + */ + orientation?: "vertical" | "horizontal"; + + /** + * Treated the same as a border object. (attributes can be contained in style). + */ + type?: string; + bg?: string; + fg?: string; + ch?: string; + } + + /** + * A simple line which can be line or bg styled. + */ + class LineElement extends BoxElement implements IHasOptions { + constructor(opts: LineOptions); + + /** + * Original options object. + */ + options: LineOptions; + } + + interface BigTextOptions extends BoxOptions { + /** + * bdf->json font file to use (see ttystudio for instructions on compiling BDFs to JSON). + */ + font?: string; + + /** + * bdf->json bold font file to use (see ttystudio for instructions on compiling BDFs to JSON). + */ + fontBold?: string; + + /** + * foreground character. (default: ' ') + */ + fch?: string; + } + + /** + * A box which can render content drawn as 8x14 cell characters using the terminus font. + */ + class BigTextElement extends BoxElement implements IHasOptions { + constructor(opts: BigTextOptions); + + /** + * Original options object. + */ + options: BigTextOptions; + } + + interface ListElementStyle { + selected?: any; + item?: any; + } + + interface ListOptions extends BoxOptions { + /** + * Style for a selected item. Style for an unselected item. + */ + style?: TStyle; + + /** + * An array of strings which become the list's items. + */ + items?: string[]; + + /** + * A function that is called when vi mode is enabled and the key / is pressed. This function accepts a + * callback function which should be called with the search string. The search string is then used to + * jump to an item that is found in items. + */ + search?(err: any, value?: string): void; + + /** + * Whether the list is interactive and can have items selected (Default: true). + */ + interactive?: boolean; + + /** + * Whether to automatically override tags and invert fg of item when selected (Default: true). + */ + invertSelected?: boolean; + } + + type ListElementEventType = + /** List was canceled (when esc is pressed with the keys option). */ + | "cancel" + /** Either a select or a cancel event was received. */ + | "action" + | "create item" + | "add item" + | "remove item" + | "insert item" + | "set items"; + + class ListElement extends BoxElement implements IHasOptions> { + constructor(opts: ListOptions); + + /** + * Original options object. + */ + options: ListOptions; + + /** + * Add an item based on a string. + */ + add(text: string): void; + + /** + * Add an item based on a string. + */ + addItem(text: string): void; + + /** + * Removes an item from the list. Child can be an element, index, or string. + */ + removeItem(child: BlessedElement): BlessedElement; + + /** + * Push an item onto the list. + */ + pushItem(child: BlessedElement): number; + + /** + * Pop an item off the list. + */ + popItem(): BlessedElement; + + /** + * Unshift an item onto the list. + */ + unshiftItem(child: BlessedElement): number; + + /** + * Shift an item off the list. + */ + shiftItem(): BlessedElement; + + /** + * Inserts an item to the list. Child can be an element, index, or string. + */ + insertItem(i: number, child: BlessedElement): void; + + /** + * Returns the item element. Child can be an element, index, or string. + */ + getItem(child: BlessedElement): BlessedElement; + + /** + * Set item to content. + */ + setItem(child: BlessedElement, content: BlessedElement | string): void; + + /** + * Remove and insert items to the list. + */ + spliceItem(i: number, n: number, ...items: BlessedElement[]): void; + + /** + * Clears all items from the list. + */ + clearItems(): void; + + /** + * Sets the list items to multiple strings. + */ + setItems(items: BlessedElement[]): void; + + /** + * Returns the item index from the list. Child can be an element, index, or string. + */ + getItemIndex(child: BlessedElement): number; + + /** + * Select an index of an item. + */ + select(index: number): void; + + /** + * Select item based on current offset. + */ + move(offset: number): void; + + /** + * Select item above selected. + */ + up(amount: number): void; + + /** + * Select item below selected. + */ + down(amount: number): void; + + /** + * Show/focus list and pick an item. The callback is executed with the result. + */ + pick(callback: () => void): void; + + /** + * Find an item based on its text content. + */ + fuzzyFind(arg: string | RegExp | (() => void)): void; + + on(event: string, listener: (...args: any[]) => void): this; + /** Received when an item is selected. */ + on(event: "select", callback: (item: BoxElement, index: number) => void): this; + on(event: ListElementEventType, callback: () => void): this; + on(event: "select item", callback: (item: BlessedElement, index: number) => void): this; + } + + interface FileManagerOptions extends ListOptions { + /** + * Current working directory. + */ + cwd?: string; + } + + class FileManagerElement extends ListElement implements IHasOptions { + constructor(opts: FileManagerOptions); + + /** + * Original options object. + */ + options: FileManagerOptions; + + /** + * Current working directory. + */ + cwd: string; + + /** + * Refresh the file list (perform a readdir on cwd and update the list items). + */ + refresh(cwd: string, callback: () => void): void; + refresh(callback?: () => void): void; + + /** + * Pick a single file and return the path in the callback. + */ + pick(cwd: string, callback: () => void): void; + pick(callback: () => void): void; + + /** + * Reset back to original cwd. + */ + reset(cwd: string, callback: () => void): void; + reset(callback?: () => void): void; + + on(event: string, listener: (...args: any[]) => void): this; + /** Received when an item is selected. */ + on(event: "cd", callback: (file: string, cwd: string) => void): this; + /** Received when an item is selected. */ + on(event: "file", callback: (file: string) => void): this; + on(event: "error", callback: (err: any, file: string) => void): this; + on(event: "refresh", callback: () => void): this; + } + + interface StyleListTable extends ListElementStyle { + /** + * Header style. + */ + header?: any; + + /** + * Cell style. + */ + cell?: any; + } + + interface ListTableOptions extends ListOptions { + /** + * Array of array of strings representing rows. + */ + rows?: string[]; + data?: string[][]; + + /** + * Spaces to attempt to pad on the sides of each cell. 2 by default: one space on each side + * (only useful if the width is shrunken). + */ + pad?: number; + + /** + * Do not draw inner cells. + */ + noCellBorders?: boolean; + + style?: StyleListTable; + } + + class ListTableElement extends ListElement implements IHasOptions { + constructor(opts: ListTableOptions); + + /** + * Original options object. + */ + options: ListTableOptions; + + /** + * Set rows in table. Array of arrays of strings. + * @example: + * + * table.setData([ + * [ 'Animals', 'Foods' ], + * [ 'Elephant', 'Apple' ], + * [ 'Bird', 'Orange' ] + * ]); + */ + setRows(rows: string[][]): void; + + /** + * Set rows in table. Array of arrays of strings. + * @example: + * + * table.setData([ + * [ 'Animals', 'Foods' ], + * [ 'Elephant', 'Apple' ], + * [ 'Bird', 'Orange' ] + * ]); + */ + setData(rows: string[][]): void; + } + + interface ListbarOptions extends BoxOptions { + style?: ListElementStyle; + + /** + * Set buttons using an object with keys as titles of buttons, containing of objects + * containing keys of keys and callback. + */ + commands: Types.ListbarCommand[]; + items: Types.ListbarCommand[]; + + /** + * Automatically bind list buttons to keys 0-9. + */ + autoCommandKeys: boolean; + } + + class ListbarElement extends BoxElement implements IHasOptions { + constructor(opts: ListbarOptions); + + /** + * Original options object. + */ + options: ListbarOptions; + + /** + * Set commands (see commands option above). + */ + setItems(commands: Types.ListbarCommand[]): void; + + /** + * Append an item to the bar. + */ + add(item: Types.ListbarCommand, callback: () => void): void; + + /** + * Append an item to the bar. + */ + addItem(item: Types.ListbarCommand, callback: () => void): void; + + /** + * Append an item to the bar. + */ + appendItem(item: Types.ListbarCommand, callback: () => void): void; + + /** + * Select an item on the bar. + */ + select(offset: number): void; + + /** + * Remove item from the bar. + */ + removeItem(child: BlessedElement): void; + + /** + * Move relatively across the bar. + */ + move(offset: number): void; + + /** + * Move left relatively across the bar. + */ + moveLeft(offset: number): void; + + /** + * Move right relatively across the bar. + */ + moveRight(offset: number): void; + + /** + * Select button and execute its callback. + */ + selectTab(index: number): void; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "set items" | "remove item" | "select tab", callback: () => void): this; + } + + interface FormOptions extends BoxOptions { + /** + * Allow default keys (tab, vi keys, enter). + */ + keys?: any; + + /** + * Allow vi keys. + */ + vi?: boolean; + } + + class FormElement extends BoxElement implements IHasOptions { + constructor(opts: FormOptions); + + /** + * Original options object. + */ + options: FormOptions; + + /** + * Last submitted data. + */ + submission: TFormData; + + /** + * Focus next form element. + */ + focusNext(): void; + + /** + * Focus previous form element. + */ + focusPrevious(): void; + + /** + * Submit the form. + */ + submit(): void; + + /** + * Discard the form. + */ + cancel(): void; + + /** + * Clear the form. + */ + reset(): void; + + on(event: string, listener: (...args: any[]) => void): this; + /** Form is submitted. Receives a data object. */ + on(event: "submit", callback: (out: TFormData) => void): this; + on(event: "cancel" | "reset", callback: () => void): this; + } + + interface InputOptions extends BoxOptions {} + + abstract class InputElement extends BoxElement { + constructor(opts: InputOptions); + } + + /** + * A box which allows multiline text input. + */ + interface TextareaOptions extends InputOptions { + /** + * Call readInput() when the element is focused. Automatically unfocus. + */ + inputOnFocus?: boolean; + } + + type TextareaElementEventType = + /** Value is an error. */ + | "error" + /** Value is submitted (enter). */ + | "submit" + /** Value is discared (escape). */ + | "cancel" + /** Either submit or cancel. */ + | "action"; + + class TextareaElement extends InputElement implements IHasOptions { + constructor(opts: TextareaOptions); + + /** + * Original options object. + */ + options: TextareaOptions; + + /** + * The input text. read-only. + */ + value: string; + + /** + * Submit the textarea (emits submit). + */ + submit(): void; + + /** + * Cancel the textarea (emits cancel). + */ + cancel(): void; + + /** + * Grab key events and start reading text from the keyboard. Takes a callback which receives + * the final value. + */ + readInput(callback?: (err: any, value?: string) => void): void; + + /** + * Grab key events and start reading text from the keyboard. Takes a callback which receives + * the final value. + */ + input(callback: (err: any, value?: string) => void): void; + + /** + * Grab key events and start reading text from the keyboard. Takes a callback which receives + * the final value. + */ + setInput(callback: (err: any, value?: string) => void): void; + + /** + * Open text editor in $EDITOR, read the output from the resulting file. Takes a callback which + * receives the final value. + */ + readEditor(callback: (err: any, value?: string) => void): void; + + /** + * Open text editor in $EDITOR, read the output from the resulting file. Takes a callback which + * receives the final value. + */ + editor(callback: (err: any, value?: string) => void): void; + + /** + * Open text editor in $EDITOR, read the output from the resulting file. Takes a callback which + * receives the final value. + */ + setEditor(callback: (err: any, value?: string) => void): void; + + /** + * The same as this.value, for now. + */ + getValue(): string; + + /** + * Clear input. + */ + clearValue(): void; + + /** + * Set value. + */ + setValue(text: string): void; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: TextareaElementEventType, callback: (err: any) => void): this; + } + + interface TextboxOptions extends TextareaOptions { + /** + * Completely hide text. + */ + secret?: boolean; + + /** + * Replace text with asterisks (*). + */ + censor?: boolean; + } + + class TextboxElement extends TextareaElement implements IHasOptions { + constructor(opts: TextboxOptions); + + /** + * Original options object. + */ + options: TextboxOptions; + + /** + * Completely hide text. + */ + secret: boolean; + + /** + * Replace text with asterisks (*). + */ + censor: boolean; + } + + interface ButtonOptions extends BoxOptions {} + + class ButtonElement extends InputElement implements IHasOptions { + constructor(opts: ButtonOptions); + + /** + * Original options object. + */ + options: ButtonOptions; + + /** + * Press button. Emits press. + */ + press(): void; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "press", callback: () => void): this; + } + + interface CheckboxOptions extends BoxOptions { + /** + * whether the element is checked or not. + */ + checked?: boolean; + + /** + * enable mouse support. + */ + mouse?: boolean; + } + + /** + * A checkbox which can be used in a form element. + */ + class CheckboxElement extends InputElement implements IHasOptions { + constructor(options?: CheckboxOptions); + + /** + * Original options object. + */ + options: CheckboxOptions; + + /** + * the text next to the checkbox (do not use setcontent, use `check.text = ''`). + */ + text: string; + + /** + * whether the element is checked or not. + */ + checked: boolean; + + /** + * same as `checked`. + */ + value: boolean; + + /** + * check the element. + */ + check(): void; + + /** + * uncheck the element. + */ + uncheck(): void; + + /** + * toggle checked state. + */ + toggle(): void; + } + + interface RadioSetOptions extends BoxOptions {} + + /** + * An element wrapping RadioButtons. RadioButtons within this element will be mutually exclusive + * with each other. + */ + abstract class RadioSetElement extends BoxElement { + constructor(opts: RadioSetOptions); + } + + interface RadioButtonOptions extends BoxOptions {} + + /** + * A radio button which can be used in a form element. + */ + abstract class RadioButtonElement extends CheckboxElement { + constructor(opts: RadioButtonOptions); + } + + interface PromptOptions extends BoxOptions {} + + /** + * A prompt box containing a text input, okay, and cancel buttons (automatically hidden). + */ + class PromptElement extends BoxElement implements IHasOptions { + constructor(opts: PromptOptions); + + options: PromptOptions; + + /** + * Show the prompt and wait for the result of the textbox. Set text and initial value. + */ + input(text: string, value: string, callback: (err: any, value: string) => void): void; + setInput(text: string, value: string, callback: (err: any, value: string) => void): void; + readInput(text: string, value: string, callback: (err: any, value: string) => void): void; + } + + interface QuestionOptions extends BoxOptions {} + + /** + * A question box containing okay and cancel buttons (automatically hidden). + */ + class QuestionElement extends BoxElement implements IHasOptions { + constructor(opts: QuestionOptions); + + options: QuestionOptions; + + /** + * Ask a question. callback will yield the result. + */ + ask(question: string, callback: (err: any, value: string) => void): void; + } + + interface MessageOptions extends BoxOptions {} + + /** + * A box containing a message to be displayed (automatically hidden). + */ + class MessageElement extends BoxElement implements IHasOptions { + constructor(opts: MessageOptions); + + options: MessageOptions; + + /** + * Display a message for a time (default is 3 seconds). Set time to 0 for a + * perpetual message that is dismissed on keypress. + */ + log(text: string, time: number, callback: (err: any) => void): void; + log(text: string, callback: (err: any) => void): void; + display(text: string, time: number, callback: (err: any) => void): void; + display(text: string, callback: (err: any) => void): void; + + /** + * Display an error in the same way. + */ + error(text: string, time: number, callback: () => void): void; + error(text: string, callback: () => void): void; + } + + interface LoadingOptions extends BoxOptions {} + + /** + * A box with a spinning line to denote loading (automatically hidden). + */ + class LoadingElement extends BoxElement implements IHasOptions { + constructor(opts: LoadingOptions); + + options: LoadingOptions; + + /** + * Display the loading box with a message. Will lock keys until stop is called. + */ + load(text: string): void; + + /** + * Hide loading box. Unlock keys. + */ + stop(): void; + } + + interface ProgressBarOptions extends BoxOptions { + /** + * can be `horizontal` or `vertical`. + */ + orientation: string; + + /** + * the character to fill the bar with (default is space). + */ + pch: string; + + /** + * the amount filled (0 - 100). + */ + filled: number; + + /** + * same as `filled`. + */ + value: number; + + /** + * enable key support. + */ + keys: boolean; + + /** + * enable mouse support. + */ + mouse: boolean; + } + + /** + * A progress bar allowing various styles. This can also be used as a form input. + */ + class ProgressBarElement extends InputElement implements IHasOptions { + constructor(options?: ProgressBarOptions); + + options: ProgressBarOptions; + + /** + * progress the bar by a fill amount. + */ + progress(amount: number): void; + + /** + * set progress to specific amount. + */ + setProgress(amount: number): void; + + /** + * reset the bar. + */ + reset(): void; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "reset" | "complete", callback: () => void): this; + } + + interface LogOptions extends ScrollableTextOptions { + /** + * amount of scrollback allowed. default: Infinity. + */ + scrollback?: number; + + /** + * scroll to bottom on input even if the user has scrolled up. default: false. + */ + scrollOnInput?: boolean; + } + + /** + * A log permanently scrolled to the bottom. + */ + class Log extends ScrollableTextElement implements IHasOptions { + constructor(options?: LogOptions); + + options: LogOptions; + + /** + * amount of scrollback allowed. default: Infinity. + */ + scrollback: number; + + /** + * scroll to bottom on input even if the user has scrolled up. default: false. + */ + scrollOnInput: boolean; + + /** + * add a log line. + */ + log(text: string): void; + + /** + * add a log line. + */ + add(text: string): void; + } + + interface TableOptions extends BoxOptions { + /** + * array of array of strings representing rows (same as `data`). + */ + rows?: string[][]; + + /** + * array of array of strings representing rows (same as `rows`). + */ + data?: string[][]; + + /** + * spaces to attempt to pad on the sides of each cell. `2` by default: one space on each side (only useful if the width is shrunken). + */ + pad?: number; + + /** + * do not draw inner cells. + */ + noCellBorders?: boolean; + + /** + * fill cell borders with the adjacent background color. + */ + fillCellBorders?: boolean; + } + + /** + * A stylized table of text elements. + */ + class TableElement extends BoxElement implements IHasOptions { + constructor(opts: TableOptions); + + options: TableOptions; + + /** + * set rows in table. array of arrays of strings. + */ + setData(rows: string[][]): void; + + /** + * set rows in table. array of arrays of strings. + */ + setRows(rows: string[][]): void; + } + + interface TerminalOptions extends BoxOptions { + /** + * handler for input data. + */ + handler?(userInput: Buffer): void; + + /** + * name of shell. $SHELL by default. + */ + shell?: string; + + /** + * args for shell. + */ + args?: any; + + /** + * can be line, underline, and block. + */ + cursor?: "line" | "underline" | "block"; + + terminal?: string; + + /** + * Object for process env. + */ + env?: any; + } + + class TerminalElement extends BoxElement implements IHasOptions { + constructor(opts: TerminalOptions); + + options: TerminalOptions; + + /** + * reference to the headless term.js terminal. + */ + term: any; + + /** + * reference to the pty.js pseudo terminal. + */ + pty: any; + + /** + * write data to the terminal. + */ + write(data: string): void; + + /** + * nearly identical to `element.screenshot`, however, the specified region includes the terminal's + * _entire_ scrollback, rather than just what is visible on the screen. + */ + screenshot(xi?: number, xl?: number, yi?: number, yl?: number): string; + } + + interface ImageOptions extends BoxOptions { + /** + * path to image. + */ + file: string; + + /** + * path to w3mimgdisplay. if a proper w3mimgdisplay path is not given, blessed will search the + * entire disk for the binary. + */ + type: "ansi" | "overlay" | "w3m"; + } + + /** + * Display an image in the terminal (jpeg, png, gif) using w3mimgdisplay. Requires w3m to be installed. + * X11 required: works in xterm, urxvt, and possibly other terminals. + */ + class ImageElement extends BoxElement implements IHasOptions { + constructor(options?: ImageOptions); + + options: ImageOptions; + } + + interface ANSIImageOptions extends BoxOptions { + /** + * URL or path to PNG/GIF file. Can also be a buffer. + */ + file: string; + + /** + * Scale cellmap down (0-1.0) from its original pixel width/height (Default: 1.0). + */ + scale: number; + + /** + * This differs from other element's width or height in that only one + * of them is needed: blessed will maintain the aspect ratio of the image + * as it scales down to the proper number of cells. NOTE: PNG/GIF's are + * always automatically shrunken to size (based on scale) if a width or + * height is not given. + */ + width: number | string; + height: number | string; + + /** + * Add various "density" ASCII characters over the rendering to give the + * image more detail, similar to libcaca/libcucul (the library mplayer uses + * to display videos in the terminal). + */ + ascii: string; + + /** + * Whether to animate if the image is an APNG/animating GIF. If false, only + * display the first frame or IDAT (Default: true). + */ + animate: boolean; + + /** + * Set the speed of animation. Slower: 0.0-1.0. Faster: 1-1000. It cannot go + * faster than 1 frame per millisecond, so 1000 is the fastest. (Default: 1.0) + */ + speed: number; + + /** + * mem or cpu. If optimizing for memory, animation frames will be rendered to + * bitmaps as the animation plays, using less memory. Optimizing for cpu will + * precompile all bitmaps beforehand, which may be faster, but might also OOM + * the process on large images. (Default: mem). + */ + optimization: "mem" | "cpu"; + } + + /** + * Convert any .png file (or .gif, see below) to an ANSI image and display it as an element. + */ + class ANSIImageElement extends BoxElement implements IHasOptions { + constructor(options?: ANSIImageOptions); + + options: ANSIImageOptions; + + /** + * Image object from the png reader. + */ + img: Types.TImage; + + /** + * set the image in the box to a new path. + */ + setImage(img: string, callback: () => void): void; + + /** + * clear the current image. + */ + clearImage(callback: () => void): void; + + /** + * Play animation if it has been paused or stopped. + */ + play(): void; + + /** + * Pause animation. + */ + pause(): void; + + /** + * Stop animation. + */ + stop(): void; + } + + interface OverlayImageOptions extends BoxOptions { + /** + * Path to image. + */ + file: string; + + /** + * Render the file as ANSI art instead of using w3m to overlay Internally uses the + * ANSIImage element. See the ANSIImage element for more information/options. (Default: true). + */ + ansi: boolean; + + /** + * Path to w3mimgdisplay. If a proper w3mimgdisplay path is not given, blessed will + * search the entire disk for the binary. + */ + w3m: string; + + /** + * Whether to search /usr, /bin, and /lib for w3mimgdisplay (Default: true). + */ + search: string; + } + + /** + * Convert any .png file (or .gif, see below) to an ANSI image and display it as an element. + */ + class OverlayImageElement extends BoxElement implements IHasOptions { + constructor(options?: OverlayImageOptions); + + options: OverlayImageOptions; + + /** + * set the image in the box to a new path. + */ + setImage(img: string, callback: () => void): void; + + /** + * clear the current image. + */ + clearImage(callback: () => void): void; + + /** + * get the size of an image file in pixels. + */ + imageSize(img: string, callback: () => void): void; + + /** + * get the size of the terminal in pixels. + */ + termSize(callback: () => void): void; + + /** + * get the pixel to cell ratio for the terminal. + */ + getPixelRatio(callback: () => void): void; + } + + interface VideoOptions extends BoxOptions { + /** + * Video to play. + */ + file: string; + + /** + * Start time in seconds. + */ + start: number; + } + + class VideoElement extends BoxElement implements IHasOptions { + constructor(options?: VideoOptions); + + options: VideoOptions; + + /** + * The terminal element running mplayer or mpv. + */ + tty: any; + } + + interface LayoutOptions extends ElementOptions { + /** + * A callback which is called right before the children are iterated over to be rendered. Should return an + * iterator callback which is called on each child element: iterator(el, i). + */ + renderer?(): void; + + /** + * Using the default renderer, it provides two layouts: inline, and grid. inline is the default and will render + * akin to inline-block. grid will create an automatic grid based on element dimensions. The grid cells' + * width and height are always determined by the largest children in the layout. + */ + layout: "inline" | "inline-block" | "grid"; + } + + class LayoutElement extends BlessedElement implements IHasOptions { + constructor(options?: LayoutOptions); + + options: LayoutOptions; + + /** + * A callback which is called right before the children are iterated over to be rendered. Should return an + * iterator callback which is called on each child element: iterator(el, i). + */ + renderer(coords: PositionCoords): void; + + /** + * Check to see if a previous child element has been rendered and is visible on screen. This is only useful + * for checking child elements that have already been attempted to be rendered! see the example below. + */ + isRendered(el: BlessedElement): boolean; + + /** + * Get the last rendered and visible child element based on an index. This is useful for basing the position + * of the current child element on the position of the last child element. + */ + getLast(i: number): BlessedElement; + + /** + * Get the last rendered and visible child element coords based on an index. This is useful for basing the position + * of the current child element on the position of the last child element. See the example below. + */ + getLastCoords(i: number): PositionCoords; + } + + class Program { + /** + * Wrap the given text in terminal formatting codes corresponding to the given attribute + * name. The `attr` string can be of the form `red fg` or `52 bg` where `52` is a 0-255 + * integer color number. + */ + text(text: string, attr: string): string; } } -export = Blessed; +export namespace widget { + class Terminal extends Widgets.TerminalElement {} +} + +export function screen(options?: Widgets.IScreenOptions): Widgets.Screen; +export function box(options?: Widgets.BoxOptions): Widgets.BoxElement; +export function text(options?: Widgets.TextOptions): Widgets.TextElement; +export function line(options?: Widgets.LineOptions): Widgets.LineElement; +export function scrollablebox(options?: Widgets.BoxOptions): Widgets.BoxElement; +export function scrollabletext(options?: Widgets.BoxOptions): Widgets.BoxElement; +export function bigtext(options?: Widgets.BigTextOptions): Widgets.BigTextElement; +export function list(options?: Widgets.ListOptions): Widgets.ListElement; +export function filemanager(options?: Widgets.FileManagerOptions): Widgets.FileManagerElement; +export function listtable(options?: Widgets.ListTableOptions): Widgets.ListTableElement; +export function listbar(options?: Widgets.ListbarOptions): Widgets.ListbarElement; +export function form(options?: Widgets.FormOptions): Widgets.FormElement; +export function input(options?: Widgets.InputOptions): Widgets.InputElement; +export function textarea(options?: Widgets.TextareaOptions): Widgets.TextareaElement; +export function textbox(options?: Widgets.TextboxOptions): Widgets.TextboxElement; +export function button(options?: Widgets.ButtonOptions): Widgets.ButtonElement; +export function checkbox(options?: Widgets.CheckboxOptions): Widgets.CheckboxElement; +export function radioset(options?: Widgets.RadioSetOptions): Widgets.RadioSetElement; +export function radiobutton(options?: Widgets.RadioButtonOptions): Widgets.RadioButtonElement; +export function table(options?: Widgets.TableOptions): Widgets.TableElement; +export function prompt(options?: Widgets.PromptOptions): Widgets.PromptElement; +export function question(options?: Widgets.QuestionOptions): Widgets.QuestionElement; +export function message(options?: Widgets.MessageOptions): Widgets.MessageElement; +export function loading(options?: Widgets.LoadingOptions): Widgets.LoadingElement; +export function log(options?: Widgets.LogOptions): Widgets.Log; +export function progressbar(options?: Widgets.ProgressBarOptions): Widgets.ProgressBarElement; +export function terminal(options?: Widgets.TerminalOptions): Widgets.TerminalElement; +export function layout(options?: Widgets.LayoutOptions): Widgets.LayoutElement; +export function escape(item: any): any; + +export const colors: { + match(hexColor: string): string; +}; diff --git a/types/blessed/tslint.json b/types/blessed/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/blessed/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/blissfuljs/tslint.json b/types/blissfuljs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/blissfuljs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/blob-stream/tslint.json b/types/blob-stream/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/blob-stream/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/blob-to-buffer/blob-to-buffer-tests.ts b/types/blob-to-buffer/blob-to-buffer-tests.ts new file mode 100644 index 0000000000..21d9508469 --- /dev/null +++ b/types/blob-to-buffer/blob-to-buffer-tests.ts @@ -0,0 +1,6 @@ +import blobToBuffer = require("blob-to-buffer"); + +blobToBuffer(new Blob(), (error, buffer) => { + console.log(error); + console.log(buffer); +}); diff --git a/types/blob-to-buffer/index.d.ts b/types/blob-to-buffer/index.d.ts new file mode 100644 index 0000000000..8c8156963e --- /dev/null +++ b/types/blob-to-buffer/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for blob-to-buffer 1.2 +// Project: https://github.com/feross/blob-to-buffer +// Definitions by: nrlquaker +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +declare function blobToBuffer(blob: Blob, callback: (error: any, buffer: Buffer) => void): void; +declare namespace blobToBuffer {} +export = blobToBuffer; diff --git a/types/askmethat-rating/tsconfig.json b/types/blob-to-buffer/tsconfig.json similarity index 92% rename from types/askmethat-rating/tsconfig.json rename to types/blob-to-buffer/tsconfig.json index a41db58d7a..2421ce2493 100644 --- a/types/askmethat-rating/tsconfig.json +++ b/types/blob-to-buffer/tsconfig.json @@ -19,6 +19,6 @@ }, "files": [ "index.d.ts", - "askmethat-rating-tests.ts" + "blob-to-buffer-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/blob-to-buffer/tslint.json b/types/blob-to-buffer/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/blob-to-buffer/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/blob-util/index.d.ts b/types/blob-util/index.d.ts index 3e900f0ecb..7710734bf2 100644 --- a/types/blob-util/index.d.ts +++ b/types/blob-util/index.d.ts @@ -4,14 +4,54 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 +/** + * Shim for new Blob() to support older browsers that use the deprecated BlobBuilder API. + * + * @param parts content of the Blob + * @param options usually just `{ type: mimeType }` + */ export function createBlob(parts: any[], options?: { type: string }): Blob; + +/** + * Shim for URL.createObjectURL() to support browsers that only have the prefixed webkitURL (e.g. Android <4.4). + */ export function createObjectURL(blob: Blob): string; + +/** + * Shim for URL.revokeObjectURL() to support browsers that only have the prefixed webkitURL (e.g. Android <4.4). + */ export function revokeObjectURL(url: string): void; + +/** + * Convert a Blob to a binary string. + */ export function blobToBinaryString(blob: Blob): Promise; + +/** + * Convert a binary string to a Blob. + * @param type the content type + */ export function binaryStringToBlob(binary: string, type?: string): Promise; + +/** + * Convert a Blob to a base-64 string. + */ export function blobToBase64String(blob: Blob): Promise; + +/** + * Convert a base-64 string to a Blob. + * @param type the content type + */ export function base64StringToBlob(base64: string, type?: string): Promise; + +/** + * Convert a data URL string (e.g. `'data:image/png;base64,iVBORw0KG...'`) to a Blob. + */ export function dataURLToBlob(dataURL: string): Promise; + +/** + * Convert a Blob to a data URL string (e.g. `'data:image/png;base64,iVBORw0KG...'`). + */ export function blobToDataURL(blob: Blob): Promise; /** @@ -19,7 +59,6 @@ export function blobToDataURL(blob: Blob): Promise; * * Note: this will coerce the image to the desired content type, and it will only paint the first frame of an animated GIF. * - * @param src * @param type the content type (optional, defaults to 'image/png') * @param crossOrigin for CORS-enabled images, set this to 'Anonymous' to avoid "tainted canvas" errors * @param quality a number between 0 and 1 indicating image quality if the requested type is 'image/jpeg' or 'image/webp' @@ -29,7 +68,6 @@ export function imgSrcToDataURL(src: string, type?: string, crossOrigin?: string /** * Convert a canvas to a Blob. * - * @param src * @param type the content type (optional, defaults to 'image/png') * @param quality a number between 0 and 1 indicating image quality if the requested type is 'image/jpeg' or 'image/webp' */ @@ -40,12 +78,20 @@ export function canvasToBlob(canvas: HTMLCanvasElement, type?: string, quality?: * * Note: this will coerce the image to the desired content type, and it will only paint the first frame of an animated GIF. * - * @param src * @param type the content type (optional, defaults to 'image/png') * @param crossOrigin for CORS-enabled images, set this to 'Anonymous' to avoid "tainted canvas" errors * @param quality a number between 0 and 1 indicating image quality if the requested type is 'image/jpeg' or 'image/webp' */ export function imgSrcToBlob(src: string, type?: string, crossOrigin?: string, quality?: number): Promise; +/** + * Convert an ArrayBuffer to a Blob. + * + * @param type the content type + */ export function arrayBufferToBlob(arrayBuff: ArrayBuffer, type?: string): Promise; + +/** + * Convert a Blob to an ArrayBuffer. + */ export function blobToArrayBuffer(blob: Blob): Promise; diff --git a/types/blocks/tslint.json b/types/blocks/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/blocks/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/blue-tape/tslint.json b/types/blue-tape/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/blue-tape/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bluebird-global/tslint.json b/types/bluebird-global/tslint.json index 1d81af2349..31bf31d881 100644 --- a/types/bluebird-global/tslint.json +++ b/types/bluebird-global/tslint.json @@ -6,6 +6,7 @@ "array-type": false, "unified-signatures": false, "ban-types": false, + "no-redundant-undefined": false, "no-unnecessary-generics": false } } diff --git a/types/bluebird-retry/bluebird-retry-tests.ts b/types/bluebird-retry/bluebird-retry-tests.ts index eb3260a007..e9beaf5562 100644 --- a/types/bluebird-retry/bluebird-retry-tests.ts +++ b/types/bluebird-retry/bluebird-retry-tests.ts @@ -1,13 +1,13 @@ import Promise = require('bluebird'); import retry = require('bluebird-retry'); -function promiseSuccess(text:string) { +function promiseSuccess(text: string) { return Promise.resolve(text); -}; +} -var count = 0; +let count = 0; function myfunc() { - console.log('myfunc called ' + (++count) + ' times'); + console.log(`myfunc called ${++count} times`); if (count < 3) { throw new Error('i fail the first two times'); } else { @@ -16,18 +16,17 @@ function myfunc() { } retry(myfunc) - .done(function(result) { console.log(result); } ); + .done(result => { console.log(result); }); - -//Options example +// Options example function logFail() { console.log(new Date().toISOString()); throw new Error('bail'); } -var options:retry.Options = { +const options: retry.Options = { max_tries: 4, interval: 500 }; -retry(logFail, options); \ No newline at end of file +retry(logFail, options); diff --git a/types/bluebird-retry/index.d.ts b/types/bluebird-retry/index.d.ts index 97d756524b..358c75936d 100644 --- a/types/bluebird-retry/index.d.ts +++ b/types/bluebird-retry/index.d.ts @@ -1,17 +1,15 @@ -// Type definitions for bluebird-retry +// Type definitions for bluebird-retry 0.11 // Project: https://github.com/jut-io/bluebird-retry // Definitions by: Pascal Vomhoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -/// - import Promise = require('bluebird'); declare function retry(func: (param: T) => void, options?: retry.Options): Promise; declare namespace retry { - export interface Options { + interface Options { interval?: number; backoff?: number; max_interval?: number; @@ -22,7 +20,6 @@ declare namespace retry { context?: any; args?: any; } - } export = retry; diff --git a/types/bluebird-retry/tslint.json b/types/bluebird-retry/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/bluebird-retry/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/bluebird/bluebird-tests.ts b/types/bluebird/bluebird-tests.ts index a77a6262db..9dfb4fdc1f 100644 --- a/types/bluebird/bluebird-tests.ts +++ b/types/bluebird/bluebird-tests.ts @@ -7,26 +7,25 @@ import Promise = require("bluebird"); -var obj: Object; -var bool: boolean; -var num: number; -var str: string; -var err: Error; -var x: any; -var f: (...args: any[]) => any; -var asyncfunc: (...args: any[]) => Promise; -var arr: any[]; -var exp: RegExp; -var anyArr: any[]; -var strArr: string[]; -var numArr: number[]; -var voidVar: void; +let obj: object; +let bool: boolean; +let num: number; +let str: string; +let err: Error; +let x: any; +let f: (...args: any[]) => any; +let asyncfunc: (...args: any[]) => Promise; +let arr: any[]; +let exp: RegExp; +let anyArr: any[]; +let strArr: string[]; +let numArr: number[]; // - - - - - - - - - - - - - - - - - -var value: any; -var reason: any; -var insanity: any; +let value: any; +let reason: any; +let insanity: any; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -43,120 +42,119 @@ interface Baz { // - - - - - - - - - - - - - - - - - interface StrFooMap { - [key:string]:Foo; + [key: string]: Foo; } interface StrBarMap { - [key:string]:Bar; + [key: string]: Bar; } // - - - - - - - - - - - - - - - - - interface StrFooArrMap { - [key:string]:Foo[]; + [key: string]: Foo[]; } interface StrBarArrMap { - [key:string]:Bar[]; + [key: string]: Bar[]; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var foo: Foo; -var bar: Bar; -var baz: Baz; +let foo: Foo; +let bar: Bar; +let baz: Baz; -var fooArr: Foo[]; -var barArr: Bar[]; +let fooArr: Foo[]; +let barArr: Bar[]; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var numProm: Promise; -var strProm: Promise; -var anyProm: Promise; -var boolProm: Promise; -var objProm: Promise; -var voidProm: Promise; +let numProm: Promise; +let strProm: Promise; +let anyProm: Promise; +let boolProm: Promise; +let objProm: Promise; +let voidProm: Promise; -var fooProm: Promise; -var barProm: Promise; -var barOrVoidProm: Promise; -var fooOrBarProm: Promise; -var bazProm: Promise; +let fooProm: Promise; +let barProm: Promise; +let fooOrBarProm: Promise; +let bazProm: Promise; // - - - - - - - - - - - - - - - - - -var numThen: PromiseLike; -var strThen: PromiseLike; -var anyThen: PromiseLike; -var boolThen: PromiseLike; -var objThen: PromiseLike; -var voidThen: PromiseLike; +let numThen: PromiseLike; +let strThen: PromiseLike; +let anyThen: PromiseLike; +let boolThen: PromiseLike; +let objThen: PromiseLike; +let voidThen: PromiseLike; -var fooThen: PromiseLike; -var barThen: PromiseLike; +let fooThen: PromiseLike; +let barThen: PromiseLike; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var numArrProm: Promise; -var strArrProm: Promise; -var anyArrProm: Promise; +let numArrProm: Promise; +let strArrProm: Promise; +let anyArrProm: Promise; -var fooArrProm: Promise; -var barArrProm: Promise; +let fooArrProm: Promise; +let barArrProm: Promise; // - - - - - - - - - - - - - - - - - -var numArrThen: PromiseLike; -var strArrThen: PromiseLike; -var anyArrThen: PromiseLike; +let numArrThen: PromiseLike; +let strArrThen: PromiseLike; +let anyArrThen: PromiseLike; -var fooArrThen: PromiseLike; -var barArrThen: PromiseLike; +let fooArrThen: PromiseLike; +let barArrThen: PromiseLike; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var numPromArr: Promise[]; -var strPromArr: Promise[]; -var anyPromArr: Promise[]; +let numPromArr: Array>; +let strPromArr: Array>; +let anyPromArr: Array>; -var fooPromArr: Promise[]; -var barPromArr: Promise[]; +let fooPromArr: Array>; +let barPromArr: Array>; // - - - - - - - - - - - - - - - - - -var numThenArr: PromiseLike[]; -var strThenArr: PromiseLike[]; -var anyThenArr: PromiseLike[]; +let numThenArr: Array>; +let strThenArr: Array>; +let anyThenArr: Array>; -var fooThenArr: PromiseLike[]; -var barThenArr: PromiseLike[]; +let fooThenArr: Array>; +let barThenArr: Array>; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // booya! -var fooThenArrThen: PromiseLike[]>; -var barThenArrThen: PromiseLike[]>; +let fooThenArrThen: PromiseLike>>; +let barThenArrThen: PromiseLike>>; -var fooResolver: Promise.Resolver; -var barResolver: Promise.Resolver; +let fooResolver: Promise.Resolver; +let barResolver: Promise.Resolver; -var fooInspection: Promise.Inspection; -var fooInspectionPromise: Promise>; +let fooInspection: Promise.Inspection; +let fooInspectionPromise: Promise>; -var fooInspectionArrProm: Promise[]>; -var barInspectionArrProm: Promise[]>; +let fooInspectionArrProm: Promise>>; +let barInspectionArrProm: Promise>>; -var BlueBird: typeof Promise; +let BlueBird: typeof Promise; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var version: string = Promise.version; +let version: string = Promise.version; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var nodeCallbackFunc = (callback: (err: any, result: string) => void) => {} -var nodeCallbackFuncErrorOnly = (callback: (err: any) => void) => {} +let nodeCallbackFunc = (callback: (err: any, result: string) => void) => {}; +let nodeCallbackFuncErrorOnly = (callback: (err: any) => void) => {}; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -168,8 +166,7 @@ barThen = barProm; fooProm = new Promise((resolve: (value: Foo) => void, reject: (reason: any) => void) => { if (bool) { resolve(foo); - } - else { + } else { reject(new Error(str)); } }); @@ -185,8 +182,7 @@ fooProm = new Promise((resolve: (value: Foo) => void) => { fooProm = new Promise((resolve, reject) => { if (bool) { resolve(fooThen); - } - else { + } else { reject(new Error(str)); } }); @@ -200,9 +196,7 @@ fooResolver.resolve(foo); fooResolver.reject(err); -fooResolver.callback = (err: any, value: Foo) => { - -}; +fooResolver.callback = (err: any, value: Foo) => {}; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -224,12 +218,14 @@ barProm = fooProm.then((value: Foo) => { }, (reason: any) => { return barProm; }); -barOrVoidProm = fooProm.then((value: Foo) => { +// $ExpectType Bluebird +fooProm.then((value: Foo) => { return bar; }, (reason: any) => { return; }); -barOrVoidProm = fooProm.then((value: Foo) => { +// $ExpectType Bluebird +fooProm.then((value: Foo) => { return bar; }, (reason: any) => { return voidProm; @@ -239,50 +235,58 @@ barProm = fooProm.then((value: Foo) => { }); barProm = barProm.then((value: Bar) => { if (value) return value; - var b:Bar; + let b: Bar; return Promise.resolve(b); }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -fooProm = fooProm.catch((reason: any) => { +// $ExpectType Bluebird +fooProm.catch((reason: any) => { return; }); -fooProm = fooProm.caught((reason: any) => { +// $ExpectType Bluebird +fooProm.caught((reason: any) => { return; }); -fooProm = fooProm.catch((error: any) => { +// $ExpectType Bluebird +fooProm.catch((error: any) => { return true; }, (reason: any) => { return; }); -fooProm = fooProm.caught((error: any) => { +// $ExpectType Bluebird +fooProm.caught((error: any) => { return true; }, (reason: any) => { return; }); -fooProm = fooProm.catch((reason: any) => { +// $ExpectType Bluebird +fooProm.catch((reason: any) => { return voidProm; }); - -fooProm = fooProm.caught((reason: any) => { +// $ExpectType Bluebird +fooProm.caught((reason: any) => { return voidProm; }); -fooProm = fooProm.catch((error: any) => { +// $ExpectType Bluebird +fooProm.catch((error: any) => { return true; }, (reason: any) => { return voidProm; }); -fooProm = fooProm.caught((error: any) => { +// $ExpectType Bluebird +fooProm.caught((error: any) => { return true; }, (reason: any) => { return voidProm; }); -fooProm = fooProm.catch((reason: any) => { - //handle multiple valid return types simultaneously +// $ExpectType Bluebird +fooProm.catch((reason: any) => { // tslint:disable-line:void-return + // handle multiple valid return types simultaneously if (foo === null) { return; } else if (!reason) { @@ -312,16 +316,20 @@ fooOrBarProm = fooProm.caught((error: any) => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -fooProm = fooProm.catch(Error, (reason: any) => { +// $ExpectType Bluebird +fooProm.catch(Error, (reason: any) => { return; }); -fooProm = fooProm.catch(Promise.CancellationError, (reason: any) => { +// $ExpectType Bluebird +fooProm.catch(Promise.CancellationError, (reason: any) => { return; }); -fooProm = fooProm.caught(Error, (reason: any) => { +// $ExpectType Bluebird +fooProm.caught(Error, (reason: any) => { return; }); -fooProm = fooProm.caught(Promise.CancellationError, (reason: any) => { +// $ExpectType Bluebird +fooProm.caught(Promise.CancellationError, (reason: any) => { return; }); @@ -341,63 +349,80 @@ fooOrBarProm = fooProm.caught(Promise.CancellationError, (reason: any) => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - class CustomError extends Error { - public customField: number; + customField: number; } -fooProm = fooProm.catch(CustomError, reason => { - let a: number = reason.customField -}) +// $ExpectType Bluebird +fooProm.catch(CustomError, (reason: CustomError) => { + let a: number = reason.customField; +}); -{ - class CustomErrorWithConstructor extends Error { - constructor(public arg1: boolean, public arg2: number) { - super(); - }; +class CustomErrorWithConstructor extends Error { + arg1: boolean; + arg2: number; + constructor(arg1: boolean, arg2: number) { + super(); + this.arg1 = arg1; + this.arg2 = arg2; } - fooProm = fooProm.catch(CustomErrorWithConstructor, reason => { - let a: boolean = reason.arg1; - let b: number = reason.arg2; - }) } +// $ExpectType Bluebird +fooProm.catch(CustomErrorWithConstructor, (reason: CustomErrorWithConstructor) => { + let a: boolean = reason.arg1; + let b: number = reason.arg2; +}); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -{ - class CustomError1 extends Error {} - class CustomError2 extends Error {} - class CustomError3 extends Error {} - class CustomError4 extends Error {} - class CustomError5 extends Error {} +class CustomError1 extends Error {} +class CustomError2 extends Error {} +class CustomError3 extends Error {} +class CustomError4 extends Error {} +class CustomError5 extends Error {} - fooProm = fooProm.catch(CustomError1, error => {}); - fooProm = fooProm.catch(CustomError1, CustomError2, error => {}); - fooProm = fooProm.catch(CustomError1, CustomError2, CustomError3, error => {}); - fooProm = fooProm.catch(CustomError1, CustomError2, CustomError3, CustomError4, error => {}); - fooProm = fooProm.catch(CustomError1, CustomError2, CustomError3, CustomError4, CustomError5, error => {}); +// $ExpectType Bluebird +fooProm.catch(CustomError1, error => {}); +// $ExpectType Bluebird +fooProm.catch(CustomError1, CustomError2, error => {}); +// $ExpectType Bluebird +fooProm.catch(CustomError1, CustomError2, CustomError3, error => {}); +// $ExpectType Bluebird +fooProm.catch(CustomError1, CustomError2, CustomError3, CustomError4, error => {}); +// $ExpectType Bluebird +fooProm.catch(CustomError1, CustomError2, CustomError3, CustomError4, CustomError5, error => {}); - const booPredicate1 = (error: CustomError1) => true; - const booPredicate2 = (error: [number]) => true; - const booPredicate3 = (error: string) => true; - const booPredicate4 = (error: Object) => true; - const booPredicate5 = (error: any) => true; +const booPredicate1 = (error: CustomError1) => true; +const booPredicate2 = (error: [number]) => true; +const booPredicate3 = (error: string) => true; +const booPredicate4 = (error: object) => true; +const booPredicate5 = (error: any) => true; - fooProm = fooProm.catch(booPredicate1, error => {}); - fooProm = fooProm.catch(booPredicate1, booPredicate2, error => {}); - fooProm = fooProm.catch(booPredicate1, booPredicate2, booPredicate3, error => {}); - fooProm = fooProm.catch(booPredicate1, booPredicate2, booPredicate3, booPredicate4, error => {}); - fooProm = fooProm.catch(booPredicate1, booPredicate2, booPredicate3, booPredicate4, booPredicate5, error => {}); +// $ExpectType Bluebird +fooProm.catch(booPredicate1, error => {}); +// $ExpectType Bluebird +fooProm.catch(booPredicate1, booPredicate2, error => {}); +// $ExpectType Bluebird +fooProm.catch(booPredicate1, booPredicate2, booPredicate3, error => {}); +// $ExpectType Bluebird +fooProm.catch(booPredicate1, booPredicate2, booPredicate3, booPredicate4, error => {}); +// $ExpectType Bluebird +fooProm.catch(booPredicate1, booPredicate2, booPredicate3, booPredicate4, booPredicate5, error => {}); - const booObject1 = new CustomError1(); - const booObject2 = [400, 500]; - const booObject3 = ["Error1", "Error2"]; - const booObject4 = {code: 400}; - const booObject5: any = null; +const booObject1 = new CustomError1(); +const booObject2 = [400, 500]; +const booObject3 = ["Error1", "Error2"]; +const booObject4 = {code: 400}; +const booObject5: any = null; - fooProm = fooProm.catch(booObject1, error => {}); - fooProm = fooProm.catch(booObject1, booObject2, error => {}); - fooProm = fooProm.catch(booObject1, booObject2, booObject3, error => {}); - fooProm = fooProm.catch(booObject1, booObject2, booObject3, booObject4, error => {}); - fooProm = fooProm.catch(booObject1, booObject2, booObject3, booObject4, booObject5, error => {}); -} +// $ExpectType Bluebird +fooProm.catch(booObject1, error => {}); +// $ExpectType Bluebird +fooProm.catch(booObject1, booObject2, error => {}); +// $ExpectType Bluebird +fooProm.catch(booObject1, booObject2, booObject3, error => {}); +// $ExpectType Bluebird +fooProm.catch(booObject1, booObject2, booObject3, booObject4, error => {}); +// $ExpectType Bluebird +fooProm.catch(booObject1, booObject2, booObject3, booObject4, booObject5, error => {}); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -437,23 +462,27 @@ fooProm = fooProm.bind(obj); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -voidVar = fooProm.done((value: Foo) => { +// $ExpectType void +fooProm.done((value: Foo) => { return bar; }, (reason: any) => { return bar; }); -voidVar = fooProm.done((value: Foo) => { +// $ExpectType void +fooProm.done((value: Foo) => { return bar; }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -voidVar = fooProm.done((value: Foo) => { +// $ExpectType void +fooProm.done((value: Foo) => { return barThen; }, (reason: any) => { return barThen; }); -voidVar = fooProm.done((value: Foo) => { +// $ExpectType void +fooProm.done((value: Foo) => { return barThen; }); @@ -512,7 +541,8 @@ fooProm = fooProm.nodeify((err: any, foo?: Foo) => { }, { spread: true }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -voidVar = fooProm.cancel(); +// $ExpectType void +fooProm.cancel(); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -524,11 +554,10 @@ bool = fooProm.isResolved(); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -anyProm = fooProm.call(str); -anyProm = fooProm.call(str, 1, 2, 3); +anyProm = fooProm.call("foo"); +anyProm = fooProm.call("foo", 1, 2, 3); -//TODO enable get() test when implemented -// barProm = fooProm.get(str); +voidProm = fooProm.get("foo").then((method) => { str = method(); }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -546,7 +575,7 @@ fooProm = fooProm.thenThrow(err); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -barProm = fooProm.catchReturn(bar); +fooOrBarProm = fooProm.return(foo).catchReturn(bar); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -573,7 +602,7 @@ barProm = fooArrProm.spread((one: Foo, two: Bar, twotwo: Foo) => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//TODO fix collection inference +// TODO fix collection inference barArrProm = fooProm.all(); fooInspectionPromise = fooProm.reflect(); @@ -583,16 +612,16 @@ barProm = fooProm.race(); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -var propsValue: { num: number, str: string }; -Promise.resolve({ num: 1, str: Promise.resolve('a') }).props().then(val => { propsValue = val }); -Promise.props({ num: 1, str: Promise.resolve('a') }).then(val => { propsValue = val }); -Promise.props(Promise.props({ num: 1, str: Promise.resolve('a') })).then(val => { propsValue = val }); +let propsValue: { num: number, str: string }; +Promise.resolve({ num: 1, str: Promise.resolve('a') }).props().then(val => { propsValue = val; }); +Promise.props({ num: 1, str: Promise.resolve('a') }).then(val => { propsValue = val; }); +Promise.props(Promise.props({ num: 1, str: Promise.resolve('a') })).then(val => { propsValue = val; }); -var propsMapValue: Map; -Promise.resolve(new Map()).props().then(val => { propsMapValue = val }); -Promise.resolve(new Map>()).props().then(val => { propsMapValue = val }); -Promise.props(new Map()).then(val => { propsMapValue = val }); -Promise.props(new Map>()).then(val => { propsMapValue = val }); +let propsMapValue: Map; +Promise.resolve(new Map()).props().then(val => { propsMapValue = val; }); +Promise.resolve(new Map>()).props().then(val => { propsMapValue = val; }); +Promise.props(new Map()).then(val => { propsMapValue = val; }); +Promise.props(new Map>()).then(val => { propsMapValue = val; }); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -620,7 +649,7 @@ Promise.all([fooProm, barProm, fooProm]).then(result => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//TODO fix collection inference +// TODO fix collection inference barArrProm = fooArrProm.map((item: Foo, index: number, arrayLength: number) => { return bar; @@ -649,7 +678,6 @@ barArrProm = fooArrProm.mapSeries((item: Foo) => { return bar; }); - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - barProm = fooArrProm.reduce((memo: Bar, item: Foo, index: number, arrayLength: number) => { @@ -755,9 +783,7 @@ fooProm = Promise.attempt(() => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -asyncfunc = Promise.method(function () { - -}); +asyncfunc = Promise.method(() => {}); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -785,7 +811,7 @@ Promise.longStackTraces(); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//TODO enable delay +// TODO enable delay fooProm = Promise.delay(num, fooThen); fooProm = Promise.delay(num, foo); @@ -797,36 +823,33 @@ asyncfunc = Promise.promisify(f); asyncfunc = Promise.promisify(f, obj); obj = Promise.promisifyAll(obj); -anyProm = Promise.fromNode(callback => nodeCallbackFunc(callback)); -anyProm = Promise.fromNode(callback => nodeCallbackFuncErrorOnly(callback)); -anyProm = Promise.fromNode(callback => nodeCallbackFunc(callback), {multiArgs : true}); -anyProm = Promise.fromNode(callback => nodeCallbackFuncErrorOnly(callback), {multiArgs : true}); +anyProm = Promise.fromNode(nodeCallbackFunc); +anyProm = Promise.fromNode(nodeCallbackFuncErrorOnly); +anyProm = Promise.fromNode(nodeCallbackFunc, {multiArgs : true}); +anyProm = Promise.fromNode(nodeCallbackFuncErrorOnly, {multiArgs : true}); -anyProm = Promise.fromCallback(callback => nodeCallbackFunc(callback)); -anyProm = Promise.fromCallback(callback => nodeCallbackFuncErrorOnly(callback)); -anyProm = Promise.fromCallback(callback => nodeCallbackFunc(callback), {multiArgs : true}); -anyProm = Promise.fromCallback(callback => nodeCallbackFuncErrorOnly(callback), {multiArgs : true}); +anyProm = Promise.fromCallback(nodeCallbackFunc); +anyProm = Promise.fromCallback(nodeCallbackFuncErrorOnly); +anyProm = Promise.fromCallback(nodeCallbackFunc, {multiArgs : true}); +anyProm = Promise.fromCallback(nodeCallbackFuncErrorOnly, {multiArgs : true}); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -declare var util: any; +declare let util: any; -function defaultFilter(name: string, func: Function) { +function defaultFilter(name: string, func: (...args: any[]) => any) { return util.isIdentifier(name) && name.charAt(0) !== "_" && !util.isClass(func); } -function DOMPromisifier(originalMethod: Function) { +function DOMPromisifier(originalMethod: (...args: any[]) => any) { // return a function - return function promisified() { - var args = [].slice.call(arguments); - // Needed so that the original method can be called with the correct receiver - var self = this; + return function promisified(this: object, ...args: any[]) { // which returns a promise - return new Promise(function(resolve, reject) { + return new Promise((resolve, reject) => { args.push(resolve, reject); - originalMethod.apply(self, args); + originalMethod.apply(this, args); }); }; } @@ -839,11 +862,11 @@ obj = Promise.promisifyAll(obj, { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -const generator = function* (a: number, b: string) {return "string"} +const generator = function*(a: number, b: string) { return "string"; }; const coroutine = Promise.coroutine(generator); coroutine(5, "foo").then((x: string) => {}); -const coroutineCustomYield = Promise.coroutine(generator, { yieldHandler: (value) => "whatever" }) +const coroutineCustomYield = Promise.coroutine(generator, { yieldHandler: (value) => "whatever" }); /* barProm = Promise.spawn(f); */ @@ -852,13 +875,11 @@ const coroutineCustomYield = Promise.coroutine(generator, { yieldHandler: (value BlueBird = Promise.getNewLibraryCopy(); BlueBird = Promise.noConflict(); -Promise.onPossiblyUnhandledRejection((reason: any) => { - -}); +Promise.onPossiblyUnhandledRejection((reason: any) => {}); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//TODO expand tests to overloads +// TODO expand tests to overloads fooArrProm = Promise.all(fooThenArrThen); fooArrProm = Promise.all(fooArrProm); fooArrProm = Promise.all(fooThenArr); @@ -871,7 +892,7 @@ objProm = Promise.props(obj); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//TODO expand tests to overloads +// TODO expand tests to overloads fooProm = Promise.any(fooThenArrThen); fooProm = Promise.any(fooArrProm); fooProm = Promise.any(fooThenArr); @@ -879,7 +900,7 @@ fooProm = Promise.any(fooArr); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//TODO expand tests to overloads +// TODO expand tests to overloads fooProm = Promise.race(fooThenArrThen); fooProm = Promise.race(fooArrProm); fooProm = Promise.race(fooThenArr); @@ -887,7 +908,7 @@ fooProm = Promise.race(fooArr); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//TODO expand tests to overloads +// TODO expand tests to overloads fooArrProm = Promise.some(fooThenArrThen, num); fooArrProm = Promise.some(fooThenArr, num); fooArrProm = Promise.some(fooArr, num); @@ -1090,7 +1111,6 @@ barArrProm = Promise.mapSeries(fooArrThen, (item: Foo, index: number, arrayLengt return barThen; }); - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // fooThenArr @@ -1108,7 +1128,6 @@ barArrProm = Promise.mapSeries(fooThenArr, (item: Foo, index: number, arrayLengt return barThen; }); - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // fooArr @@ -1126,7 +1145,6 @@ barArrProm = Promise.mapSeries(fooArr, (item: Foo, index: number, arrayLength: n return barThen; }); - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // reduce() diff --git a/types/bluebird/index.d.ts b/types/bluebird/index.d.ts index b9a9d35e4d..ba7a8bd172 100644 --- a/types/bluebird/index.d.ts +++ b/types/bluebird/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bluebird 3.5.0 +// Type definitions for bluebird 3.5 // Project: https://github.com/petkaantonov/bluebird // Definitions by: Leonard Hecker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -43,30 +43,39 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { constructor(callback: (resolve: (thenableOrResult?: R | PromiseLike) => void, reject: (error?: any) => void, onCancel?: (callback: () => void) => void) => void); /** - * Promises/A+ `.then()`. Returns a new promise chained from this promise. The new promise will be rejected or resolved dedefer on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise. + * Promises/A+ `.then()`. Returns a new promise chained from this promise. + * + * The new promise will be rejected or resolved dedefer on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise. */ // Based on PromiseLike.then, but returns a Bluebird instance. then(onFulfill?: (value: R) => U | PromiseLike, onReject?: (error: any) => U | PromiseLike): Bluebird; // For simpler signature help. - then(onfulfilled?: ((value: R) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Bluebird; + then( + onfulfilled?: ((value: R) => TResult1 | PromiseLike) | null, + onrejected?: ((reason: any) => TResult2 | PromiseLike) | null + ): Bluebird; /** - * This is a catch-all exception handler, shortcut for calling `.then(null, handler)` on this promise. Any exception happening in a `.then`-chain will propagate to nearest `.catch` handler. + * This is a catch-all exception handler, shortcut for calling `.then(null, handler)` on this promise. + * + * Any exception happening in a `.then`-chain will propagate to nearest `.catch` handler. * * Alias `.caught();` for compatibility with earlier ECMAScript version. */ - catch(onReject?: (error: any) => R | PromiseLike | void | PromiseLike): Bluebird; - caught(onReject?: (error: any) => R | PromiseLike | void | PromiseLike): Bluebird; - catch(onReject?: (error: any) => U | PromiseLike): Bluebird; - caught(onReject?: (error: any) => U | PromiseLike): Bluebird; + catch(onReject: (error: any) => R | PromiseLike): Bluebird; + catch(onReject: ((error: any) => U | PromiseLike) | undefined | null): Bluebird; /** - * This extends `.catch` to work more like catch-clauses in languages like Java or C#. Instead of manually checking `instanceof` or `.name === "SomeError"`, you may specify a number of error constructors which are eligible for this catch handler. The catch handler that is first met that has eligible constructors specified, is the one that will be called. + * This extends `.catch` to work more like catch-clauses in languages like Java or C#. * - * This method also supports predicate-based filters. If you pass a predicate function instead of an error constructor, the predicate will receive the error as an argument. The return result of the predicate will be used determine whether the error handler should be called. + * Instead of manually checking `instanceof` or `.name === "SomeError"`, + * you may specify a number of error constructors which are eligible for this catch handler. + * The catch handler that is first met that has eligible constructors specified, is the one that will be called. + * + * This method also supports predicate-based filters. + * If you pass a predicate function instead of an error constructor, the predicate will receive the error as an argument. + * The return result of the predicate will be used determine whether the error handler should be called. * * Alias `.caught();` for compatibility with earlier ECMAScript version. - * - * TODO: disallow non-objects */ catch( filter1: (new (...args: any[]) => E1), @@ -74,7 +83,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { filter3: (new (...args: any[]) => E3), filter4: (new (...args: any[]) => E4), filter5: (new (...args: any[]) => E5), - onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike | void | PromiseLike, + onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike, ): Bluebird; catch( filter1: ((error: E1) => boolean) | (E1 & object), @@ -82,23 +91,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { filter3: ((error: E3) => boolean) | (E3 & object), filter4: ((error: E4) => boolean) | (E4 & object), filter5: ((error: E5) => boolean) | (E5 & object), - onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - caught( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - filter4: (new (...args: any[]) => E4), - filter5: (new (...args: any[]) => E5), - onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - caught( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - filter4: ((error: E4) => boolean) | (E4 & object), - filter5: ((error: E5) => boolean) | (E5 & object), - onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike | void | PromiseLike, + onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike, ): Bluebird; catch( filter1: (new (...args: any[]) => E1), @@ -106,7 +99,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { filter3: (new (...args: any[]) => E3), filter4: (new (...args: any[]) => E4), filter5: (new (...args: any[]) => E5), - onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike | void | PromiseLike, + onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike, ): Bluebird; catch( filter1: ((error: E1) => boolean) | (E1 & object), @@ -116,6 +109,136 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { filter5: ((error: E5) => boolean) | (E5 & object), onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike, ): Bluebird; + + catch( + filter1: (new (...args: any[]) => E1), + filter2: (new (...args: any[]) => E2), + filter3: (new (...args: any[]) => E3), + filter4: (new (...args: any[]) => E4), + onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike, + ): Bluebird; + catch( + filter1: ((error: E1) => boolean) | (E1 & object), + filter2: ((error: E2) => boolean) | (E2 & object), + filter3: ((error: E3) => boolean) | (E3 & object), + filter4: ((error: E4) => boolean) | (E4 & object), + onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike, + ): Bluebird; + catch( + filter1: (new (...args: any[]) => E1), + filter2: (new (...args: any[]) => E2), + filter3: (new (...args: any[]) => E3), + filter4: (new (...args: any[]) => E4), + onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike, + ): Bluebird; + catch( + filter1: ((error: E1) => boolean) | (E1 & object), + filter2: ((error: E2) => boolean) | (E2 & object), + filter3: ((error: E3) => boolean) | (E3 & object), + filter4: ((error: E4) => boolean) | (E4 & object), + onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike, + ): Bluebird; + + catch( + filter1: (new (...args: any[]) => E1), + filter2: (new (...args: any[]) => E2), + filter3: (new (...args: any[]) => E3), + onReject: (error: E1 | E2 | E3) => R | PromiseLike, + ): Bluebird; + catch( + filter1: ((error: E1) => boolean) | (E1 & object), + filter2: ((error: E2) => boolean) | (E2 & object), + filter3: ((error: E3) => boolean) | (E3 & object), + onReject: (error: E1 | E2 | E3) => R | PromiseLike, + ): Bluebird; + catch( + filter1: (new (...args: any[]) => E1), + filter2: (new (...args: any[]) => E2), + filter3: (new (...args: any[]) => E3), + onReject: (error: E1 | E2 | E3) => U | PromiseLike, + ): Bluebird; + catch( + filter1: ((error: E1) => boolean) | (E1 & object), + filter2: ((error: E2) => boolean) | (E2 & object), + filter3: ((error: E3) => boolean) | (E3 & object), + onReject: (error: E1 | E2 | E3) => U | PromiseLike, + ): Bluebird; + + catch( + filter1: (new (...args: any[]) => E1), + filter2: (new (...args: any[]) => E2), + onReject: (error: E1 | E2) => R | PromiseLike, + ): Bluebird; + catch( + filter1: ((error: E1) => boolean) | (E1 & object), + filter2: ((error: E2) => boolean) | (E2 & object), + onReject: (error: E1 | E2) => R | PromiseLike, + ): Bluebird; + catch( + filter1: (new (...args: any[]) => E1), + filter2: (new (...args: any[]) => E2), + onReject: (error: E1 | E2) => U | PromiseLike, + ): Bluebird; + catch( + filter1: ((error: E1) => boolean) | (E1 & object), + filter2: ((error: E2) => boolean) | (E2 & object), + onReject: (error: E1 | E2) => U | PromiseLike, + ): Bluebird; + + catch( + filter1: (new (...args: any[]) => E1), + onReject: (error: E1) => R | PromiseLike, + ): Bluebird; + catch( + filter1: ((error: E1) => boolean) | (E1 & object), + onReject: (error: E1) => R | PromiseLike, + ): Bluebird; + catch( + filter1: (new (...args: any[]) => E1), + onReject: (error: E1) => U | PromiseLike, + ): Bluebird; + catch( + filter1: ((error: E1) => boolean) | (E1 & object), + onReject: (error: E1) => U | PromiseLike, + ): Bluebird; + + /** + * This is a catch-all exception handler, shortcut for calling `.then(null, handler)` on this promise. + * + * Any exception happening in a `.then`-chain will propagate to nearest `.catch` handler. + * + * Alias `.caught();` for compatibility with earlier ECMAScript version. + */ + caught(onReject: (error: any) => R | PromiseLike): Bluebird; + caught(onReject: ((error: any) => U | PromiseLike) | undefined | null): Bluebird; + + /** + * This extends `.catch` to work more like catch-clauses in languages like Java or C#. + * + * Instead of manually checking `instanceof` or `.name === "SomeError"`, you may specify a number of error constructors which are eligible for this catch handler. + * The catch handler that is first met that has eligible constructors specified, is the one that will be called. + * + * This method also supports predicate-based filters. If you pass a predicate function instead of an error constructor, the predicate will receive the error as an argument. + * The return result of the predicate will be used determine whether the error handler should be called. + * + * Alias `.caught();` for compatibility with earlier ECMAScript version. + */ + caught( + filter1: (new (...args: any[]) => E1), + filter2: (new (...args: any[]) => E2), + filter3: (new (...args: any[]) => E3), + filter4: (new (...args: any[]) => E4), + filter5: (new (...args: any[]) => E5), + onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike, + ): Bluebird; + caught( + filter1: ((error: E1) => boolean) | (E1 & object), + filter2: ((error: E2) => boolean) | (E2 & object), + filter3: ((error: E3) => boolean) | (E3 & object), + filter4: ((error: E4) => boolean) | (E4 & object), + filter5: ((error: E5) => boolean) | (E5 & object), + onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike, + ): Bluebird; caught( filter1: (new (...args: any[]) => E1), filter2: (new (...args: any[]) => E2), @@ -133,48 +256,20 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike, ): Bluebird; - catch( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - filter4: (new (...args: any[]) => E4), - onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - catch( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - filter4: ((error: E4) => boolean) | (E4 & object), - onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike | void | PromiseLike, - ): Bluebird; caught( filter1: (new (...args: any[]) => E1), filter2: (new (...args: any[]) => E2), filter3: (new (...args: any[]) => E3), filter4: (new (...args: any[]) => E4), - onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike | void | PromiseLike, + onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike, ): Bluebird; caught( filter1: ((error: E1) => boolean) | (E1 & object), filter2: ((error: E2) => boolean) | (E2 & object), filter3: ((error: E3) => boolean) | (E3 & object), filter4: ((error: E4) => boolean) | (E4 & object), - onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike | void | PromiseLike, + onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike, ): Bluebird; - catch( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - filter4: (new (...args: any[]) => E4), - onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike, - ): Bluebird; - catch( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - filter4: ((error: E4) => boolean) | (E4 & object), - onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike, - ): Bluebird; caught( filter1: (new (...args: any[]) => E1), filter2: (new (...args: any[]) => E2), @@ -190,42 +285,18 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike, ): Bluebird; - catch( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - onReject: (error: E1 | E2 | E3) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - catch( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - onReject: (error: E1 | E2 | E3) => R | PromiseLike | void | PromiseLike, - ): Bluebird; caught( filter1: (new (...args: any[]) => E1), filter2: (new (...args: any[]) => E2), filter3: (new (...args: any[]) => E3), - onReject: (error: E1 | E2 | E3) => R | PromiseLike | void | PromiseLike, + onReject: (error: E1 | E2 | E3) => R | PromiseLike, ): Bluebird; caught( filter1: ((error: E1) => boolean) | (E1 & object), filter2: ((error: E2) => boolean) | (E2 & object), filter3: ((error: E3) => boolean) | (E3 & object), - onReject: (error: E1 | E2 | E3) => R | PromiseLike | void | PromiseLike, + onReject: (error: E1 | E2 | E3) => R | PromiseLike, ): Bluebird; - catch( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - filter3: (new (...args: any[]) => E3), - onReject: (error: E1 | E2 | E3) => U | PromiseLike, - ): Bluebird; - catch( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - filter3: ((error: E3) => boolean) | (E3 & object), - onReject: (error: E1 | E2 | E3) => U | PromiseLike, - ): Bluebird; caught( filter1: (new (...args: any[]) => E1), filter2: (new (...args: any[]) => E2), @@ -239,36 +310,16 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { onReject: (error: E1 | E2 | E3) => U | PromiseLike, ): Bluebird; - catch( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - onReject: (error: E1 | E2) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - catch( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - onReject: (error: E1 | E2) => R | PromiseLike | void | PromiseLike, - ): Bluebird; caught( filter1: (new (...args: any[]) => E1), filter2: (new (...args: any[]) => E2), - onReject: (error: E1 | E2) => R | PromiseLike | void | PromiseLike, + onReject: (error: E1 | E2) => R | PromiseLike, ): Bluebird; caught( filter1: ((error: E1) => boolean) | (E1 & object), filter2: ((error: E2) => boolean) | (E2 & object), - onReject: (error: E1 | E2) => R | PromiseLike | void | PromiseLike, + onReject: (error: E1 | E2) => R | PromiseLike, ): Bluebird; - catch( - filter1: (new (...args: any[]) => E1), - filter2: (new (...args: any[]) => E2), - onReject: (error: E1 | E2) => U | PromiseLike, - ): Bluebird; - catch( - filter1: ((error: E1) => boolean) | (E1 & object), - filter2: ((error: E2) => boolean) | (E2 & object), - onReject: (error: E1 | E2) => U | PromiseLike, - ): Bluebird; caught( filter1: (new (...args: any[]) => E1), filter2: (new (...args: any[]) => E2), @@ -280,30 +331,14 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { onReject: (error: E1 | E2) => U | PromiseLike, ): Bluebird; - catch( - filter1: (new (...args: any[]) => E1), - onReject: (error: E1) => R | PromiseLike | void | PromiseLike, - ): Bluebird; - catch( - filter1: ((error: E1) => boolean) | (E1 & object), - onReject: (error: E1) => R | PromiseLike | void | PromiseLike, - ): Bluebird; caught( filter1: (new (...args: any[]) => E1), - onReject: (error: E1) => R | PromiseLike | void | PromiseLike, + onReject: (error: E1) => R | PromiseLike, ): Bluebird; caught( filter1: ((error: E1) => boolean) | (E1 & object), - onReject: (error: E1) => R | PromiseLike | void | PromiseLike, + onReject: (error: E1) => R | PromiseLike, ): Bluebird; - catch( - filter1: (new (...args: any[]) => E1), - onReject: (error: E1) => U | PromiseLike, - ): Bluebird; - catch( - filter1: ((error: E1) => boolean) | (E1 & object), - onReject: (error: E1) => U | PromiseLike, - ): Bluebird; caught( filter1: (new (...args: any[]) => E1), onReject: (error: E1) => U | PromiseLike, @@ -319,7 +354,9 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { error(onReject: (reason: any) => U | PromiseLike): Bluebird; /** - * Pass a handler that will be called regardless of this promise's fate. Returns a new promise chained from this promise. There are special semantics for `.finally()` in that the final value cannot be modified from the handler. + * Pass a handler that will be called regardless of this promise's fate. Returns a new promise chained from this promise. + * + * There are special semantics for `.finally()` in that the final value cannot be modified from the handler. * * Alias `.lastly();` for compatibility with earlier ECMAScript version. */ @@ -328,7 +365,9 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { lastly(handler: () => U | PromiseLike): Bluebird; /** - * Create a promise that follows this promise, but is bound to the given `thisArg` value. A bound promise will call its handlers with the bound value set to `this`. Additionally promises derived from a bound promise will also be bound promises with the same `thisArg` binding as the original promise. + * Create a promise that follows this promise, but is bound to the given `thisArg` value. A bound promise will call its handlers with the bound value set to `this`. + * + * Additionally promises derived from a bound promise will also be bound promises with the same `thisArg` binding as the original promise. */ bind(thisArg: any): Bluebird; @@ -340,43 +379,41 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * Like `.finally()`, but not called for rejections. */ - tap(onFulFill: (value: R) => PromiseLike): Bluebird; - tap(onFulfill: (value: R) => U): Bluebird; + tap(onFulFill: (value: R) => PromiseLike | U): Bluebird; /** * Like `.catch()` but rethrows the error - * TODO: disallow non-objects */ tapCatch(onReject: (error?: any) => U | PromiseLike): Bluebird; tapCatch( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | Object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | Object, - filter5: (new (...args: any[]) => E5) | ((error: any) => boolean) | Object, + filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, + filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, + filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object, + filter5: (new (...args: any[]) => E5) | ((error: any) => boolean) | object, onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike, ): Bluebird; tapCatch( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | Object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | Object, + filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, + filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, + filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | object, onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike, ): Bluebird; tapCatch( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | Object, + filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, + filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | object, onReject: (error: E1 | E2 | E3) => U | PromiseLike, ): Bluebird; tapCatch( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object, + filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | object, onReject: (error: E1 | E2) => U | PromiseLike, ): Bluebird; tapCatch( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, + filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | object, onReject: (error: E1) => U | PromiseLike, ): Bluebird; @@ -395,7 +432,11 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { timeout(ms: number, message?: string | Error): Bluebird; /** - * Register a node-style callback on this promise. When this promise is is either fulfilled or rejected, the node callback will be called back with the node.js convention where error reason is the first argument and success value is the second argument. The error argument will be `null` in case of success. + * Register a node-style callback on this promise. + * + * When this promise is is either fulfilled or rejected, + * the node callback will be called back with the node.js convention where error reason is the first argument and success value is the second argument. + * The error argument will be `null` in case of success. * If the `callback` argument is not a function, this method does not do anything. */ nodeify(callback: (err: any, value?: R) => void, options?: Bluebird.SpreadOption): this; @@ -458,7 +499,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * }); * */ - call(propertyName: string, ...args: any[]): Bluebird; + call(propertyName: keyof R, ...args: any[]): Bluebird; /** * This is a convenience method for doing: @@ -469,9 +510,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * }); * */ - // TODO: Use "type property type" once it's there - // @see https://github.com/Microsoft/TypeScript/issues/1295 - get(key: string | number): Bluebird; + get(key: U): Bluebird; /** * Convenience method for: @@ -487,8 +526,8 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * Alias `.thenReturn();` for compatibility with earlier ECMAScript version. */ return(): Bluebird; - thenReturn(): Bluebird; return(value: U): Bluebird; + thenReturn(): Bluebird; thenReturn(value: U): Bluebird; /** @@ -503,8 +542,8 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * * Alias `.thenThrow();` for compatibility with earlier ECMAScript version. */ - throw(reason: Error): Bluebird; - thenThrow(reason: Error): Bluebird; + throw(reason: Error): Bluebird; + thenThrow(reason: Error): Bluebird; /** * Convenience method for: @@ -516,40 +555,39 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * * * in the case where `value` doesn't change its value. That means `value` is bound at the time of calling `.catchReturn()` - * TODO: disallow non-objects */ - catchReturn(value: U): Bluebird; + catchReturn(value: U): Bluebird; - catchReturn( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | Object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | Object, - filter5: (new (...args: any[]) => E5) | ((error: any) => boolean) | Object, + catchReturn( + filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter4: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter5: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, value: U, - ): Bluebird; - catchReturn( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | Object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | Object, + ): Bluebird; + catchReturn( + filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter4: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, value: U, - ): Bluebird; - catchReturn( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | Object, + ): Bluebird; + catchReturn( + filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, value: U, - ): Bluebird; - catchReturn( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object, + ): Bluebird; + catchReturn( + filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, value: U, - ): Bluebird; - catchReturn( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, + ): Bluebird; + catchReturn( + filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, value: U, - ): Bluebird; + ): Bluebird; /** * Convenience method for: @@ -560,38 +598,37 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * }); * * Same limitations apply as with `.catchReturn()`. - * TODO: disallow non-objects */ catchThrow(reason: Error): Bluebird; - catchThrow( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | Object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | Object, - filter5: (new (...args: any[]) => E5) | ((error: any) => boolean) | Object, + catchThrow( + filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter4: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter5: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, reason: Error, ): Bluebird; - catchThrow( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | Object, - filter4: (new (...args: any[]) => E4) | ((error: any) => boolean) | Object, + catchThrow( + filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter4: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, reason: Error, ): Bluebird; - catchThrow( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object, - filter3: (new (...args: any[]) => E3) | ((error: any) => boolean) | Object, + catchThrow( + filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter3: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, reason: Error, ): Bluebird; - catchThrow( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, - filter2: (new (...args: any[]) => E2) | ((error: any) => boolean) | Object, + catchThrow( + filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, + filter2: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, reason: Error, ): Bluebird; - catchThrow( - filter1: (new (...args: any[]) => E1) | ((error: any) => boolean) | Object, + catchThrow( + filter1: (new (...args: any[]) => Error) | ((error: any) => boolean) | object, reason: Error, ): Bluebird; @@ -603,7 +640,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * This is implicitly called by `JSON.stringify` when serializing the object. Returns a serialized representation of the `Promise`. */ - toJSON(): Object; + toJSON(): object; /** * Like calling `.then`, but the fulfillment value or rejection reason is assumed to be an array, which is flattened to the formal parameters of the handlers. @@ -684,7 +721,8 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * Start the chain of promises with `Promise.try`. Any synchronous exceptions will be turned into rejections on the returned promise. * - * Note about second argument: if it's specifically a true array, its values become respective arguments for the function call. Otherwise it is passed as is as the first argument for the function call. + * Note about second argument: if it's specifically a true array, its values become respective arguments for the function call. + * Otherwise it is passed as is as the first argument for the function call. * * Alias for `attempt();` for compatibility with earlier ECMAScript version. */ @@ -692,14 +730,15 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { static attempt(fn: () => R | PromiseLike): Bluebird; /** - * Returns a new function that wraps the given function `fn`. The new function will always return a promise that is fulfilled with the original functions return values or rejected with thrown exceptions from the original function. + * Returns a new function that wraps the given function `fn`. + * The new function will always return a promise that is fulfilled with the original functions return values or rejected with thrown exceptions from the original function. * This method is convenient when a function can sometimes return synchronously or throw synchronously. */ - static method(fn: (arg1: A1) => R | PromiseLike): (arg1: A1) => Bluebird - static method(fn: (arg1: A1, arg2: A2) => R | PromiseLike): (arg1: A1, arg2: A2) => Bluebird - static method(fn: (arg1: A1, arg2: A2, arg3: A3) => R | PromiseLike): (arg1: A1, arg2: A2, arg3: A3) => Bluebird - static method(fn: (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => R | PromiseLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Bluebird - static method(fn: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => R | PromiseLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Bluebird + static method(fn: (arg1: A1) => R | PromiseLike): (arg1: A1) => Bluebird; + static method(fn: (arg1: A1, arg2: A2) => R | PromiseLike): (arg1: A1, arg2: A2) => Bluebird; + static method(fn: (arg1: A1, arg2: A2, arg3: A3) => R | PromiseLike): (arg1: A1, arg2: A2, arg3: A3) => Bluebird; + static method(fn: (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => R | PromiseLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Bluebird; + static method(fn: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => R | PromiseLike): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Bluebird; static method(fn: (...args: any[]) => R | PromiseLike): (...args: any[]) => Bluebird; /** @@ -711,8 +750,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { /** * Create a promise that is rejected with the given `reason`. */ - static reject(reason: any): Bluebird; - static reject(reason: any): Bluebird; + static reject(reason: any): Bluebird; /** * Create a promise with undecided fate and return a `PromiseResolver` to control it. See resolution?: Promise(#promise-resolution). @@ -720,7 +758,10 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { static defer(): Bluebird.Resolver; /** - * Cast the given `value` to a trusted promise. If `value` is already a trusted `Promise`, it is returned as is. If `value` is not a thenable, a fulfilled is: Promise returned with `value` as its fulfillment value. If `value` is a thenable (Promise-like object, like those returned by jQuery's `$.ajax`), returns a trusted that: Promise assimilates the state of the thenable. + * Cast the given `value` to a trusted promise. + * + * If `value` is already a trusted `Promise`, it is returned as is. If `value` is not a thenable, a fulfilled is: Promise returned with `value` as its fulfillment value. + * If `value` is a thenable (Promise-like object, like those returned by jQuery's `$.ajax`), returns a trusted that: Promise assimilates the state of the thenable. */ static cast(value: R | PromiseLike): Bluebird; @@ -735,7 +776,10 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { static is(value: any): boolean; /** - * Call this right after the library is loaded to enabled long stack traces. Long stack traces cannot be disabled after being enabled, and cannot be enabled after promises have already been created. Long stack traces imply a substantial performance penalty, around 4-5x for throughput and 0.5x for latency. + * Call this right after the library is loaded to enabled long stack traces. + * + * Long stack traces cannot be disabled after being enabled, and cannot be enabled after promises have already been created. + * Long stack traces imply a substantial performance penalty, around 4-5x for throughput and 0.5x for latency. */ static longStackTraces(): void; @@ -748,27 +792,52 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { static delay(ms: number): Bluebird; /** - * Returns a function that will wrap the given `nodeFunction`. Instead of taking a callback, the returned function will return a promise whose fate is decided by the callback behavior of the given node function. The node function should conform to node.js convention of accepting a callback as last argument and calling that callback with error as the first argument and success value on the second argument. + * Returns a function that will wrap the given `nodeFunction`. + * + * Instead of taking a callback, the returned function will return a promise whose fate is decided by the callback behavior of the given node function. + * The node function should conform to node.js convention of accepting a callback as last argument and + * calling that callback with error as the first argument and success value on the second argument. * * If the `nodeFunction` calls its callback with multiple success values, the fulfillment value will be an array of them. * * If you pass a `receiver`, the `nodeFunction` will be called as a method on the `receiver`. */ - static promisify(func: (callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): () => Bluebird; - static promisify(func: (arg1: A1, callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1) => Bluebird; - static promisify(func: (arg1: A1, arg2: A2, callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2) => Bluebird; - static promisify(func: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2, arg3: A3) => Bluebird; - static promisify(func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Bluebird; - static promisify(func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Bluebird; + static promisify( + func: (callback: (err: any, result?: T) => void) => void, + options?: Bluebird.PromisifyOptions + ): () => Bluebird; + static promisify( + func: (arg1: A1, callback: (err: any, result?: T) => void) => void, + options?: Bluebird.PromisifyOptions + ): (arg1: A1) => Bluebird; + static promisify( + func: (arg1: A1, arg2: A2, callback: (err: any, result?: T) => void) => void, + options?: Bluebird.PromisifyOptions + ): (arg1: A1, arg2: A2) => Bluebird; + static promisify( + func: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any, result?: T) => void) => void, + options?: Bluebird.PromisifyOptions + ): (arg1: A1, arg2: A2, arg3: A3) => Bluebird; + static promisify( + func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any, result?: T) => void) => void, + options?: Bluebird.PromisifyOptions + ): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Bluebird; + static promisify( + func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any, result?: T) => void) => void, + options?: Bluebird.PromisifyOptions + ): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Bluebird; static promisify(nodeFunction: (...args: any[]) => void, options?: Bluebird.PromisifyOptions): (...args: any[]) => Bluebird; /** - * Promisifies the entire object by going through the object's properties and creating an async equivalent of each function on the object and its prototype chain. The promisified method name will be the original method name postfixed with `Async`. Returns the input object. + * Promisifies the entire object by going through the object's properties and creating an async equivalent of each function on the object and its prototype chain. * - * Note that the original methods on the object are not overwritten but new methods are created with the `Async`-postfix. For example, if you `promisifyAll()` the node.js `fs` object use `fs.statAsync()` to call the promisified `stat` method. + * The promisified method name will be the original method name postfixed with `Async`. Returns the input object. + * + * Note that the original methods on the object are not overwritten but new methods are created with the `Async`-postfix. For example, + * if you `promisifyAll()` the node.js `fs` object use `fs.statAsync()` to call the promisified `stat` method. */ // TODO how to model promisifyAll? - static promisifyAll(target: Object, options?: Bluebird.PromisifyAllOptions): Object; + static promisifyAll(target: T, options?: Bluebird.PromisifyAllOptions): T; /** * Returns a promise that is resolved by a node style callback function. @@ -779,19 +848,50 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { static fromCallback(resolver: (callback: (err: any, result?: T) => void) => void, options?: Bluebird.FromNodeOptions): Bluebird; /** - * Returns a function that can use `yield` to run asynchronous code synchronously. This feature requires the support of generators which are drafted in the next version of the language. Node version greater than `0.11.2` is required and needs to be executed with the `--harmony-generators` (or `--harmony`) command-line switch. + * Returns a function that can use `yield` to run asynchronous code synchronously. + * + * This feature requires the support of generators which are drafted in the next version of the language. + * Node version greater than `0.11.2` is required and needs to be executed with the `--harmony-generators` (or `--harmony`) command-line switch. */ // TODO: After https://github.com/Microsoft/TypeScript/issues/2983 is implemented, we can use // the return type propagation of generators to automatically infer the return type T. - static coroutine(generatorFunction: () => IterableIterator, options?: Bluebird.CoroutineOptions): () => Bluebird; - static coroutine(generatorFunction: (a1: A1) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1) => Bluebird; - static coroutine(generatorFunction: (a1: A1, a2: A2) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2) => Bluebird; - static coroutine(generatorFunction: (a1: A1, a2: A2, a3: A3) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3) => Bluebird; - static coroutine(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4) => Bluebird; - static coroutine(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5) => Bluebird; - static coroutine(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6) => Bluebird; - static coroutine(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7) => Bluebird; - static coroutine(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8) => IterableIterator, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8) => Bluebird; + static coroutine( + generatorFunction: () => IterableIterator, + options?: Bluebird.CoroutineOptions + ): () => Bluebird; + static coroutine( + generatorFunction: (a1: A1) => IterableIterator, + options?: Bluebird.CoroutineOptions + ): (a1: A1) => Bluebird; + static coroutine( + generatorFunction: (a1: A1, a2: A2) => IterableIterator, + options?: Bluebird.CoroutineOptions + ): (a1: A1, a2: A2) => Bluebird; + static coroutine( + generatorFunction: (a1: A1, a2: A2, a3: A3) => IterableIterator, + options?: Bluebird.CoroutineOptions + ): (a1: A1, a2: A2, a3: A3) => Bluebird; + static coroutine( + generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4) => IterableIterator, + options?: Bluebird.CoroutineOptions + ): (a1: A1, a2: A2, a3: A3, a4: A4) => Bluebird; + static coroutine( + generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5) => IterableIterator, + options?: Bluebird.CoroutineOptions + ): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5) => Bluebird; + static coroutine( + generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6) => IterableIterator, + options?: Bluebird.CoroutineOptions + ): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6) => Bluebird; + static coroutine( + generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7) => IterableIterator, + options?: Bluebird.CoroutineOptions + ): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7) => Bluebird; + static coroutine( + generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8) => IterableIterator, + options?: Bluebird.CoroutineOptions + ): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8) => Bluebird; + /** * Add `handler` as the handler to call when there is a possibly unhandled rejection. The default handler logs the error stack to stderr or `console.error` in browsers. * @@ -800,7 +900,19 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { static onPossiblyUnhandledRejection(handler: (reason: any) => any): void; /** - * Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled when all the items in the array are fulfilled. The promise's fulfillment value is an array with fulfillment values at respective positions to the original array. If any promise in the array rejects, the returned promise is rejected with the rejection reason. + * Add handler as the handler to call when there is a possibly unhandled rejection. + * The default handler logs the error stack to stderr or console.error in browsers. + * + * Passing no value or a non-function will have the effect of removing any kind of handling for possibly unhandled rejections. + * + * Note: this hook is specific to the bluebird instance its called on, application developers should use global rejection events. + */ + static onPossiblyUnhandledRejection(handler?: (error: Error, promise: Bluebird) => void): void; + + /** + * Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled when all the items in the array are fulfilled. + * The promise's fulfillment value is an array with fulfillment values at respective positions to the original array. + * If any promise in the array rejects, the returned promise is rejected with the rejection reason. */ // TODO enable more overloads // array with promises of different types @@ -810,50 +922,47 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { static all(values: [PromiseLike | T1, PromiseLike | T2]): Bluebird<[T1, T2]>; static all(values: [PromiseLike | T1]): Bluebird<[T1]>; // array with values - static all(values: PromiseLike<(PromiseLike | R)[]> | (PromiseLike | R)[]): Bluebird; + static all(values: PromiseLike | R>> | Iterable | R>): Bluebird; /** - * Like ``Promise.all`` but for object properties instead of array items. Returns a promise that is fulfilled when all the properties of the object are fulfilled. The promise's fulfillment value is an object with fulfillment values at respective keys to the original object. If any promise in the object rejects, the returned promise is rejected with the rejection reason. + * Like ``Promise.all`` but for object properties instead of array items. Returns a promise that is fulfilled when all the properties of the object are fulfilled. * - * If `object` is a trusted `Promise`, then it will be treated as a promise for object rather than for its properties. All other objects are treated for their properties as is returned by `Object.keys` - the object's own enumerable properties. + * The promise's fulfillment value is an object with fulfillment values at respective keys to the original object. + * If any promise in the object rejects, the returned promise is rejected with the rejection reason. + * + * If `object` is a trusted `Promise`, then it will be treated as a promise for object rather than for its properties. + * All other objects are treated for their properties as is returned by `Object.keys` - the object's own enumerable properties. * * *The original object is not modified.* */ - // trusted promise for object - static props(map: PromiseLike | V>>): Bluebird>; - static props(object: PromiseLike>): Bluebird; // map - static props(map: Map | V>): Bluebird>; + static props(map: PromiseLike | V>> | Map | V>): Bluebird>; + // trusted promise for object + static props(object: PromiseLike>): Bluebird; // tslint:disable-line:unified-signatures // object - static props(object: Bluebird.ResolvableProps): Bluebird; + static props(object: Bluebird.ResolvableProps): Bluebird; // tslint:disable-line:unified-signatures /** * Like `Promise.some()`, with 1 as `count`. However, if the promise fulfills, the fulfillment value is not an array of 1 but the value directly. */ - static any(values: PromiseLike<(PromiseLike | R)[]> | (PromiseLike | R)[]): Bluebird; + static any(values: PromiseLike | R>> | Iterable | R>): Bluebird; /** * Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled or rejected as soon as a promise in the array is fulfilled or rejected with the respective rejection reason or fulfillment value. * * **Note** If you pass empty array or a sparse array with no values, or a promise/thenable for such, it will be forever pending. */ - static race(values: PromiseLike<(PromiseLike | R)[]> | (PromiseLike | R)[]): Bluebird; + static race(values: PromiseLike | R>> | Iterable | R>): Bluebird; /** - * Initiate a competetive race between multiple promises or values (values will become immediately fulfilled promises). When `count` amount of promises have been fulfilled, the returned promise is fulfilled with an array that contains the fulfillment values of the winners in order of resolution. + * Initiate a competetive race between multiple promises or values (values will become immediately fulfilled promises). + * When `count` amount of promises have been fulfilled, the returned promise is fulfilled with an array that contains the fulfillment values of the winners in order of resolution. * * If too many promises are rejected so that the promise can never become fulfilled, it will be immediately rejected with an array of rejection reasons in the order they were thrown in. * * *The original array is not modified.* */ - // promise of array with promises of value - static some(values: PromiseLike[]>, count: number): Bluebird; - // promise of array with values - static some(values: PromiseLike, count: number): Bluebird; - // array with promises of value - static some(values: PromiseLike[], count: number): Bluebird; - // array with values - static some(values: R[], count: number): Bluebird; + static some(values: PromiseLike | R>> | Iterable | R>, count: number): Bluebird; /** * Promise.join( @@ -862,95 +971,112 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * ) -> Promise * For coordinating multiple concurrent discrete promises. * - * Note: In 1.x and 0.x Promise.join used to be a Promise.all that took the values in as arguments instead in an array. This behavior has been deprecated but is still supported partially - when the last argument is an immediate function value the new semantics will apply + * Note: In 1.x and 0.x Promise.join used to be a Promise.all that took the values in as arguments instead in an array. + * This behavior has been deprecated but is still supported partially - when the last argument is an immediate function value the new semantics will apply */ - static join(arg1: A1 | PromiseLike, handler: (arg1: A1) => R | PromiseLike): Bluebird; - static join(arg1: A1 | PromiseLike, arg2: A2 | PromiseLike, handler: (arg1: A1, arg2: A2) => R | PromiseLike): Bluebird; - static join(arg1: A1 | PromiseLike, arg2: A2 | PromiseLike, arg3: A3 | PromiseLike, handler: (arg1: A1, arg2: A2, arg3: A3) => R | PromiseLike): Bluebird; - static join(arg1: A1 | PromiseLike, arg2: A2 | PromiseLike, arg3: A3 | PromiseLike, arg4: A4 | PromiseLike, handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => R | PromiseLike): Bluebird; - static join(arg1: A1 | PromiseLike, arg2: A2 | PromiseLike, arg3: A3 | PromiseLike, arg4: A4 | PromiseLike, arg5: A5 | PromiseLike, handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => R | PromiseLike): Bluebird; + static join( + arg1: A1 | PromiseLike, + handler: (arg1: A1) => R | PromiseLike + ): Bluebird; + static join( + arg1: A1 | PromiseLike, + arg2: A2 | PromiseLike, + handler: (arg1: A1, arg2: A2) => R | PromiseLike + ): Bluebird; + static join( + arg1: A1 | PromiseLike, + arg2: A2 | PromiseLike, + arg3: A3 | PromiseLike, + handler: (arg1: A1, arg2: A2, arg3: A3) => R | PromiseLike + ): Bluebird; + static join( + arg1: A1 | PromiseLike, + arg2: A2 | PromiseLike, + arg3: A3 | PromiseLike, + arg4: A4 | PromiseLike, + handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => R | PromiseLike + ): Bluebird; + static join( + arg1: A1 | PromiseLike, + arg2: A2 | PromiseLike, + arg3: A3 | PromiseLike, + arg4: A4 | PromiseLike, + arg5: A5 | PromiseLike, + handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => R | PromiseLike + ): Bluebird; // variadic array /** @deprecated use .all instead */ - static join(...values: (R | PromiseLike)[]): Bluebird; + static join(...values: Array>): Bluebird; /** - * Map an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `mapper` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well. + * Map an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `mapper` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. + * If any promise in the input array is rejected the returned promise is rejected as well. * * If the `mapper` function returns promises or thenables, the returned promise will wait for all the mapped results to be resolved as well. * * *The original array is not modified.* */ - // promise of array with promises of value - static map(values: PromiseLike[]>, mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird; - - // promise of array with values - static map(values: PromiseLike, mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird; - - // array with promises of value - static map(values: PromiseLike[], mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird; - - // array with values - static map(values: R[], mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike, options?: Bluebird.ConcurrencyOption): Bluebird; + static map( + values: PromiseLike | R>> | Iterable | R>, + mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike, + options?: Bluebird.ConcurrencyOption + ): Bluebird; /** - * Reduce an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `reducer` function with the signature `(total, current, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well. + * Reduce an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `reducer` function with the signature `(total, current, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. + * If any promise in the input array is rejected the returned promise is rejected as well. * * If the reducer function returns a promise or a thenable, the result for the promise is awaited for before continuing with next iteration. * - * *The original array is not modified. If no `intialValue` is given and the array doesn't contain at least 2 items, the callback will not be called and `undefined` is returned. If `initialValue` is given and the array doesn't have at least 1 item, `initialValue` is returned.* + * *The original array is not modified. If no `intialValue` is given and the array doesn't contain at least 2 items, the callback will not be called and `undefined` is returned. + * If `initialValue` is given and the array doesn't have at least 1 item, `initialValue` is returned.* */ - // promise of array with promises of value - static reduce(values: PromiseLike[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Bluebird; - - // promise of array with values - static reduce(values: PromiseLike, reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Bluebird; - - // array with promises of value - static reduce(values: PromiseLike[], reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Bluebird; - - // array with values - static reduce(values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike, initialValue?: U): Bluebird; + static reduce( + values: PromiseLike | R>> | Iterable | R>, + reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike, + initialValue?: U + ): Bluebird; /** - * Filter an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `filterer` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well. + * Filter an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `filterer` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. + * If any promise in the input array is rejected the returned promise is rejected as well. * * The return values from the filtered functions are coerced to booleans, with the exception of promises and thenables which are awaited for their eventual result. * * *The original array is not modified. */ - // promise of array with promises of value - static filter(values: PromiseLike[]>, filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike, option?: Bluebird.ConcurrencyOption): Bluebird; - - // promise of array with values - static filter(values: PromiseLike, filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike, option?: Bluebird.ConcurrencyOption): Bluebird; - - // array with promises of value - static filter(values: PromiseLike[], filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike, option?: Bluebird.ConcurrencyOption): Bluebird; - - // array with values - static filter(values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike, option?: Bluebird.ConcurrencyOption): Bluebird; + static filter( + values: PromiseLike | R>> | Iterable | R>, + filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike, + option?: Bluebird.ConcurrencyOption + ): Bluebird; /** - * Iterate over an array, or a promise of an array, which contains promises (or a mix of promises and values) with the given iterator function with the signature (item, index, value) where item is the resolved value of a respective promise in the input array. Iteration happens serially. If any promise in the input array is rejected the returned promise is rejected as well. + * Iterate over an array, or a promise of an array, which contains promises (or a mix of promises and values) with the given iterator function with the signature (item, index, value) where item is the resolved value of a respective promise in the input array. + * Iteration happens serially. If any promise in the input array is rejected the returned promise is rejected as well. * - * Resolves to the original array unmodified, this method is meant to be used for side effects. If the iterator function returns a promise or a thenable, the result for the promise is awaited for before continuing with next iteration. + * Resolves to the original array unmodified, this method is meant to be used for side effects. + * If the iterator function returns a promise or a thenable, the result for the promise is awaited for before continuing with next iteration. */ - // promise of array with promises of value - static each(values: PromiseLike[]>, iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; - // array with promises of value - static each(values: PromiseLike[], iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; - // array with values OR promise of array with values - static each(values: R[] | PromiseLike, iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; + static each( + values: PromiseLike | R>> | Iterable | R>, + iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike + ): Bluebird; /** * Given an Iterable(arrays are Iterable), or a promise of an Iterable, which produces promises (or a mix of promises and values), iterate over all the values in the Iterable into an array and iterate over the array serially, in-order. * - * Returns a promise for an array that contains the values returned by the iterator function in their respective positions. The iterator won't be called for an item until its previous item, and the promise returned by the iterator for that item are fulfilled. This results in a mapSeries kind of utility but it can also be used simply as a side effect iterator similar to Array#forEach. + * Returns a promise for an array that contains the values returned by the iterator function in their respective positions. + * The iterator won't be called for an item until its previous item, and the promise returned by the iterator for that item are fulfilled. + * This results in a mapSeries kind of utility but it can also be used simply as a side effect iterator similar to Array#forEach. * * If any promise in the input array is rejected or any promise returned by the iterator function is rejected, the result will be rejected as well. */ - static mapSeries(values: (R | PromiseLike)[] | PromiseLike<(R | PromiseLike)[]>, iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike): Bluebird; + static mapSeries( + values: PromiseLike | R>> | Iterable | R>, + iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike + ): Bluebird; /** * A meta method used to specify the disposer method that cleans up a resource when using `Promise.using`. @@ -969,19 +1095,21 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * will be called when the promise returned by the callback passed to using has settled. The disposer is * necessary because there is no standard interface in node for disposing resources. */ - static using(disposer: Bluebird.Disposer, executor: (transaction: R) => PromiseLike): Bluebird; - static using(disposer: Bluebird.Disposer, disposer2: Bluebird.Disposer, executor: (transaction1: R1, transaction2: R2) => PromiseLike): Bluebird; - static using(disposer: Bluebird.Disposer, disposer2: Bluebird.Disposer, disposer3: Bluebird.Disposer, executor: (transaction1: R1, transaction2: R2, transaction3: R3) => PromiseLike): Bluebird; - - /** - * Add handler as the handler to call when there is a possibly unhandled rejection. - * The default handler logs the error stack to stderr or console.error in browsers. - * - * Passing no value or a non-function will have the effect of removing any kind of handling for possibly unhandled rejections. - * - * Note: this hook is specific to the bluebird instance its called on, application developers should use global rejection events. - */ - static onPossiblyUnhandledRejection(handler?: (error: Error, promise: Bluebird) => void): void; + static using( + disposer: Bluebird.Disposer, + executor: (transaction: R) => PromiseLike + ): Bluebird; + static using( + disposer: Bluebird.Disposer, + disposer2: Bluebird.Disposer, + executor: (transaction1: R1, transaction2: R2 + ) => PromiseLike): Bluebird; + static using( + disposer: Bluebird.Disposer, + disposer2: Bluebird.Disposer, + disposer3: Bluebird.Disposer, + executor: (transaction1: R1, transaction2: R2, transaction3: R3) => PromiseLike + ): Bluebird; /** * Configure long stack traces, warnings, monitoring and cancellation. @@ -1006,7 +1134,7 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { * Create a new promise. The passed in function will receive functions `resolve` and `reject` as its arguments which can be called to seal the fate of the created promise. * If promise cancellation is enabled, passed in function will receive one more function argument `onCancel` that allows to register an optional cancellation callback. */ - static Promise: typeof Bluebird + static Promise: typeof Bluebird; /** * The version number of the library @@ -1015,27 +1143,27 @@ declare class Bluebird implements PromiseLike, Bluebird.Inspection { } declare namespace Bluebird { - export interface ConcurrencyOption { + interface ConcurrencyOption { concurrency: number; } - export interface SpreadOption { + interface SpreadOption { spread: boolean; } - export interface FromNodeOptions { + interface FromNodeOptions { multiArgs?: boolean; } - export interface PromisifyOptions { + interface PromisifyOptions { context?: any; multiArgs?: boolean; } - export interface PromisifyAllOptions extends PromisifyOptions { + interface PromisifyAllOptions extends PromisifyOptions { suffix?: string; - filter?: (name: string, func: (...args: any[]) => any, target?: any, passesDefaultFilter?: boolean) => boolean; + filter?(name: string, func: (...args: any[]) => any, target?: any, passesDefaultFilter?: boolean): boolean; // The promisifier gets a reference to the original method and should return a function which returns a promise - promisifier?: (originalMethod: (...args: any[]) => any, defaultPromisifer: (...args: any[]) => (...args: any[]) => Bluebird) => () => PromiseLike; + promisifier?(this: T, originalMethod: (...args: any[]) => any, defaultPromisifer: (...args: any[]) => (...args: any[]) => Bluebird): () => PromiseLike; } - export interface CoroutineOptions { - yieldHandler: (value: any) => any; + interface CoroutineOptions { + yieldHandler(value: any): any; } /** @@ -1046,17 +1174,17 @@ declare namespace Bluebird { * * `OperationalError`s are caught in `.error` handlers. */ - export class OperationalError extends Error { } + class OperationalError extends Error { } /** * Signals that an operation has timed out. Used as a custom cancellation reason in `.timeout`. */ - export class TimeoutError extends Error { } + class TimeoutError extends Error { } /** * Signals that an operation has been aborted or cancelled. The default reason used by `.cancel`. */ - export class CancellationError extends Error {} + class CancellationError extends Error { } /** * A collection of errors. `AggregateError` is an array-like object, with numeric indices and a `.length` property. @@ -1066,7 +1194,7 @@ declare namespace Bluebird { * * `Promise.some` and `Promise.any` use `AggregateError` as rejection reason when they fail. */ - export class AggregateError extends Error implements ArrayLike { + class AggregateError extends Error implements ArrayLike { length: number; [index: number]: Error; join(separator?: string): string; @@ -1088,19 +1216,17 @@ declare namespace Bluebird { reverse(): AggregateError; } - /** * returned by `Bluebird.disposer()`. */ - export class Disposer { - } + class Disposer { } /** @deprecated Use PromiseLike directly. */ - export type Thenable = PromiseLike; + type Thenable = PromiseLike; - export type ResolvableProps = object & { [K in keyof T]: PromiseLike | T[K] }; + type ResolvableProps = object & {[K in keyof T]: PromiseLike | T[K]}; - export interface Resolver { + interface Resolver { /** * Returns a reference to the controlled promise that can be passed to clients. */ @@ -1118,15 +1244,16 @@ declare namespace Bluebird { reject(reason: any): void; /** - * Gives you a callback representation of the `PromiseResolver`. Note that this is not a method but a property. The callback accepts error object in first argument and success values on the 2nd parameter and the rest, I.E. node js conventions. + * Gives you a callback representation of the `PromiseResolver`. Note that this is not a method but a property. + * The callback accepts error object in first argument and success values on the 2nd parameter and the rest, I.E. node js conventions. * * If the the callback is called with multiple success values, the resolver fullfills its promise with an array of the values. */ // TODO specify resolver callback - callback: (err: any, value: R, ...values: R[]) => void; + callback(err: any, value: R, ...values: R[]): void; } - export interface Inspection { + interface Inspection { /** * See if the underlying promise was fulfilled at the creation time of this inspection object. */ @@ -1167,14 +1294,14 @@ declare namespace Bluebird { * * This method should be used before you use any of the methods which would otherwise alter the global Bluebird object - to avoid polluting global state. */ - export function getNewLibraryCopy(): typeof Bluebird; + function getNewLibraryCopy(): typeof Bluebird; /** * This is relevant to browser environments with no module loader. * * Release control of the Promise namespace to whatever it was before this library was loaded. Returns a reference to the library namespace so you can attach it to something else. */ - export function noConflict(): typeof Bluebird; + function noConflict(): typeof Bluebird; /** * Changes how bluebird schedules calls a-synchronously. @@ -1182,7 +1309,7 @@ declare namespace Bluebird { * @param scheduler Should be a function that asynchronously schedules * the calling of the passed in function */ - export function setScheduler(scheduler: (callback: (...args: any[]) => void) => void): void; + function setScheduler(scheduler: (callback: (...args: any[]) => void) => void): void; } export = Bluebird; diff --git a/types/bluebird/tsconfig.json b/types/bluebird/tsconfig.json index 94fc104c8f..909dae3771 100644 --- a/types/bluebird/tsconfig.json +++ b/types/bluebird/tsconfig.json @@ -9,9 +9,9 @@ "es6" ], "noImplicitAny": true, - "noImplicitThis": false, + "noImplicitThis": true, "strictNullChecks": false, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -20,4 +20,4 @@ "noEmit": true, "forceConsistentCasingInFileNames": true } -} \ No newline at end of file +} diff --git a/types/bluebird/tslint.json b/types/bluebird/tslint.json index 55713db673..6abaaba4e3 100644 --- a/types/bluebird/tslint.json +++ b/types/bluebird/tslint.json @@ -1,29 +1,8 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "ban-types": false, - "comment-format": false, - "dt-header": false, - "max-line-length": false, - "member-access": false, - "no-consecutive-blank-lines": false, - "no-padding": false, - "no-unnecessary-callback-wrapper": false, + "max-line-length": [true, 280], "no-unnecessary-generics": false, - "no-var-keyword": false, - "no-void-expression": false, - "one-line": false, - "only-arrow-functions": false, - "prefer-const": false, - "prefer-method-signature": false, - "semicolon": false, - "space-before-function-paren": false, - "strict-export-declare-modifiers": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "prefer-const": false } -} \ No newline at end of file +} diff --git a/types/bluebird/v1/tslint.json b/types/bluebird/v1/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bluebird/v1/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bluebird/v2/tslint.json b/types/bluebird/v2/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bluebird/v2/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/blueimp-md5/tslint.json b/types/blueimp-md5/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/blueimp-md5/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/body-parser/index.d.ts b/types/body-parser/index.d.ts index 2056c89b22..b1485770a1 100644 --- a/types/body-parser/index.d.ts +++ b/types/body-parser/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/expressjs/body-parser // Definitions by: Santi Albo , Vilic Vane , Jonathan Häberle , Gevik Babakhani , Tomasz Łaziuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /// diff --git a/types/bookshelf/index.d.ts b/types/bookshelf/index.d.ts index bb817d3074..dca8d5fad2 100644 --- a/types/bookshelf/index.d.ts +++ b/types/bookshelf/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bookshelfjs v0.9.3 +// Type definitions for bookshelfjs v0.9.4 // Project: http://bookshelfjs.org/ // Definitions by: Andrew Schurman , Vesa Poikajärvi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -17,7 +17,7 @@ interface Bookshelf extends Bookshelf.Events { Collection: typeof Bookshelf.Collection; plugin(name: string | string[] | Function, options?: any): Bookshelf; - transaction(callback: (transaction: knex.Transaction) => BlueBird): BlueBird; + transaction(callback: (transaction: knex.Transaction) => PromiseLike): BlueBird; } declare function Bookshelf(knex: knex): Bookshelf; diff --git a/types/bookshelf/tslint.json b/types/bookshelf/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bookshelf/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/boolify-string/tslint.json b/types/boolify-string/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/boolify-string/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/boom/index.d.ts b/types/boom/index.d.ts index 8025a7ddab..76cd2d6b46 100644 --- a/types/boom/index.d.ts +++ b/types/boom/index.d.ts @@ -4,7 +4,7 @@ // AJP // Jinesh Shah // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.4 export = Boom; @@ -55,7 +55,7 @@ declare namespace Boom { // Excluded this to aid typing of the other values. See tests for example casting to a custom interface to manipulate the payload // [anyContent: string]: any; } - + /** * Decorates an error with the boom properties * @param error the error object to wrap. If error is already a boom object, it defaults to overriding the object with the new status code and message. diff --git a/types/boom/tslint.json b/types/boom/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/boom/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/boom/v3/tslint.json b/types/boom/v3/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/boom/v3/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootbox/tslint.json b/types/bootbox/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootbox/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootpag/tslint.json b/types/bootpag/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootpag/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootstrap-datepicker/tslint.json b/types/bootstrap-datepicker/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootstrap-datepicker/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootstrap-fileinput/index.d.ts b/types/bootstrap-fileinput/index.d.ts index 8a7df2dbbc..61a53b12bb 100644 --- a/types/bootstrap-fileinput/index.d.ts +++ b/types/bootstrap-fileinput/index.d.ts @@ -6,10 +6,14 @@ /// -interface JQuery { - fileinput: (options?: BootstrapFileInput.FileInputOptions) => JQuery; -} +export = BootstrapFileInput; +export as namespace BootstrapFileInput; +declare global { + interface JQuery { + fileinput: (options?: BootstrapFileInput.FileInputOptions) => JQuery; + } +} declare module BootstrapFileInput { interface FileInputOptions { @@ -19,6 +23,11 @@ declare module BootstrapFileInput { The locale JS file for the language code must be defined as mentioned in the translations section: http://plugins.krajee.com/file-input#translations */ language?: string; + + /** + * Theming + */ + theme?: string; /** Whether to display the file caption. Defaults to true. diff --git a/types/bootstrap-fileinput/tslint.json b/types/bootstrap-fileinput/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootstrap-fileinput/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootstrap-maxlength/tslint.json b/types/bootstrap-maxlength/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootstrap-maxlength/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootstrap-notify/tslint.json b/types/bootstrap-notify/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootstrap-notify/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootstrap-select/tslint.json b/types/bootstrap-select/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootstrap-select/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootstrap-slider/bootstrap-slider-tests.ts b/types/bootstrap-slider/bootstrap-slider-tests.ts index 2073a3de9d..9b2a1a2014 100644 --- a/types/bootstrap-slider/bootstrap-slider-tests.ts +++ b/types/bootstrap-slider/bootstrap-slider-tests.ts @@ -90,6 +90,56 @@ $(() => { $('#ex16a').slider({ min: 0, max: 10, value: 0, focus: true }); $('#ex16b').slider({ min: 0, max: 10, value: [0, 10], focus: true }); + $("#ex17a").slider({ + min: 0, + max: 10, + value: 0, + tooltip_position: 'bottom' + }); + $("#ex17b").slider({ + min: 0, + max: 10, + value: 0, + orientation: 'vertical', + tooltip_position: 'left' + }); + + $("#ex18a").slider({ + min: 0, + max: 10, + value: 5, + labelledby: 'ex18-label-1' + }); + $("#ex18b").slider({ + min: 0, + max: 10, + value: [3, 6], + labelledby: ['ex18-label-2a', 'ex18-label-2b'] + }); + + $('#ex22').slider({ + id: 'slider22', + min: 0, + max: 20, + step: 1, + value: 14, + rangeHighlights: [{ start: 2, end: 5, class: "category1" }, + { start: 7, end: 8, class: "category2" }, + { start: 17, end: 19 }, + { start: 17, end: 24 }, + { start: -3, end: 19 }]}); + + $("#ex23").slider({ + ticks: [0, 1, 2, 3, 4], + ticks_positions: [0, 30, 60, 70, 90, 100], + ticks_snap_bounds: 200, + formatter(value) { + return 'Current value: ' + value; + }, + ticks_tooltip: true, + step: 0.01 + }); + // examples from https://github.com/seiyria/bootstrap-slider/blob/master/README.md { diff --git a/types/bootstrap-slider/index.d.ts b/types/bootstrap-slider/index.d.ts index 557c7aa5ad..5559e12f12 100644 --- a/types/bootstrap-slider/index.d.ts +++ b/types/bootstrap-slider/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bootstrap-slider.js 9.8 +// Type definitions for bootstrap-slider.js 9.9 // Project: https://github.com/seiyria/bootstrap-slider // Definitions by: Daniel Beckwith // Leonard Thieu @@ -7,6 +7,19 @@ /// +interface RangeHighlight { + class?: string; + start?: number; + end?: number; +} + +type SliderEventType = 'slide' | + 'slideStart' | + 'slideStop' | + 'change' | + 'slideEnabled' | + 'slideDisabled'; + interface SliderOptions { /** * Default: '' @@ -63,6 +76,14 @@ interface SliderOptions { * if false show one tootip if true show two tooltips one for each handler */ tooltip_split?: boolean; + /** + * Default: null + * Position of tooltip, relative to slider. Accepts 'top'/'bottom' for + * horizontal sliders and 'left'/'right' for vertically orientated sliders. + * Default positions are 'top' for horizontal and 'right' for vertical + * slider. + */ + tooltip_position?: 'top' | 'bottom' | 'left' | 'right'; /** * Default: 'round' * handle shape. Accepts: 'round', 'square', 'triangle' or 'custom' @@ -73,6 +94,10 @@ interface SliderOptions { * whether or not the slider should be reversed */ reversed?: boolean; + /** + * Default: 'auto' + */ + rtl?: boolean | 'auto'; /** * Default: true * whether or not the slider is initially enabled @@ -111,16 +136,34 @@ interface SliderOptions { * Used to define the snap bounds of a tick. Snaps to the tick if value is within these bounds. */ ticks_snap_bounds?: number; + /** + * Default: false + * Used to allow for a user to hover over a given tick to see it's value. + * Useful if custom formatter passed in + */ + ticks_tooltip?: boolean; /** * Default: 'linear' * Set to 'logarithmic' to use a logarithmic scale. */ - scale?: string; + scale?: 'linear' | 'logarithmic'; /** * Default: false * Focus the appropriate slider handle after a value change. */ focus?: boolean; + /** + * Default: null + * ARIA labels for the slider handle's, Use array for multiple values in a + * range slider. + */ + labelledby?: string | string[]; + /** + * Default: [] + * Defines a range array that you want to highlight, for example: + * [{'start':val1, 'end': val2, 'class': 'optionalAdditionalClassName'}]. + */ + rangeHighlights?: RangeHighlight[]; } interface JQuery { @@ -134,7 +177,6 @@ interface SliderPlugin { (methodName: string, ...args: any[]): TJQuery; /** * Creates a slider from the current element. - * @param options */ (options?: SliderOptions): TJQuery; } @@ -163,11 +205,12 @@ declare class Slider { /** * Set a new value for the slider. If optional triggerSlideEvent parameter is true, 'slide' events will be triggered. * If optional triggerChangeEvent parameter is true, 'change' events will be triggered. - * @param newValue - * @param triggerSlideEvent - * @param triggerChangeEvent */ setValue(newValue: number, triggerSlideEvent?: boolean, triggerChangeEvent?: boolean): this; + /** + * Get the div slider element + */ + getElement(): HTMLDivElement; /** * Properly clean up and remove the slider instance */ @@ -180,25 +223,34 @@ declare class Slider { * Enables the slider */ enable(): this; + /** + * Toggles the slider between enabled and disabled + */ + toggle(): this; /** * Returns true if enabled, false if disabled */ isEnabled(): boolean; /** * Updates the slider's attributes - * @param attribute - * @param value */ setAttribute(attribute: string, value: any): this; /** * Get the slider's attributes - * @param attribute */ getAttribute(attribute: string): any; /** * Refreshes the current slider */ refresh(): this; + /** + * When the slider event eventType is triggered, the callback function will be invoked + */ + on(eventType: SliderEventType, callback: (val: number | undefined) => void): this; + /** + * Removes the callback function from the slider event eventType + */ + off(eventType: SliderEventType, callback: (val: number | undefined) => void): void; /** * Renders the tooltip again, after initialization. Useful in situations when the slider and tooltip are initially hidden. */ diff --git a/types/bootstrap-switch/tslint.json b/types/bootstrap-switch/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootstrap-switch/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootstrap-table/tslint.json b/types/bootstrap-table/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootstrap-table/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootstrap-touchspin/tslint.json b/types/bootstrap-touchspin/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootstrap-touchspin/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootstrap.paginator/tslint.json b/types/bootstrap.paginator/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootstrap.paginator/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootstrap.timepicker/tslint.json b/types/bootstrap.timepicker/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootstrap.timepicker/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootstrap.v3.datetimepicker/index.d.ts b/types/bootstrap.v3.datetimepicker/index.d.ts index 7b1d3877ba..c588943afd 100644 --- a/types/bootstrap.v3.datetimepicker/index.d.ts +++ b/types/bootstrap.v3.datetimepicker/index.d.ts @@ -24,7 +24,8 @@ export interface Datetimepicker { clear(): void; /** Returns the component's model current date, a moment object or null if not set. */ date(): moment.Moment; - /** Takes string, Date, moment, null parameter and sets the components model current moment to it. + /** + * Takes string, Date, moment, null parameter and sets the components model current moment to it. * Passing a null value unsets the components model current moment. * Parsing of the newDate parameter is made using moment library with the options.format and options.useStrict components configuration. * Throws: @@ -36,14 +37,16 @@ export interface Datetimepicker { date(date: moment.Moment | Date | string | null): void; /** Destroys the widget and removes all attached event listeners */ destroy(): void; - /** Disables the input element, the component is attached to, by adding a disabled="true" attribute to it. If the widget was visible before that call it is hidden. + /** + * Disables the input element, the component is attached to, by adding a disabled="true" attribute to it. If the widget was visible before that call it is hidden. * Emits: * - dp.hide - if the widget was visible before that call */ disable(): void; /** Enables the input element, the component is attached to, by removing disabled attribute from it. */ enable(): void; - /** Hides the widget + /** + * Hides the widget * Emits: * - dp.hide - if the widget was visible before that call */ @@ -55,13 +58,15 @@ export interface Datetimepicker { options(): DatetimepickerOptions; /** Takes an object variable with option key:value properties and configures the component. Use this to update multiple options on the component. */ options(options: DatetimepickerOptions): void; - /** Shows the widget + /** + * Shows the widget * Emits: * - dp.show - if the widget was hidden before that call * - dp.change - if the widget is opened for the first time and the useCurrent is set to true or to a granularity value and the input element the component is attached to has an empty value */ show(): void; - /** Shows or hides the widget + /** + * Shows or hides the widget * Emits: * - dp.hide - if the widget is hidden after the toggle call * - dp.show - if the widget is show after the toggle call @@ -90,7 +95,8 @@ export interface Datetimepicker { * IMPORTANT! Throws exception if not set explicitly https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1459 */ daysOfWeekDisabled(): number[]; - /** Takes an [ Number:0 to 6 ] and disallow the user to select weekdays that exist in this array. + /** + * Takes an [ Number:0 to 6 ] and disallow the user to select weekdays that exist in this array. * This has lower priority over the options.minDate, options.maxDate, options.disabledDates and options.enabledDates configuration settings. * Emits: * - dp.change - if the currently selected moment falls in the values passed on the daysOfWeek parameter. @@ -133,13 +139,15 @@ export interface Datetimepicker { * Like en/disabledDates, the en/disabledHours options are mutually exclusive and will reset one of the options back to false. */ disabledHours(value: boolean | number[]): void; - /** Returns the options.disabledTimeIntervals option, or... not exactly + /** + * Returns the options.disabledTimeIntervals option, or... not exactly * IMPORTANT! Creates an object from the options.disabledTimeIntervals with the keys being numbers, the values being the moment arrays. * eg { "0": [, ], "1": [...] } * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1498 */ disabledTimeIntervals(): boolean | moment.Moment[][]; - /** Disables time selection between the given moments + /** + * Disables time selection between the given moments * eg: [[moment({ h: 0 }), moment({ h: 8 })], [moment({ h: 18 }), moment({ h: 24 })]] */ disabledTimeIntervals(value: boolean | moment.Moment[][]): void; @@ -148,7 +156,8 @@ export interface Datetimepicker { * NOTES: probably should be: enabledDates(): boolean | Array; see: DatetimepickerOptions */ enabledDates(): boolean | any; - /** Takes an array of values and allows the user to select only from those days. + /** + * Takes an array of values and allows the user to select only from those days. * Setting this takes precedence over options.minDate, options.maxDate configuration. * Also calling this function removes the configuration of options.disabledDates if such exist. * Note: These values are matched with Day granularity. @@ -174,7 +183,8 @@ export interface Datetimepicker { focusOnShow(value: boolean): void; /** Returns the component's options.format string */ format(): boolean | string | moment.MomentBuiltinFormat; - /** Takes a moment.js format string and sets the components options.format. + /** + * Takes a moment.js format string and sets the components options.format. * This is used for displaying and also for parsing input strings either from the input element the component is attached to or the date() function. * The parameter can also be a boolean:false in which case the format is set to the locale's L LT. * Note: this is also used to determine if the TimePicker sub component will display the hours in 12 or 24 format. (if "a" or "h" exists in the passed string then a 12 hour mode is set) @@ -184,7 +194,8 @@ export interface Datetimepicker { format(format: boolean | string | moment.MomentBuiltinFormat): void; /** Returns options.icons */ icons(): Icons; - /** Takes an Object of strings. + /** + * Takes an Object of strings. * Throws: * - TypeError - if icons parameter is not an Object */ @@ -209,14 +220,16 @@ export interface Datetimepicker { keyBinds(value: any): void; /** Returns the currently set locale of the options.locale */ locale(): string; - /** Takes a string of any valid moment locale e.g. de for German. + /** + * Takes a string of any valid moment locale e.g. de for German. * Throws: * - TypeError - if the locale is not loaded via a separate script or moment-with-locale */ locale(newLocale: string): void; /** Returns the currently set moment of the options.maxDate or false if not set */ maxDate(): moment.Moment | boolean; - /** Takes a parameter and disallows the user to select a moment that is after that moment. + /** + * Takes a parameter and disallows the user to select a moment that is after that moment. * If a boolean:false value is passed options.maxDate is cleared and there is no restriction to the maximum moment the user can select. * Note: If the parameter is before the currently selected moment the currently selected moment changes to maxDate * Throws: @@ -230,7 +243,8 @@ export interface Datetimepicker { maxDate(date: moment.Moment | Date | string | boolean): void; /** Returns the currently set moment of the options.minDate or false if not set */ minDate(): moment.Moment | boolean; - /** Takes a parameter and disallows the user to select a moment that is before that moment. + /** + * Takes a parameter and disallows the user to select a moment that is before that moment. * If a boolean:false value is passed the options.minDate parameter is cleared and there is no restriction to the miminum moment the user can select. * Note: If the parameter is after the currently selected moment the currently selected moment changes to minDate parameter * Throws: @@ -244,7 +258,8 @@ export interface Datetimepicker { minDate(date: moment.Moment | Date | string | boolean): void; /** Returns the options.parseInputDate option */ parseInputDate(): InputParser | undefined; - /** Allows custom input formatting For example: the user can enter "yesterday"" or "30 days ago". + /** + * Allows custom input formatting For example: the user can enter "yesterday"" or "30 days ago". * {@link http://eonasdan.github.io/bootstrap-datetimepicker/Functions/#parseinputdate} */ parseInputDate(value: InputParser): void; @@ -270,14 +285,16 @@ export interface Datetimepicker { stepping(step: number): void; /** Returns a string of options.timeZone */ timeZone(): string | null; - /** Takes a null or a string of a valid timezone. + /** + * Takes a null or a string of a valid timezone. * Throws: * - TypeError - if tooltips parameter is not a string or null */ timeZone(timeZone: string | null): void; /** Returns the options.toolbarplacement option. */ toolbarPlacement(): string; - /** Changes the placement of the toolbar where the today, clear, component switch icon are located. + /** + * Changes the placement of the toolbar where the today, clear, component switch icon are located. * See valid values at DatetimepickerOptions.toolbarplacement * Throws: * - TypeError - if the parameter is not a valid value @@ -285,14 +302,16 @@ export interface Datetimepicker { toolbarPlacement(value: string): void; /** Returns the options.tooltips option */ tooltips(): Tooltips; - /** Sets the tooltips for icons. + /** + * Sets the tooltips for icons. * Throws: * - TypeError - if tooltips parameter is not an Object */ tooltips(value: Tooltips): void; /** Returns the options.useCurrent option configuration */ useCurrent(): boolean | string; - /** Takes a boolean or string. + /** + * Takes a boolean or string. * If a boolean true is passed and the components model moment is not set (either through setDate or through a valid value on the input element the component is attached to) * then the first time the user opens the datetimepicker widget the value is initialized to the current moment of the action. * If a false boolean is passed then no initialization happens on the input element. @@ -312,7 +331,8 @@ export interface Datetimepicker { viewDate(value: string | Date | moment.Moment | boolean): void; /** Returns the options.viewMode. */ viewMode(): string; - /** Takes a string. See valid values at DatetimepickerOptions.viewMode + /** + * Takes a string. See valid values at DatetimepickerOptions.viewMode * Throws: * - TypeError - if the parameter is not a string or not a valid value */ @@ -323,7 +343,8 @@ export interface Datetimepicker { widgetParent(widgetParent: string | JQuery | null): void; /** Returns the options.widgetPositioning object */ widgetPositioning(): WidgetPositioningOptions; - /** WidgetPositioning defines where the dropdown with the widget will appear relative to the input element the component is attached to. + /** + * WidgetPositioning defines where the dropdown with the widget will appear relative to the input element the component is attached to. * "auto" is the default value for both horizontal and vertical keys and it tries to automatically place the dropdown in a position that is visible to the user. * Usually you should not override those options unless you have a special need in your layout. */ @@ -331,7 +352,6 @@ export interface Datetimepicker { /** * JQuery plugin function. - * @param {DatetimepickerOptions} options */ (options?: DatetimepickerOptions): JQuery; @@ -343,91 +363,109 @@ export interface Datetimepicker { } export interface DatetimepickerOptions { - /** If true, the picker will show on textbox focus and icon click when used in a button group + /** + * If true, the picker will show on textbox focus and icon click when used in a button group * @default: false */ allowInputToggle?: boolean; - /** Shows the week of the year to the left of first day of the week. + /** + * Shows the week of the year to the left of first day of the week. * @default: false */ calendarWeeks?: boolean; - /** Using a Bootstraps collapse to switch between date/time pickers. + /** + * Using a Bootstraps collapse to switch between date/time pickers. * @default: true */ collapse?: boolean; - /** Disables the section of days of the week, e.g. weekends. + /** + * Disables the section of days of the week, e.g. weekends. * Accepts: array of numbers from 0-6 * @default: false */ daysOfWeekDisabled?: number[] | boolean; - /** Changes the heading of the datepicker when in "days" view. + /** + * Changes the heading of the datepicker when in "days" view. * @default: "MMMM YYYY" */ dayViewHeaderFormat?: string; - /** Will cause the date picker to stay open after a blur event. + /** + * Will cause the date picker to stay open after a blur event. * @default: false */ debug?: boolean; - /** Sets the picker default date/time. Overrides useCurrent + /** + * Sets the picker default date/time. Overrides useCurrent * @default: false */ defaultDate?: boolean | moment.Moment | Date | string; - /** Disables selection of dates in the array, e.g. holidays + /** + * Disables selection of dates in the array, e.g. holidays * @default: false * IMPORTANT! The getter returns an Object NOT an Array, with keys being the dates, values being true. * eg disabledDates = ["2010-10-10"]; -> disabledDated will be { "2010-01-01": true } * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499 */ disabledDates?: boolean | Array | any; - /** Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days + /** + * Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days * @default: false * IMPORTANT! The getter returns an Object NOT an Array, with keys being the hours, values being true. * eg disabledHours = [0, 1]; -> disabledHours will be { "0": true, "1": true } * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499 */ disabledHours?: boolean | number[] | any; - /** Disables time selection between the given moments + /** + * Disables time selection between the given moments * eg: [[moment({ h: 0 }), moment({ h: 8 })], [moment({ h: 18 }), moment({ h: 24 })]] * @default: false */ disabledTimeIntervals?: boolean | moment.Moment[][]; - /** Disables selection of dates NOT in the array, e.g. holidays + /** + * Disables selection of dates NOT in the array, e.g. holidays * @default: false * IMPORTANT! The getter returns an Object NOT an Array, with keys being the dates, values being true. * eg enabledDates = ["2010-10-10"]; -> enabledDated will be { "2010-01-01": true } * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499 */ enabledDates?: boolean | Array | any; - /** Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days + /** + * Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days * @default: false * IMPORTANT! The getter returns an Object NOT an Array, with keys being the hours, values being true. * eg enabledHours = [0, 1]; -> enabledHours will be { "0": true, "1": true } * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499 */ enabledHours?: boolean | number[]; - /** Allows for several input formats to be valid. See: https://github.com/Eonasdan/bootstrap-datetimepicker/pull/666 + /** + * Allows for several input formats to be valid. See: https://github.com/Eonasdan/bootstrap-datetimepicker/pull/666 * @default: false */ extraFormats?: boolean | Array; - /** If false, the textbox will not be given focus when the picker is shown + /** + * If false, the textbox will not be given focus when the picker is shown * @default: true */ focusOnShow?: boolean; - /** See momentjs' docs for valid formats. Format also dictates what components are shown, e.g. MM/dd/YYYY will not display the time picker. + /** + * See momentjs' docs for valid formats. Format also dictates what components are shown, e.g. MM/dd/YYYY will not display the time picker. * @default: false */ format?: boolean | string | moment.MomentBuiltinFormat; /** Change the default icons for the pickers functions. */ icons?: Icons; - /** Allow date picker show event to fire even when the associated input element has the readonly="readonly"property. + /** + * Allow date picker show event to fire even when the associated input element has the readonly="readonly"property. * @default: false */ ignoreReadonly?: boolean; - /** Will display the picker inline without the need of a input field. This will also hide borders and shadows. + /** + * Will display the picker inline without the need of a input field. This will also hide borders and shadows. * @default: false */ inline?: boolean; - /** Allows for custom events to fire on keyboard press. + /** + * Allows for custom events to fire on keyboard press. * eg: keybinds: { * up: (widget) => console.log(widget), * "control up": (widget) => console.log(widget) @@ -435,52 +473,63 @@ export interface DatetimepickerOptions { * The widget parameter is false, if the datepicker is closed. */ keyBinds?: { [key: string]: (widget: boolean | JQuery) => void }; - /** Will cause the date picker to not revert or overwrite invalid dates. + /** + * Will cause the date picker to not revert or overwrite invalid dates. * @default: false */ keepInvalid?: boolean; - /** Will cause the date picker to stay open after selecting a date if no time components are being used. + /** + * Will cause the date picker to stay open after selecting a date if no time components are being used. * @default: false */ keepOpen?: boolean; - /** See momentjs for valid locales. You must include moment-with-locales.js or a local js file. + /** + * See momentjs for valid locales. You must include moment-with-locales.js or a local js file. * @default: moment.locale() */ locale?: string; - /** Prevents date/time selections after this date. + /** + * Prevents date/time selections after this date. * maxDate will override defaultDate and useCurrent if either of these settings are the same day since both options are invalid according to the rules you've selected. * @default: false */ maxDate?: boolean | moment.Moment | Date | string; - /** Prevents date/time selections before this date. + /** + * Prevents date/time selections before this date. * minDate will override defaultDate and useCurrent if either of these settings are the same day since both options are invalid according to the rules you've selected. * @default: false */ minDate?: boolean | moment.Moment | Date | string; - /** Allows custom input formatting For example: the user can enter "yesterday"" or "30 days ago". + /** + * Allows custom input formatting For example: the user can enter "yesterday"" or "30 days ago". * {@link http://eonasdan.github.io/bootstrap-datetimepicker/Functions/#parseinputdate} */ parseInputDate?: InputParser; - /** Show the "Clear" button in the icon toolbar. + /** + * Show the "Clear" button in the icon toolbar. * Clicking the "Clear" button will set the calendar to null. * @default: false */ showClear?: boolean; - /** Show the "Close" button in the icon toolbar. + /** + * Show the "Close" button in the icon toolbar. * Clicking the "Close" button will call hide() * @default: false */ showClose?: boolean; - /** Show the "Today" button in the icon toolbar. + /** + * Show the "Today" button in the icon toolbar. * Clicking the "Today" button will set the calendar view and set the date to now. * @default: false */ showTodayButton?: boolean; - /** Shows the picker side by side when using the time and date together. + /** + * Shows the picker side by side when using the time and date together. * @default: false */ sideBySide?: boolean; - /** Number of minutes the up/down arrow's will move the minutes value in the time picker + /** + * Number of minutes the up/down arrow's will move the minutes value in the time picker * @default: 1 */ stepping?: number; @@ -489,30 +538,36 @@ export interface DatetimepickerOptions { * @default: "" */ timeZone?: string | null; - /** Changes the placement of the icon toolbar. + /** + * Changes the placement of the icon toolbar. * @default: "default" */ toolbarPlacement?: "default" | "top" | "bottom"; /** This will change the tooltips over each icon to a custom string */ tooltips?: Tooltips; - /** On show, will set the picker to the current date/time + /** + * On show, will set the picker to the current date/time * @default: true */ useCurrent?: boolean; - /** Defines if moment should use strict date parsing when considering a date to be valid + /** + * Defines if moment should use strict date parsing when considering a date to be valid * @default: false */ useStrict?: boolean; - /** This will change the viewDate without changing or setting the selected date. + /** + * This will change the viewDate without changing or setting the selected date. * @default: false */ viewDate?: boolean | moment.Moment | Date | string; - /** The default view to display when the picker is shown. + /** + * The default view to display when the picker is shown. * Note: To limit the picker to selecting, for instance the year and month, use format: MM/YYYY * @default: "days" */ viewMode?: "decades" | "years" | "months" | "days"; - /** On picker show, places the widget at the identifier (string) or jQuery object if the element has css position: "relative" + /** + * On picker show, places the widget at the identifier (string) or jQuery object if the element has css position: "relative" * @default: null */ widgetParent?: string | JQuery | null; diff --git a/types/bootstrap.v3.datetimepicker/package.json b/types/bootstrap.v3.datetimepicker/package.json index fce08a048d..19e5fb0d14 100644 --- a/types/bootstrap.v3.datetimepicker/package.json +++ b/types/bootstrap.v3.datetimepicker/package.json @@ -3,4 +3,4 @@ "dependencies": { "moment": ">=2.14.0" } -} \ No newline at end of file +} diff --git a/types/bootstrap.v3.datetimepicker/v3/package.json b/types/bootstrap.v3.datetimepicker/v3/package.json index fce08a048d..19e5fb0d14 100644 --- a/types/bootstrap.v3.datetimepicker/v3/package.json +++ b/types/bootstrap.v3.datetimepicker/v3/package.json @@ -3,4 +3,4 @@ "dependencies": { "moment": ">=2.14.0" } -} \ No newline at end of file +} diff --git a/types/bootstrap.v3.datetimepicker/v3/tslint.json b/types/bootstrap.v3.datetimepicker/v3/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootstrap.v3.datetimepicker/v3/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bootstrap/tslint.json b/types/bootstrap/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bootstrap/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/botvs/index.d.ts b/types/botvs/index.d.ts index 2eabcb98da..04d8f76c97 100644 --- a/types/botvs/index.d.ts +++ b/types/botvs/index.d.ts @@ -282,21 +282,18 @@ declare global { /** * 返回交易所名称(string) * - * @return {string} */ GetName(): string; /** * 返回交易所自定义的标签(string) * - * @return {string} */ GetLabel(): string; /** * 返回交易所使用的美元的汇率, OKCoin期货返回官方提供的汇率, 该值不受SetRate影响 * - * @return {number} */ GetUSDCNY(): number; @@ -306,7 +303,6 @@ declare global { * 汇率接口调用雅虎提供的接口, 5分钟更新一次 * 所有函数自动经过汇率转换,如果为1指禁用汇率转换 * - * @return {number} */ GetRate(): number; @@ -317,7 +313,6 @@ declare global { * SetRate(), 如果不加参数,则恢复系统内置汇率 * SetRate(1), 就是禁用汇率转换 * - * @param {number} rate */ SetRate(rate?: number): void; @@ -326,43 +321,36 @@ declare global { * * exchange.SetPrecision(2, 3); // 设置价格小数位精度为2位, 品种下单量小数位精度为3位 * - * @param {number} PricePrecision - * @param {number} AmountPrecision */ SetPrecision(PricePrecision: number, AmountPrecision: number): void; /** * 返回交易所操作的货币名称(string), 传统期货CTP返回的固定为STOCK * - * @return {string} */ GetCurrency(): string; /** * 返回交易所操作的基础货币名称(string), BTC_CNY就返回CNY, ETH_BTC就返回BTC * - * @return {string} */ GetBaseCurrency(): string; /** * 返回一个Ticker结构 * - * @return {botvs.Ticker} */ GetTicker(): Ticker; /** * 返回一个Depth结构 * - * @return {botvs.Depth} */ GetDepth(): Depth; /** * 返回一个Trade数组, 按时间从低到高的顺序, 只支持数字货币(BTC/LTC) * - * @return {botvs.Trade[]} */ GetTrades(): Trade[]; @@ -373,15 +361,12 @@ declare global { * 支持: PERIOD_M1 指1分钟, PERIOD_M5 指5分钟, PERIOD_M15 指15分钟, * PERIOD_M30 指30分钟, PERIOD_H1 指1小时, PERIOD_D1 指一天 * - * @param {number} Period - * @return {botvs.Record[]} */ GetRecords(Period?: VPeriod): Record[]; /** * 返回一个Account结构, 如exchange.GetAccount(), 将返回主交易所账户信息 * - * @return {botvs.Account} */ GetAccount(): Account; @@ -392,59 +377,43 @@ declare global { * 支持现货(火币/BitVC/OKCoin/OKCoin国际/OKCoin期货/BTCChina/BitYes)市价单, 市价单价格指定为-1 * exchange.Buy(1000), 指买市价1000元的币, BTCChina例外exchange.Buy(0.3)指市价买0.3个币 * - * @param {number} Price - * @param {number} Amount - * @param {*[]} args - * @return {string} - 订单ID + * @return - 订单ID */ Buy(Price: number, Amount: number, ...args: any[]): string; /** * 跟Buy函数一样的调用方法和场景 {@see Exchange#Buy} * - * @param {number} Price - * @param {number} Amount - * @return {string} */ Sell(Price: number, Amount: number): string; /** * 获取所有未完成的订单, 返回一个Order数组结构 * - * @return {botvs.Order[]} */ GetOrders(): Order[]; /** * 根据订单号获取订单详情, 返回一个Order结构 * - * @param {string} orderId - * @return {botvs.Order} */ GetOrder(orderId: string): Order; /** * 根据订单号取消一个订单, 返回true或者false * - * @param {string} orderId - * @return {boolean} */ CancelOrder(orderId: string): boolean; /** * 不下单, 只记录交易信息, logType可为LOG_TYPE_BUY/LOG_TYPE_SELL/LOG_TYPE_CANCEL * - * @param {VLogType} logType - * @param {string} orderId - * @param {number} price - * @param {number} amount */ Log(logType: VLogType, orderId: string, price: number, amount: number): void; /** * 返回币最小交易数量 * - * @return {number} */ GetMinStock(): number; @@ -453,14 +422,12 @@ declare global { * * Bitstamp要求5美元(程序会根据汇率自动转换为人民币), 其它没有限制 * - * @return {number} */ GetMinPrice(): number; /** * 返回一个Fee结构 * - * @return {botvs.Fee} */ GetFee(): Fee; @@ -476,7 +443,6 @@ declare global { * Log(exchange.GetRawJSON());//在GetAccount成功后调用, 获取更详细的账户信息, 可以用JSON.parse解析 * 也支持GetTicker, GetDepth后的exchange.GetRawJSON(), 以及GetPosition与GetOrders,GetOrder这三个调用后的详细反馈数据 * - * @return {string} */ GetRawJSON(): string; @@ -501,9 +467,6 @@ declare global { * ret, ok = d.wait() // ok是一定返回True的, 除非策略被停止 * ret, ok = d.wait(100) // ok返回False, 如果等待超时, 或者wait了一个已经结束的实例 * - * @param {keyof botvs.Exchange} Method - * @param Args - * @return {botvs.AsyncJob} */ Go(Method: keyof Exchange, ...Args: any[]): AsyncJob; @@ -553,10 +516,6 @@ declare global { * exchange.IO("wait_instrument"); // 有任何品种更新行情信息时才返回, 可带第二个参数(毫秒数) * 指定超时, 超时返回空字符串, 正常返回触发事件的品种名称, 只支持实盘 * - * @param {"api" | "usd" | "cny" | "currency" | string} Api - * @param {string} ApiName - * @param {string} Args - * @return {T} */ IO(Api: 'api' | 'usd' | 'cny' | 'currency' | string, ApiName?: string, Args?: string): T; @@ -565,7 +524,6 @@ declare global { * * 返回一个Position数组, (BitVC和OKCoin)可以传入一个参数, 指定要获取的合约类型 * - * @return {botvs.Position[]} */ GetPosition(): Position[]; @@ -576,7 +534,6 @@ declare global { * 796支持5,10,20,50三个选项, BitVC的LTC不支持20倍杠杆, OKCoin支持10倍和20倍 * 如: exchange.SetMarginLevel(5) * - * @param {number} MarginLevel */ SetMarginLevel(MarginLevel: number): void; @@ -617,8 +574,6 @@ declare global { * exchange.SetDirection("sell"); * exchange.Sell(1000, 1); * - * @param {"buy" | "closebuy" | "sell" | "closesell" | "closebuy_today" | "closesell_today"} Direction - * @constructor */ SetDirection(Direction: 'buy' | 'closebuy' | 'sell' | 'closesell' | 'closebuy_today' | 'closesell_today'): void; @@ -634,7 +589,6 @@ declare global { * 在合约后加"@A"或"@B", 如: "day@A" 为日合约A子账户 BitVC有week和quarter和next_week三个可选参数, OKCoin期货有this_week, * next_week, quarter三个参数 exchange.SetContractType("week"); * - * @param {string} ContractType */ SetContractType(ContractType: string): void; } @@ -646,11 +600,6 @@ declare global { * * MACD(数据, 快周期, 慢周期, 信号周期), 默认参数为(12, 26, 9), 返回二维数组, 分别是[DIF, DEA, MACD] * - * @param {botvs.Record[]} Records - * @param {number} LongPeriod - * @param {number} ShortPeriod - * @param {number} SignalPeriod - * @return {[number[] , number[] , number[]]} */ function MACD( Records: botvs.Record[], @@ -664,11 +613,6 @@ declare global { * * KDJ(数据, 周期1, 周期2, 周期3), 默认参数为(9, 3, 3), 返回二维数组, 分别是[K, D, J] * - * @param {botvs.Record[]} Records - * @param {number} FirstPeriod - * @param {number} SecondPeriod - * @param {number} ThirdPeriod - * @return {[number[] , number[] , number[]]} */ function KDJ( Records: botvs.Record[], @@ -682,9 +626,6 @@ declare global { * * RSI(数据, 周期), 默认参数为14, 返回一个一维数组 * - * @param {botvs.Record[]} Records - * @param {number} Period - * @return {number[]} */ function RSI(Records: botvs.Record[], Period?: number): number[]; @@ -693,9 +634,6 @@ declare global { * * ATR(数据, 周期), 默认参数为14, 返回一个一维数组 * - * @param {botvs.Record[]} Records - * @param {number} Period - * @return {number[]} */ function ATR(Records: botvs.Record[], Period?: number): number[]; @@ -704,8 +642,6 @@ declare global { * * OBV(数据), 返回一个一维数组 * - * @param {botvs.Record[]} Records - * @return {[number[] , number[]]} */ function OBV(Records: botvs.Record[]): [number[], number[]]; @@ -714,9 +650,6 @@ declare global { * * MA(数据, 周期), 默认参数为9, 返回一个一维数组 * - * @param {botvs.Record[]} Records - * @param {number} Period - * @return {number[]} */ function MA(Records: botvs.Record[], Period?: number): number[]; @@ -724,9 +657,6 @@ declare global { * 指数平均数指标 * EMA(数据, 周期), 默认参数为9, 返回一个一维数组 * - * @param {botvs.Record[]} Records - * @param {number} Period - * @return {number[]} */ function EMA(Records: botvs.Record[], Period?: number): number[]; @@ -735,11 +665,6 @@ declare global { * * Alligator(数据, 下颚周期,牙齿周期,上唇周期), 鳄鱼线指标, 默认参数为(13,8,5) 返回一个二维数组[下颚,牙齿,上唇] * - * @param {botvs.Record[]} Records - * @param {number} JawPeriod - * @param {number} TeethPeriod - * @param {number} LibsPeriod - * @return {[number[] , number[] , number[]]} */ function Alligator( Records: botvs.Record[], @@ -753,9 +678,6 @@ declare global { * * CMF(数据, 周期), 默认周期参数为20, 返回一个一维数组 * - * @param {botvs.Record[]} Records - * @param {number} Period - * @return {number[]} */ function CMF(Records: botvs.Record[], Period?: number): number[]; @@ -765,11 +687,6 @@ declare global { * Highest(数据, 周期, 属性), 返回最近周期内的最大值(不包含当前Bar), * 如TA.Highest(records, 30, 'High'), 如果周期为0指所有, 如属性不指定则视数据为普通数组 * - * @param {botvs.Record[]} Records - * @param {number} Period - * @param {keyof botvs.Record} Property - * @return {number} - * @constructor */ function Highest(Records: botvs.Record[], Period?: number, Property?: keyof botvs.Record): number; @@ -778,10 +695,6 @@ declare global { * * Lowest(数据, 周期, 属性), 同上, 求最小值 * - * @param {botvs.Record[]} Records - * @param {number} Period - * @param {keyof botvs.Record} Property - * @return {number} */ function Lowest(Records: botvs.Record[], Period?: number, Property?: keyof botvs.Record): number; } @@ -792,8 +705,6 @@ declare global { * * Log(talib.help('MACD')); // 在回测环境下调用 * - * @param {string} Func - * @return {string} */ function help(Func: string): string; @@ -802,8 +713,6 @@ declare global { * * ACOS(Records[Close]) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} */ function ACOS(Records: botvs.Record[] | number[]): number[]; @@ -812,8 +721,6 @@ declare global { * * AD(Records[High,Low,Close,Volume]) = Array(outReal) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function AD(Records: botvs.Record[]): number[]; /** @@ -821,11 +728,6 @@ declare global { * * AD(Records[High,Low,Close,Volume]) = Array(outReal) * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number[]} Volume - * @return {number[]} */ function AD(High: number[], Low: number[], Close: number[], Volume: number[]): number[]; @@ -834,10 +736,6 @@ declare global { * * ADOSC(Records[High,Low,Close,Volume],Fast Period = 3,Slow Period = 10) = Array(outReal) * - * @param {botvs.Record[]} Records - * @param {number=3} FastPeriod - * @param {number=10} SlowPeriod - * @return {number[]} */ function ADOSC(Records: botvs.Record[], FastPeriod: number, SlowPeriod: number): number[]; /** @@ -845,13 +743,6 @@ declare global { * * ADOSC(Records[High,Low,Close,Volume],Fast Period = 3,Slow Period = 10) = Array(outReal) * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number[]} Volume - * @param {number=3} FastPeriod - * @param {number=10} SlowPeriod - * @return {number[]} */ function ADOSC( High: number[], @@ -867,9 +758,6 @@ declare global { * * ADX(Records[High,Low,Close],Time Period = 14) = Array(outReal) * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} */ function ADX(Records: botvs.Record[], TimePeriod: number): number[]; /** @@ -877,11 +765,6 @@ declare global { * * ADX(Records[High,Low,Close],Time Period = 14) = Array(outReal) * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=14} TimePeriod - * @return {number[]} */ function ADX(High: number[], Low: number[], Close: number[], TimePeriod: number): number[]; @@ -890,9 +773,6 @@ declare global { * * ADXR(Records[High,Low,Close],Time Period = 14) = Array(outReal) * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} */ function ADXR(Records: botvs.Record[], TimePeriod: number): number[]; /** @@ -900,11 +780,6 @@ declare global { * * ADXR(Records[High,Low,Close],Time Period = 14) = Array(outReal) * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=14} TimePeriod - * @return {number[]} */ function ADXR(High: number[], Low: number[], Close: number[], TimePeriod: number): number[]; @@ -913,11 +788,6 @@ declare global { * * APO(Records[Close],Fast Period = 12,Slow Period = 26,MA Type = 0) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=12} FastPeriod - * @param {number=26} SlowPeriod - * @param {number=0} MAType - * @return {number[]} */ function APO( Records: botvs.Record[] | number[], @@ -931,9 +801,6 @@ declare global { * * AROON(Records[High,Low],Time Period = 14) = [Array(outAroonDown),Array(outAroonUp)] * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {[number[], number[]]} */ function AROON(Records: botvs.Record[], TimePeriod: number): [number[], number[]]; /** @@ -941,10 +808,6 @@ declare global { * * AROON(Records[High,Low],Time Period = 14) = [Array(outAroonDown),Array(outAroonUp)] * - * @param {number[]} High - * @param {number[]} Low - * @param {number=14} TimePeriod - * @return {[number[], number[]]} */ function AROON(High: number[], Low: number[], TimePeriod: number): [number[], number[]]; @@ -953,9 +816,6 @@ declare global { * * AROONOSC(Records[High,Low],Time Period = 14) = Array(outReal) * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} */ function AROONOSC(Records: botvs.Record[], TimePeriod: number): number[]; /** @@ -963,10 +823,6 @@ declare global { * * AROONOSC(Records[High,Low],Time Period = 14) = Array(outReal) * - * @param {number[]} High - * @param {number[]} Low - * @param {number=14} TimePeriod - * @return {number[]} */ function AROONOSC(High: number[], Low: number[], TimePeriod: number): number[]; @@ -975,8 +831,6 @@ declare global { * * ASIN(Records[Close]) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} */ function ASIN(Records: botvs.Record[] | number[]): number[]; @@ -985,8 +839,6 @@ declare global { * * ATAN(Records[Close]) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} */ function ATAN(Records: botvs.Record[] | number[]): number[]; @@ -995,9 +847,6 @@ declare global { * * ATR(Records[High,Low,Close],Time Period = 14) = Array(outReal) * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} */ function ATR(Records: botvs.Record[], TimePeriod: number): number[]; /** @@ -1005,11 +854,6 @@ declare global { * * ATR(Records[High,Low,Close],Time Period = 14) = Array(outReal) * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=14} TimePeriod - * @return {number[]} */ function ATR(High: number[], Low: number[], Close: number[], TimePeriod: number): number[]; @@ -1018,8 +862,6 @@ declare global { * * AVGPRICE(Records[Open,High,Low,Close]) = Array(outReal) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function AVGPRICE(Records: botvs.Record[]): number[]; /** @@ -1027,11 +869,6 @@ declare global { * * AVGPRICE(Records[Open,High,Low,Close]) = Array(outReal) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function AVGPRICE(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1041,12 +878,6 @@ declare global { * BBANDS(Records[Close],Time Period = 5,Deviations up = 2,Deviations down = 2,MA Type = 0) = * [Array(outRealUpperBand),Array(outRealMiddleBand),Array(outRealLowerBand)] * - * @param {botvs.Record[]|number[]} Records - * @param {number=5} TimePeriod - * @param {number=2} Deviationsup - * @param {number=2} Deviationsdown - * @param {number=0} MAType - * @return {[number[], number[], number[]]} */ function BBANDS( Records: botvs.Record[] | number[], @@ -1061,8 +892,6 @@ declare global { * * BOP(Records[Open,High,Low,Close]) = Array(outReal) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function BOP(Records: botvs.Record[]): number[]; /** @@ -1070,11 +899,6 @@ declare global { * * BOP(Records[Open,High,Low,Close]) = Array(outReal) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function BOP(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1083,9 +907,6 @@ declare global { * * CCI(Records[High,Low,Close],Time Period = 14) = Array(outReal) * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} */ function CCI(Records: botvs.Record[], TimePeriod: number): number[]; /** @@ -1093,11 +914,6 @@ declare global { * * CCI(Records[High,Low,Close],Time Period = 14) = Array(outReal) * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=14} TimePeriod - * @return {number[]} */ function CCI(High: number[], Low: number[], Close: number[], TimePeriod: number): number[]; @@ -1106,8 +922,6 @@ declare global { * * CDL2CROWS(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDL2CROWS(Records: botvs.Record[]): number[]; /** @@ -1115,11 +929,6 @@ declare global { * * CDL2CROWS(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDL2CROWS(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1128,8 +937,6 @@ declare global { * * CDL3BLACKCROWS(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDL3BLACKCROWS(Records: botvs.Record[]): number[]; /** @@ -1137,11 +944,6 @@ declare global { * * CDL3BLACKCROWS(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDL3BLACKCROWS(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1150,8 +952,6 @@ declare global { * * CDL3INSIDE(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDL3INSIDE(Records: botvs.Record[]): number[]; /** @@ -1159,11 +959,6 @@ declare global { * * CDL3INSIDE(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDL3INSIDE(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1172,8 +967,6 @@ declare global { * * CDL3LINESTRIKE(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDL3LINESTRIKE(Records: botvs.Record[]): number[]; /** @@ -1181,11 +974,6 @@ declare global { * * CDL3LINESTRIKE(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDL3LINESTRIKE(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1194,8 +982,6 @@ declare global { * * CDL3OUTSIDE(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDL3OUTSIDE(Records: botvs.Record[]): number[]; /** @@ -1203,11 +989,6 @@ declare global { * * CDL3OUTSIDE(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDL3OUTSIDE(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1216,8 +997,6 @@ declare global { * * CDL3STARSINSOUTH(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDL3STARSINSOUTH(Records: botvs.Record[]): number[]; /** @@ -1225,11 +1004,6 @@ declare global { * * CDL3STARSINSOUTH(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDL3STARSINSOUTH(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1238,8 +1012,6 @@ declare global { * * CDL3WHITESOLDIERS(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDL3WHITESOLDIERS(Records: botvs.Record[]): number[]; /** @@ -1247,11 +1019,6 @@ declare global { * * CDL3WHITESOLDIERS(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDL3WHITESOLDIERS(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1260,9 +1027,6 @@ declare global { * * CDLABANDONEDBABY(Records[Open,High,Low,Close],Penetration = 0.3) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @param {number=0.3} Penetration - * @return {number[]} */ function CDLABANDONEDBABY(Records: botvs.Record[], Penetration: number): number[]; /** @@ -1270,12 +1034,6 @@ declare global { * * CDLABANDONEDBABY(Records[Open,High,Low,Close],Penetration = 0.3) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=0.3} Penetration - * @return {number[]} */ function CDLABANDONEDBABY( Open: number[], @@ -1290,8 +1048,6 @@ declare global { * * CDLADVANCEBLOCK(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLADVANCEBLOCK(Records: botvs.Record[]): number[]; /** @@ -1299,11 +1055,6 @@ declare global { * * CDLADVANCEBLOCK(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLADVANCEBLOCK(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1312,8 +1063,6 @@ declare global { * * CDLBELTHOLD(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLBELTHOLD(Records: botvs.Record[]): number[]; /** @@ -1321,11 +1070,6 @@ declare global { * * CDLBELTHOLD(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLBELTHOLD(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1334,8 +1078,6 @@ declare global { * * CDLBREAKAWAY(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLBREAKAWAY(Records: botvs.Record[]): number[]; /** @@ -1343,11 +1085,6 @@ declare global { * * CDLBREAKAWAY(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLBREAKAWAY(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1356,8 +1093,6 @@ declare global { * * CDLCLOSINGMARUBOZU(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLCLOSINGMARUBOZU(Records: botvs.Record[]): number[]; /** @@ -1365,11 +1100,6 @@ declare global { * * CDLCLOSINGMARUBOZU(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLCLOSINGMARUBOZU(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1378,8 +1108,6 @@ declare global { * * CDLCONCEALBABYSWALL(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLCONCEALBABYSWALL(Records: botvs.Record[]): number[]; /** @@ -1387,11 +1115,6 @@ declare global { * * CDLCONCEALBABYSWALL(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLCONCEALBABYSWALL(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1400,8 +1123,6 @@ declare global { * * CDLCOUNTERATTACK(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLCOUNTERATTACK(Records: botvs.Record[]): number[]; /** @@ -1409,11 +1130,6 @@ declare global { * * CDLCOUNTERATTACK(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLCOUNTERATTACK(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1422,9 +1138,6 @@ declare global { * * CDLDARKCLOUDCOVER(Records[Open,High,Low,Close],Penetration = 0.5) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @param {number=0.5} Penetration - * @return {number[]} */ function CDLDARKCLOUDCOVER(Records: botvs.Record[], Penetration: number): number[]; /** @@ -1432,12 +1145,6 @@ declare global { * * CDLDARKCLOUDCOVER(Records[Open,High,Low,Close],Penetration = 0.5) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=0.5} Penetration - * @return {number[]} */ function CDLDARKCLOUDCOVER( Open: number[], @@ -1452,8 +1159,6 @@ declare global { * * CDLDOJI(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLDOJI(Records: botvs.Record[]): number[]; /** @@ -1461,11 +1166,6 @@ declare global { * * CDLDOJI(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLDOJI(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1474,8 +1174,6 @@ declare global { * * CDLDOJISTAR(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLDOJISTAR(Records: botvs.Record[]): number[]; /** @@ -1483,11 +1181,6 @@ declare global { * * CDLDOJISTAR(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLDOJISTAR(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1496,8 +1189,6 @@ declare global { * * CDLDRAGONFLYDOJI(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLDRAGONFLYDOJI(Records: botvs.Record[]): number[]; /** @@ -1505,11 +1196,6 @@ declare global { * * CDLDRAGONFLYDOJI(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLDRAGONFLYDOJI(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1518,8 +1204,6 @@ declare global { * * CDLENGULFING(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLENGULFING(Records: botvs.Record[]): number[]; /** @@ -1527,11 +1211,6 @@ declare global { * * CDLENGULFING(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLENGULFING(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1540,9 +1219,6 @@ declare global { * * CDLEVENINGDOJISTAR(Records[Open,High,Low,Close],Penetration = 0.3) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @param {number=0.3} Penetration - * @return {number[]} */ function CDLEVENINGDOJISTAR(Records: botvs.Record[], Penetration: number): number[]; /** @@ -1550,12 +1226,6 @@ declare global { * * CDLEVENINGDOJISTAR(Records[Open,High,Low,Close],Penetration = 0.3) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=0.3} Penetration - * @return {number[]} */ function CDLEVENINGDOJISTAR( Open: number[], @@ -1570,9 +1240,6 @@ declare global { * * CDLEVENINGSTAR(Records[Open,High,Low,Close],Penetration = 0.3) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @param {number=0.3} Penetration - * @return {number[]} */ function CDLEVENINGSTAR(Records: botvs.Record[], Penetration: number): number[]; /** @@ -1580,12 +1247,6 @@ declare global { * * CDLEVENINGSTAR(Records[Open,High,Low,Close],Penetration = 0.3) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=0.3} Penetration - * @return {number[]} */ function CDLEVENINGSTAR( Open: number[], @@ -1600,8 +1261,6 @@ declare global { * * CDLGAPSIDESIDEWHITE(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLGAPSIDESIDEWHITE(Records: botvs.Record[]): number[]; /** @@ -1609,11 +1268,6 @@ declare global { * * CDLGAPSIDESIDEWHITE(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLGAPSIDESIDEWHITE(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1622,8 +1276,6 @@ declare global { * * CDLGRAVESTONEDOJI(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLGRAVESTONEDOJI(Records: botvs.Record[]): number[]; /** @@ -1631,11 +1283,6 @@ declare global { * * CDLGRAVESTONEDOJI(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLGRAVESTONEDOJI(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1644,8 +1291,6 @@ declare global { * * CDLHAMMER(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLHAMMER(Records: botvs.Record[]): number[]; /** @@ -1653,11 +1298,6 @@ declare global { * * CDLHAMMER(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLHAMMER(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1666,8 +1306,6 @@ declare global { * * CDLHANGINGMAN(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLHANGINGMAN(Records: botvs.Record[]): number[]; /** @@ -1675,11 +1313,6 @@ declare global { * * CDLHANGINGMAN(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLHANGINGMAN(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1688,8 +1321,6 @@ declare global { * * CDLHARAMI(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLHARAMI(Records: botvs.Record[]): number[]; /** @@ -1697,11 +1328,6 @@ declare global { * * CDLHARAMI(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLHARAMI(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1710,8 +1336,6 @@ declare global { * * CDLHARAMICROSS(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLHARAMICROSS(Records: botvs.Record[]): number[]; /** @@ -1719,11 +1343,6 @@ declare global { * * CDLHARAMICROSS(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLHARAMICROSS(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1732,8 +1351,6 @@ declare global { * * CDLHIGHWAVE(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLHIGHWAVE(Records: botvs.Record[]): number[]; /** @@ -1741,11 +1358,6 @@ declare global { * * CDLHIGHWAVE(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLHIGHWAVE(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1754,8 +1366,6 @@ declare global { * * CDLHIKKAKE(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLHIKKAKE(Records: botvs.Record[]): number[]; /** @@ -1763,11 +1373,6 @@ declare global { * * CDLHIKKAKE(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLHIKKAKE(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1776,8 +1381,6 @@ declare global { * * CDLHIKKAKEMOD(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLHIKKAKEMOD(Records: botvs.Record[]): number[]; /** @@ -1785,11 +1388,6 @@ declare global { * * CDLHIKKAKEMOD(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLHIKKAKEMOD(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1798,8 +1396,6 @@ declare global { * * CDLHOMINGPIGEON(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLHOMINGPIGEON(Records: botvs.Record[]): number[]; /** @@ -1807,11 +1403,6 @@ declare global { * * CDLHOMINGPIGEON(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLHOMINGPIGEON(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1820,8 +1411,6 @@ declare global { * * CDLIDENTICAL3CROWS(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLIDENTICAL3CROWS(Records: botvs.Record[]): number[]; /** @@ -1829,11 +1418,6 @@ declare global { * * CDLIDENTICAL3CROWS(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLIDENTICAL3CROWS(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1842,8 +1426,6 @@ declare global { * * CDLINNECK(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLINNECK(Records: botvs.Record[]): number[]; /** @@ -1851,11 +1433,6 @@ declare global { * * CDLINNECK(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLINNECK(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1864,8 +1441,6 @@ declare global { * * CDLINVERTEDHAMMER(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLINVERTEDHAMMER(Records: botvs.Record[]): number[]; /** @@ -1873,11 +1448,6 @@ declare global { * * CDLINVERTEDHAMMER(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLINVERTEDHAMMER(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1886,8 +1456,6 @@ declare global { * * CDLKICKING(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLKICKING(Records: botvs.Record[]): number[]; /** @@ -1895,11 +1463,6 @@ declare global { * * CDLKICKING(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLKICKING(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1908,8 +1471,6 @@ declare global { * * CDLKICKINGBYLENGTH(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLKICKINGBYLENGTH(Records: botvs.Record[]): number[]; /** @@ -1917,11 +1478,6 @@ declare global { * * CDLKICKINGBYLENGTH(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLKICKINGBYLENGTH(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1930,8 +1486,6 @@ declare global { * * CDLLADDERBOTTOM(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLLADDERBOTTOM(Records: botvs.Record[]): number[]; /** @@ -1939,11 +1493,6 @@ declare global { * * CDLLADDERBOTTOM(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLLADDERBOTTOM(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1952,8 +1501,6 @@ declare global { * * CDLLONGLEGGEDDOJI(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLLONGLEGGEDDOJI(Records: botvs.Record[]): number[]; /** @@ -1961,11 +1508,6 @@ declare global { * * CDLLONGLEGGEDDOJI(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLLONGLEGGEDDOJI(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1974,8 +1516,6 @@ declare global { * * CDLLONGLINE(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLLONGLINE(Records: botvs.Record[]): number[]; /** @@ -1983,11 +1523,6 @@ declare global { * * CDLLONGLINE(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLLONGLINE(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -1996,8 +1531,6 @@ declare global { * * CDLMARUBOZU(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLMARUBOZU(Records: botvs.Record[]): number[]; /** @@ -2005,11 +1538,6 @@ declare global { * * CDLMARUBOZU(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLMARUBOZU(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -2018,8 +1546,6 @@ declare global { * * CDLMATCHINGLOW(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLMATCHINGLOW(Records: botvs.Record[]): number[]; /** @@ -2027,11 +1553,6 @@ declare global { * * CDLMATCHINGLOW(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLMATCHINGLOW(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -2040,9 +1561,6 @@ declare global { * * CDLMATHOLD(Records[Open,High,Low,Close],Penetration = 0.5) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @param {number=0.5} Penetration - * @return {number[]} */ function CDLMATHOLD(Records: botvs.Record[], Penetration: number): number[]; /** @@ -2050,12 +1568,6 @@ declare global { * * CDLMATHOLD(Records[Open,High,Low,Close],Penetration = 0.5) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=0.5} Penetration - * @return {number[]} */ function CDLMATHOLD( Open: number[], @@ -2070,9 +1582,6 @@ declare global { * * CDLMORNINGDOJISTAR(Records[Open,High,Low,Close],Penetration = 0.3) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @param {number=0.3} Penetration - * @return {number[]} */ function CDLMORNINGDOJISTAR(Records: botvs.Record[], Penetration: number): number[]; /** @@ -2080,12 +1589,6 @@ declare global { * * CDLMORNINGDOJISTAR(Records[Open,High,Low,Close],Penetration = 0.3) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=0.3} Penetration - * @return {number[]} */ function CDLMORNINGDOJISTAR( Open: number[], @@ -2100,9 +1603,6 @@ declare global { * * CDLMORNINGSTAR(Records[Open,High,Low,Close],Penetration = 0.3) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @param {number=0.3} Penetration - * @return {number[]} */ function CDLMORNINGSTAR(Records: botvs.Record[], Penetration: number): number[]; /** @@ -2110,12 +1610,6 @@ declare global { * * CDLMORNINGSTAR(Records[Open,High,Low,Close],Penetration = 0.3) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=0.3} Penetration - * @return {number[]} */ function CDLMORNINGSTAR( Open: number[], @@ -2130,8 +1624,6 @@ declare global { * * CDLONNECK(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLONNECK(Records: botvs.Record[]): number[]; /** @@ -2139,11 +1631,6 @@ declare global { * * CDLONNECK(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLONNECK(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -2152,8 +1639,6 @@ declare global { * * CDLPIERCING(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLPIERCING(Records: botvs.Record[]): number[]; /** @@ -2161,11 +1646,6 @@ declare global { * * CDLPIERCING(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLPIERCING(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -2174,8 +1654,6 @@ declare global { * * CDLRICKSHAWMAN(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLRICKSHAWMAN(Records: botvs.Record[]): number[]; /** @@ -2183,11 +1661,6 @@ declare global { * * CDLRICKSHAWMAN(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLRICKSHAWMAN(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -2196,8 +1669,6 @@ declare global { * * CDLRISEFALL3METHODS(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLRISEFALL3METHODS(Records: botvs.Record[]): number[]; /** @@ -2205,11 +1676,6 @@ declare global { * * CDLRISEFALL3METHODS(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLRISEFALL3METHODS(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -2218,8 +1684,6 @@ declare global { * * CDLSEPARATINGLINES(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLSEPARATINGLINES(Records: botvs.Record[]): number[]; /** @@ -2227,11 +1691,6 @@ declare global { * * CDLSEPARATINGLINES(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLSEPARATINGLINES(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -2240,8 +1699,6 @@ declare global { * * CDLSHOOTINGSTAR(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLSHOOTINGSTAR(Records: botvs.Record[]): number[]; /** @@ -2249,11 +1706,6 @@ declare global { * * CDLSHOOTINGSTAR(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLSHOOTINGSTAR(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -2262,8 +1714,6 @@ declare global { * * CDLSHORTLINE(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLSHORTLINE(Records: botvs.Record[]): number[]; /** @@ -2271,11 +1721,6 @@ declare global { * * CDLSHORTLINE(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLSHORTLINE(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -2284,8 +1729,6 @@ declare global { * * CDLSPINNINGTOP(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLSPINNINGTOP(Records: botvs.Record[]): number[]; /** @@ -2293,11 +1736,6 @@ declare global { * * CDLSPINNINGTOP(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLSPINNINGTOP(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -2306,8 +1744,6 @@ declare global { * * CDLSTALLEDPATTERN(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLSTALLEDPATTERN(Records: botvs.Record[]): number[]; /** @@ -2315,11 +1751,6 @@ declare global { * * CDLSTALLEDPATTERN(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLSTALLEDPATTERN(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -2328,8 +1759,6 @@ declare global { * * CDLSTICKSANDWICH(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLSTICKSANDWICH(Records: botvs.Record[]): number[]; /** @@ -2337,11 +1766,6 @@ declare global { * * CDLSTICKSANDWICH(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLSTICKSANDWICH(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -2350,8 +1774,6 @@ declare global { * * CDLTAKURI(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLTAKURI(Records: botvs.Record[]): number[]; /** @@ -2359,11 +1781,6 @@ declare global { * * CDLTAKURI(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLTAKURI(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -2372,8 +1789,6 @@ declare global { * * CDLTASUKIGAP(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLTASUKIGAP(Records: botvs.Record[]): number[]; /** @@ -2381,11 +1796,6 @@ declare global { * * CDLTASUKIGAP(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLTASUKIGAP(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -2394,8 +1804,6 @@ declare global { * * CDLTHRUSTING(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLTHRUSTING(Records: botvs.Record[]): number[]; /** @@ -2403,11 +1811,6 @@ declare global { * * CDLTHRUSTING(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLTHRUSTING(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -2416,8 +1819,6 @@ declare global { * * CDLTRISTAR(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLTRISTAR(Records: botvs.Record[]): number[]; /** @@ -2425,11 +1826,6 @@ declare global { * * CDLTRISTAR(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLTRISTAR(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -2438,8 +1834,6 @@ declare global { * * CDLUNIQUE3RIVER(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLUNIQUE3RIVER(Records: botvs.Record[]): number[]; /** @@ -2447,11 +1841,6 @@ declare global { * * CDLUNIQUE3RIVER(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLUNIQUE3RIVER(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -2460,8 +1849,6 @@ declare global { * * CDLUPSIDEGAP2CROWS(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLUPSIDEGAP2CROWS(Records: botvs.Record[]): number[]; /** @@ -2469,11 +1856,6 @@ declare global { * * CDLUPSIDEGAP2CROWS(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLUPSIDEGAP2CROWS(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -2482,8 +1864,6 @@ declare global { * * CDLXSIDEGAP3METHODS(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function CDLXSIDEGAP3METHODS(Records: botvs.Record[]): number[]; /** @@ -2491,11 +1871,6 @@ declare global { * * CDLXSIDEGAP3METHODS(Records[Open,High,Low,Close]) = Array(outInteger) * - * @param {number[]} Open - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function CDLXSIDEGAP3METHODS(Open: number[], High: number[], Low: number[], Close: number[]): number[]; @@ -2504,8 +1879,6 @@ declare global { * * CEIL(Records[Close]) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} */ function CEIL(Records: botvs.Record[] | number[]): number[]; @@ -2514,9 +1887,6 @@ declare global { * * CMO(Records[Close],Time Period = 14) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=14} TimePeriod - * @return {number[]} */ function CMO(Records: botvs.Record[] | number[], TimePeriod: number): number[]; @@ -2525,8 +1895,6 @@ declare global { * * COS(Records[Close]) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} */ function COS(Records: botvs.Record[] | number[]): number[]; @@ -2535,8 +1903,6 @@ declare global { * * COSH(Records[Close]) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} */ function COSH(Records: botvs.Record[] | number[]): number[]; @@ -2545,9 +1911,6 @@ declare global { * * DEMA(Records[Close],Time Period = 30) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} */ function DEMA(Records: botvs.Record[] | number[], TimePeriod: number): number[]; @@ -2556,9 +1919,6 @@ declare global { * * DX(Records[High,Low,Close],Time Period = 14) = Array(outReal) * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} */ function DX(Records: botvs.Record[], TimePeriod: number): number[]; /** @@ -2566,11 +1926,6 @@ declare global { * * DX(Records[High,Low,Close],Time Period = 14) = Array(outReal) * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=14} TimePeriod - * @return {number[]} */ function DX(High: number[], Low: number[], Close: number[], TimePeriod: number): number[]; @@ -2579,9 +1934,6 @@ declare global { * * EMA(Records[Close],Time Period = 30) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} */ function EMA(Records: botvs.Record[] | number[], TimePeriod: number): number[]; @@ -2590,8 +1942,6 @@ declare global { * * EXP(Records[Close]) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} */ function EXP(Records: botvs.Record[] | number[]): number[]; @@ -2600,8 +1950,6 @@ declare global { * * FLOOR(Records[Close]) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} */ function FLOOR(Records: botvs.Record[] | number[]): number[]; @@ -2610,8 +1958,6 @@ declare global { * * HT_DCPERIOD(Records[Close]) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} */ function HT_DCPERIOD(Records: botvs.Record[] | number[]): number[]; @@ -2620,8 +1966,6 @@ declare global { * * HT_DCPHASE(Records[Close]) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} */ function HT_DCPHASE(Records: botvs.Record[] | number[]): number[]; @@ -2630,8 +1974,6 @@ declare global { * * HT_PHASOR(Records[Close]) = [Array(outInPhase),Array(outQuadrature)] * - * @param {botvs.Record[]|number[]} Records - * @return {[number[], number[]]} */ function HT_PHASOR(Records: botvs.Record[] | number[]): [number[], number[]]; @@ -2640,8 +1982,6 @@ declare global { * * HT_SINE(Records[Close]) = [Array(outSine),Array(outLeadSine)] * - * @param {botvs.Record[]|number[]} Records - * @return {[number[], number[]]} */ function HT_SINE(Records: botvs.Record[] | number[]): [number[], number[]]; @@ -2650,8 +1990,6 @@ declare global { * * HT_TRENDLINE(Records[Close]) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} */ function HT_TRENDLINE(Records: botvs.Record[] | number[]): number[]; @@ -2660,8 +1998,6 @@ declare global { * * HT_TRENDMODE(Records[Close]) = Array(outInteger) * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} */ function HT_TRENDMODE(Records: botvs.Record[] | number[]): number[]; @@ -2670,9 +2006,6 @@ declare global { * * KAMA(Records[Close],Time Period = 30) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} */ function KAMA(Records: botvs.Record[] | number[], TimePeriod: number): number[]; @@ -2681,9 +2014,6 @@ declare global { * * LINEARREG(Records[Close],Time Period = 14) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=14} TimePeriod - * @return {number[]} */ function LINEARREG(Records: botvs.Record[] | number[], TimePeriod: number): number[]; @@ -2692,9 +2022,6 @@ declare global { * * LINEARREG_ANGLE(Records[Close],Time Period = 14) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=14} TimePeriod - * @return {number[]} */ function LINEARREG_ANGLE(Records: botvs.Record[] | number[], TimePeriod: number): number[]; @@ -2703,9 +2030,6 @@ declare global { * * LINEARREG_INTERCEPT(Records[Close],Time Period = 14) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=14} TimePeriod - * @return {number[]} */ function LINEARREG_INTERCEPT(Records: botvs.Record[] | number[], TimePeriod: number): number[]; @@ -2714,9 +2038,6 @@ declare global { * * LINEARREG_SLOPE(Records[Close],Time Period = 14) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=14} TimePeriod - * @return {number[]} */ function LINEARREG_SLOPE(Records: botvs.Record[] | number[], TimePeriod: number): number[]; @@ -2725,8 +2046,6 @@ declare global { * * LN(Records[Close]) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} */ function LN(Records: botvs.Record[] | number[]): number[]; @@ -2735,8 +2054,6 @@ declare global { * * LOG10(Records[Close]) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} */ function LOG10(Records: botvs.Record[] | number[]): number[]; @@ -2745,10 +2062,6 @@ declare global { * * MA(Records[Close],Time Period = 30,MA Type = 0) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @param {number=0} MAType - * @return {number[]} */ function MA(Records: botvs.Record[] | number[], TimePeriod: number, MAType: number): number[]; @@ -2758,11 +2071,6 @@ declare global { * MACD(Records[Close],Fast Period = 12,Slow Period = 26,Signal Period = 9) = * [Array(outMACD),Array(outMACDSignal),Array(outMACDHist)] * - * @param {botvs.Record[]|number[]} Records - * @param {number=12} FastPeriod - * @param {number=26} SlowPeriod - * @param {number=9} SignalPeriod - * @return {[number[], number[], number[]]} */ function MACD( Records: botvs.Record[] | number[], @@ -2778,14 +2086,6 @@ declare global { * = * 0) = [Array(outMACD),Array(outMACDSignal),Array(outMACDHist)] * - * @param {botvs.Record[]|number[]} Records - * @param {number=12} FastPeriod - * @param {number=0} FastMA - * @param {number=26} SlowPeriod - * @param {number=0} SlowMA - * @param {number=9} SignalPeriod - * @param {number=0} SignalMA - * @return {[number[], number[], number[]]} */ function MACDEXT( Records: botvs.Record[] | number[], @@ -2802,9 +2102,6 @@ declare global { * * MACDFIX(Records[Close],Signal Period = 9) = [Array(outMACD),Array(outMACDSignal),Array(outMACDHist)] * - * @param {botvs.Record[]|number[]} Records - * @param {number=9} SignalPeriod - * @return {[number[], number[], number[]]} */ function MACDFIX(Records: botvs.Record[] | number[], SignalPeriod: number): [number[], number[], number[]]; @@ -2813,10 +2110,6 @@ declare global { * * MAMA(Records[Close],Fast Limit = 0.5,Slow Limit = 0.05) = [Array(outMAMA),Array(outFAMA)] * - * @param {botvs.Record[]|number[]} Records - * @param {number=0.5} FastLimit - * @param {number=0.05} SlowLimit - * @return {[number[], number[]]} */ function MAMA(Records: botvs.Record[] | number[], FastLimit: number, SlowLimit: number): [number[], number[]]; @@ -2825,9 +2118,6 @@ declare global { * * MAX(Records[Close],Time Period = 30) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} */ function MAX(Records: botvs.Record[] | number[], TimePeriod: number): number[]; @@ -2836,9 +2126,6 @@ declare global { * * MAXINDEX(Records[Close],Time Period = 30) = Array(outInteger) * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} */ function MAXINDEX(Records: botvs.Record[] | number[], TimePeriod: number): number[]; @@ -2847,8 +2134,6 @@ declare global { * * MEDPRICE(Records[High,Low]) = Array(outReal) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function MEDPRICE(Records: botvs.Record[]): number[]; /** @@ -2856,9 +2141,6 @@ declare global { * * MEDPRICE(Records[High,Low]) = Array(outReal) * - * @param {number[]} High - * @param {number[]} Low - * @return {number[]} */ function MEDPRICE(High: number[], Low: number[]): number[]; @@ -2867,9 +2149,6 @@ declare global { * * MFI(Records[High,Low,Close,Volume],Time Period = 14) = Array(outReal) * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} */ function MFI(Records: botvs.Record[], TimePeriod: number): number[]; /** @@ -2877,12 +2156,6 @@ declare global { * * MFI(Records[High,Low,Close,Volume],Time Period = 14) = Array(outReal) * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number[]} Volume - * @param {number=14} TimePeriod - * @return {number[]} */ function MFI(High: number[], Low: number[], Close: number[], Volume: number[], TimePeriod: number): number[]; @@ -2891,9 +2164,6 @@ declare global { * * MIDPOINT(Records[Close],Time Period = 14) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=14} TimePeriod - * @return {number[]} */ function MIDPOINT(Records: botvs.Record[] | number[], TimePeriod: number): number[]; @@ -2902,9 +2172,6 @@ declare global { * * MIDPRICE(Records[High,Low],Time Period = 14) = Array(outReal) * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} */ function MIDPRICE(Records: botvs.Record[], TimePeriod: number): number[]; /** @@ -2912,10 +2179,6 @@ declare global { * * MIDPRICE(Records[High,Low],Time Period = 14) = Array(outReal) * - * @param {number[]} High - * @param {number[]} Low - * @param {number=14} TimePeriod - * @return {number[]} */ function MIDPRICE(High: number[], Low: number[], TimePeriod: number): number[]; @@ -2924,9 +2187,6 @@ declare global { * * MIN(Records[Close],Time Period = 30) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} */ function MIN(Records: botvs.Record[] | number[], TimePeriod: number): number[]; @@ -2935,9 +2195,6 @@ declare global { * * MININDEX(Records[Close],Time Period = 30) = Array(outInteger) * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} */ function MININDEX(Records: botvs.Record[] | number[], TimePeriod: number): number[]; @@ -2946,9 +2203,6 @@ declare global { * * MINMAX(Records[Close],Time Period = 30) = [Array(outMin),Array(outMax)] * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {[number[], number[]]} */ function MINMAX(Records: botvs.Record[] | number[], TimePeriod: number): [number[], number[]]; @@ -2957,9 +2211,6 @@ declare global { * * MINMAXINDEX(Records[Close],Time Period = 30) = [Array(outMinIdx),Array(outMaxIdx)] * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {[number[], number[]]} */ function MINMAXINDEX(Records: botvs.Record[] | number[], TimePeriod: number): [number[], number[]]; @@ -2968,9 +2219,6 @@ declare global { * * MINUS_DI(Records[High,Low,Close],Time Period = 14) = Array(outReal) * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} */ function MINUS_DI(Records: botvs.Record[], TimePeriod: number): number[]; /** @@ -2978,11 +2226,6 @@ declare global { * * MINUS_DI(Records[High,Low,Close],Time Period = 14) = Array(outReal) * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=14} TimePeriod - * @return {number[]} */ function MINUS_DI(High: number[], Low: number[], Close: number[], TimePeriod: number): number[]; @@ -2991,9 +2234,6 @@ declare global { * * MINUS_DM(Records[High,Low],Time Period = 14) = Array(outReal) * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} */ function MINUS_DM(Records: botvs.Record[], TimePeriod: number): number[]; /** @@ -3001,10 +2241,6 @@ declare global { * * MINUS_DM(Records[High,Low],Time Period = 14) = Array(outReal) * - * @param {number[]} High - * @param {number[]} Low - * @param {number=14} TimePeriod - * @return {number[]} */ function MINUS_DM(High: number[], Low: number[], TimePeriod: number): number[]; @@ -3013,9 +2249,6 @@ declare global { * * MOM(Records[Close],Time Period = 10) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=10} TimePeriod - * @return {number[]} */ function MOM(Records: botvs.Record[] | number[], TimePeriod: number): number[]; @@ -3024,9 +2257,6 @@ declare global { * * NATR(Records[High,Low,Close],Time Period = 14) = Array(outReal) * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} */ function NATR(Records: botvs.Record[], TimePeriod: number): number[]; /** @@ -3034,11 +2264,6 @@ declare global { * * NATR(Records[High,Low,Close],Time Period = 14) = Array(outReal) * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=14} TimePeriod - * @return {number[]} */ function NATR(High: number[], Low: number[], Close: number[], TimePeriod: number): number[]; @@ -3047,8 +2272,6 @@ declare global { * * OBV(Records[Close],Records[Volume]) = Array(outReal) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function OBV(Records: botvs.Record[]): number[]; @@ -3057,9 +2280,6 @@ declare global { * * OBV(Records[Close],Records[Volume]) = Array(outReal) * - * @param {number[]} Close - * @param {number[]} Volume - * @return {number[]} */ function OBV(Close: number[], Volume: number[]): number[]; @@ -3068,9 +2288,6 @@ declare global { * * PLUS_DI(Records[High,Low,Close],Time Period = 14) = Array(outReal) * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} */ function PLUS_DI(Records: botvs.Record[], TimePeriod: number): number[]; /** @@ -3078,11 +2295,6 @@ declare global { * * PLUS_DI(Records[High,Low,Close],Time Period = 14) = Array(outReal) * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=14} TimePeriod - * @return {number[]} */ function PLUS_DI(High: number[], Low: number[], Close: number[], TimePeriod: number): number[]; @@ -3091,9 +2303,6 @@ declare global { * * PLUS_DM(Records[High,Low],Time Period = 14) = Array(outReal) * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} */ function PLUS_DM(Records: botvs.Record[], TimePeriod: number): number[]; /** @@ -3101,10 +2310,6 @@ declare global { * * PLUS_DM(Records[High,Low],Time Period = 14) = Array(outReal) * - * @param {number[]} High - * @param {number[]} Low - * @param {number=14} TimePeriod - * @return {number[]} */ function PLUS_DM(High: number[], Low: number[], TimePeriod: number): number[]; @@ -3113,11 +2318,6 @@ declare global { * * PPO(Records[Close],Fast Period = 12,Slow Period = 26,MA Type = 0) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=12} FastPeriod - * @param {number=26} SlowPeriod - * @param {number=0} MAType - * @return {number[]} */ function PPO( Records: botvs.Record[] | number[], @@ -3131,9 +2331,6 @@ declare global { * * ROC(Records[Close],Time Period = 10) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=10} TimePeriod - * @return {number[]} */ function ROC(Records: botvs.Record[] | number[], TimePeriod: number): number[]; @@ -3142,9 +2339,6 @@ declare global { * * ROCP(Records[Close],Time Period = 10) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=10} TimePeriod - * @return {number[]} */ function ROCP(Records: botvs.Record[] | number[], TimePeriod: number): number[]; @@ -3153,9 +2347,6 @@ declare global { * * ROCR(Records[Close],Time Period = 10) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=10} TimePeriod - * @return {number[]} */ function ROCR(Records: botvs.Record[] | number[], TimePeriod: number): number[]; @@ -3164,9 +2355,6 @@ declare global { * * ROCR100(Records[Close],Time Period = 10) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=10} TimePeriod - * @return {number[]} */ function ROCR100(Records: botvs.Record[] | number[], TimePeriod: number): number[]; @@ -3175,9 +2363,6 @@ declare global { * * RSI(Records[Close],Time Period = 14) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=14} TimePeriod - * @return {number[]} */ function RSI(Records: botvs.Record[] | number[], TimePeriod: number): number[]; @@ -3186,10 +2371,6 @@ declare global { * * SAR(Records[High,Low],Acceleration Factor = 0.02,AF Maximum = 0.2) = Array(outReal) * - * @param {botvs.Record[]} Records - * @param {number=0.02} AccelerationFactor - * @param {number=0.2} AFMaximum - * @return {number[]} */ function SAR(Records: botvs.Record[], AccelerationFactor: number, AFMaximum: number): number[]; /** @@ -3197,11 +2378,6 @@ declare global { * * SAR(Records[High,Low],Acceleration Factor = 0.02,AF Maximum = 0.2) = Array(outReal) * - * @param {number[]} High - * @param {number[]} Low - * @param {number=0.02} AccelerationFactor - * @param {number=0.2} AFMaximum - * @return {number[]} */ function SAR(High: number[], Low: number[], AccelerationFactor: number, AFMaximum: number): number[]; @@ -3212,16 +2388,6 @@ declare global { * Long = * 0.2,AF Init Short = 0.02,AF Short = 0.02,AF Max Short = 0.2) = Array(outReal) * - * @param {botvs.Record[]} Records - * @param {number=0} StartValue - * @param {number=0} OffsetonReverse - * @param {number=0.02} AFInitLong - * @param {number=0.02} AFLong - * @param {number=0.2} AFMaxLong - * @param {number=0.02} AFInitShort - * @param {number=0.02} AFShort - * @param {number=0.2} AFMaxShort - * @return {number[]} */ function SAREXT( Records: botvs.Record[], @@ -3241,17 +2407,6 @@ declare global { * Long = * 0.2,AF Init Short = 0.02,AF Short = 0.02,AF Max Short = 0.2) = Array(outReal) * - * @param {number[]} High - * @param {number[]} Low - * @param {number=0} StartValue - * @param {number=0} OffsetonReverse - * @param {number=0.02} AFInitLong - * @param {number=0.02} AFLong - * @param {number=0.2} AFMaxLong - * @param {number=0.02} AFInitShort - * @param {number=0.02} AFShort - * @param {number=0.2} AFMaxShort - * @return {number[]} */ function SAREXT( High: number[], @@ -3271,8 +2426,6 @@ declare global { * * SIN(Records[Close]) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} */ function SIN(Records: botvs.Record[] | number[]): number[]; @@ -3281,8 +2434,6 @@ declare global { * * SINH(Records[Close]) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} */ function SINH(Records: botvs.Record[] | number[]): number[]; @@ -3291,9 +2442,6 @@ declare global { * * SMA(Records[Close],Time Period = 30) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} */ function SMA(Records: botvs.Record[] | number[], TimePeriod: number): number[]; @@ -3302,8 +2450,6 @@ declare global { * * SQRT(Records[Close]) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} */ function SQRT(Records: botvs.Record[] | number[]): number[]; @@ -3312,10 +2458,6 @@ declare global { * * STDDEV(Records[Close],Time Period = 5,Deviations = 1) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=5} TimePeriod - * @param {number=1} Deviations - * @return {number[]} */ function STDDEV(Records: botvs.Record[] | number[], TimePeriod: number, Deviations: number): number[]; @@ -3326,13 +2468,6 @@ declare global { * = 0) * = [Array(outSlowK),Array(outSlowD)] * - * @param {botvs.Record[]} Records - * @param {number=5} Fast_KPeriod - * @param {number=3} Slow_KPeriod - * @param {number=0} Slow_KMA - * @param {number=3} Slow_DPeriod - * @param {number=0} Slow_DMA - * @return {[number[], number[]]} */ function STOCH( Records: botvs.Record[], @@ -3349,15 +2484,6 @@ declare global { * = 0) * = [Array(outSlowK),Array(outSlowD)] * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=5} Fast_KPeriod - * @param {number=3} Slow_KPeriod - * @param {number=0} Slow_KMA - * @param {number=3} Slow_DPeriod - * @param {number=0} Slow_DMA - * @return {[number[], number[]]} */ function STOCH( High: number[], @@ -3376,11 +2502,6 @@ declare global { * STOCHF(Records[High,Low,Close],Fast-K Period = 5,Fast-D Period = 3,Fast-D MA = 0) = * [Array(outFastK),Array(outFastD)] * - * @param {botvs.Record[]} Records - * @param {number=5} Fast_KPeriod - * @param {number=3} Fast_DPeriod - * @param {number=0} Fast_DMA - * @return {[number[], number[]]} */ function STOCHF( Records: botvs.Record[], @@ -3394,13 +2515,6 @@ declare global { * STOCHF(Records[High,Low,Close],Fast-K Period = 5,Fast-D Period = 3,Fast-D MA = 0) = * [Array(outFastK),Array(outFastD)] * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=5} Fast_KPeriod - * @param {number=3} Fast_DPeriod - * @param {number=0} Fast_DMA - * @return {[number[], number[]]} */ function STOCHF( High: number[], @@ -3417,12 +2531,6 @@ declare global { * STOCHRSI(Records[Close],Time Period = 14,Fast-K Period = 5,Fast-D Period = 3,Fast-D MA = 0) = * [Array(outFastK),Array(outFastD)] * - * @param {botvs.Record[]|number[]} Records - * @param {number=14} TimePeriod - * @param {number=5} Fast_KPeriod - * @param {number=3} Fast_DPeriod - * @param {number=0} Fast_DMA - * @return {[number[], number[]]} */ function STOCHRSI( Records: botvs.Record[] | number[], @@ -3437,9 +2545,6 @@ declare global { * * SUM(Records[Close],Time Period = 30) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} */ function SUM(Records: botvs.Record[] | number[], TimePeriod: number): number[]; @@ -3448,10 +2553,6 @@ declare global { * * T3(Records[Close],Time Period = 5,Volume Factor = 0.7) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=5} TimePeriod - * @param {number=0.7} VolumeFactor - * @return {number[]} */ function T3(Records: botvs.Record[] | number[], TimePeriod: number, VolumeFactor: number): number[]; @@ -3460,8 +2561,6 @@ declare global { * * TAN(Records[Close]) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} */ function TAN(Records: botvs.Record[] | number[]): number[]; @@ -3470,8 +2569,6 @@ declare global { * * TANH(Records[Close]) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @return {number[]} */ function TANH(Records: botvs.Record[] | number[]): number[]; @@ -3480,9 +2577,6 @@ declare global { * * TEMA(Records[Close],Time Period = 30) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} */ function TEMA(Records: botvs.Record[] | number[], TimePeriod: number): number[]; @@ -3491,8 +2585,6 @@ declare global { * * TRANGE(Records[High,Low,Close]) = Array(outReal) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function TRANGE(Records: botvs.Record[]): number[]; /** @@ -3500,10 +2592,6 @@ declare global { * * TRANGE(Records[High,Low,Close]) = Array(outReal) * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function TRANGE(High: number[], Low: number[], Close: number[]): number[]; @@ -3512,9 +2600,6 @@ declare global { * * TRIMA(Records[Close],Time Period = 30) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} */ function TRIMA(Records: botvs.Record[] | number[], TimePeriod: number): number[]; @@ -3523,9 +2608,6 @@ declare global { * * TRIX(Records[Close],Time Period = 30) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} */ function TRIX(Records: botvs.Record[] | number[], TimePeriod: number): number[]; @@ -3534,9 +2616,6 @@ declare global { * * TSF(Records[Close],Time Period = 14) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=14} TimePeriod - * @return {number[]} */ function TSF(Records: botvs.Record[] | number[], TimePeriod: number): number[]; @@ -3545,8 +2624,6 @@ declare global { * * TYPPRICE(Records[High,Low,Close]) = Array(outReal) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function TYPPRICE(Records: botvs.Record[]): number[]; /** @@ -3554,10 +2631,6 @@ declare global { * * TYPPRICE(Records[High,Low,Close]) = Array(outReal) * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function TYPPRICE(High: number[], Low: number[], Close: number[]): number[]; @@ -3566,11 +2639,6 @@ declare global { * * ULTOSC(Records[High,Low,Close],First Period = 7,Second Period = 14,Third Period = 28) = Array(outReal) * - * @param {botvs.Record[]} Records - * @param {number=7} FirstPeriod - * @param {number=14} SecondPeriod - * @param {number=28} ThirdPeriod - * @return {number[]} */ function ULTOSC( Records: botvs.Record[], @@ -3583,13 +2651,6 @@ declare global { * * ULTOSC(Records[High,Low,Close],First Period = 7,Second Period = 14,Third Period = 28) = Array(outReal) * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=7} FirstPeriod - * @param {number=14} SecondPeriod - * @param {number=28} ThirdPeriod - * @return {number[]} */ function ULTOSC( High: number[], @@ -3605,10 +2666,6 @@ declare global { * * VAR(Records[Close],Time Period = 5,Deviations = 1) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=5} TimePeriod - * @param {number=1} Deviations - * @return {number[]} */ function VAR(Records: botvs.Record[] | number[], TimePeriod: number, Deviations: number): number[]; @@ -3617,8 +2674,6 @@ declare global { * * WCLPRICE(Records[High,Low,Close]) = Array(outReal) * - * @param {botvs.Record[]} Records - * @return {number[]} */ function WCLPRICE(Records: botvs.Record[]): number[]; /** @@ -3626,10 +2681,6 @@ declare global { * * WCLPRICE(Records[High,Low,Close]) = Array(outReal) * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @return {number[]} */ function WCLPRICE(High: number[], Low: number[], Close: number[]): number[]; @@ -3638,9 +2689,6 @@ declare global { * * WILLR(Records[High,Low,Close],Time Period = 14) = Array(outReal) * - * @param {botvs.Record[]} Records - * @param {number=14} TimePeriod - * @return {number[]} */ function WILLR(Records: botvs.Record[], TimePeriod: number): number[]; /** @@ -3648,11 +2696,6 @@ declare global { * * WILLR(Records[High,Low,Close],Time Period = 14) = Array(outReal) * - * @param {number[]} High - * @param {number[]} Low - * @param {number[]} Close - * @param {number=14} TimePeriod - * @return {number[]} */ function WILLR(High: number[], Low: number[], Close: number[], TimePeriod: number): number[]; @@ -3661,9 +2704,6 @@ declare global { * * WMA(Records[Close],Time Period = 30) = Array(outReal) * - * @param {botvs.Record[]|number[]} Records - * @param {number=30} TimePeriod - * @return {number[]} */ function WMA(Records: botvs.Record[] | number[], TimePeriod: number): number[]; } @@ -3780,7 +2820,6 @@ declare global { * plt.plot([3,6,2,4,7,1]) * Log(plt) * - * @param {string} arg */ function Log(arg: string): void; @@ -3789,7 +2828,6 @@ declare global { * * 参数为毫秒数,如Sleep(1000)为休眠一秒 * - * @param {number} Millisecond */ function Sleep(Millisecond: number): void; @@ -3798,28 +2836,24 @@ declare global { * * 模拟回测状态返回true,实盘返回false * - * @return {boolean} */ function IsVirtual(): boolean; /** * 记录盈利值,这个为总盈利的值,参数类型为浮点数 * - * @param {number} Profit */ function LogProfit(Profit: number): void; /** * 清空所有收益日志, 可以带一个数字参数, 指定保留的条数 * - * @param {number} reserve */ function LogProfitReset(reserve?: number): void; /** * 清空所有日志, 可以带一个数字参数, 指定保留的条数 * - * @param {number} reserve */ function LogReset(reserve?: number): void; @@ -3856,14 +2890,12 @@ declare global { * LogStatus('`' + JSON.stringify({'type':'button', 'class': 'btn btn-xs btn-danger', 'cmd': 'coverAll', 'name': * '平仓'}) + '`') * - * @param {string} Msg */ function LogStatus(Msg: string): void; /** * 打开或者关闭定单和出错信息的日志记录 * - * @param {boolean} IsEnable */ function EnableLog(IsEnable: boolean): void; @@ -3883,8 +2915,6 @@ declare global { * series的数据, 指定序列3指的是图表3的第一个series的数据 HighStocks: * http://api.highcharts.com/highstock * - * @param {botvs.ChartOptions} options - * @return {botvs.RChart} */ function Chart(...options: botvs.ChartOptions[]): botvs.RChart; @@ -3894,13 +2924,6 @@ declare global { * Mail(smtpServer, smtpUsername, smtpPassword, mailTo, title, body); ret true or false * Mail("smtp.163.com", "asdf@163.com", "password", "111@163.com", "title", "body") * - * @param {string} smtpServer - * @param {string} smtpUsername - * @param {string} smtpPassword - * @param {string} mailTo - * @param {string} title - * @param {string} body - * @return {boolean} */ function Mail( smtpServer: string, @@ -3918,21 +2941,18 @@ declare global { * SetErrorFilter("502:|503:|tcp|character|unexpected|network|timeout|WSARecv|Connect|GetAddr|no * such|reset|http|received|EOF|reused"); * - * @param {string} RegEx */ function SetErrorFilter(RegEx: string): void; /** * 返回机器人进程ID * - * @return {number} */ function GetPid(): number; /** * 获取最近一次出错信息,一般无需使用,因为程序会把出错信息自动上传到日志系统 * - * @return {string} */ function GetLastError(): string; @@ -3948,8 +2968,6 @@ declare global { * _G(); // 返回当前机器人的ID * _G(null); // 删除所有全局变量 * - * @param {string} K - * @param {T} V */ function _G(K: string, V: T): void; @@ -3965,7 +2983,6 @@ declare global { * Sleep(1000); * } * - * @return {string} */ function GetCommand(): string | null; @@ -3989,9 +3006,6 @@ declare global { * } * ``` * - * @param {string} Address - * @param {number} Timeout - * @return {botvs.Socket} */ function Dial(Address: string, Timeout?: number): botvs.Socket | void; @@ -4009,11 +3023,6 @@ declare global { * HttpQuery("http://www.baidu.com/", null, "a=10; b=20", "User-Agent: Mobile\nContent-Type: text/html", true); * // will return {Header: HTTP Header, Body: HTML} * - * @param {string} Url - * @param {string | null | {method: string; data?: string}} PostData - * @param {string} Cookies - * @param {string} Headers - * @return {string} */ function HttpQuery( Url: string, @@ -4036,10 +3045,6 @@ declare global { * Log(Hash('md5', 'hex', 'hello')); * Log(Hash('sha512', 'base64', 'hello')); * - * @param {"md5" | "sha256" | "sha512" | "sha1"} Algo - * @param {"hex" | "base64"} OutputAlgo - * @param {string} Data - * @return {string} */ function Hash( Algo: 'md5' | 'sha256' | 'sha512' | 'sha1', @@ -4054,11 +3059,6 @@ declare global { * Log(HMAC('md5', 'hex', 'hello', 'pass')); * Log(HMAC('sha512', 'base64', 'hello', 'pass')); * - * @param {"md5" | "sha256" | "sha512" | "sha1"} Algo - * @param {"hex" | "base64" | "raw"} OutputAlgo - * @param {string} Data - * @param {string} password - * @return {string} */ function HMAC( Algo: 'md5' | 'sha256' | 'sha512' | 'sha1', @@ -4071,18 +3071,13 @@ declare global { * 返回指定时间戳(ms)字符串, 不传任何参数就返回当前时间, * 如_D(),或者_D(1478570053241), 默认格式为yyyy-MM-dd hh:mm:ss * - * @param {string} timestamp - * @param {string} format - * @return {string} */ function _D(timestamp: string, format: string): string; /** * 格式化一个浮点函数 * - * @param {number} num - * @param {number=4} precision - * @return {string} + * @param precision Default 4 */ function _N(num: number, precision?: number): string; @@ -4091,16 +3086,12 @@ declare global { * 比如_C(exchange.GetTicker), 默认重试间隔为3秒, 可以调用_CDelay函数来控制重试间隔 * 比如_CDelay(1000), 指改变_C函数重试间隔为1秒 * - * @param {(...args: any[]) => T} func - * @param args - * @return {T} */ function _C(func: (...args: any[]) => T, ...args: any[]): T; /** * 比如_CDelay(1000), 指改变_C函数重试间隔为1秒, 默认为3秒 * - * @param {number} delay */ function _CDelay(delay: number): void; } diff --git a/types/bounce.js/tslint.json b/types/bounce.js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bounce.js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bowser/bowser-tests.ts b/types/bowser/bowser-tests.ts index 490d02a254..6b69a12ca2 100644 --- a/types/bowser/bowser-tests.ts +++ b/types/bowser/bowser-tests.ts @@ -1,10 +1,11 @@ -bowser.msedge === true; -bowser.test(['msie']) === true; +bowser.msedge; // $ExpectType boolean +bowser.test(['msie']); // $ExpectType boolean bowser.a === bowser.c; bowser.osversion > 10; bowser.osversion === '10.1A'; bowser.compareVersions(['9.0', '10']); -bowser() === {android: true, x: true}; +bowser().android; // $ExpectType boolean +bowser().x; // $ExpectType boolean bowser.check({msie: "11"}, window.navigator.userAgent); -bowser.isUnsupportedBrowser({msie: "10"}, window.navigator.userAgent); \ No newline at end of file +bowser.isUnsupportedBrowser({msie: "10"}, window.navigator.userAgent); diff --git a/types/bowser/index.d.ts b/types/bowser/index.d.ts index 163342a631..7339783c77 100644 --- a/types/bowser/index.d.ts +++ b/types/bowser/index.d.ts @@ -8,13 +8,12 @@ export = bowser; export as namespace bowser; declare namespace bowser { - - export interface IBowserOS { + interface IBowserOS { mac: boolean; - /**other than Windows Phone */ + /** other than Windows Phone */ windows: boolean; windowsphone: boolean; - /**other than android, chromeos, webos, tizen, and sailfish */ + /** other than android, chromeos, webos, tizen, and sailfish */ linux: boolean; chromeos: boolean; android: boolean; @@ -29,7 +28,7 @@ declare namespace bowser { sailfish: boolean; } - export interface IBowserVersions { + interface IBowserVersions { chrome: boolean; firefox: boolean; msie: boolean; @@ -53,14 +52,14 @@ declare namespace bowser { kMeleon: boolean; } - export interface IBowserEngines { + interface IBowserEngines { /** IE <= 11 */ msie: boolean; - /**Chrome 0-27, Android <4.4, iOs, BB, etc. */ + /** Chrome 0-27, Android <4.4, iOs, BB, etc. */ webkit: boolean; - /**Chrome >=28, Android >=4.4, Opera, etc. */ + /** Chrome >=28, Android >=4.4, Opera, etc. */ blink: boolean; - /**Firefox, etc. */ + /** Firefox, etc. */ gecko: boolean; /** IE > 11 */ msedge: boolean; @@ -68,37 +67,35 @@ declare namespace bowser { tablet: boolean; /** All detected mobile OSes are additionally flagged mobile, unless it's a tablet */ mobile: boolean; - } - export interface IBowserGrade { + interface IBowserGrade { /** Grade A browser */ a: boolean; /** Grade C browser */ c: boolean; /** Grade X browser */ x: boolean; - /**A human readable name for this browser. E.g. 'Chrome', '' */ + /** A human readable name for this browser. E.g. 'Chrome', '' */ name: string; - /**Version number for the browser. E.g. '32.0' */ - version: string|number; - osversion: string|number; + /** Version number for the browser. E.g. '32.0' */ + version: string | number; + osversion: string | number; } - export interface IBowserDetection extends IBowserGrade, IBowserEngines, IBowserOS, IBowserVersions { } + interface IBowserDetection extends IBowserGrade, IBowserEngines, IBowserOS, IBowserVersions { } - export interface IBowserMinVersions { + interface IBowserMinVersions { // { msie: "11", "firefox": "4" } [index: string]: string; } - export interface IBowser extends IBowserDetection { + interface IBowser extends IBowserDetection { (): IBowserDetection; test(browserList: string[]): boolean; _detect(ua: string): IBowser; compareVersions(versions: string[]): number; - check(minVersions: IBowserMinVersions, strictMode?: boolean|string, ua?: string): Boolean; - isUnsupportedBrowser(minVersions: IBowserMinVersions, strictMode?: boolean|string, ua?: string): boolean; + check(minVersions: IBowserMinVersions, strictMode?: boolean | string, ua?: string): boolean; + isUnsupportedBrowser(minVersions: IBowserMinVersions, strictMode?: boolean | string, ua?: string): boolean; } - } diff --git a/types/bowser/tslint.json b/types/bowser/tslint.json new file mode 100644 index 0000000000..45f91d386b --- /dev/null +++ b/types/bowser/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // TODO + "interface-name": false + } +} diff --git a/types/box2d/index.d.ts b/types/box2d/index.d.ts index 77a132592e..d17eb2c8f6 100644 --- a/types/box2d/index.d.ts +++ b/types/box2d/index.d.ts @@ -5147,7 +5147,7 @@ declare namespace Box2D.Dynamics.Joints { /** * The pulley joint is connected to two bodies and two fixed ground points. The pulley supports a ratio such that: length1 + ratio length2 <= constant Yes, the force transmitted is scaled by the ratio. The pulley also enforces a maximum length limit on both sides. This is useful to prevent one side of the pulley hitting the top. **/ - export class b2PullyJoint extends b2Joint { + export class b2PulleyJoint extends b2Joint { /** * Get the anchor point on bodyA in world coordinates. @@ -5207,7 +5207,7 @@ declare namespace Box2D.Dynamics.Joints { /** * Pulley joint definition. This requires two ground anchors, two dynamic body anchor points, max lengths for each side, and a pulley ratio. **/ - export class b2PullyJointDef extends b2JointDef { + export class b2PulleyJointDef extends b2JointDef { /** * The first ground anchor in world coordinates. This point never moves. diff --git a/types/box2d/tslint.json b/types/box2d/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/box2d/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/braintree-web/index.d.ts b/types/braintree-web/index.d.ts index 46f16e072b..bc5ca0b01f 100644 --- a/types/braintree-web/index.d.ts +++ b/types/braintree-web/index.d.ts @@ -611,12 +611,14 @@ declare namespace braintree { * @property {object} details Additional account details. * @property {string} details.cardType Type of card, ex: Visa, MasterCard. * @property {string} details.lastTwo Last two digits of card number. + * @property {string} details.lastFour Last four digits of card number. * @property {string} description A human-readable description. * @property {string} type The payment method type, always `CreditCard`. */ interface HostedFieldsAccountDetails { cardType: string; lastTwo: string; + lastFour: string; } interface HostedFieldsTokenizePayload { diff --git a/types/braintree-web/tslint.json b/types/braintree-web/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/braintree-web/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/breeze/tslint.json b/types/breeze/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/breeze/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/brorand/tslint.json b/types/brorand/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/brorand/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/browser-bunyan/index.d.ts b/types/browser-bunyan/index.d.ts index 7edabdca26..4fedbcd780 100644 --- a/types/browser-bunyan/index.d.ts +++ b/types/browser-bunyan/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Paul Lockwood // Michael Strobel // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/browser-harness/tslint.json b/types/browser-harness/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/browser-harness/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/browser-pack/tslint.json b/types/browser-pack/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/browser-pack/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/browser-report/tslint.json b/types/browser-report/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/browser-report/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/browser-resolve/tslint.json b/types/browser-resolve/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/browser-resolve/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/browser-sync/browser-sync-tests.ts b/types/browser-sync/browser-sync-tests.ts index c20f27236a..85cd464a21 100644 --- a/types/browser-sync/browser-sync-tests.ts +++ b/types/browser-sync/browser-sync-tests.ts @@ -24,6 +24,46 @@ browserSync({ proxy: "yourlocal.dev" }); +browserSync({ + proxy: { + target: "http://yourlocal.dev", + proxyReq: function(proxyReq) { + console.log(proxyReq); + } + } +}); + +browserSync({ + proxy: { + target: "http://yourlocal.dev", + proxyReq: [ + function(proxyReq) { + console.log(proxyReq); + } + ] + } +}); + +browserSync({ + proxy: { + target: "http://yourlocal.dev", + proxyRes: function(proxyRes, req, res) { + console.log(proxyRes); + } + } +}); + +browserSync({ + proxy: { + target: "http://yourlocal.dev", + proxyRes: [ + function(proxyRes, req, res) { + console.log(proxyRes); + } + ] + } +}); + var config = { server: { baseDir: "./" diff --git a/types/browser-sync/index.d.ts b/types/browser-sync/index.d.ts index ade12d3cb6..b22054c367 100644 --- a/types/browser-sync/index.d.ts +++ b/types/browser-sync/index.d.ts @@ -48,6 +48,7 @@ declare namespace browserSync { * middleware - Default: undefined * reqHeaders - Default: undefined * proxyRes - Default: undefined + * proxyReq - Default: undefined */ proxy?: string | boolean | ProxyOptions; /** @@ -291,9 +292,10 @@ declare namespace browserSync { interface ProxyOptions { target?: string; middleware?: MiddlewareHandler; - ws: boolean; - reqHeaders: (config: any) => Hash; - proxyRes: (res: http.ServerResponse, req: http.IncomingMessage, next: Function) => any; + ws?: boolean; + reqHeaders?: (config: any) => Hash; + proxyRes?: ((res: http.ServerResponse, req: http.IncomingMessage, next: Function) => any)[] | ((res: http.ServerResponse, req: http.IncomingMessage, next: Function) => any); + proxyReq?: ((res: http.ServerRequest) => any)[] | ((res: http.ServerRequest) => any); } interface MiddlewareHandler { diff --git a/types/browser-sync/tslint.json b/types/browser-sync/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/browser-sync/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/browserify/tslint.json b/types/browserify/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/browserify/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bs58/tslint.json b/types/bs58/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bs58/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bson/tslint.json b/types/bson/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bson/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bucks/tslint.json b/types/bucks/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bucks/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/buffer-compare/tslint.json b/types/buffer-compare/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/buffer-compare/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/buffer-equal/tslint.json b/types/buffer-equal/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/buffer-equal/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/buffers/tslint.json b/types/buffers/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/buffers/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index 5754236da8..1e9e3b55bc 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -1,11 +1,14 @@ -// Type definitions for bull 3.0 +// Type definitions for bull 3.3 // Project: https://github.com/OptimalBits/bull // Definitions by: Bruno Grieder // Cameron Crothers // Marshall Cottrell +// Weeco // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import * as Redis from "ioredis"; +import * as Promise from "bluebird"; /** * This is the Queue constructor. @@ -13,407 +16,591 @@ import * as Redis from "ioredis"; * Everytime the same queue is instantiated it tries to process all the old jobs that may exist from a previous unfinished session. */ declare const Bull: { - // tslint:disable:unified-signatures - (queueName: string, opts?: Bull.QueueOptions): Bull.Queue; - (queueName: string, url?: string): Bull.Queue; - new (queueName: string, opts?: Bull.QueueOptions): Bull.Queue; - new (queueName: string, url?: string): Bull.Queue; - // tslint:enable:unified-signatures + // tslint:disable:unified-signatures + (queueName: string, opts?: Bull.QueueOptions): Bull.Queue; + (queueName: string, url?: string): Bull.Queue; + new (queueName: string, opts?: Bull.QueueOptions): Bull.Queue; + new (queueName: string, url?: string): Bull.Queue; + // tslint:enable:unified-signatures }; declare namespace Bull { - interface QueueOptions { - /** - * Options passed directly to the `ioredis` constructor - */ - redis?: Redis.RedisOptions; - - /** - * When specified, the `Queue` will use this function to create new `ioredis` client connections. - * This is useful if you want to re-use connections. - */ - createClient?(type: 'client' | 'subscriber', redisOpts?: Redis.RedisOptions): Redis.Redis; - - /** - * Prefix to use for all redis keys - */ - prefix?: string; - - settings?: AdvancedSettings; - } - - interface AdvancedSettings { - /** - * Key expiration time for job locks - */ - lockDuration?: number; - - /** - * How often check for stalled jobs (use 0 for never checking) - */ - stalledInterval?: number; - - /** - * Max amount of times a stalled job will be re-processed - */ - maxStalledCount?: number; - - /** - * Poll interval for delayed jobs and added jobs - */ - guardInterval?: number; - - /** - * Delay before processing next job in case of internal error - */ - retryProcessDelay?: number; - } - - type DoneCallback = (error?: Error | null, value?: any) => void; - - type JobId = number | string; - - interface Job { - id: JobId; - - /** - * The custom data passed when the job was created - */ - data: any; - - /** - * Report progress on a job - */ - progress(value: any): Promise; - - /** - * Removes a job from the queue and from any lists it may be included in. - * @returns {Promise} A promise that resolves when the job is removed. - */ - remove(): Promise; - - /** - * Re-run a job that has failed. - * @returns {Promise} A promise that resolves when the job is scheduled for retry. - */ - retry(): Promise; - - /** - * Returns a promise the resolves when the job has been finished. - * TODO: Add a watchdog to check if the job has finished periodically. - * since pubsub does not give any guarantees. - */ - finished(): Promise; - - /** - * Promotes a job that is currently "delayed" to the "waiting" state and executed as soon as possible. - */ - promote(): Promise; - } - - type JobStatus = 'completed' | 'waiting' | 'active' | 'delayed' | 'failed'; - - interface BackoffOptions { - /** - * Backoff type, which can be either `fixed` or `exponential` - */ - type: 'fixed' | 'exponential'; - - /** - * Backoff delay, in milliseconds - */ - delay: number; - } - - interface RepeatOptions { - /** - * Cron pattern specifying when the job should execute - */ - cron: string; - - /** - * Timezone - */ - tz?: string; - - /** - * End date when the repeat job should stop repeating - */ - endDate?: Date | string | number; - } - - interface JobOptions { - /** - * Optional priority value. ranges from 1 (highest priority) to MAX_INT (lowest priority). - * Note that using priorities has a slight impact on performance, so do not use it if not required - */ - priority?: number; - - /** - * An amount of miliseconds to wait until this job can be processed. - * Note that for accurate delays, both server and clients should have their clocks synchronized. [optional] - */ - delay?: number; - - /** - * The total number of attempts to try the job until it completes - */ - attempts?: number; - - /** - * Repeat job according to a cron specification - */ - repeat?: RepeatOptions; - - /** - * Backoff setting for automatic retries if the job fails - */ - backoff?: number | BackoffOptions; - - /** - * A boolean which, if true, adds the job to the right - * of the queue instead of the left (default false) - */ - lifo?: boolean; - - /** - * The number of milliseconds after which the job should be fail with a timeout error - */ - timeout?: number; - - /** - * Override the job ID - by default, the job ID is a unique - * integer, but you can use this setting to override it. - * If you use this option, it is up to you to ensure the - * jobId is unique. If you attempt to add a job with an id that - * already exists, it will not be added. - */ - jobId?: JobId; - - /** - * A boolean which, if true, removes the job when it successfully completes. - * Default behavior is to keep the job in the completed set. - */ - removeOnComplete?: boolean; - - /** - * A boolean which, if true, removes the job when it fails after all attempts - * Default behavior is to keep the job in the completed set. - */ - removeOnFail?: boolean; - } - - interface JobCounts { - wait: number; - active: number; - completed: number; - failed: number; - delayed: number; - } - - 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. - */ - isReady(): Promise; - - /** - * Defines a processing function for the jobs placed into a given Queue. - * - * The callback is called everytime a job is placed in the queue. - * It is passed an instance of the job as first argument. - * - * The done callback can be called with an Error instance, to signal that the job did not complete successfully, - * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. - * Errors will be passed as a second argument to the "failed" event; - * results, as a second argument to the "completed" event. - * - * concurrency: Bull will then call you handler in parallel respecting this max number. - */ - process(concurrency: number, callback: (job: Job, done: DoneCallback) => void): void; - - /** - * Defines a processing function for the jobs placed into a given Queue. - * - * The callback is called everytime a job is placed in the queue. - * It is passed an instance of the job as first argument. - * - * The done callback can be called with an Error instance, to signal that the job did not complete successfully, - * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. - * 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; - - /** - * Defines a processing function for the jobs placed into a given Queue. - * - * The callback is called everytime a job is placed in the queue. - * It is passed an instance of the job as first argument. - * - * A promise must be returned to signal job completion. - * 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. - * - * concurrency: Bull will then call you handler in parallel respecting this max number. - */ - process(concurrency: number, callback: (job: Job) => void): Promise; - - /** - * Defines a processing function for the jobs placed into a given Queue. - * - * The callback is called everytime a job is placed in the queue. - * It is passed an instance of the job as first argument. - * - * A promise must be returned to signal job completion. - * 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): Promise; - - /** - * 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; - - /** - * Returns a promise that resolves when the queue is paused. - * The pause is global, meaning that all workers in all queue instances for a given queue will be paused. - * A paused queue will not process new jobs until resumed, - * but current jobs being processed will continue until they are finalized. - * - * Pausing a queue that is already paused does nothing. - */ - pause(): Promise; - - /** - * Returns a promise that resolves when the queue is resumed after being paused. - * The resume is global, meaning that all workers in all queue instances for a given queue will be resumed. - * - * Resuming a queue that is not paused does nothing. - */ - resume(): Promise; - - /** - * Returns a promise that returns the number of jobs in the queue, waiting or paused. - * Since there may be other processes adding or processing jobs, this value may be true only for a very small amount of time. - */ - count(): Promise; - - /** - * Empties a queue deleting all the input lists and associated jobs. - */ - empty(): Promise; - - /** - * Closes the underlying redis client. Use this to perform a graceful shutdown. - * - * `close` can be called from anywhere, with one caveat: - * if called from within a job handler the queue won't close until after the job has been processed - */ - close(): Promise; - - /** - * 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; - - /** - * Returns a promise that resolves with the job counts for the given queue - */ - getJobCounts(): Promise; - - /** - * Tells the queue remove all jobs created outside of a grace period in milliseconds. - * You can clean the jobs with the following states: completed, waiting, active, delayed, and failed. - */ - clean(grace: number, status?: JobStatus, limit?: number): Promise; - - // tslint:disable:unified-signatures - - /** - * Listens to queue events - */ - on(event: string, callback: (...args: any[]) => void): this; - - /** - * An error occured - */ - on(event: 'error', callback: ErrorEventCallback): this; - - /** - * A job has started. You can use `jobPromise.cancel()` to abort it - */ - 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; - - /** - * A job's progress was updated - */ - on(event: 'progress', callback: ProgressEventCallback): this; - - /** - * A job successfully completed with a `result` - */ - on(event: 'completed', callback: CompletedEventCallback): this; - - /** - * A job failed with `err` as the reason - */ - on(event: 'failed', callback: FailedEventCallback): this; - - /** - * The queue has been paused - */ - on(event: 'paused', callback: EventCallback): this; - - /** - * The queue has been resumed - */ - on(event: 'resumed', callback: EventCallback): this; - - /** - * Old jobs have been cleaned from the queue. - * `jobs` is an array of jobs that were removed, and `type` is the type of those jobs. - * - * @see Queue#clean() for details - */ - on(event: 'cleaned', callback: CleanedEventCallback): this; - - // tslint:enable:unified-signatures - } - - type EventCallback = () => void; - - type ErrorEventCallback = (error: Error) => void; - - interface JobPromise { - /** - * Abort this job - */ - cancel(): void; - } - - type ActiveEventCallback = (job: Job, jobPromise?: JobPromise) => void; - - type StalledEventCallback = (job: Job) => void; - - type ProgressEventCallback = (job: Job, progress: any) => void; - - type CompletedEventCallback = (job: Job, result: any) => void; - - type FailedEventCallback = (job: Job, error: Error) => void; - - type CleanedEventCallback = (jobs: Job[], status: JobStatus) => void; + interface RateLimiter { + /** Max numbers of jobs processed */ + max: number; + /** Per duration in milliseconds */ + duration: number; + } + + interface QueueOptions { + /** + * Options passed directly to the `ioredis` constructor + */ + redis?: Redis.RedisOptions; + + /** + * When specified, the `Queue` will use this function to create new `ioredis` client connections. + * This is useful if you want to re-use connections. + */ + createClient?(type: 'client' | 'subscriber', redisOpts?: Redis.RedisOptions): Redis.Redis; + + /** + * Prefix to use for all redis keys + */ + prefix?: string; + + settings?: AdvancedSettings; + + limiter?: RateLimiter; + } + + interface AdvancedSettings { + /** + * Key expiration time for job locks + */ + lockDuration?: number; + + /** + * How often check for stalled jobs (use 0 for never checking) + */ + stalledInterval?: number; + + /** + * Max amount of times a stalled job will be re-processed + */ + maxStalledCount?: number; + + /** + * Poll interval for delayed jobs and added jobs + */ + guardInterval?: number; + + /** + * Delay before processing next job in case of internal error + */ + retryProcessDelay?: number; + } + + type DoneCallback = (error?: Error | null, value?: any) => void; + + type JobId = number | string; + + interface Job { + id: JobId; + + /** + * The custom data passed when the job was created + */ + data: any; + + /** + * Report progress on a job + */ + progress(value: any): Promise; + + /** + * Returns a promise resolving to the current job's status. + * Please take note that the implementation of this method is not very efficient, nor is + * it atomic. If your queue does have a very large quantity of jobs, you may want to + * avoid using this method. + */ + getState(): Promise; + + /** + * Update a specific job's data. Promise resolves when the job has been updated. + */ + update(data: any): Promise; + + /** + * Removes a job from the queue and from any lists it may be included in. + * The returned promise resolves when the job has been removed. + */ + remove(): Promise; + + /** + * Re-run a job that has failed. The returned promise resolves when the job + * has been scheduled for retry. + */ + retry(): Promise; + + /** + * Returns a promise that resolves to the returned data when the job has been finished. + * TODO: Add a watchdog to check if the job has finished periodically. + * since pubsub does not give any guarantees. + */ + finished(): Promise; + + /** + * Promotes a job that is currently "delayed" to the "waiting" state and executed as soon as possible. + */ + promote(): Promise; + } + + type JobStatus = 'completed' | 'waiting' | 'active' | 'delayed' | 'failed'; + + interface BackoffOptions { + /** + * Backoff type, which can be either `fixed` or `exponential` + */ + type: 'fixed' | 'exponential'; + + /** + * Backoff delay, in milliseconds + */ + delay: number; + } + + interface RepeatOptions { + /** + * Cron pattern specifying when the job should execute + */ + cron: string; + + /** + * Timezone + */ + tz?: string; + + /** + * End date when the repeat job should stop repeating + */ + endDate?: Date | string | number; + } + + interface JobOptions { + /** + * Optional priority value. ranges from 1 (highest priority) to MAX_INT (lowest priority). + * Note that using priorities has a slight impact on performance, so do not use it if not required + */ + priority?: number; + + /** + * An amount of miliseconds to wait until this job can be processed. + * Note that for accurate delays, both server and clients should have their clocks synchronized. [optional] + */ + delay?: number; + + /** + * The total number of attempts to try the job until it completes + */ + attempts?: number; + + /** + * Repeat job according to a cron specification + */ + repeat?: RepeatOptions; + + /** + * Backoff setting for automatic retries if the job fails + */ + backoff?: number | BackoffOptions; + + /** + * A boolean which, if true, adds the job to the right + * of the queue instead of the left (default false) + */ + lifo?: boolean; + + /** + * The number of milliseconds after which the job should be fail with a timeout error + */ + timeout?: number; + + /** + * Override the job ID - by default, the job ID is a unique + * integer, but you can use this setting to override it. + * If you use this option, it is up to you to ensure the + * jobId is unique. If you attempt to add a job with an id that + * already exists, it will not be added. + */ + jobId?: JobId; + + /** + * A boolean which, if true, removes the job when it successfully completes. + * Default behavior is to keep the job in the completed set. + */ + removeOnComplete?: boolean; + + /** + * A boolean which, if true, removes the job when it fails after all attempts + * Default behavior is to keep the job in the completed set. + */ + removeOnFail?: boolean; + } + + interface JobCounts { + wait: number; + active: number; + completed: number; + failed: number; + delayed: number; + } + + interface JobInformation { + key: string; + name: string; + id?: string; + endDate?: number; + tz?: string; + cron: string; + next: number; + } + + 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. + */ + isReady(): Promise; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * The done callback can be called with an Error instance, to signal that the job did not complete successfully, + * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. + * 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; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * A promise must be returned to signal job completion. + * 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): Promise; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * A promise must be returned to signal job completion. + * 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. + * + * @param concurrency Bull will then call you handler in parallel respecting this max number. + */ + process(concurrency: number, callback: (job: Job) => void): Promise; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * The done callback can be called with an Error instance, to signal that the job did not complete successfully, + * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. + * Errors will be passed as a second argument to the "failed" event; + * results, as a second argument to the "completed" event. + * + * @param concurrency Bull will then call you handler in parallel respecting this max number. + */ + process(concurrency: number, callback: (job: Job, done: DoneCallback) => void): void; + + /** + * Defines a named processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * A promise must be returned to signal job completion. + * 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. + * + * @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): Promise; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * The done callback can be called with an Error instance, to signal that the job did not complete successfully, + * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. + * Errors will be passed as a second argument to the "failed" event; + * results, as a second argument to the "completed" event. + * + * @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; + + /** + * Defines a named processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * A promise must be returned to signal job completion. + * 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. + * + * @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): Promise; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * + * The done callback can be called with an Error instance, to signal that the job did not complete successfully, + * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. + * Errors will be passed as a second argument to the "failed" event; + * results, as a second argument to the "completed" event. + * + * @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; + + /** + * 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; + + /** + * 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; + + /** + * Returns a promise that resolves when the queue is paused. + * The pause is global, meaning that all workers in all queue instances for a given queue will be paused. + * A paused queue will not process new jobs until resumed, + * but current jobs being processed will continue until they are finalized. + * + * Pausing a queue that is already paused does nothing. + */ + pause(): Promise; + + /** + * Returns a promise that resolves when the queue is resumed after being paused. + * The resume is global, meaning that all workers in all queue instances for a given queue will be resumed. + * + * Resuming a queue that is not paused does nothing. + */ + resume(): Promise; + + /** + * Returns a promise that returns the number of jobs in the queue, waiting or paused. + * Since there may be other processes adding or processing jobs, this value may be true only for a very small amount of time. + */ + count(): Promise; + + /** + * Empties a queue deleting all the input lists and associated jobs. + */ + empty(): Promise; + + /** + * Closes the underlying redis client. Use this to perform a graceful shutdown. + * + * `close` can be called from anywhere, with one caveat: + * if called from within a job handler the queue won't close until after the job has been processed + */ + close(): Promise; + + /** + * 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; + + /** + * Returns a promise that will return an array with the active jobs between start and end. + */ + 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; + + /** + * Returns a promise that will return an array with the completed jobs between start and end. + */ + 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; + + /** + * Returns JobInformation of repeatable jobs (ordered descending). Provide a start and/or an end + * index to limit the number of results. Start defaults to 0, end to -1 and asc to false. + */ + getRepeatableJobs(start?: number, end?: number, asc?: boolean): Promise; + + /** + * ??? + */ + nextRepeatableJob(name: string, data: any, opts: JobOptions): Promise; + + /** + * Removes a given repeatable job. The RepeatOpts needs to be the same as the ones used for + * the job when it was added. + */ + removeRepeatable(repeat: RepeatOptions): Promise; + + /** + * Removes a given repeatable job. The RepeatOpts needs to be the same as the ones used for + * the job when it was added. + * + * name: The name of the to be removed job + */ + removeRepeatable(name: string, repeat: RepeatOptions): Promise; + + /** + * Returns a promise that resolves with the job counts for the given queue. + */ + getJobCounts(): Promise; + + /** + * Returns a promise that resolves with the quantity of completed jobs. + */ + getCompletedCount(): Promise; + + /** + * Returns a promise that resolves with the quantity of failed jobs. + */ + getFailedCount(): Promise; + + /** + * Returns a promise that resolves with the quantity of delayed jobs. + */ + getDelayedCount(): Promise; + + /** + * Returns a promise that resolves with the quantity of waiting jobs. + */ + getWaitingCount(): Promise; + + /** + * Returns a promise that resolves with the quantity of paused jobs. + */ + getPausedCount(): Promise; + + /** + * Returns a promise that resolves with the quantity of active jobs. + */ + getActiveCount(): Promise; + + /** + * Returns a promise that resolves to the quantity of repeatable jobs. + */ + getRepeatableCount(): Promise; + + /** + * Tells the queue remove all jobs created outside of a grace period in milliseconds. + * You can clean the jobs with the following states: completed, waiting, active, delayed, and failed. + * @param grace Grace period in milliseconds. + * @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; + + // tslint:disable:unified-signatures + + /** + * Listens to queue events + */ + on(event: string, callback: (...args: any[]) => void): this; + + /** + * An error occured + */ + on(event: 'error', callback: ErrorEventCallback): this; + + /** + * A job has started. You can use `jobPromise.cancel()` to abort it + */ + 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; + + /** + * A job's progress was updated + */ + on(event: 'progress', callback: ProgressEventCallback): this; + + /** + * A job successfully completed with a `result` + */ + on(event: 'completed', callback: CompletedEventCallback): this; + + /** + * A job failed with `err` as the reason + */ + on(event: 'failed', callback: FailedEventCallback): this; + + /** + * The queue has been paused + */ + on(event: 'paused', callback: EventCallback): this; + + /** + * The queue has been resumed + */ + on(event: 'resumed', callback: EventCallback): this; + + /** + * Old jobs have been cleaned from the queue. + * `jobs` is an array of jobs that were removed, and `type` is the type of those jobs. + * + * @see Queue#clean() for details + */ + on(event: 'cleaned', callback: CleanedEventCallback): this; + + // tslint:enable:unified-signatures + } + + type EventCallback = () => void; + + type ErrorEventCallback = (error: Error) => void; + + interface JobPromise { + /** + * Abort this job + */ + cancel(): void; + } + + type ActiveEventCallback = (job: Job, jobPromise?: JobPromise) => void; + + type StalledEventCallback = (job: Job) => void; + + type ProgressEventCallback = (job: Job, progress: any) => void; + + type CompletedEventCallback = (job: Job, result: any) => void; + + type FailedEventCallback = (job: Job, error: Error) => void; + + type CleanedEventCallback = (jobs: Job[], status: JobStatus) => void; } export = Bull; diff --git a/types/bull/v2/tslint.json b/types/bull/v2/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bull/v2/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bunnymq/index.d.ts b/types/bunnymq/index.d.ts index c4c0a770e1..1adb125697 100644 --- a/types/bunnymq/index.d.ts +++ b/types/bunnymq/index.d.ts @@ -17,8 +17,8 @@ declare namespace bunnymq { /** * Handle messages from a named queue. * - * @param {string} queue A named queue. - * @param {ConsumerCallback} callback A callback. + * @param queue A named queue. + * @param callback A callback. */ consume(queue: string, callback: ConsumerCallback): void; } @@ -31,16 +31,15 @@ declare namespace bunnymq { /** * Subscriber to handle messages from a named queue. * - * @param {string} queue A named queue. - * @param {ConsumerCallback} callback A callback. + * @param queue A named queue. + * @param callback A callback. */ subscribe(queueName: string, callback: ConsumerCallback): void; /** * Publisher to send messages to a named queue. * - * @type {Producer} - * @return {Promise} The consumer response. + * @return The consumer response. */ publish(queueName: string, message: any, options?: ProducerOptions): Promise; } @@ -61,14 +60,12 @@ declare namespace bunnymq { /** * Number of fetched messages at once on the channel. * - * @type {number} */ prefetch?: number; /** * Requeue put back message into the broker if consumer crashes/trigger exception. * - * @type {boolean} */ requeue?: boolean; rpcTimeout?: number; @@ -80,9 +77,9 @@ declare namespace bunnymq { /** * Send messages to a named queue. * - * @param {string} queue A named queue. - * @param {any} message A message. - * @return {Promise} The consumer response. + * @param queue A named queue. + * @param message A message. + * @return The consumer response. */ produce(queue: string, message: any, options?: ProducerOptions): Promise; } diff --git a/types/bunyan-blackhole/index.d.ts b/types/bunyan-blackhole/index.d.ts index f8be6fc730..80b4a33fcf 100644 --- a/types/bunyan-blackhole/index.d.ts +++ b/types/bunyan-blackhole/index.d.ts @@ -2,13 +2,14 @@ // Project: https://github.com/Floby/node-bunyan-blackhole // Definitions by: Olivier Chevet // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import * as Logger from "bunyan"; /** * Constructor. - * @param {string} [name] name of the blackhole Logger - * @return {Logger} A bunyan logger . + * @param name name of the blackhole Logger + * @return A bunyan logger . */ declare function bunyanBlackHole(name: string): Logger; export = bunyanBlackHole; diff --git a/types/bunyan-bugsnag/index.d.ts b/types/bunyan-bugsnag/index.d.ts index 9716238aab..06e13714b7 100644 --- a/types/bunyan-bugsnag/index.d.ts +++ b/types/bunyan-bugsnag/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/marnusw/bunyan-bugsnag // Definitions by: Pasi Eronen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import * as Logger from 'bunyan'; diff --git a/types/bunyan-config/tslint.json b/types/bunyan-config/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bunyan-config/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bunyan-format/bunyan-format-tests.ts b/types/bunyan-format/bunyan-format-tests.ts new file mode 100644 index 0000000000..3f4c2a658d --- /dev/null +++ b/types/bunyan-format/bunyan-format-tests.ts @@ -0,0 +1,5 @@ +import BunyanFormatWritable = require('bunyan-format'); + +const formatOut = new BunyanFormatWritable({ outputMode: 'short' }); + +const formatOut2 = new BunyanFormatWritable({ outputMode: 'bunyan', levelInString: true }); diff --git a/types/bunyan-format/index.d.ts b/types/bunyan-format/index.d.ts new file mode 100644 index 0000000000..06a37ba2e5 --- /dev/null +++ b/types/bunyan-format/index.d.ts @@ -0,0 +1,30 @@ +// Type definitions for bunyan-format 0.2 +// Project: https://github.com/thlorenz/bunyan-format +// Definitions by: Piotr Roszatycki +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// + +import { Writable } from 'stream'; + +declare namespace BunyanFormatWritable { + interface ColorFromLevel { + [level: number]: string; + } + + interface Options { + outputMode?: 'short' | 'long' | 'simple' | 'json' | 'bunyan'; + color?: boolean; + colorFromLevel?: ColorFromLevel; + levelInString?: boolean; + jsonIndent?: string | number; + } +} + +declare class BunyanFormatWritable extends Writable { + /** Creates a writable stream that formats bunyan records written to it. */ + constructor(options: BunyanFormatWritable.Options, output?: Writable); +} + +export = BunyanFormatWritable; diff --git a/types/bunyan-format/tsconfig.json b/types/bunyan-format/tsconfig.json new file mode 100644 index 0000000000..c26359cdb6 --- /dev/null +++ b/types/bunyan-format/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", + "bunyan-format-tests.ts" + ] +} diff --git a/types/bunyan-format/tslint.json b/types/bunyan-format/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/bunyan-format/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/bunyan-logentries/tslint.json b/types/bunyan-logentries/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bunyan-logentries/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bunyan-prettystream/tslint.json b/types/bunyan-prettystream/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bunyan-prettystream/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bunyan-winston-adapter/index.d.ts b/types/bunyan-winston-adapter/index.d.ts index e0c4f835d9..6798b8f1c9 100644 --- a/types/bunyan-winston-adapter/index.d.ts +++ b/types/bunyan-winston-adapter/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/gluwer/bunyan-winston-adapter // Definitions by: Steve Hipwell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import * as bunyan from "bunyan"; import { LoggerInstance } from "winston"; diff --git a/types/busboy/tslint.json b/types/busboy/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/busboy/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/business-rules-engine/index.d.ts b/types/business-rules-engine/index.d.ts index a74bcf180d..d85cd49c81 100644 --- a/types/business-rules-engine/index.d.ts +++ b/types/business-rules-engine/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/rsamec/form // Definitions by: Roman Samec // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 // Source: typings/business-rules-engine/Validation.d.ts diff --git a/types/business-rules-engine/package.json b/types/business-rules-engine/package.json index fce08a048d..19e5fb0d14 100644 --- a/types/business-rules-engine/package.json +++ b/types/business-rules-engine/package.json @@ -3,4 +3,4 @@ "dependencies": { "moment": ">=2.14.0" } -} \ No newline at end of file +} diff --git a/types/business-rules-engine/tslint.json b/types/business-rules-engine/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/business-rules-engine/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bwip-js/tslint.json b/types/bwip-js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bwip-js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/byline/tslint.json b/types/byline/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/byline/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bytebuffer/tslint.json b/types/bytebuffer/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bytebuffer/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/bytes/tslint.json b/types/bytes/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/bytes/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/c3/index.d.ts b/types/c3/index.d.ts index 00d1cf1840..afae3cff31 100644 --- a/types/c3/index.d.ts +++ b/types/c3/index.d.ts @@ -366,7 +366,7 @@ declare namespace c3 { * and it will recieve the data as argument. * Available Values: desc, asc, function (data1, data2) { ... }, null */ - order?: string | ((...data: string[]) => void); + order?: string | ((...data: string[]) => void) | null; /** * Define regions for each data. * The values must be an array for each data and it should include an object that has start, end, style. If start is not set, the start will be the first data point. If end is not set, the @@ -459,11 +459,11 @@ declare namespace c3 { /** * Set max value of x axis range. */ - max?: number; + max?: string | number | Date; /** * Set min value of x axis range. */ - min?: number; + min?: string | number | Date; /** * Set padding for x axis. * If this option is set, the range of x axis will increase/decrease according to the values. If no padding is needed in the ragen of x axis, 0 should be set. On category axis, this option @@ -636,7 +636,7 @@ declare namespace c3 { } interface LineOptions { - value: number; + value: string | number | Date; text?: string; axis?: string; position?: string; diff --git a/types/cache-manager/tslint.json b/types/cache-manager/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cache-manager/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cachefactory/tslint.json b/types/cachefactory/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cachefactory/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cal-heatmap/tslint.json b/types/cal-heatmap/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cal-heatmap/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/callsite/tslint.json b/types/callsite/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/callsite/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/calq/tslint.json b/types/calq/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/calq/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/camljs/tslint.json b/types/camljs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/camljs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/camo/tslint.json b/types/camo/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/camo/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cannon/index.d.ts b/types/cannon/index.d.ts index 45e005d53d..8516d968dd 100644 --- a/types/cannon/index.d.ts +++ b/types/cannon/index.d.ts @@ -428,7 +428,7 @@ declare module CANNON { angularVelocity?: Vec3; quaternion?: Quaternion; mass?: number; - material?: number; + material?: Material; type?: number; linearDamping?: number; angularDamping?: number; @@ -478,7 +478,7 @@ declare module CANNON { interpolatedQuaternion: Quaternion; shapes: Shape[]; shapeOffsets: any[]; - shapeOrentiations: any[]; + shapeOrientations: any[]; inertia: Vec3; invInertia: Vec3; invInertiaWorld: Mat3; @@ -735,7 +735,7 @@ declare module CANNON { vertices: Vec3[]; worldVertices: Vec3[]; worldVerticesNeedsUpdate: boolean; - faces: number[]; + faces: number[][]; faceNormals: Vec3[]; uniqueEdges: Vec3[]; @@ -776,7 +776,7 @@ declare module CANNON { export class Heightfield extends Shape { - data: number[]; + data: number[][]; maxValue: number; minValue: number; elementSize: number; @@ -930,7 +930,7 @@ declare module CANNON { } export class World extends EventTarget { - + iterations: number; dt: number; allowSleep: boolean; contacts: ContactEquation[]; @@ -992,6 +992,10 @@ declare module CANNON { } + export interface ICollisionEvent extends IBodyEvent { + contact: any; + } + } diff --git a/types/cannon/tslint.json b/types/cannon/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cannon/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/canvas-gauges/tslint.json b/types/canvas-gauges/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/canvas-gauges/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/case-sensitive-paths-webpack-plugin/case-sensitive-paths-webpack-plugin-tests.ts b/types/case-sensitive-paths-webpack-plugin/case-sensitive-paths-webpack-plugin-tests.ts new file mode 100644 index 0000000000..a4370cff73 --- /dev/null +++ b/types/case-sensitive-paths-webpack-plugin/case-sensitive-paths-webpack-plugin-tests.ts @@ -0,0 +1,15 @@ +import { Configuration } from 'webpack'; +import CaseSensitivePathsWebpackPlugin = require('case-sensitive-paths-webpack-plugin'); + +const options: CaseSensitivePathsWebpackPlugin.Options = { + debug: true, +}; + +const c: Configuration = { + plugins: [ + new CaseSensitivePathsWebpackPlugin(), + new CaseSensitivePathsWebpackPlugin({ + debug: true + }), + ], +}; diff --git a/types/case-sensitive-paths-webpack-plugin/index.d.ts b/types/case-sensitive-paths-webpack-plugin/index.d.ts new file mode 100644 index 0000000000..360d3d6d08 --- /dev/null +++ b/types/case-sensitive-paths-webpack-plugin/index.d.ts @@ -0,0 +1,21 @@ +// Type definitions for case-sensitive-paths-webpack-plugin 2.1 +// Project: https://github.com/Urthen/case-sensitive-paths-webpack-plugin#readme +// Definitions by: Andrew Makarov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Plugin } from 'webpack'; + +export = CaseSensitivePathsWebpackPlugin; + +declare class CaseSensitivePathsWebpackPlugin extends Plugin { + constructor(options?: CaseSensitivePathsWebpackPlugin.Options); +} + +declare namespace CaseSensitivePathsWebpackPlugin { + interface Options { + /** + * Show more information + */ + debug?: boolean; + } +} diff --git a/types/case-sensitive-paths-webpack-plugin/tsconfig.json b/types/case-sensitive-paths-webpack-plugin/tsconfig.json new file mode 100644 index 0000000000..b8cb05390a --- /dev/null +++ b/types/case-sensitive-paths-webpack-plugin/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", + "case-sensitive-paths-webpack-plugin-tests.ts" + ] +} diff --git a/types/case-sensitive-paths-webpack-plugin/tslint.json b/types/case-sensitive-paths-webpack-plugin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/case-sensitive-paths-webpack-plugin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cash/tslint.json b/types/cash/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cash/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/casperjs/index.d.ts b/types/casperjs/index.d.ts index e8388d17c7..f2378f1f97 100644 --- a/types/casperjs/index.d.ts +++ b/types/casperjs/index.d.ts @@ -1,17 +1,17 @@ -// Type definitions for CasperJS v1.0.29 +// Type definitions for CasperJS 1.1 // Project: http://casperjs.org/ // Definitions by: Jed Mao +// Uriel Chemouni // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /// - export function create(options?: CasperOptions): Casper; -export function selectXPath(expression: string): Object; +export function selectXPath(expression: string): object; export class Casper { - constructor(options: CasperOptions); test: Tester; @@ -23,23 +23,23 @@ export class Casper { // Methods back(): Casper; base64encode(url: string, method?: string, data?: any): string; - bypass(nb: number): any; - click(selector: string): boolean; + bypass(nb: number): Casper; + click(selector: string, X?: number | string, Y?: number | string): boolean; clickLabel(label: string, tag?: string): boolean; - capture(targetFilePath: string, clipRect: ClipRect): Casper; - captureBase64(format: string): string; - captureBase64(format: string, area: string): string; - captureBase64(format: string, area: ClipRect): string; - captureBase64(format: string, area: any): string; - captureSelector(targetFile: string, selector: string): Casper; + capture(targetFilePath: string, clipRect?: ClipRect, imgOptions?: ImgOptions): Casper; + captureBase64(format: string, area?: string | ClipRect | CasperSelector): string; + captureSelector(targetFile: string, selector: string, imgOptions?: ImgOptions): Casper; clear(): Casper; + clearCache(): Casper; + clearMemoryCache(): Casper; debugHTML(selector?: string, outer?: boolean): Casper; debugPage(): Casper; die(message: string, status?: number): Casper; - download(url: string, target?: string, method?: string, data?: any): Casper; + download(url: string, target: string, method?: string, data?: any): Casper; each(array: T[], fn: (this: Casper, item: T, index: number) => void): Casper; + eachThen(array: any[], then?: FunctionThen): Casper; echo(message: string, style?: string): Casper; - evaluate(fn: (...args: any[]) => T, ...args: any[]): T + evaluate(fn: (...args: any[]) => T, ...args: any[]): T; evaluateOrDie(fn: () => any, message?: string, status?: number): Casper; exit(status?: number): Casper; exists(selector: string): boolean; @@ -52,7 +52,7 @@ export class Casper { getCurrentUrl(): string; getElementAttribute(selector: string, attribute: string): string; getElementsAttribute(selector: string, attribute: string): string; - getElementBounds(selector: string): ElementBounds; + getElementBounds(selector: string, page?: boolean): ElementBounds | null; getElementsBounds(selector: string): ElementBounds[]; getElementInfo(selector: string): ElementInfo; getElementsInfo(selector: string): ElementInfo; @@ -61,83 +61,125 @@ export class Casper { getHTML(selector?: string, outer?: boolean): string; getPageContent(): string; getTitle(): string; - mouseEvent(type: string, selector: string): boolean; + mouseEvent(type: string, selector: string, X?: number|string, Y?: number|string): boolean; + newPage(): any; open(location: string, settings: OpenSettings): Casper; - reload(then?: (response: HttpResponse) => void): Casper; - repeat(times: number, then: Function): Casper; - resourceExists(test: Function): boolean; - resourceExists(test: string): boolean; - run(onComplete: Function, time?: number): Casper; + reload(then?: FunctionThen): Casper; + repeat(times: number, then: FunctionThen): Casper; + resourceExists(test: string | Function | RegExp): boolean; + run(onComplete?: Function, time?: number): Casper; scrollTo(x: number, y: number): Casper; scrollToBottom(): Casper; - sendKeys(selector: string, keys: string, options?: any): Casper; + sendKeys(selector: string, keys: string, options?: KeyOptions): Casper; setHttpAuth(username: string, password: string): Casper; - start(url?: string, then?: (response: HttpResponse) => void): Casper; - status(asString: boolean): any; + setMaxListeners(maxListeners: number): Casper; + start(url?: string, then?: FunctionThen): Casper; + status(asString?: false): number; + status(asString: true): string; + switchToFrame(frameInfo: string | number): Casper; + switchToMainFrame(): Casper; + switchToParentFrame(): Casper; then(fn: (this: Casper) => void): Casper; thenBypass(nb: number): Casper; thenBypassIf(condition: any, nb: number): Casper; thenBypassUnless(condition: any, nb: number): Casper; - thenClick(selector: string): Casper; + thenClick(selector: string, then?: FunctionThen): Casper; thenEvaluate(fn: () => any, ...args: any[]): Casper; thenOpen(location: string, then?: (response: HttpResponse) => void): Casper; thenOpen(location: string, options?: OpenSettings, then?: (response: HttpResponse) => void): Casper; - thenOpenAndEvaluate(location: string, then?: Function, ...args: any[]): Casper; + thenOpenAndEvaluate(location: string, then?: FunctionThen, ...args: any[]): Casper; toString(): string; unwait(): Casper; - userAgent(agent: string): string; - viewport(width: number, height: number): Casper; + // 2017-10-19 Doc said returning String but code return Casper object. + userAgent(agent: string): Casper; + viewport(width: number, height: number, then?: FunctionThen): Casper; visible(selector: string): boolean; - wait(timeout: number, then?: Function): Casper; - waitFor(testFx: Function, then?: Function, onTimeout?: Function, timeout?: number): Casper; - waitForAlert(then: Function, onTimeout?: Function, timeout?: number): Casper; - waitForPopup(urlPattern: string, then?: Function, onTimeout?: Function, timeout?: number): Casper; - waitForPopup(urlPattern: RegExp, then?: Function, onTimeout?: Function, timeout?: number): Casper; - waitForUrl(url: string, then?: Function, onTimeout?: Function, timeout?: number): Casper; - waitForUrl(url: RegExp, then?: Function, onTimeout?: Function, timeout?: number): Casper; - waitForSelector(selector: string, then?: Function, onTimeout?: Function, timeout?: number): Casper; - waitWhileSelector(selector: string, then?: Function, onTimeout?: Function, timeout?: number): Casper; - waitForResource(testFx: Function, then?: Function, onTimeout?: Function, timeout?: number): Casper; - waitForText(pattern: string, then?: Function, onTimeout?: Function, timeout?: number): Casper; - waitForText(pattern: RegExp, then?: Function, onTimeout?: Function, timeout?: number): Casper; - waitUntilVisible(selector: string, then?: Function, onTimeout?: Function, timeout?: number): Casper; - waitWhileVisible(selector: string, then?: Function, onTimeout?: Function, timeout?: number): Casper; + wait(timeout: number, then?: FunctionThen): Casper; + waitFor(testFx: Function, then?: FunctionThen, onTimeout?: FunctionOnTimeout, timeout?: number, details?: any): Casper; + waitForAlert(then: FunctionThen, onTimeout?: FunctionOnTimeout, timeout?: number): Casper; + waitForExec(command: string | null, parameter: string[], then?: FunctionThen, onTimeout?: FunctionOnTimeout, timeout?: number): Casper; + waitForPopup(urlPattern: RegExp | string | number | FindByUrlNameTitle, then?: FunctionThen, onTimeout?: Function, timeout?: number): Casper; + waitForResource(testFx: RegExp | string | ((resource: {url: string}) => boolean), then?: FunctionThen, onTimeout?: Function, timeout?: number): Casper; + waitForUrl(url: RegExp | string, then?: FunctionThen, onTimeout?: FunctionOnTimeout, timeout?: number): Casper; + waitForSelector(selector: string, then?: FunctionThen, onTimeout?: FunctionOnTimeout, timeout?: number): Casper; + waitWhileSelector(selector: string, then?: FunctionThen, onTimeout?: FunctionOnTimeout, timeout?: number): Casper; + waitForSelectorTextChange(selectors: string, then?: FunctionThen, onTimeout?: FunctionOnTimeout, timeout?: number): Casper; + waitForText(pattern: RegExp | string, then?: FunctionThen, onTimeout?: FunctionOnTimeout, timeout?: number): Casper; + waitUntilVisible(selector: string, then?: FunctionThen, onTimeout?: FunctionOnTimeout, timeout?: number): Casper; + waitWhileVisible(selector: string, then?: FunctionThen, onTimeout?: FunctionOnTimeout, timeout?: number): Casper; warn(message: string): Casper; - withFrame(frameInfo: string, then: Function): Casper; - withFrame(frameInfo: number, then: Function): Casper; - withPopup(popupInfo: string, step: Function): Casper; - withPopup(popupInfo: RegExp, step: Function): Casper; + withFrame(frameInfo: string | number, then: FunctionThen): Casper; + withPopup(popupInfo: RegExp | string | number | FindByUrlNameTitle, step: FunctionThen): Casper; + withSelectorScope(selector: string, then: FunctionThen): Casper; zoom(factor: number): Casper; - removeAllFilters(filter: string): Casper; - setFilter(filter: string, cb: Function): boolean; + // do not exists anymore + // removeAllFilters(filter: string): Casper; + // do not exists anymore + // setFilter(filter: string, cb: Function): boolean; } -interface HttpResponse { +export type FunctionThen = (this: Casper, response: HttpResponse) => void; +export type FunctionOnTimeout = (this: Casper, timeout: number, details: any) => void; +// not visible in doc +// interface QtRuntimeObject {id?: any; url?: string;} +// see modules/pagestack.js in casperjs + +export interface ImgOptions { + // format to set the image format manually, avoiding relying on the filename + format?: string; + // quality to set the image quality, from 1 to 100 + quality?: number; +} + +export interface FindByUrlNameTitle { + url?: string; + title?: string; + windowName?: string; +} + +export interface Header { + name: string; + value: string; +} + +export interface CasperSelector { + type?: 'xpath' | 'css'; + path: string; +} + +export interface KeyOptions { + reset?: boolean; + keepFocus?: boolean; + modifiers?: string; // combinaison of 'ctrl+alt+shift+meta+keypad' +} + +export interface HttpResponse { contentType: string; - headers: any[]; + headers: Header[]; id: number; - redirectURL: string; + redirectURL: string | null; stage: string; status: number; statusText: string; time: string; url: string; + data: any; } -interface OpenSettings { +export interface OpenSettings { method: string; data: any; headers: any; } -interface ElementBounds { +export interface ElementBounds { top: number; left: number; width: number; height: number; } -interface ElementInfo { +export interface ElementInfo { nodeName: string; attributes: any; tag: string; @@ -150,7 +192,7 @@ interface ElementInfo { visible: boolean; } -interface CasperOptions { +export interface CasperOptions { clientScripts?: any[]; exitOnError?: boolean; httpStatusHandlers?: any; @@ -179,7 +221,7 @@ interface CasperOptions { waitTimeout?: number; } -interface ClientUtils { +export interface ClientUtils { echo(message: string): void; encode(contents: string): void; exists(selector: string): void; @@ -200,12 +242,12 @@ interface ClientUtils { visible(selector: string): void; } -interface Colorizer { +export interface Colorizer { colorize(text: string, styleName: string): void; format(text: string, style: any): void; } -interface Tester { +export interface Tester { assert(condition: boolean, message?: string): any; assertDoesntExist(selector: string, message?: string): any; assertElementCount(selctor: string, expected: number, message?: string): any; @@ -235,15 +277,14 @@ interface Tester { assertTruthy(subject: any, message?: string): any; assertType(input: any, type: string, message?: string): any; assertInstanceOf(input: any, ctor: Function, message?: string): any; - assertUrlMatch(pattern: string, message?: string): any; - assertUrlMatch(pattern: RegExp, message?: string): any; + assertUrlMatch(pattern: RegExp | string, message?: string): any; assertVisible(selector: string, message?: string): any; /* since 1.1 */ begin(description: string, planned: number, suite: Function): any; begin(description: string, suite: Function): any; - begin(description: string, planned: number, config: Object): any; - begin(description: string, config: Object): any; + begin(description: string, planned: number, config: object): any; + begin(description: string, config: object): any; colorize(message: string, style: string): any; comment(message: string): any; @@ -262,12 +303,12 @@ interface Tester { tearDown(fn: Function): any; } -interface Cases { +export interface Cases { length: number; cases: Case[]; } -interface Case { +export interface Case { success: boolean; type: string; standard: string; @@ -275,12 +316,12 @@ interface Case { values: CaseValues; } -interface CaseValues { +export interface CaseValues { subject: boolean; expected: boolean; } -interface Utils { +export interface Utils { betterTypeOf(input: any): any; dump(value: any): any; fileExt(file: string): any; diff --git a/types/casperjs/tslint.json b/types/casperjs/tslint.json new file mode 100644 index 0000000000..c2a140228c --- /dev/null +++ b/types/casperjs/tslint.json @@ -0,0 +1,12 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // need to fix some Function type + "ban-types": false, + // can not merge + // begin(description: string, planned: number, suite: Function): any; + // and + // begin(description: string, planned: number, config: object): any; + "unified-signatures": false + } +} diff --git a/types/cassandra-driver/cassandra-driver-tests.ts b/types/cassandra-driver/cassandra-driver-tests.ts index 40971c7183..891c5a0167 100644 --- a/types/cassandra-driver/cassandra-driver-tests.ts +++ b/types/cassandra-driver/cassandra-driver-tests.ts @@ -1,9 +1,16 @@ import * as cassandra from 'cassandra-driver'; import * as util from 'util'; +import * as fs from 'fs'; -var client = new cassandra.Client({ contactPoints: ['h1', 'h2'], keyspace: 'ks1'}); +const client = new cassandra.Client({ + contactPoints: ['h1', 'h2'], + keyspace: 'ks1', + sslOptions: { + cert: fs.readFileSync('certFilePath') + } +}); -var query = 'SELECT email, last_name FROM user_profiles WHERE key=?'; +const query = 'SELECT email, last_name FROM user_profiles WHERE key=?'; client.execute(query, ['guy'], function(err, result) { console.log('got user profile with email ' + result.rows[0].email); }); diff --git a/types/cassandra-driver/index.d.ts b/types/cassandra-driver/index.d.ts index a581071dfb..bdaed6559c 100644 --- a/types/cassandra-driver/index.d.ts +++ b/types/cassandra-driver/index.d.ts @@ -12,11 +12,12 @@ export type ResultCallback = (err: Error, result: types.ResultSet) => void; import * as events from "events"; import * as stream from "stream"; +import * as tls from "tls"; import _Long = require("long"); export namespace policies { namespace addressResolution { - var EC2MultiRegionTranslator: EC2MultiRegionTranslatorStatic; + let EC2MultiRegionTranslator: EC2MultiRegionTranslatorStatic; interface AddressTranslator { translate(address: string, port: number, callback: Callback): void; @@ -32,10 +33,10 @@ export namespace policies { } namespace loadBalancing { - var DCAwareRoundRobinPolicy: DCAwareRoundRobinPolicyStatic; - var RoundRobinPolicy: RoundRobinPolicyStatic; - var TokenAwarePolicy: TokenAwarePolicyStatic; - var WhiteListPolicy: WhiteListPolicyStatic; + let DCAwareRoundRobinPolicy: DCAwareRoundRobinPolicyStatic; + let RoundRobinPolicy: RoundRobinPolicyStatic; + let TokenAwarePolicy: TokenAwarePolicyStatic; + let WhiteListPolicy: WhiteListPolicyStatic; interface LoadBalancingPolicy { init(client: Client, hosts: HostMap, callback: Callback): void; @@ -72,8 +73,8 @@ export namespace policies { } namespace reconnection { - var ConstantReconnectionPolicy: ConstantReconnectionPolicyStatic; - var ExponentialReconnectionPolicy: ExponentialReconnectionPolicyStatic; + let ConstantReconnectionPolicy: ConstantReconnectionPolicyStatic; + let ExponentialReconnectionPolicy: ExponentialReconnectionPolicyStatic; interface ReconnectionPolicy { newSchedule(): { next: Function }; @@ -93,7 +94,7 @@ export namespace policies { } namespace retry { - var RetryPolicy: RetryPolicyStatic; + let RetryPolicy: RetryPolicyStatic; interface DecisionInfo { decision: number; @@ -128,18 +129,18 @@ export namespace policies { } export namespace types { - var BigDecimal: BigDecimalStatic; - var InetAddress: InetAddressStatic; - var Integer: IntegerStatic; - var LocalDate: LocalDateStatic; - var LocalTime: LocalTimeStatic; - var Long: _Long; - var ResultSet: ResultSetStatic; - // var ResultStream: ResultStreamStatic; - var Row: RowStatic; - var TimeUuid: TimeUuidStatic; - var Tuple: TupleStatic; - var Uuid: UuidStatic; + let BigDecimal: BigDecimalStatic; + let InetAddress: InetAddressStatic; + let Integer: IntegerStatic; + let LocalDate: LocalDateStatic; + let LocalTime: LocalTimeStatic; + let Long: _Long; + let ResultSet: ResultSetStatic; + // let ResultStream: ResultStreamStatic; + let Row: RowStatic; + let TimeUuid: TimeUuidStatic; + let Tuple: TupleStatic; + let Uuid: UuidStatic; enum consistencies { any = 0, @@ -433,10 +434,10 @@ export namespace types { } } -export var Client: ClientStatic; -export var Host: HostStatic; -export var HostMap: HostMapStatic; -export var Encoder: EncoderStatic; +export let Client: ClientStatic; +export let Host: HostStatic; +export let HostMap: HostMapStatic; +export let Encoder: EncoderStatic; export interface ClientOptions { contactPoints: Array, @@ -468,7 +469,7 @@ export interface ClientOptions { coalescingThreshold: number }, authProvider?: auth.AuthProvider, - sslOptions?: any, + sslOptions?: tls.ConnectionOptions, encoding?: { map: Function, set: Function, @@ -564,8 +565,8 @@ export interface Encoder { } export namespace auth { - var Authenticator: AuthenticatorStatic; - var PlainTextAuthProvider: PlainTextAuthProviderStatic; + let Authenticator: AuthenticatorStatic; + let PlainTextAuthProvider: PlainTextAuthProviderStatic; interface AuthenticatorStatic { new (): Authenticator; @@ -623,12 +624,12 @@ export namespace errors { } export namespace metadata { - var Aggregate: AggregateStatic; - var Index: IndexStatic; - var MaterializedView: MaterializedViewStatic; - var Metadata: MetadataStatic; - var SchemaFunction: SchemaFunctionStatic; - var TableMetadata: TableMetadataStatic; + let Aggregate: AggregateStatic; + let Index: IndexStatic; + let MaterializedView: MaterializedViewStatic; + let Metadata: MetadataStatic; + let SchemaFunction: SchemaFunctionStatic; + let TableMetadata: TableMetadataStatic; type caching = "all" | "keys_only" | "rows_only" | "none"; diff --git a/types/cassandra-driver/tslint.json b/types/cassandra-driver/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cassandra-driver/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/catbox/index.d.ts b/types/catbox/index.d.ts index 7bc691abdc..826f1f7369 100644 --- a/types/catbox/index.d.ts +++ b/types/catbox/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/hapijs/catbox // Definitions by: Jason Swearingen , AJP // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.4 import * as Boom from 'boom'; diff --git a/types/cbor/tslint.json b/types/cbor/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cbor/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chai-as-promised/tslint.json b/types/chai-as-promised/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chai-as-promised/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chai-datetime/tslint.json b/types/chai-datetime/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chai-datetime/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chai-dom/tslint.json b/types/chai-dom/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chai-dom/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chai-enzyme/tslint.json b/types/chai-enzyme/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chai-enzyme/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chai-fuzzy/tslint.json b/types/chai-fuzzy/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chai-fuzzy/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chai-jest-snapshot/chai-jest-snapshot-tests.ts b/types/chai-jest-snapshot/chai-jest-snapshot-tests.ts index 05cf190765..c93c4a1d04 100644 --- a/types/chai-jest-snapshot/chai-jest-snapshot-tests.ts +++ b/types/chai-jest-snapshot/chai-jest-snapshot-tests.ts @@ -16,7 +16,7 @@ const mockContext: Mocha.IBeforeAndAfterContext = { } }; -chaiJestSnapshot.setFileName("filename"); +chaiJestSnapshot.setFilename("filename"); chaiJestSnapshot.setTestName("testname"); chaiJestSnapshot.configureUsingMochaContext(mockContext); chaiJestSnapshot.resetSnapshotRegistry(); diff --git a/types/chai-jest-snapshot/index.d.ts b/types/chai-jest-snapshot/index.d.ts index f19158e282..862da8cd16 100644 --- a/types/chai-jest-snapshot/index.d.ts +++ b/types/chai-jest-snapshot/index.d.ts @@ -9,12 +9,7 @@ declare global { namespace Chai { interface Assertion { - /** - * Assert that the object matches the snapshot - * @param snapshotFilename - * @param snapshotName - * @param update - */ + /** Assert that the object matches the snapshot */ matchSnapshot(snapshotFilename?: string, snapshotName?: string, update?: boolean): Assertion; matchSnapshot(update: boolean): Assertion; } @@ -22,40 +17,24 @@ declare global { } interface ChaiJestSnapshot { - /** - * Chai bootstrapper - * @param chai - * @param utils - */ + /** Chai bootstrapper */ (chai: any, utils: any): void; - /** - * Set snapshot file name - * @param filename - */ - setFileName(filename: string): void; + /** Set snapshot file name */ + setFilename(filename: string): void; /** * Set snapshot test name - * @param testname */ setTestName(testname: string): void; - /** - * Configure snapshot name using mocha context - * @param context - */ + /** Configure snapshot name using mocha context */ configureUsingMochaContext(context: Mocha.IBeforeAndAfterContext): void; - /** - * Reset snapshot registry - */ + /** Reset snapshot registry */ resetSnapshotRegistry(): void; - /** - * Add a serializer plugin - * @param serializer - */ + /** Add a serializer plugin */ addSerializer(serializer: any): void; } diff --git a/types/chai-jquery/tslint.json b/types/chai-jquery/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chai-jquery/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chai-spies/tslint.json b/types/chai-spies/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chai-spies/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chai-string/tslint.json b/types/chai-string/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chai-string/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chai-things/tslint.json b/types/chai-things/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chai-things/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chai/chai-tests.ts b/types/chai/chai-tests.ts index 31802ca303..0076396422 100644 --- a/types/chai/chai-tests.ts +++ b/types/chai/chai-tests.ts @@ -1677,4 +1677,80 @@ suite('assert', () => { assert.notFrozen(obj); assert.notFrozen(obj, 'message'); }); + + test('hasAnyKeys', () => { + assert.hasAnyKeys({foo: 1, bar: 2, baz: 3}, ['foo', 'iDontExist', 'baz']); + assert.hasAnyKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, iDontExist: 99, baz: 1337}); + assert.hasAnyKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}, 'key']); + assert.hasAnyKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{foo: 'bar'}, 'anotherKey']); + }); + + test('hasAllKeys', () => { + assert.hasAllKeys({foo: 1, bar: 2, baz: 3}, ['foo', 'bar', 'baz']); + assert.hasAllKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, bar: 99, baz: 1337}); + assert.hasAllKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}, 'key']); + assert.hasAllKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{foo: 'bar'}, 'anotherKey']); + }); + + test('containsAllKeys', () => { + assert.containsAllKeys({foo: 1, bar: 2, baz: 3}, ['foo', 'baz']); + assert.containsAllKeys({foo: 1, bar: 2, baz: 3}, ['foo', 'bar', 'baz']); + assert.containsAllKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, baz: 1337}); + assert.containsAllKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, bar: 99, baz: 1337}); + assert.containsAllKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}]); + assert.containsAllKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}, 'key']); + assert.containsAllKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{foo: 'bar'}]); + assert.containsAllKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{foo: 'bar'}, 'anotherKey']); + }); + + test('doesNotHaveAnyKeys', () => { + assert.doesNotHaveAnyKeys({foo: 1, bar: 2, baz: 3}, ['one', 'two', 'example']); + assert.doesNotHaveAnyKeys({foo: 1, bar: 2, baz: 3}, {one: 1, two: 2, example: 'foo'}); + assert.doesNotHaveAnyKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{one: 'two'}, 'example']); + assert.doesNotHaveAnyKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{one: 'two'}, 'example']); + }); + + test('doesNotHaveAllKeys', () => { + assert.doesNotHaveAllKeys({foo: 1, bar: 2, baz: 3}, ['one', 'two', 'example']); + assert.doesNotHaveAllKeys({foo: 1, bar: 2, baz: 3}, {one: 1, two: 2, example: 'foo'}); + assert.doesNotHaveAllKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{one: 'two'}, 'example']); + assert.doesNotHaveAllKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{one: 'two'}, 'example']); + }); + + test('hasAnyDeepKeys', () => { + assert.hasAnyDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [1, 2]]), {one: 'one'}); + assert.hasAnyDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [1, 2]]), [{one: 'one'}, {two: 'two'}]); + assert.hasAnyDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{one: 'one'}, {two: 'two'}]); + assert.hasAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), {one: 'one'}); + assert.hasAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {three: 'three'}]); + assert.hasAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]); + }); + + test('hasAllDeepKeys', () => { + assert.hasAllDeepKeys(new Map([[{one: 'one'}, 'valueOne']]), {one: 'one'}); + assert.hasAllDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{one: 'one'}, {two: 'two'}]); + assert.hasAllDeepKeys(new Set([{one: 'one'}]), {one: 'one'}); + assert.hasAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]); + }); + + test('containsAllDeepKeys', () => { + assert.containsAllDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [1, 2]]), {one: 'one'}); + assert.containsAllDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{one: 'one'}, {two: 'two'}]); + assert.containsAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), {one: 'one'}); + assert.containsAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]); + }); + + test('doesNotHaveAnyDeepKeys', () => { + assert.doesNotHaveAnyDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [1, 2]]), {thisDoesNot: 'exist'}); + assert.doesNotHaveAnyDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{twenty: 'twenty'}, {fifty: 'fifty'}]); + assert.doesNotHaveAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), {twenty: 'twenty'}); + assert.doesNotHaveAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{twenty: 'twenty'}, {fifty: 'fifty'}]); + }); + + test('doesNotHaveAllDeepKeys', () => { + assert.doesNotHaveAllDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [1, 2]]), {thisDoesNot: 'exist'}); + assert.doesNotHaveAllDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{twenty: 'twenty'}, {one: 'one'}]); + assert.doesNotHaveAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), {twenty: 'twenty'}); + assert.doesNotHaveAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {fifty: 'fifty'}]); + }); }); diff --git a/types/chai/index.d.ts b/types/chai/index.d.ts index bb730fe598..340d69f7cd 100644 --- a/types/chai/index.d.ts +++ b/types/chai/index.d.ts @@ -1360,6 +1360,136 @@ declare namespace Chai { * @param message Message to display on error. */ isNotEmpty(object: T, message?: string): void; + + /** + * Asserts that `object` has at least one of the `keys` provided. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * @type T Type of object. + * @param object Object to test. + * @param keys Keys to check + * @param message Message to display on error. + */ + hasAnyKeys(object: T, keys: Array | { [key: string]: any }, message?: string): void; + + /** + * Asserts that `object` has all and only all of the `keys` provided. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * @type T Type of object. + * @param object Object to test. + * @param keys Keys to check + * @param message Message to display on error. + */ + hasAllKeys(object: T, keys: Array | { [key: string]: any }, message?: string): void; + + /** + * Asserts that `object` has all of the `keys` provided but may have more keys not listed. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * @type T Type of object. + * @param object Object to test. + * @param keys Keys to check + * @param message Message to display on error. + */ + containsAllKeys(object: T, keys: Array | { [key: string]: any }, message?: string): void; + + /** + * Asserts that `object` has none of the `keys` provided. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * @type T Type of object. + * @param object Object to test. + * @param keys Keys to check + * @param message Message to display on error. + */ + doesNotHaveAnyKeys(object: T, keys: Array | { [key: string]: any }, message?: string): void; + + /** + * Asserts that `object` does not have at least one of the `keys` provided. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * @type T Type of object. + * @param object Object to test. + * @param keys Keys to check + * @param message Message to display on error. + */ + doesNotHaveAllKeys(object: T, keys: Array | { [key: string]: any }, message?: string): void; + + /** + * Asserts that `object` has at least one of the `keys` provided. + * Since Sets and Maps can have objects as keys you can use this assertion to perform + * a deep comparison. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * @type T Type of object. + * @param object Object to test. + * @param keys Keys to check + * @param message Message to display on error. + */ + hasAnyDeepKeys(object: T, keys: Array | { [key: string]: any }, message?: string): void; + + /** + * Asserts that `object` has all and only all of the `keys` provided. + * Since Sets and Maps can have objects as keys you can use this assertion to perform + * a deep comparison. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * @type T Type of object. + * @param object Object to test. + * @param keys Keys to check + * @param message Message to display on error. + */ + hasAllDeepKeys(object: T, keys: Array | { [key: string]: any }, message?: string): void; + + /** + * Asserts that `object` contains all of the `keys` provided. + * Since Sets and Maps can have objects as keys you can use this assertion to perform + * a deep comparison. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * @type T Type of object. + * @param object Object to test. + * @param keys Keys to check + * @param message Message to display on error. + */ + containsAllDeepKeys(object: T, keys: Array | { [key: string]: any }, message?: string): void; + + /** + * Asserts that `object` contains all of the `keys` provided. + * Since Sets and Maps can have objects as keys you can use this assertion to perform + * a deep comparison. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * @type T Type of object. + * @param object Object to test. + * @param keys Keys to check + * @param message Message to display on error. + */ + doesNotHaveAnyDeepKeys(object: T, keys: Array | { [key: string]: any }, message?: string): void; + + /** + * Asserts that `object` contains all of the `keys` provided. + * Since Sets and Maps can have objects as keys you can use this assertion to perform + * a deep comparison. + * You can also provide a single object instead of a `keys` array and its keys + * will be used as the expected set of keys. + * + * @type T Type of object. + * @param object Object to test. + * @param keys Keys to check + * @param message Message to display on error. + */ + doesNotHaveAllDeepKeys(object: T, keys: Array | { [key: string]: any }, message?: string): void; } export interface Config { diff --git a/types/chai/tslint.json b/types/chai/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chai/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chai/v2/tslint.json b/types/chai/v2/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chai/v2/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chalk/chalk-tests.ts b/types/chalk/chalk-tests.ts deleted file mode 100644 index 20bdd9382c..0000000000 --- a/types/chalk/chalk-tests.ts +++ /dev/null @@ -1,42 +0,0 @@ -import chalk = require('chalk'); - -var str = ''; -var bool = false; -var chain: chalk.ChalkChain; - -chalk.enabled = bool; -str = chalk.stripColor(str); - -bool = chalk.supportsColor; -bool = chalk.hasColor(str); - -// style a string -console.log( chalk.blue('Hello world!') ); - -// combine styled and normal strings -console.log( chalk.blue('Hello'), 'World' + chalk.red('!') ); - -// compose multiple styles using the chainable API -console.log( chalk.blue.bgRed.bold('Hello world!') ); - -// pass in multiple arguments -console.log( chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz') ); - -// nest styles -console.log( chalk.red('Hello', chalk.underline.bgBlue('world') + '!') ); - -// nest styles of the same type even (color, underline, background) -console.log( chalk.green('I am a green line ' + chalk.blue('with a blue substring') + ' that becomes green again!') ); - -chain = chalk.green; -chain = chain.underline; -str = chain('someString'); - -chalk.enabled = chalk.supportsColor = bool; - -var chalkObj = new chalk.constructor({enabled: false}); - -chain = chalkObj.green; -chain = chalkObj.underline; -chalkObj.enabled = true; -str = chain('foo'); diff --git a/types/chalk/index.d.ts b/types/chalk/index.d.ts deleted file mode 100644 index 3651e8077d..0000000000 --- a/types/chalk/index.d.ts +++ /dev/null @@ -1,133 +0,0 @@ -// Type definitions for chalk v0.4.0 -// Project: https://github.com/sindresorhus/chalk -// Definitions by: Diullei Gomes , Bart van der Schoor , Nico Jansen -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = Chalk; - -declare namespace Chalk { - export var enabled: boolean; - export var supportsColor: boolean; - export var styles: ChalkStyleMap; - - export function stripColor(value: string): any; - export function hasColor(str: string): boolean; - - export interface ChalkChain extends ChalkStyle { - (): boolean; - (...text: string[]): string; - } - - export interface ChalkStyleElement { - open: string; - close: string; - } - - // General - export var reset: ChalkChain; - export var bold: ChalkChain; - export var dim: ChalkChain; - export var italic: ChalkChain; - export var underline: ChalkChain; - export var inverse: ChalkChain; - export var hidden: ChalkChain; - export var strikethrough: ChalkChain; - - // Text colors - export var black: ChalkChain; - export var red: ChalkChain; - export var green: ChalkChain; - export var yellow: ChalkChain; - export var blue: ChalkChain; - export var magenta: ChalkChain; - export var cyan: ChalkChain; - export var white: ChalkChain; - export var gray: ChalkChain; - export var grey: ChalkChain; - - // Background colors - export var bgBlack: ChalkChain; - export var bgRed: ChalkChain; - export var bgGreen: ChalkChain; - export var bgYellow: ChalkChain; - export var bgBlue: ChalkChain; - export var bgMagenta: ChalkChain; - export var bgCyan: ChalkChain; - export var bgWhite: ChalkChain; - - - export interface ChalkStyle { - // General - reset: ChalkChain; - bold: ChalkChain; - dim: ChalkChain; - italic: ChalkChain; - underline: ChalkChain; - inverse: ChalkChain; - hidden: ChalkChain; - strikethrough: ChalkChain; - - // Text colors - black: ChalkChain; - red: ChalkChain; - green: ChalkChain; - yellow: ChalkChain; - blue: ChalkChain; - magenta: ChalkChain; - cyan: ChalkChain; - white: ChalkChain; - gray: ChalkChain; - grey: ChalkChain; - - // Background colors - bgBlack: ChalkChain; - bgRed: ChalkChain; - bgGreen: ChalkChain; - bgYellow: ChalkChain; - bgBlue: ChalkChain; - bgMagenta: ChalkChain; - bgCyan: ChalkChain; - bgWhite: ChalkChain; - } - - export interface ChalkStyleMap { - // General - reset: ChalkStyleElement; - bold: ChalkStyleElement; - dim: ChalkStyleElement; - italic: ChalkStyleElement; - underline: ChalkStyleElement; - inverse: ChalkStyleElement; - hidden: ChalkStyleElement; - strikethrough: ChalkStyleElement; - - // Text colors - black: ChalkStyleElement; - red: ChalkStyleElement; - green: ChalkStyleElement; - yellow: ChalkStyleElement; - blue: ChalkStyleElement; - magenta: ChalkStyleElement; - cyan: ChalkStyleElement; - white: ChalkStyleElement; - gray: ChalkStyleElement; - - // Background colors - bgBlack: ChalkStyleElement; - bgRed: ChalkStyleElement; - bgGreen: ChalkStyleElement; - bgYellow: ChalkStyleElement; - bgBlue: ChalkStyleElement; - bgMagenta: ChalkStyleElement; - bgCyan: ChalkStyleElement; - bgWhite: ChalkStyleElement; - } - - export const constructor: { - new (options: {enabled: boolean}): Chalk; - } - - export interface Chalk extends ChalkStyle { - enabled: boolean; - } -} diff --git a/types/chance/tslint.json b/types/chance/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chance/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/change-emitter/tslint.json b/types/change-emitter/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/change-emitter/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index a4cccb0bae..9ec7fde23f 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -36,7 +36,13 @@ const chart: Chart = new Chart(new CanvasRenderingContext2D(), { ticks: { callback: Math.floor }, - gridLines: { display: false } + gridLines: { + display: false, + borderDash: [5, 15], + borderDashOffset: 2, + zeroLineBorderDash: [5, 15], + zeroLineBorderDashOffset: 2 + } }] } } diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 78f1aa6142..f4f4bda40d 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Chart.js 2.6 +// Type definitions for Chart.js 2.7 // Project: https://github.com/nnnick/Chart.js // Definitions by: Alberto Nuti // Fabien Lavocat @@ -6,6 +6,7 @@ // Larry Bahr // Daniel Luz // Joseph Page +// Dan Manastireanu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -77,7 +78,7 @@ interface Size { } declare namespace Chart { - type ChartType = 'line' | 'bar' | 'radar' | 'doughnut' | 'polarArea' | 'bubble'; + type ChartType = 'line' | 'bar' | 'radar' | 'doughnut' | 'polarArea' | 'bubble' | 'pie'; type TimeUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year'; @@ -113,18 +114,25 @@ declare namespace Chart { index?: number; } + interface ChartTooltipLabelColor { + borderColor: ChartColor; + backgroundColor: ChartColor; + } + interface ChartTooltipCallback { - beforeTitle?(item?: ChartTooltipItem[], data?: any): void; - title?(item?: ChartTooltipItem[], data?: any): void; - afterTitle?(item?: ChartTooltipItem[], data?: any): void; - beforeBody?(item?: ChartTooltipItem[], data?: any): void; - beforeLabel?(tooltipItem?: ChartTooltipItem, data?: any): void; - label?(tooltipItem?: ChartTooltipItem, data?: any): void; - afterLabel?(tooltipItem?: ChartTooltipItem, data?: any): void; - afterBody?(item?: ChartTooltipItem[], data?: any): void; - beforeFooter?(item?: ChartTooltipItem[], data?: any): void; - footer?(item?: ChartTooltipItem[], data?: any): void; - afterFooter?(item?: ChartTooltipItem[], data?: any): void; + beforeTitle?(item: ChartTooltipItem[], data: ChartData): string | string[]; + title?(item: ChartTooltipItem[], data: ChartData): string | string[]; + afterTitle?(item: ChartTooltipItem[], data: ChartData): string | string[]; + beforeBody?(item: ChartTooltipItem[], data: ChartData): string | string[]; + beforeLabel?(tooltipItem: ChartTooltipItem, data: ChartData): string | string[]; + label?(tooltipItem: ChartTooltipItem, data: ChartData): string | string[]; + labelColor?(tooltipItem: ChartTooltipItem, chart: Chart): ChartTooltipLabelColor; + labelTextColor?(tooltipItem: ChartTooltipItem, chart: Chart): string; + afterLabel?(tooltipItem: ChartTooltipItem, data: ChartData): string | string[]; + afterBody?(item: ChartTooltipItem[], data: ChartData): string | string[]; + beforeFooter?(item: ChartTooltipItem[], data: ChartData): string | string[]; + footer?(item: ChartTooltipItem[], data: ChartData): string | string[]; + afterFooter?(item: ChartTooltipItem[], data: ChartData): string | string[]; } interface ChartAnimationParameter { @@ -153,13 +161,14 @@ declare namespace Chart { responsiveAnimationDuration?: number; maintainAspectRatio?: boolean; events?: string[]; - onClick?(any?: any): any; + onClick?(event?: MouseEvent, activeElements?: Array<{}>): any; title?: ChartTitleOptions; legend?: ChartLegendOptions; tooltips?: ChartTooltipOptions; hover?: ChartHoverOptions; animation?: ChartAnimationOptions; elements?: ChartElementsOptions; + layout?: ChartLayoutOptions; scales?: ChartScales; showLines?: boolean; spanGaps?: boolean; @@ -312,9 +321,23 @@ declare namespace Chart { borderColor?: ChartColor; borderSkipped?: string; } + + interface ChartLayoutOptions { + padding?: ChartLayoutPaddingObject | number; + } + + interface ChartLayoutPaddingObject { + top?: number; + right?: number; + bottom?: number; + left?: number; + } + interface GridLineOptions { display?: boolean; color?: ChartColor; + borderDash?: number[]; + borderDashOffset?: number; lineWidth?: number; drawBorder?: boolean; drawOnChartArea?: boolean; @@ -322,6 +345,8 @@ declare namespace Chart { tickMarkLength?: number; zeroLineWidth?: number; zeroLineColor?: ChartColor; + zeroLineBorderDash?: number[]; + zeroLineBorderDashOffset?: number; offsetGridLines?: boolean; } @@ -393,8 +418,8 @@ declare namespace Chart { interface ChartDataSets { cubicInterpolationMode?: 'default' | 'monotone'; backgroundColor?: ChartColor | ChartColor[]; - borderWidth?: number; - borderColor?: ChartColor; + borderWidth?: number | number[]; + borderColor?: ChartColor | ChartColor[]; borderCapStyle?: string; borderDash?: number[]; borderDashOffset?: number; diff --git a/types/chartist/index.d.ts b/types/chartist/index.d.ts index 3eb5e07973..6bdb7ebfe3 100644 --- a/types/chartist/index.d.ts +++ b/types/chartist/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Chartist v0.9.7 +// Type definitions for Chartist v0.9.8 // Project: https://github.com/gionkunz/chartist-js // Definitions by: Matt Gibbs , Simon Pfeifer , Cassey Lottman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -190,7 +190,7 @@ declare namespace Chartist { /** * If specified the donut segments will be drawn as shapes instead of strokes. - */ + */ donutSolid?: boolean; /** @@ -367,6 +367,7 @@ declare namespace Chartist { area?: string; grid?: string; gridGroup?: string; + gridBackground?: string; vertical?: string; horizontal?: string; start?: string; diff --git a/types/chartist/tslint.json b/types/chartist/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chartist/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chartjs/tslint.json b/types/chartjs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chartjs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/checksum/tslint.json b/types/checksum/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/checksum/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cheerio/cheerio-tests.ts b/types/cheerio/cheerio-tests.ts index 4a15f029f0..1a9821a6bb 100644 --- a/types/cheerio/cheerio-tests.ts +++ b/types/cheerio/cheerio-tests.ts @@ -52,6 +52,7 @@ var $multiEl = $('selector', 'selector', 'selector'); */ // attr +$el.attr(); $el.attr('id'); $el.attr('id', 'favorite').html(); diff --git a/types/cheerio/index.d.ts b/types/cheerio/index.d.ts index f525a46ee6..511fce354d 100644 --- a/types/cheerio/index.d.ts +++ b/types/cheerio/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Cheerio v0.22.0 // Project: https://github.com/cheeriojs/cheerio -// Definitions by: Bret Little , VILIC VANE , Wayne Maurer , Umar Nizamani +// Definitions by: Bret Little , VILIC VANE , Wayne Maurer , Umar Nizamani , LiJinyao // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface Cheerio { @@ -13,6 +13,7 @@ interface Cheerio { // Attributes + attr(): {[attr: string]: string}; attr(name: string): string; attr(name: string, value: any): Cheerio; @@ -171,7 +172,7 @@ interface Cheerio { empty(): Cheerio; - html(): string; + html(): string | null; html(html: string): Cheerio; text(): string; @@ -254,6 +255,7 @@ interface CheerioElement { children: CheerioElement[]; childNodes: CheerioElement[]; lastChild: CheerioElement; + firstChild: CheerioElement; next: CheerioElement; nextSibling: CheerioElement; prev: CheerioElement; diff --git a/types/cheerio/tslint.json b/types/cheerio/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cheerio/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chokidar/tslint.json b/types/chokidar/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chokidar/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chosen-js/tslint.json b/types/chosen-js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chosen-js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chroma-js/index.d.ts b/types/chroma-js/index.d.ts index f826c8f254..c18484dc1f 100644 --- a/types/chroma-js/index.d.ts +++ b/types/chroma-js/index.d.ts @@ -34,9 +34,6 @@ declare namespace chroma { /** * Create a color in the specified color space using a, b and c as values. * - * @param a - * @param b - * @param c * @param colorSpace The color space to use. Defaults to "rgb". * @return the color object. */ diff --git a/types/chroma-js/v0/tslint.json b/types/chroma-js/v0/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chroma-js/v0/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index 5104ab7ca1..bb2b4afcb5 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -1274,104 +1274,106 @@ declare namespace chrome.cookies { * Availability: Since Chrome 18. * Permissions: "debugger" */ -// TODO: Uncomment when Microsoft/TypeScript#8312 is merged in -// declare module chrome.debugger { -// /** Debuggee identifier. Either tabId or extensionId must be specified */ -// interface Debuggee { -// /** Optional. The id of the tab which you intend to debug. */ -// tabId?: number; -// /** -// * Optional. -// * Since Chrome 27. -// * The id of the extension which you intend to debug. Attaching to an extension background page is only possible when 'silent-debugger-extension-api' flag is enabled on the target browser. -// */ -// extensionId?: string; -// /** -// * Optional. -// * Since Chrome 28. -// * The opaque id of the debug target. -// */ -// targetId?: string; -// } -// -// /** -// * Since Chrome 28. -// * Debug target information -// */ -// interface TargetInfo { -// /** Target type. */ -// type: string; -// /** Target id. */ -// id: string; -// /** -// * Optional. -// * Since Chrome 30. -// * The tab id, defined if type == 'page'. -// */ -// tabId?: number; -// /** -// * Optional. -// * Since Chrome 30. -// * The extension id, defined if type = 'background_page'. -// */ -// extensionId?: string; -// /** True if debugger is already attached. */ -// attached: boolean; -// /** Target page title. */ -// title: string; -// /** Target URL. */ -// url: string; -// /** Optional. Target favicon URL. */ -// faviconUrl?: string; -// } -// -// interface DebuggerDetachedEvent extends chrome.events.Event<(source: Debuggee, reason: string) => void> {} -// -// interface DebuggerEventEvent extends chrome.events.Event<(source: Debuggee, method: string, params?: Object) => void> {} -// -// /** -// * Attaches debugger to the given target. -// * @param target Debugging target to which you want to attach. -// * @param requiredVersion Required debugging protocol version ("0.1"). One can only attach to the debuggee with matching major version and greater or equal minor version. List of the protocol versions can be obtained in the documentation pages. -// * @param callback Called once the attach operation succeeds or fails. Callback receives no arguments. If the attach fails, runtime.lastError will be set to the error message. -// * If you specify the callback parameter, it should be a function that looks like this: -// * function() {...}; -// */ -// export function attach(target: Debuggee, requiredVersion: string, callback?: () => void): void; -// /** -// * Detaches debugger from the given target. -// * @param target Debugging target from which you want to detach. -// * @param callback Called once the detach operation succeeds or fails. Callback receives no arguments. If the detach fails, runtime.lastError will be set to the error message. -// * If you specify the callback parameter, it should be a function that looks like this: -// * function() {...}; -// */ -// export function detach(target: Debuggee, callback?: () => void): void; -// /** -// * Sends given command to the debugging target. -// * @param target Debugging target to which you want to send the command. -// * @param method Method name. Should be one of the methods defined by the remote debugging protocol. -// * @param commandParams Since Chrome 22. -// * JSON object with request parameters. This object must conform to the remote debugging params scheme for given method. -// * @param callback Response body. If an error occurs while posting the message, the callback will be called with no arguments and runtime.lastError will be set to the error message. -// * If you specify the callback parameter, it should be a function that looks like this: -// * function(object result) {...}; -// */ -// export function sendCommand(target: Debuggee, method: string, commandParams?: Object, callback?: (result?: Object) => void): void; -// /** -// * Since Chrome 28. -// * Returns the list of available debug targets. -// * @param callback The callback parameter should be a function that looks like this: -// * function(array of TargetInfo result) {...}; -// * Parameter result: Array of TargetInfo objects corresponding to the available debug targets. -// */ -// export function getTargets(callback: (result: TargetInfo[]) => void): void; -// -// /** Fired when browser terminates debugging session for the tab. This happens when either the tab is being closed or Chrome DevTools is being invoked for the attached tab. */ -// var onDetach: DebuggerDetachedEvent; -// /** Fired whenever debugging target issues instrumentation event. */ -// var onEvent: DebuggerEventEvent; -// } +declare module chrome { + namespace _debugger { + /** Debuggee identifier. Either tabId or extensionId must be specified */ + interface Debuggee { + /** Optional. The id of the tab which you intend to debug. */ + tabId?: number; + /** + * Optional. + * Since Chrome 27. + * The id of the extension which you intend to debug. Attaching to an extension background page is only possible when 'silent-debugger-extension-api' flag is enabled on the target browser. + */ + extensionId?: string; + /** + * Optional. + * Since Chrome 28. + * The opaque id of the debug target. + */ + targetId?: string; + } + /** + * Since Chrome 28. + * Debug target information + */ + interface TargetInfo { + /** Target type. */ + type: string; + /** Target id. */ + id: string; + /** + * Optional. + * Since Chrome 30. + * The tab id, defined if type == 'page'. + */ + tabId?: number; + /** + * Optional. + * Since Chrome 30. + * The extension id, defined if type = 'background_page'. + */ + extensionId?: string; + /** True if debugger is already attached. */ + attached: boolean; + /** Target page title. */ + title: string; + /** Target URL. */ + url: string; + /** Optional. Target favicon URL. */ + faviconUrl?: string; + } + + interface DebuggerDetachedEvent extends chrome.events.Event<(source: Debuggee, reason: string) => void> {} + + interface DebuggerEventEvent extends chrome.events.Event<(source: Debuggee, method: string, params?: Object) => void> {} + + /** + * Attaches debugger to the given target. + * @param target Debugging target to which you want to attach. + * @param requiredVersion Required debugging protocol version ("0.1"). One can only attach to the debuggee with matching major version and greater or equal minor version. List of the protocol versions can be obtained in the documentation pages. + * @param callback Called once the attach operation succeeds or fails. Callback receives no arguments. If the attach fails, runtime.lastError will be set to the error message. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function attach(target: Debuggee, requiredVersion: string, callback?: () => void): void; + /** + * Detaches debugger from the given target. + * @param target Debugging target from which you want to detach. + * @param callback Called once the detach operation succeeds or fails. Callback receives no arguments. If the detach fails, runtime.lastError will be set to the error message. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function detach(target: Debuggee, callback?: () => void): void; + /** + * Sends given command to the debugging target. + * @param target Debugging target to which you want to send the command. + * @param method Method name. Should be one of the methods defined by the remote debugging protocol. + * @param commandParams Since Chrome 22. + * JSON object with request parameters. This object must conform to the remote debugging params scheme for given method. + * @param callback Response body. If an error occurs while posting the message, the callback will be called with no arguments and runtime.lastError will be set to the error message. + * If you specify the callback parameter, it should be a function that looks like this: + * function(object result) {...}; + */ + export function sendCommand(target: Debuggee, method: string, commandParams?: Object, callback?: (result?: Object) => void): void; + /** + * Since Chrome 28. + * Returns the list of available debug targets. + * @param callback The callback parameter should be a function that looks like this: + * function(array of TargetInfo result) {...}; + * Parameter result: Array of TargetInfo objects corresponding to the available debug targets. + */ + export function getTargets(callback: (result: TargetInfo[]) => void): void; + + /** Fired when browser terminates debugging session for the tab. This happens when either the tab is being closed or Chrome DevTools is being invoked for the attached tab. */ + var onDetach: DebuggerDetachedEvent; + /** Fired whenever debugging target issues instrumentation event. */ + var onEvent: DebuggerEventEvent; + } + + export {_debugger as debugger} +} //////////////////// // Declarative Content //////////////////// @@ -1424,8 +1426,7 @@ declare namespace chrome.declarativeContent { ports?: (number | number[])[]; } - /** Matches the state of a web page by various criteria. */ - interface PageStateMatcher { + class PageStateMatcherProperties { /** Optional. Filters URLs for various criteria. See event filtering. All criteria are case sensitive. */ pageUrl?: PageStateUrlDetails; /** Optional. Matches if all of the CSS selectors in the array match displayed elements in a frame with the same origin as the page's main frame. All selectors in this array must be compound selectors to speed up matching. Note that listing hundreds of CSS selectors or CSS selectors that match hundreds of times per page can still slow down web sites. */ @@ -1437,6 +1438,19 @@ declare namespace chrome.declarativeContent { */ isBookmarked?: boolean; } + + /** Matches the state of a web page by various criteria. */ + class PageStateMatcher { + constructor(options: PageStateMatcherProperties); + } + + /** Declarative event action that shows the extension's page action while the corresponding conditions are met. */ + class ShowPageAction {} + + /** Provides the Declarative Event API consisting of addRules, removeRules, and getRules. */ + interface PageChangedEvent extends chrome.events.Event<() => void> {} + + var onPageChanged: PageChangedEvent; } //////////////////// @@ -1662,7 +1676,7 @@ declare namespace chrome.devtools.inspectedWindow { * Parameter result: The result of evaluation. * Parameter exceptionInfo: An object providing details if an exception occurred while evaluating the expression. */ - export function eval(expression: string, callback?: (result: Object, exceptionInfo: EvaluationExceptionInfo) => void): void; + export function eval(expression: string, callback?: (result: T, exceptionInfo: EvaluationExceptionInfo) => void): void; /** * Retrieves the list of resources from the inspected page. * @param callback A function that receives the list of resources when the request completes. @@ -3311,13 +3325,13 @@ declare namespace chrome.history { declare namespace chrome.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}. + /** 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; + percentage: number; } /** Holds detected language reliability and array of DetectedLanguage */ @@ -3328,7 +3342,7 @@ declare namespace chrome.i18n { /** 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: @@ -3347,7 +3361,7 @@ declare namespace chrome.i18n { * @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) {...}; @@ -5124,7 +5138,7 @@ declare namespace chrome.runtime { actions?: { type: string; }[]; - conditions?: chrome.declarativeContent.PageStateMatcher[] + conditions?: chrome.declarativeContent.PageStateMatcherProperties[] }[]; externally_connectable?: { ids?: string[]; @@ -5533,19 +5547,12 @@ declare namespace chrome.storage { */ set(items: Object, callback?: () => void): void; /** - * Removes one item from storage. - * @param key A single key for items to remove. + * 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(key: string, callback?: () => void): void; - /** - * Removes items from storage. - * @param keys 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[], callback?: () => void): void; + 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). @@ -6598,7 +6605,7 @@ declare namespace chrome.tabs { * @since Chrome 38. */ var onZoomChange: TabZoomChangeEvent; - + /** * An ID which represents the absence of a browser tab. * @since Chrome 46. @@ -7016,8 +7023,9 @@ declare namespace chrome.webNavigation { /** * The ID of the process runs the renderer for this tab. * @since Chrome 22. + * @deprecated since Chrome 49. Frames are now uniquely identified by their tab ID and frame ID; the process ID is no longer needed and therefore ignored. */ - processId: number; + processId?: number; /** The ID of the tab in which the frame is. */ tabId: number; /** The ID of the frame in the given tab. */ @@ -7226,7 +7234,7 @@ declare namespace chrome.webRequest { types?: string[]; /** A list of URLs or URL patterns. Requests that cannot match any of the URLs will be filtered out. */ urls: string[]; - + /** Optional. */ windowId?: number; } diff --git a/types/chrome/test/index.ts b/types/chrome/test/index.ts index b7b7868ba3..7b37e548b5 100644 --- a/types/chrome/test/index.ts +++ b/types/chrome/test/index.ts @@ -188,18 +188,18 @@ function beforeRedditNavigation() { // for chrome.tabs.InjectDetails.frameId function executeScriptFramed () { - + const tabId = 123; const frameId = 0; - + const code = "alert('hi');"; - + chrome.tabs.executeScript({frameId, code}); chrome.tabs.insertCSS({frameId, code}); - + chrome.tabs.executeScript(tabId, {frameId, code}); chrome.tabs.insertCSS(tabId, {frameId, code}); - + } // for chrome.tabs.TAB_ID_NONE @@ -298,6 +298,42 @@ function testOptionsPage() { }); } +// https://developer.chrome.com/extensions/debugger +function testDebugger() { + chrome.debugger.attach({tabId: 123}, '1.23', () => { + console.log('This is a callback!'); + }); + + chrome.debugger.detach({tabId: 123}, () => { + console.log('This is a callback!'); + }); + + chrome.debugger.sendCommand( + {targetId: 'abc'}, 'Debugger.Cmd', {param1: 'x'}, (result) => { + console.log('Do something with the result.' + result); + }); + + chrome.debugger.getTargets((results) => { + for (let result of results) { + if (result.tabId == 123) { + // Do Something. + } + } + }); + + chrome.debugger.onEvent.addListener((source, methodName, params) => { + if (source.tabId == 123) { + console.log('Hello World.'); + } + }); + + chrome.debugger.onDetach.addListener((source, reason) => { + if (source.tabId == 123) { + console.log('Hello World.'); + } + }); +} + // https://developer.chrome.com/extensions/storage#type-StorageArea function testStorage() { function getCallback(loadedData: { [key: string]: any; }) { diff --git a/types/chrome/tslint.json b/types/chrome/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chrome/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/chui/index.d.ts b/types/chui/index.d.ts index 7042edd4bd..f80aaa3e5d 100644 --- a/types/chui/index.d.ts +++ b/types/chui/index.d.ts @@ -2,6 +2,8 @@ // Project: https://github.com/chocolatechipui/chocolatechip-ui // Definitions by: Robert Biggs // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + // ChocolateChip-UI 3.9.1 /** These TypeScript delcarations for ChocolateChip-UI contain interfaces for both ChocolateChipJS and jQuery. Depending on which library you are using, you will get the type interfaces appropriate for it. @@ -1078,7 +1080,7 @@ interface JQueryStatic { data: { repeaterName?: any; }; - + /** * Use this value to output an index value in a template repeater. */ diff --git a/types/chui/tslint.json b/types/chui/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/chui/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/circular-json/circular-json-tests.ts b/types/circular-json/circular-json-tests.ts index 41ec8f0a36..786ec5cec6 100644 --- a/types/circular-json/circular-json-tests.ts +++ b/types/circular-json/circular-json-tests.ts @@ -1,14 +1,10 @@ - import CircularJSON = require('circular-json'); -var replacer = (key: any, val: any) => { +const replacer = (key: any, val: any) => { return val; -} +}; -var replacerArray = ['a', 'x']; - -// implements JSON interface -var json_obj: JSON = CircularJSON; +const replacerArray = ['a', 'x']; CircularJSON.parse('{"a":"b"}'); diff --git a/types/circular-json/index.d.ts b/types/circular-json/index.d.ts index 1b4e5c1d2b..ce94972de4 100644 --- a/types/circular-json/index.d.ts +++ b/types/circular-json/index.d.ts @@ -1,14 +1,7 @@ -// Type definitions for circular-json v0.1.6 +// Type definitions for circular-json 0.4 // Project: https://github.com/WebReflection/circular-json // Definitions by: Jonathan Pevarnek // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface ICircularJSON extends JSON { - parse(text: string, reviver?: (key: any, value: any) => any): any; - stringify(value: any, replacer?: ((key: string, value: any) => any) | any[], space?: any, placeholder?: boolean): string; -} - -declare var CircularJSON: ICircularJSON; - -export = CircularJSON; +export function parse(text: string, reviver?: (key: any, value: any) => any): any; +export function stringify(value: any, replacer?: ((key: string, value: any) => any) | Array | null, space?: any, placeholder?: boolean): string; diff --git a/types/circular-json/tslint.json b/types/circular-json/tslint.json new file mode 100644 index 0000000000..b4b47a0378 --- /dev/null +++ b/types/circular-json/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/ckeditor/ckeditor-tests.ts b/types/ckeditor/ckeditor-tests.ts index b6471ddab6..dd0ec92164 100644 --- a/types/ckeditor/ckeditor-tests.ts +++ b/types/ckeditor/ckeditor-tests.ts @@ -52,6 +52,23 @@ function test_config() { [ 'list', 'indent', 'blocks', 'align', 'bidi' ], ], }; + var config3: CKEDITOR.config = { + toolbarGroups: [ + { name: 'clipboard', groups: [ 'clipboard', 'undo' ] }, + { name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] }, + { name: 'links', groups: [ 'links' ] }, + { name: 'insert', groups: [ 'insert' ] }, + { name: 'tools', groups: [ 'tools' ] }, + { name: 'document', groups: [ 'mode' ] }, + { name: 'about', groups: [ 'about' ] }, + '/', + { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] }, + { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'paragraph' ] }, + '/', + { name: 'styles', groups: [ 'styles' ] }, + { name: 'colors', groups: [ 'colors' ] }, + ], + } } function test_dom_comment() { diff --git a/types/ckeditor/index.d.ts b/types/ckeditor/index.d.ts index 24ff341b38..f26a08a725 100644 --- a/types/ckeditor/index.d.ts +++ b/types/ckeditor/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for CKEditor // Project: http://ckeditor.com/ -// Definitions by: Ondrej Sevcik +// Definitions by: Thomas Wittwer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // WORK-IN-PROGRESS: Any contribution support welcomed. @@ -727,7 +727,7 @@ declare namespace CKEDITOR { magicline_holdDistance?: number; magicline_keystrokeNext?: number; magicline_keystrokePrevious?: number; - magicline_tabuList?: number; + magicline_tabuList?: string[]; magicline_triggerOffset?: number; mathJaxLib?: string; menu_groups?: string; @@ -814,7 +814,7 @@ declare namespace CKEDITOR { toolbar?: string | (string | string[])[]; toolbarCanCollapse?: boolean; toolbarGroupCycling?: boolean; - toolbarGroups?: toolbarGroups[]; + toolbarGroups?: (toolbarGroups | string)[]; toolbarLocation?: string; toolbarStartupExpanded?: boolean; diff --git a/types/ckeditor/tslint.json b/types/ckeditor/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/ckeditor/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cldrjs/tslint.json b/types/cldrjs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cldrjs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/clean-css/tslint.json b/types/clean-css/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/clean-css/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/clean-webpack-plugin/clean-webpack-plugin-tests.ts b/types/clean-webpack-plugin/clean-webpack-plugin-tests.ts new file mode 100644 index 0000000000..6d60f36d51 --- /dev/null +++ b/types/clean-webpack-plugin/clean-webpack-plugin-tests.ts @@ -0,0 +1,17 @@ +import CleanWebpackPlugin = require('clean-webpack-plugin'); + +const paths = [ + 'path', + 'glob/**/*.js', +]; + +new CleanWebpackPlugin(paths); +new CleanWebpackPlugin(paths, 'root-directory'); +new CleanWebpackPlugin(paths, {}); +new CleanWebpackPlugin(paths, { + root: 'root-directory', + verbose: true, + dry: true, + watch: true, + exclude: ['a, b'], +}); diff --git a/types/clean-webpack-plugin/index.d.ts b/types/clean-webpack-plugin/index.d.ts new file mode 100644 index 0000000000..7fc45cc3e4 --- /dev/null +++ b/types/clean-webpack-plugin/index.d.ts @@ -0,0 +1,47 @@ +// Type definitions for clean-webpack-plugin 0.1 +// Project: https://github.com/johnagan/clean-webpack-plugin +// Definitions by: Jed Fox +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Plugin } from 'webpack'; + +export = CleanWebpackPlugin; + +declare class CleanWebpackPlugin extends Plugin { + /** + * @param paths A glob or array of globs to delete + */ + constructor(paths: string | ReadonlyArray, options?: string | CleanWebpackPlugin.Options); +} + +declare namespace CleanWebpackPlugin { + interface Options { + /** + * Absolute path to your webpack root folder (paths appended to this) + * Default: root of your package + */ + root?: string; + /** + * Write logs to the console. + */ + verbose?: boolean; + /** + * Set to `true` to emulate deletion without actually removing any files. + */ + dry?: boolean; + /** + * If true, remove files on recompile. + */ + watch?: boolean; + /** + * Instead of removing whole path recursively, + * remove all path's content with exclusion of provided immediate children. + * Good for not removing shared files from build directories. + */ + exclude?: ReadonlyArray; + /** + * Allow the plugin to clean folders outside of the webpack root + */ + allowExternal?: boolean; + } +} diff --git a/types/clean-webpack-plugin/tsconfig.json b/types/clean-webpack-plugin/tsconfig.json new file mode 100644 index 0000000000..2f342b4d42 --- /dev/null +++ b/types/clean-webpack-plugin/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "clean-webpack-plugin-tests.ts" + ] +} diff --git a/types/clean-webpack-plugin/tslint.json b/types/clean-webpack-plugin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/clean-webpack-plugin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cleave.js/cleave.js-tests.tsx b/types/cleave.js/cleave.js-tests.tsx new file mode 100644 index 0000000000..3bbc6570a3 --- /dev/null +++ b/types/cleave.js/cleave.js-tests.tsx @@ -0,0 +1,17 @@ +import * as React from "react"; +import Cleave = require("cleave.js"); +import CleaveReact = require("cleave.js/react"); + +const Example1 = () => { + Cleave("#my-input", { phone: true }); +}; + +const ExampleReact1 = (props: any) => { + return ( + + ); +}; diff --git a/types/cleave.js/index.d.ts b/types/cleave.js/index.d.ts new file mode 100644 index 0000000000..17e8c1c512 --- /dev/null +++ b/types/cleave.js/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for cleave.js 1.0 +// Project: https://github.com/nosir/cleave.js +// Definitions by: C Lentfort , J Giancono +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { CleaveOptions } from './options'; + +declare function Cleave(selector: string, options: CleaveOptions): void; +export = Cleave; diff --git a/types/cleave.js/options.d.ts b/types/cleave.js/options.d.ts new file mode 100644 index 0000000000..81757fe097 --- /dev/null +++ b/types/cleave.js/options.d.ts @@ -0,0 +1,63 @@ +// Credit Card Options +export type CreditCardType = + | "amex" + | "dankort" + | "diners" + | "discover" + | "instapayment" + | "jcb" + | "maestro" + | "mastercard" + | "uatp" + | "unknown" + | "unionPay" + | "mir" + | "visa"; +export type CreditCardTypeChangeHandler = (owner: HTMLInputElement, type: CreditCardType) => void; + +export interface CleaveOptions { + creditCard?: boolean; + creditCardStrictMode?: boolean; + creditCardType?: string; + onCreditCardTypeChanged?: CreditCardTypeChangeHandler; +} + +// Phone Options +export interface CleaveOptions { + phone?: boolean; + phoneRegionCode?: string; +} + +// Date Options +export interface CleaveOptions { + date?: boolean; + datePattern?: ReadonlyArray; +} + +// Numeral Options +export type NumeralThousandsGroupStyleType = "lakh" | "thousand" | "wan" | "none"; + +export interface CleaveOptions { + numeral?: boolean; + numeralDecimalMark?: string; + numeralDecimalScale?: number; + numeralIntegerScale?: number; + numeralPositiveOnly?: boolean; + numeralThousandsGroupStyle?: NumeralThousandsGroupStyleType; + stripLeadingZeroes?: boolean; +} + +// Extra Options +export interface CleaveOptions { + blocks?: ReadonlyArray; + copyDelimiter?: boolean; + delimiter?: string; + delimiters?: ReadonlyArray; + initValue?: any; + lowercase?: boolean; + numericOnly?: boolean; + prefix?: string; + noImmediatePrefix?: boolean; + rawValueTrimPrefix?: boolean; + uppercase?: boolean; +} diff --git a/types/cleave.js/react/index.d.ts b/types/cleave.js/react/index.d.ts new file mode 100644 index 0000000000..6d40ea4ed5 --- /dev/null +++ b/types/cleave.js/react/index.d.ts @@ -0,0 +1,12 @@ +import * as React from "react"; +import { CleaveOptions } from "../options"; + +type InitHandler = (owner: React.ReactInstance) => void; + +interface Props extends React.InputHTMLAttributes { + onInit?: InitHandler; + options: CleaveOptions; +} + +declare var Cleave: React.ComponentClass; +export = Cleave; diff --git a/types/cleave.js/tsconfig.json b/types/cleave.js/tsconfig.json new file mode 100644 index 0000000000..40e69541bc --- /dev/null +++ b/types/cleave.js/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "cleave.js-tests.tsx", + "index.d.ts", + "options.d.ts", + "react/index.d.ts" + ] +} diff --git a/types/cleave.js/tslint.json b/types/cleave.js/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cleave.js/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cli-color/tslint.json b/types/cli-color/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cli-color/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cli/cli-tests.ts b/types/cli/cli-tests.ts index 294cb7dd8b..2a88a216db 100644 --- a/types/cli/cli-tests.ts +++ b/types/cli/cli-tests.ts @@ -52,7 +52,8 @@ cli.main(function (args, options) { } return str; } - for (i = 0, l = this.argc; i < l; i++) { + var l: number = this.argc; + for (i = 0; i < l; i++) { args[i] = escape(args[i]); } options.separator = escape(options.separator); diff --git a/types/cli/tslint.json b/types/cli/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cli/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cliff/tslint.json b/types/cliff/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cliff/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/clipboard-js/tslint.json b/types/clipboard-js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/clipboard-js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/clipboard/index.d.ts b/types/clipboard/index.d.ts index 0aa51518dd..76d28674d6 100644 --- a/types/clipboard/index.d.ts +++ b/types/clipboard/index.d.ts @@ -8,7 +8,7 @@ declare class Clipboard { /** * Subscribes to events that indicate the result of a copy/cut operation. - * @param type {"success" | "error"} Event type ('success' or 'error'). + * @param type Event type ('success' or 'error'). * @param handler Callback function. */ on(type: "success" | "error", handler: (e: Clipboard.Event) => void): this; @@ -29,22 +29,21 @@ declare namespace Clipboard { interface Options { /** * Overwrites default command ('cut' or 'copy'). - * @param {Element} elem Current element - * @returns {String} Only 'cut' or 'copy'. + * @param elem Current element */ - action?(elem: Element): string; + action?(elem: Element): "cut" | "copy"; /** * Overwrites default target input element. - * @param {Element} elem Current element - * @returns {Element} element to use. + * @param elem Current element + * @returns element to use. */ target?(elem: Element): Element; /** * Returns the explicit text to copy. - * @param {Element} elem Current element - * @returns {String} Text to be copied. + * @param elem Current element + * @returns Text to be copied. */ text?(elem: Element): string; } diff --git a/types/clndr/package.json b/types/clndr/package.json index 770614d9be..eaacac663e 100644 --- a/types/clndr/package.json +++ b/types/clndr/package.json @@ -3,4 +3,4 @@ "dependencies": { "moment": ">=2.8.3" } -} \ No newline at end of file +} diff --git a/types/clockpicker/clockpicker-tests.ts b/types/clockpicker/clockpicker-tests.ts new file mode 100644 index 0000000000..473c268aac --- /dev/null +++ b/types/clockpicker/clockpicker-tests.ts @@ -0,0 +1,32 @@ +// ClockPicker tests from https://github.com/weareoutman/clockpicker + +// Initialize ClockPicker +$('.clockpicker').clockpicker(); + +// Initialize ClockPicker with options +$('.clockpicker').clockpicker({ + default: 'now', + placement: 'bottom', + align: 'left', + donetext: 'Done', + autoclose: false, + twelvehour: true, + vibrate: true, + fromnow: 0, + init: () => {}, + beforeShow: () => {}, + afterShow: () => {}, + beforeHide: () => {}, + afterHide: () => {}, + beforeHourSelect: () => {}, + afterHourSelect: () => {}, + beforeDone: () => {}, + afterDone: () => {}, +}); + +// Invoke ClockPicker operation methods +$('.clockpicker').clockpicker('show'); +$('.clockpicker').clockpicker('hide'); +$('.clockpicker').clockpicker('remove'); +$('.clockpicker').clockpicker('toggleView', 'hours'); +$('.clockpicker').clockpicker('toggleView', 'minutes'); diff --git a/types/clockpicker/index.d.ts b/types/clockpicker/index.d.ts new file mode 100644 index 0000000000..d9dbd444e8 --- /dev/null +++ b/types/clockpicker/index.d.ts @@ -0,0 +1,36 @@ +// Type definitions for ClockPicker 0.0 +// Project: https://github.com/weareoutman/clockpicker +// Definitions by: jfcere +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +interface ClockPickerOptions { + default?: string; + placement?: string; + align?: string; + donetext?: string; + autoclose?: boolean; + twelvehour?: boolean; + vibrate?: boolean; + fromnow?: number; + init?: () => void; + beforeShow?: () => void; + afterShow?: () => void; + beforeHide?: () => void; + afterHide?: () => void; + beforeHourSelect?: () => void; + afterHourSelect?: () => void; + beforeDone?: () => void; + afterDone?: () => void; +} + +interface ClockPicker { + (options?: ClockPickerOptions): JQuery; + (methodName: string, ...params: any[]): JQuery; +} + +interface JQuery { + clockpicker: ClockPicker; +} diff --git a/types/popper.js/tsconfig.json b/types/clockpicker/tsconfig.json similarity index 87% rename from types/popper.js/tsconfig.json rename to types/clockpicker/tsconfig.json index e5f5d39e07..64b80a0278 100644 --- a/types/popper.js/tsconfig.json +++ b/types/clockpicker/tsconfig.json @@ -6,7 +6,7 @@ "dom" ], "noImplicitAny": true, - "noImplicitThis": true, + "noImplicitThis": false, "strictNullChecks": false, "strictFunctionTypes": true, "baseUrl": "../", @@ -19,6 +19,6 @@ }, "files": [ "index.d.ts", - "popper.js-tests.ts" + "clockpicker-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/popper.js/tslint.json b/types/clockpicker/tslint.json similarity index 58% rename from types/popper.js/tslint.json rename to types/clockpicker/tslint.json index fd7e538a58..11584e5acd 100644 --- a/types/popper.js/tslint.json +++ b/types/clockpicker/tslint.json @@ -1,7 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - // TODO - "ban-types": false + "prefer-method-signature": false } } diff --git a/types/clone/tslint.json b/types/clone/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/clone/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/closure-compiler/tslint.json b/types/closure-compiler/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/closure-compiler/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cloud-env/tslint.json b/types/cloud-env/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cloud-env/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/clusterize.js/clusterize.js-tests.ts b/types/clusterize.js/clusterize.js-tests.ts new file mode 100644 index 0000000000..acbfbc36f8 --- /dev/null +++ b/types/clusterize.js/clusterize.js-tests.ts @@ -0,0 +1,20 @@ +import Clusterize = require('clusterize.js'); + +const options: Clusterize.Options = { contentId: '', scrollId: '' }; +const clusterize = new Clusterize(options); + +clusterize.append(['
  • ']); + +clusterize.prepend(['
  • ']); + +clusterize.getRowsAmount(); + +clusterize.update(['
  • ']); + +clusterize.getScrollProgress(); + +clusterize.refresh(); + +clusterize.clear(); + +clusterize.destroy(); diff --git a/types/clusterize.js/index.d.ts b/types/clusterize.js/index.d.ts new file mode 100644 index 0000000000..7c549761d6 --- /dev/null +++ b/types/clusterize.js/index.d.ts @@ -0,0 +1,41 @@ +// Type definitions for clusterize.js 0.17 +// Project: https://github.com/NeXTs/Clusterize.js +// Definitions by: Pr1st0n +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare class Clusterize { + constructor(options: Clusterize.Options); + + destroy(clean?: boolean): void; + refresh(force?: boolean): void; + clear(): void; + getRowsAmount(): number; + getScrollProgress(): number; + update(data?: string[]): void; + append(rows: string[]): void; + prepend(rows: string[]): void; +} + +declare namespace Clusterize { + interface Options { + scrollId: string; + contentId: string; + rows?: string[]; + tag?: string; + rows_in_block?: number; + blocks_in_cluster?: number; + show_no_data_row?: boolean; + no_data_text?: string; + no_data_class?: string; + keep_parity?: boolean; + callbacks?: Callbacks; + } + + interface Callbacks { + clusterWillChange?(cb: () => void): void; + clusterChanged?(cb: () => void): void; + scrollingProgress?(cb: (progress: number) => void): void; + } +} + +export = Clusterize; diff --git a/types/clusterize.js/tsconfig.json b/types/clusterize.js/tsconfig.json new file mode 100644 index 0000000000..10ca5c2a1a --- /dev/null +++ b/types/clusterize.js/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", + "clusterize.js-tests.ts" + ] +} diff --git a/types/clusterize.js/tslint.json b/types/clusterize.js/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/clusterize.js/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/co-body/index.d.ts b/types/co-body/index.d.ts index 0393db0a94..7906f38e81 100644 --- a/types/co-body/index.d.ts +++ b/types/co-body/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/cojs/co-body // Definitions by: Joshua DeVinney // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// /// @@ -26,6 +27,7 @@ declare namespace CoBody { strict?: boolean; queryString?: qs.IParseOptions; jsonTypes?: string[]; + returnRawBody?: boolean; formTypes?: string[]; textTypes?: string[]; encoding?: string; diff --git a/types/co-body/tslint.json b/types/co-body/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/co-body/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/codemirror/index.d.ts b/types/codemirror/index.d.ts index 88989b2ef2..126eafe013 100644 --- a/types/codemirror/index.d.ts +++ b/types/codemirror/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/marijnh/CodeMirror // Definitions by: mihailik // nrbernard +// Pr1st0n // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export = CodeMirror; @@ -104,7 +105,9 @@ declare namespace CodeMirror { function signal(target: any, name: string, ...args: any[]): void; type DOMEvent = 'mousedown' | 'dblclick' | 'touchstart' | 'contextmenu' | 'keydown' | 'keypress' | 'keyup' | 'cut' | 'copy' | 'paste' | 'dragstart' | 'dragenter' | 'dragover' | 'dragleave' | 'drop'; - + + type CoordsMode = 'window' | 'page' | 'local'; + interface Token { /** The character(on the given line) at which the token starts. */ start: number; @@ -196,12 +199,15 @@ declare namespace CodeMirror { class can be left off to remove all classes for the specified node, or be a string to remove only a specific class. */ removeLineClass(line: any, where: string, class_?: string): CodeMirror.LineHandle; - /** - * Compute the line at the given pixel height. - * - * `mode` is the relative element to use to compute this line - defaults to 'page' if not specified - */ - lineAtHeight(height: number, mode?: 'window' | 'page' | 'local'): number + /** Compute the line at the given pixel height. mode is the relative element + to use to compute this line, it may be "window", "page" (the default), or "local" */ + lineAtHeight(height: number, mode?: CoordsMode): number; + + /** Computes the height of the top of a line, in the coordinate system specified by mode, it may be "window", + "page" (the default), or "local". When a line below the bottom of the document is specified, the returned value + is the bottom of the last line in the document. By default, the position of the actual text is returned. + If includeWidgets is true and the line has line widgets, the position above the first line widget is returned. */ + heightAtLine(line: any, mode?: CoordsMode, includeWidgets?: boolean): number; /** Returns the line number, text content, and marker status of the given line, which can be either a number or a line handle. */ lineInfo(line: any): { @@ -267,25 +273,28 @@ declare namespace CodeMirror { scrollIntoView(pos: { from: CodeMirror.Position, to: CodeMirror.Position }, margin: number): void; /** Returns an { left , top , bottom } object containing the coordinates of the cursor position. - If mode is "local" , they will be relative to the top-left corner of the editable document. + If mode is "local", they will be relative to the top-left corner of the editable document. If it is "page" or not given, they are relative to the top-left corner of the page. where is a boolean indicating whether you want the start(true) or the end(false) of the selection. */ - cursorCoords(where: boolean, mode: string): { left: number; top: number; bottom: number; }; + cursorCoords(where: boolean, mode?: CoordsMode): { left: number; top: number; bottom: number; }; /** Returns an { left , top , bottom } object containing the coordinates of the cursor position. - If mode is "local" , they will be relative to the top-left corner of the editable document. + If mode is "local", they will be relative to the top-left corner of the editable document. If it is "page" or not given, they are relative to the top-left corner of the page. where specifies the precise position at which you want to measure. */ - cursorCoords(where: CodeMirror.Position, mode: string): { left: number; top: number; bottom: number; }; + cursorCoords(where: CodeMirror.Position, mode?: CoordsMode): { left: number; top: number; bottom: number; }; - /** Returns the position and dimensions of an arbitrary character.pos should be a { line , ch } object. + /** Returns the position and dimensions of an arbitrary character. pos should be a { line , ch } object. + If mode is "local", they will be relative to the top-left corner of the editable document. + If it is "page" or not given, they are relative to the top-left corner of the page. This differs from cursorCoords in that it'll give the size of the whole character, rather than just the position that the cursor would have when it would sit at that position. */ - charCoords(pos: CodeMirror.Position, mode: string): { left: number; right: number; top: number; bottom: number; }; + charCoords(pos: CodeMirror.Position, mode?: CoordsMode): { left: number; right: number; top: number; bottom: number; }; /** Given an { left , top } object , returns the { line , ch } position that corresponds to it. - The optional mode parameter determines relative to what the coordinates are interpreted. It may be "window" , "page"(the default) , or "local". */ - coordsChar(object: { left: number; top: number; }, mode?: string): CodeMirror.Position; + The optional mode parameter determines relative to what the coordinates are interpreted. + It may be "window", "page" (the default), or "local". */ + coordsChar(object: { left: number; top: number; }, mode?: CoordsMode): CodeMirror.Position; /** Returns the line height of the default font for the editor. */ defaultTextHeight(): number; @@ -304,7 +313,7 @@ declare namespace CodeMirror { refresh(): void; /** Retrieves information about the token the current mode found before the given position (a {line, ch} object). */ - getTokenAt(pos: CodeMirror.Position): Token; + getTokenAt(pos: CodeMirror.Position, precise?: boolean): Token; /** This is similar to getTokenAt, but collects all tokens for a given line into an array. */ getLineTokens(line: number, precise?: boolean): Token[]; @@ -328,6 +337,11 @@ declare namespace CodeMirror { "subtract" Reduce the indentation of the line. */ indentLine(line: number, dir?: string): void; + /** Tells you whether the editor's content can be edited by the user. */ + isReadOnly(): boolean; + + /** Runs the command with the given name on the editor. */ + execCommand(name: string): void; /** Give the editor focus. */ focus(): void; @@ -678,7 +692,7 @@ declare namespace CodeMirror { interface EditorChangeCancellable extends CodeMirror.EditorChange { /** may be used to modify the change. All three arguments to update are optional, and can be left off to leave the existing value for that field intact. */ - update(from?: CodeMirror.Position, to?: CodeMirror.Position, text?: string): void; + update(from?: CodeMirror.Position, to?: CodeMirror.Position, text?: string[]): void; cancel(): void; } @@ -1239,14 +1253,14 @@ declare namespace CodeMirror { * Left side of the merge view. */ left: DiffView; - leftChunks(): MergeViewDiffChunk; + leftChunks(): MergeViewDiffChunk[]; leftOriginal(): Editor; /** * Right side of the merge view. */ right: DiffView; - rightChunks(): MergeViewDiffChunk; + rightChunks(): MergeViewDiffChunk[]; rightOriginal(): Editor; /** diff --git a/types/codemirror/test/index.ts b/types/codemirror/test/index.ts index e283abe974..39c601f159 100644 --- a/types/codemirror/test/index.ts +++ b/types/codemirror/test/index.ts @@ -68,3 +68,6 @@ myCodeMirror.on( ); CodeMirror.registerHelper("lint", "javascript", {}); + +myCodeMirror.isReadOnly(); +myCodeMirror.execCommand('selectAll'); diff --git a/types/codemirror/tslint.json b/types/codemirror/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/codemirror/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/coffeeify/tslint.json b/types/coffeeify/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/coffeeify/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/collections/tslint.json b/types/collections/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/collections/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/color/v0/tslint.json b/types/color/v0/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/color/v0/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/color/v1/tslint.json b/types/color/v1/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/color/v1/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/colorbrewer/tslint.json b/types/colorbrewer/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/colorbrewer/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/com.darktalker.cordova.screenshot/tslint.json b/types/com.darktalker.cordova.screenshot/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/com.darktalker.cordova.screenshot/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/combine-source-map/index.d.ts b/types/combine-source-map/index.d.ts index 43f1c994b0..3855942092 100644 --- a/types/combine-source-map/index.d.ts +++ b/types/combine-source-map/index.d.ts @@ -3,13 +3,15 @@ // Definitions by: TeamworkGuy2 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/** Add source maps of multiple files, offset them and then combine them into one source map. +/** + * Add source maps of multiple files, offset them and then combine them into one source map. * (documentation based on project's README file) */ declare class Combiner { constructor(file?: string, sourceRoot?: string); - /** Adds map to underlying source map. + /** + * Adds map to underlying source map. * If source contains a source map comment that has the source of the original file inlined it will offset these * mappings and include them. * If no source map comment is found or it has no source inlined, mappings for the file will be generated and included @@ -18,12 +20,14 @@ declare class Combiner { */ addFile(opts: { sourceFile: string; source: string }, offset?: Combiner.Offset): Combiner; - /** output the combined source map in base64 format + /** + * output the combined source map in base64 format * @return base64 encoded combined source map */ base64(): string; - /** generate a base64 encoded sourceMappingURL comment + /** + * generate a base64 encoded sourceMappingURL comment * @return base64 encoded sourceMappingUrl comment of the combined source map */ comment(): string; @@ -40,15 +44,15 @@ declare namespace Combiner { column?: number; } - /** Create a source map combiner that accepts multiple files, offsets them and then combines them into one source map. + /** + * Create a source map combiner that accepts multiple files, offsets them and then combines them into one source map. * @param file optional name of the generated file * @param sourceRoot optional sourceRoot of the map to be generated * @return Combiner instance to which source maps can be added and later combined */ function create(file?: string, sourceRoot?: string): Combiner; - /** removeComments - * @param src + /** * @return src with all sourceMappingUrl comments removed */ function removeComments(src: string): string; diff --git a/types/combokeys/tslint.json b/types/combokeys/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/combokeys/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cometd/tslint.json b/types/cometd/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cometd/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/command-line-args/index.d.ts b/types/command-line-args/index.d.ts index 442ee5cb93..332368d827 100644 --- a/types/command-line-args/index.d.ts +++ b/types/command-line-args/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for command-line-args 4.0.6 +// Type definitions for command-line-args 4.0.7 // Project: https://github.com/75lb/command-line-args // Definitions by: CzBuCHi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -25,50 +25,63 @@ */ declare function commandLineArgs(optionDefinitions: commandLineArgs.OptionDefinition[], options?: commandLineArgs.Options): any; -declare module commandLineArgs { +declare module commandLineArgs { - export interface OptionDefinition { - /** - * The only required definition property is name, the value of each option will be either a Boolean or string. - */ - name: string, - /** - * The type value is a setter function (you receive the output from this), enabling you to be specific about the type and value received. - */ - type?: (arg: string) => any, - /** - * getopt-style short option names. Can be any single character (unicode included) except a digit or hypen. - */ - alias?: string, - /** - * Set this flag if the option takes a list of values. You will receive an array of values, each passed through the type function (if specified). - */ - multiple?: boolean, - /** - * Any unclaimed command-line args will be set on this option. This flag is typically set on the most commonly-used option to make for more concise usage (i.e. $ myapp *.js instead of $ myapp --files *.js). - */ - defaultOption?: boolean, - /** - * An initial value for the option. - */ - defaultValue?: any, - /** - * When your app has a large amount of options it makes sense to organise them in groups. - * There are two automatic groups: _all (contains all options) and _none (contains options without a group specified in their definition). - */ - group?: string | string[], - } + export interface OptionDefinition { + /** + * The only required definition property is name, the value of each option will be either a Boolean or string. + */ + name: string, + /** + * The type value is a setter function (you receive the output from this), + * enabling you to be specific about the type and value received. + */ + type?: (arg: string) => any, + /** + * getopt-style short option names. Can be any single character (unicode included) except a digit or hypen. + */ + alias?: string, + /** + * Set this flag if the option takes a list of values. You will receive an array of values, each passed + * through the type function (if specified). + */ + multiple?: boolean, + /** + * Any unclaimed command-line args will be set on this option. This flag is typically set on + * the most commonly-used option to make for more concise usage + * (i.e. $ myapp *.js instead of $ myapp --files *.js). + */ + defaultOption?: boolean, + /** + * An initial value for the option. + */ + defaultValue?: any, + /** + * When your app has a large amount of options it makes sense to organise them in groups. + * There are two automatic groups: _all (contains all options) and _none (contains options + * without a group specified in their definition). + */ + group?: string | string[], + /** + * Describes the option. + */ + description?: string, + /** + * A label for the type, e.g. . + */ + typeLabel?: string; + } - export interface Options { - /** - * An array of strings, which if passed will be parsed instead of `process.argv`. - */ - argv?: string[]; - /** - * If `true`, an array of unknown arguments is returned in the `_unknown` property of the output. - */ - partial?: boolean; - } + export interface Options { + /** + * An array of strings, which if passed will be parsed instead of `process.argv`. + */ + argv?: string[]; + /** + * If `true`, an array of unknown arguments is returned in the `_unknown` property of the output. + */ + partial?: boolean; + } } export = commandLineArgs; diff --git a/types/command-line-args/tslint.json b/types/command-line-args/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/command-line-args/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/command-line-commands/tslint.json b/types/command-line-commands/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/command-line-commands/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/commander/tslint.json b/types/commander/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/commander/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/commangular/tslint.json b/types/commangular/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/commangular/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/common-tags/tslint.json b/types/common-tags/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/common-tags/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/compare-version/tslint.json b/types/compare-version/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/compare-version/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/complex/tslint.json b/types/complex/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/complex/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/component-emitter/tslint.json b/types/component-emitter/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/component-emitter/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/compose-function/tslint.json b/types/compose-function/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/compose-function/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/compression/index.d.ts b/types/compression/index.d.ts index 75c37d4374..68d687a9c4 100644 --- a/types/compression/index.d.ts +++ b/types/compression/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/expressjs/compression // Definitions by: Santi Albo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 import * as express from 'express'; diff --git a/types/compression/tslint.json b/types/compression/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/compression/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/compute-stdev/compute-stdev-tests.ts b/types/compute-stdev/compute-stdev-tests.ts new file mode 100644 index 0000000000..72b9869ded --- /dev/null +++ b/types/compute-stdev/compute-stdev-tests.ts @@ -0,0 +1,4 @@ +import stdev = require('compute-stdev'); + +// $ExpectType number +stdev([1, 2, 3]); diff --git a/types/compute-stdev/index.d.ts b/types/compute-stdev/index.d.ts new file mode 100644 index 0000000000..7e981ae529 --- /dev/null +++ b/types/compute-stdev/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for compute-stdev 1.0 +// Project: https://github.com/compute-io/stdev +// Definitions by: mrmlnc +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function stdev(data: ArrayLike): number; + +export = stdev; diff --git a/types/compute-stdev/tsconfig.json b/types/compute-stdev/tsconfig.json new file mode 100644 index 0000000000..f622c386a3 --- /dev/null +++ b/types/compute-stdev/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", + "compute-stdev-tests.ts" + ] +} diff --git a/types/compute-stdev/tslint.json b/types/compute-stdev/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/compute-stdev/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/concaveman/tslint.json b/types/concaveman/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/concaveman/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/confidence/tslint.json b/types/confidence/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/confidence/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/config/tslint.json b/types/config/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/config/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/confit/tslint.json b/types/confit/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/confit/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/connect-ensure-login/index.d.ts b/types/connect-ensure-login/index.d.ts index 9158255c40..6c91101ab5 100644 --- a/types/connect-ensure-login/index.d.ts +++ b/types/connect-ensure-login/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/jaredhanson/connect-ensure-login // Definitions by: Pavel Puchkov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 import { RequestHandler } from "express"; diff --git a/types/connect-flash/index.d.ts b/types/connect-flash/index.d.ts index cb7d460623..90540da3ed 100644 --- a/types/connect-flash/index.d.ts +++ b/types/connect-flash/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/jaredhanson/connect-flash // Definitions by: Andreas Gassmann // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /// diff --git a/types/connect-flash/tslint.json b/types/connect-flash/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/connect-flash/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/connect-history-api-fallback/index.d.ts b/types/connect-history-api-fallback/index.d.ts index 9cd77ac174..a39fbfdbd6 100644 --- a/types/connect-history-api-fallback/index.d.ts +++ b/types/connect-history-api-fallback/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/bripkens/connect-history-api-fallback#readme // Definitions by: Douglas Duteil // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /// diff --git a/types/connect-livereload/tslint.json b/types/connect-livereload/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/connect-livereload/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/connect-modrewrite/index.d.ts b/types/connect-modrewrite/index.d.ts index 41372046d1..910d56f9af 100644 --- a/types/connect-modrewrite/index.d.ts +++ b/types/connect-modrewrite/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/tinganho/connect-modrewrite // Definitions by: Tingan Ho // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 diff --git a/types/connect-modrewrite/tslint.json b/types/connect-modrewrite/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/connect-modrewrite/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/connect-mongo/tslint.json b/types/connect-mongo/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/connect-mongo/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/connect-redis/index.d.ts b/types/connect-redis/index.d.ts index b5084609a2..5675512795 100644 --- a/types/connect-redis/index.d.ts +++ b/types/connect-redis/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Xavier Stouder // Albert Kurniawan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /// /// diff --git a/types/connect-redis/tslint.json b/types/connect-redis/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/connect-redis/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/connect-slashes/index.d.ts b/types/connect-slashes/index.d.ts index ccb7eb82c3..440f54372c 100644 --- a/types/connect-slashes/index.d.ts +++ b/types/connect-slashes/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/avinoamr/connect-slashes // Definitions by: Sam Herrmann // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /* =================== USAGE =================== diff --git a/types/connect-slashes/tslint.json b/types/connect-slashes/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/connect-slashes/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/connect-timeout/index.d.ts b/types/connect-timeout/index.d.ts index 0ec4963306..93114c1469 100644 --- a/types/connect-timeout/index.d.ts +++ b/types/connect-timeout/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/expressjs/timeout // Definitions by: Cyril Schumacher // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 /// diff --git a/types/connect-timeout/tslint.json b/types/connect-timeout/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/connect-timeout/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/connect/tslint.json b/types/connect/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/connect/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/console-stamp/tslint.json b/types/console-stamp/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/console-stamp/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/consolidate/tslint.json b/types/consolidate/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/consolidate/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/consul/tslint.json b/types/consul/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/consul/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/content-type/index.d.ts b/types/content-type/index.d.ts index 5ff4ae7ff1..c81c78c966 100644 --- a/types/content-type/index.d.ts +++ b/types/content-type/index.d.ts @@ -18,7 +18,7 @@ export interface MediaType { } export interface RequestLike { - headers: {[header: string]: string | string[]}; + headers: {[header: string]: string | string[] | undefined}; } export interface ResponseLike { diff --git a/types/contentful-resolve-response/tslint.json b/types/contentful-resolve-response/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/contentful-resolve-response/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/contextjs/tslint.json b/types/contextjs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/contextjs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/convert-layout/by.d.ts b/types/convert-layout/by.d.ts deleted file mode 100644 index bc4d5ac834..0000000000 --- a/types/convert-layout/by.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { layout } from './index'; -export const by: layout; diff --git a/types/convert-layout/convert-layout-tests.ts b/types/convert-layout/convert-layout-tests.ts index 041e257531..8a55a1bfb5 100644 --- a/types/convert-layout/convert-layout-tests.ts +++ b/types/convert-layout/convert-layout-tests.ts @@ -1,4 +1,4 @@ -import { ru } from 'convert-layout/ru'; +import { ru } from 'convert-layout'; const s = 'Lorem ipsum dolor sit amet.'; let result = ru.toEn(s); diff --git a/types/convert-layout/de.d.ts b/types/convert-layout/de.d.ts deleted file mode 100644 index d422224a3f..0000000000 --- a/types/convert-layout/de.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { layout } from './index'; -export const de: layout; diff --git a/types/convert-layout/es.d.ts b/types/convert-layout/es.d.ts deleted file mode 100644 index 3c4a7b75dd..0000000000 --- a/types/convert-layout/es.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { layout } from './index'; -export const es: layout; diff --git a/types/convert-layout/he.d.ts b/types/convert-layout/he.d.ts deleted file mode 100644 index ca98b2d035..0000000000 --- a/types/convert-layout/he.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { layout } from './index'; -export const he: layout; diff --git a/types/convert-layout/index.d.ts b/types/convert-layout/index.d.ts index 65475cf107..b19370efd2 100644 --- a/types/convert-layout/index.d.ts +++ b/types/convert-layout/index.d.ts @@ -3,9 +3,52 @@ // Definitions by: Mikhail Aksenov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 -export const layouts: { [id: string]: layout }; +declare var layouts: { [id: string]: layout }; +declare var lang_layout: layout; -export interface layout { +declare const convert_layout: { + by: layout; + de: layout; + es: layout; + he: layout; + kk: layout; + ru: layout; + uk: layout; +}; + +declare module "convert-layout" { + export = convert_layout; +} + +declare module "convert-layout/by" { + export = lang_layout; +} + +declare module "convert-layout/de" { + export = lang_layout; +} + +declare module "convert-layout/es" { + export = lang_layout; +} + +declare module "convert-layout/he" { + export = lang_layout; +} + +declare module "convert-layout/kk" { + export = lang_layout; +} + +declare module "convert-layout/ru" { + export = lang_layout; +} + +declare module "convert-layout/uk" { + export = lang_layout; +} + +interface layout { toEn(s: string): string; fromEn(s: string): string; } diff --git a/types/convert-layout/kk.d.ts b/types/convert-layout/kk.d.ts deleted file mode 100644 index a9cc93f774..0000000000 --- a/types/convert-layout/kk.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { layout } from './index'; -export const kk: layout; diff --git a/types/convert-layout/ru.d.ts b/types/convert-layout/ru.d.ts deleted file mode 100644 index 3cd24807cb..0000000000 --- a/types/convert-layout/ru.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { layout } from './index'; -export const ru: layout; diff --git a/types/convert-layout/tsconfig.json b/types/convert-layout/tsconfig.json index 6e40f2f030..e9ef959215 100644 --- a/types/convert-layout/tsconfig.json +++ b/types/convert-layout/tsconfig.json @@ -18,13 +18,6 @@ }, "files": [ "index.d.ts", - "by.d.ts", - "de.d.ts", - "es.d.ts", - "he.d.ts", - "kk.d.ts", - "ru.d.ts", - "uk.d.ts", "convert-layout-tests.ts" ] } \ No newline at end of file diff --git a/types/convert-layout/tslint.json b/types/convert-layout/tslint.json index 3db14f85ea..5ef9aa96e5 100644 --- a/types/convert-layout/tslint.json +++ b/types/convert-layout/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "no-declare-current-package": false + } +} diff --git a/types/convert-layout/uk.d.ts b/types/convert-layout/uk.d.ts deleted file mode 100644 index dee51e6f00..0000000000 --- a/types/convert-layout/uk.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { layout } from './index'; -export const uk: layout; diff --git a/types/convert-source-map/index.d.ts b/types/convert-source-map/index.d.ts index 6b1346b61f..6950445a6c 100644 --- a/types/convert-source-map/index.d.ts +++ b/types/convert-source-map/index.d.ts @@ -3,7 +3,8 @@ // Definitions by: Andrew Gaspar , Melvin Groenhoff , TeamworkGuy2 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/** Converts a source-map from/to different formats and allows adding/changing properties. +/** + * Converts a source-map from/to different formats and allows adding/changing properties. * (documentation based on project's README file) */ export interface SourceMapConverter { @@ -19,7 +20,8 @@ export interface SourceMapConverter { /** Converts source map to base64 encoded json string */ toBase64(): string; - /** Converts source map to an inline comment that can be appended to the source-file. + /** + * Converts source map to an inline comment that can be appended to the source-file. * By default, the comment is formatted like: //# sourceMappingURL=..., which you would normally see in a JS source file. * When options.multiline == true, the comment is formatted like: /*# sourceMappingURL=... *\/, which you would find in a CSS source file */ @@ -47,16 +49,19 @@ export function fromBase64(base64: string): SourceMapConverter; /** Returns source map converter from given base64 encoded json string prefixed with //# sourceMappingURL=... */ export function fromComment(comment: string): SourceMapConverter; -/** Returns source map converter from given filename by parsing //# sourceMappingURL=filename. +/** + * Returns source map converter from given filename by parsing //# sourceMappingURL=filename. * filename must point to a file that is found inside the mapFileDir. Most tools store this file right next to the generated file, i.e. the one containing the source map. */ export function fromMapFileComment(comment: string, commentFileDir: string): SourceMapConverter; -/** Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was found. +/** + * Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was found. */ export function fromSource(content: string): SourceMapConverter | null; -/** Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was found. +/** + * Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was found. * The sourcemap will be read from the map file found by parsing # sourceMappingURL=file comment. For more info see fromMapFileComment. */ export function fromMapFileSource(content: string, commentFileDir: string): SourceMapConverter | null; @@ -73,7 +78,8 @@ export const commentRegex: RegExp; /** Returns a new regex used to find source map comments pointing to map files */ export const mapFileCommentRegex: RegExp; -/** Returns a comment that links to an external source map via file. +/** + * Returns a comment that links to an external source map via file. * By default, the comment is formatted like: //# sourceMappingURL=..., which you would normally see in a JS source file. * When options.multiline == true, the comment is formatted like: /*# sourceMappingURL=... *\/, which you would find in a CSS source file. */ diff --git a/types/convict/index.d.ts b/types/convict/index.d.ts index 5aac427dd0..544cb9b3f3 100644 --- a/types/convict/index.d.ts +++ b/types/convict/index.d.ts @@ -27,27 +27,33 @@ declare namespace convict { coerce?(val: any): any; } + interface SchemaObj { + default: any; + doc?: string; + /** + * From the implementation: + * + * format can be a: + * - predefined type, as seen below + * - an array of enumerated values, e.g. ["production", "development", "testing"] + * - built-in JavaScript type, i.e. Object, Array, String, Number, Boolean + * - function that performs validation and throws an Error on failure + * + * If omitted, format will be set to the value of Object.prototype.toString.call + * for the default value + */ + format?: string | any[] | ((val: any) => void); + env?: string; + arg?: string; + sensitive?: boolean; + } + interface Schema { - [name: string]: Schema | { - default: any; - doc?: string; - /** - * From the implementation: - * - * format can be a: - * - predefined type, as seen below - * - an array of enumerated values, e.g. ["production", "development", "testing"] - * - built-in JavaScript type, i.e. Object, Array, String, Number, Boolean - * - function that performs validation and throws an Error on failure - * - * If omitted, format will be set to the value of Object.prototype.toString.call - * for the default value - */ - format?: string | any[] | ((val: any) => void); - env?: string; - arg?: string; - sensitive?: boolean; - }; + [name: string]: Schema | SchemaObj; + } + + interface InternalSchema { + properties: Schema; } interface Config { @@ -69,48 +75,40 @@ declare namespace convict { * Sets the value of name to value. name can use dot notation to reference * nested values, e.g. "database.port". If objects in the chain don't yet * exist, they will be initialized to empty objects - * - * @return {Config} instance */ set(name: string, value: any): Config; /** * Loads and merges a JavaScript object into config - * - * @return {Config} instance */ load(conf: Object): Config; /** * Loads and merges JSON configuration file(s) into config - * - * @return {Config} instance */ loadFile(files: string | string[]): Config; /** * Validates config against the schema used to initialize it - * - * @param options */ validate(options?: ValidateOptions): Config; /** * Exports all the properties (that is the keys and their current values) as a {JSON} {Object} - * @returns {Object} A {JSON} compliant {Object} + * @returns A {JSON} compliant {Object} */ getProperties(): Object; /** * Exports the schema as a {JSON} {Object} - * @returns {Object} A {JSON} compliant {Object} + * @returns A {JSON} compliant {Object} */ - getSchema(): Object; + getSchema(): InternalSchema; /** * Exports all the properties (that is the keys and their current values) as a JSON string. - * @returns {String} a string representing this object + * @returns A string representing this object */ toString(): string; /** * Exports the schema as a JSON string. - * @returns {String} a string representing the schema of this {Config} + * @returns A string representing the schema of this {Config} */ getSchemaString(): string; } diff --git a/types/cookie-session/index.d.ts b/types/cookie-session/index.d.ts index 29562d0320..001ba646d5 100644 --- a/types/cookie-session/index.d.ts +++ b/types/cookie-session/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/expressjs/cookie-session // Definitions by: Borislav Zhivkov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /// diff --git a/types/cookie-session/tslint.json b/types/cookie-session/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cookie-session/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cookie-signature/index.d.ts b/types/cookie-signature/index.d.ts index b9b29911a6..cb044f4636 100644 --- a/types/cookie-signature/index.d.ts +++ b/types/cookie-signature/index.d.ts @@ -3,19 +3,11 @@ // Definitions by: François Nguyen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/** - * Sign the given `val` with `secret`. - * @param {string} val - * @param {string} secret - * @return {string} - */ +/** Sign the given `val` with `secret`. */ export function sign(value: string, secret: string): string; /** * Unsign and decode the given `val` with `secret`, * returning `false` if the signature is invalid. - * @param {string} val - * @param {string} secret - * @return {string|boolean} */ export function unsign(value: string, secret: string): string | boolean; diff --git a/types/cookie_js/tslint.json b/types/cookie_js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cookie_js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cookies/index.d.ts b/types/cookies/index.d.ts index 8a897cfeae..380ce03b7d 100644 --- a/types/cookies/index.d.ts +++ b/types/cookies/index.d.ts @@ -4,6 +4,7 @@ // jKey Lu // BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// import { IncomingMessage, ServerResponse } from 'http'; diff --git a/types/copy-paste/tslint.json b/types/copy-paste/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/copy-paste/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/copy-webpack-plugin/tslint.json b/types/copy-webpack-plugin/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/copy-webpack-plugin/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-ionic/tslint.json b/types/cordova-ionic/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-ionic/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-app-version/tslint.json b/types/cordova-plugin-app-version/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-app-version/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-background-mode/tslint.json b/types/cordova-plugin-background-mode/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-background-mode/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-battery-status/tslint.json b/types/cordova-plugin-battery-status/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-battery-status/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-ble-central/tslint.json b/types/cordova-plugin-ble-central/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-ble-central/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-camera/tslint.json b/types/cordova-plugin-camera/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-camera/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-contacts/tslint.json b/types/cordova-plugin-contacts/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-contacts/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-device-motion/tslint.json b/types/cordova-plugin-device-motion/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-device-motion/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-device-name/tslint.json b/types/cordova-plugin-device-name/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-device-name/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-device-orientation/tslint.json b/types/cordova-plugin-device-orientation/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-device-orientation/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-device/index.d.ts b/types/cordova-plugin-device/index.d.ts index cb75703d1a..0451afb4de 100644 --- a/types/cordova-plugin-device/index.d.ts +++ b/types/cordova-plugin-device/index.d.ts @@ -2,9 +2,9 @@ // Project: https://github.com/apache/cordova-plugin-device // Definitions by: Microsoft Open Technologies Inc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// +// // Copyright (c) Microsoft Open Technologies Inc -// Licensed under the MIT license +// Licensed under the MIT license /** * This plugin defines a global device object, which describes the device's hardware and software. @@ -26,11 +26,16 @@ interface Device { uuid: string; /** Get the operating system version. */ version: string; - /** Get the device's manufacturer. */ - manufacturer: string; - /** Whether the device is running on a simulator. */ - isVirtual: boolean; - /** Get the device hardware serial number. */ - serial: string;} + /** Get the device's manufacturer. */ + manufacturer: string; + /** Whether the device is running on a simulator. */ + isVirtual: boolean; + /** Get the device hardware serial number. */ + serial: string; +} + +interface Window { + device: Device; +} declare var device: Device; diff --git a/types/cordova-plugin-device/tslint.json b/types/cordova-plugin-device/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-device/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-dialogs/tslint.json b/types/cordova-plugin-dialogs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-dialogs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-email-composer/tslint.json b/types/cordova-plugin-email-composer/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-email-composer/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-file-transfer/tslint.json b/types/cordova-plugin-file-transfer/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-file-transfer/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-file/tslint.json b/types/cordova-plugin-file/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-file/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-globalization/tslint.json b/types/cordova-plugin-globalization/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-globalization/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-ibeacon/index.d.ts b/types/cordova-plugin-ibeacon/index.d.ts index eb2115448d..20d5733ea9 100644 --- a/types/cordova-plugin-ibeacon/index.d.ts +++ b/types/cordova-plugin-ibeacon/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/petermetz/cordova-plugin-ibeacon // Definitions by: Markus Wagner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import * as Q from "q"; diff --git a/types/cordova-plugin-ibeacon/tslint.json b/types/cordova-plugin-ibeacon/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-ibeacon/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-insomnia/tslint.json b/types/cordova-plugin-insomnia/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-insomnia/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-keyboard/tslint.json b/types/cordova-plugin-keyboard/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-keyboard/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-mapsforge/tslint.json b/types/cordova-plugin-mapsforge/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-mapsforge/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-media-capture/tslint.json b/types/cordova-plugin-media-capture/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-media-capture/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-media/tslint.json b/types/cordova-plugin-media/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-media/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-ms-adal/tslint.json b/types/cordova-plugin-ms-adal/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-ms-adal/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-native-keyboard/index.d.ts b/types/cordova-plugin-native-keyboard/index.d.ts index 0f64199bd1..9acc3d0be5 100644 --- a/types/cordova-plugin-native-keyboard/index.d.ts +++ b/types/cordova-plugin-native-keyboard/index.d.ts @@ -6,7 +6,6 @@ interface NativeKeyboard { /** * Show the messenger, the bare minimum which has to be passed to the function is * the onSubmit callback - * @param options */ showMessenger( options: NativeKeyboardShowOptions @@ -16,10 +15,6 @@ interface NativeKeyboard { * It's likely your app only has 1 one page where you want to show the messenger, * so you want to hide it when the user navigates away. You can choose to do this * either animated (a quick slide down animation) or not. - * - * @param options - * @param onSuccess - * @param onError */ hideMessenger( options?: NativeKeyboardHideOptions, @@ -29,9 +24,6 @@ interface NativeKeyboard { /** * Show a previously hidden keyboard - * - * @param onSuccess - * @param onError */ showMessengerKeyboard( onSuccess?: () => void, @@ -40,9 +32,6 @@ interface NativeKeyboard { /** * Hide the keyboard, but not the messenger bar - * - * @param onSuccess - * @param onError */ hideMessengerKeyboard( onSuccess?: () => void, @@ -53,10 +42,6 @@ interface NativeKeyboard { * Manipulate the messenger while it's open. For instance if you want to * update the text programmatically based on what the user typed (by responding to * onTextChanged events). - * - * @param options - * @param onSuccess - * @param onError */ updateMessenger( options: NativeKeyboardUpdateOptions, @@ -92,7 +77,6 @@ interface NativeKeyboardHideOptions { interface NativeKeyboardShowOptions { /** * Callback function, which is being called as soon as the user submits - * @param text */ onSubmit(text: string): void; @@ -119,8 +103,6 @@ interface NativeKeyboardShowOptions { /** * Callback function which is being executed as soon as the entered text changes. Will * return the new text - * - * @param text */ onTextChanged?(text: string): void; diff --git a/types/cordova-plugin-network-information/tslint.json b/types/cordova-plugin-network-information/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-network-information/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-ouralabs/tslint.json b/types/cordova-plugin-ouralabs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-ouralabs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-qrscanner/tslint.json b/types/cordova-plugin-qrscanner/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-qrscanner/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-spinner/tslint.json b/types/cordova-plugin-spinner/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-spinner/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-splashscreen/tslint.json b/types/cordova-plugin-splashscreen/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-splashscreen/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-statusbar/tslint.json b/types/cordova-plugin-statusbar/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-statusbar/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-vibration/tslint.json b/types/cordova-plugin-vibration/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-vibration/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-websql/tslint.json b/types/cordova-plugin-websql/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-websql/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova-plugin-x-socialsharing/tslint.json b/types/cordova-plugin-x-socialsharing/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova-plugin-x-socialsharing/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova.plugins.diagnostic/tslint.json b/types/cordova.plugins.diagnostic/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova.plugins.diagnostic/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova/tslint.json b/types/cordova/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordova_app_version_plugin/tslint.json b/types/cordova_app_version_plugin/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordova_app_version_plugin/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cordovarduino/tslint.json b/types/cordovarduino/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cordovarduino/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cors/cors-tests.ts b/types/cors/cors-tests.ts index f43b9ee153..83975549c7 100644 --- a/types/cors/cors-tests.ts +++ b/types/cors/cors-tests.ts @@ -2,7 +2,7 @@ import express = require('express'); import cors = require('cors'); -var app = express(); +const app = express(); app.use(cors()); app.use(cors({ maxAge: 100, @@ -28,6 +28,9 @@ app.use(cors({ app.use(cors({ origin: /example\.com$/ })); +app.use(cors({ + origin: [/example\.com$/, 'http://example.com'] +})); app.use(cors({ origin: ['http://example.com', 'http://fakeurl.com'] })); @@ -37,7 +40,7 @@ app.use(cors({ app.use(cors({ origin: (requestOrigin, cb) => { try { - var allow = requestOrigin.indexOf('.edu') !== -1; + const allow = requestOrigin.indexOf('.edu') !== -1; cb(null, allow); } catch (err) { cb(err); diff --git a/types/cors/index.d.ts b/types/cors/index.d.ts index 6c1fc3e4c3..ab8ba2ed2d 100644 --- a/types/cors/index.d.ts +++ b/types/cors/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/troygoode/node-cors/ // Definitions by: Mihhail Lapushkin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 @@ -15,7 +16,7 @@ type CustomOrigin = ( declare namespace e { interface CorsOptions { - origin?: boolean | string | RegExp | string[] | RegExp[] | CustomOrigin; + origin?: boolean | string | RegExp | (string | RegExp)[] | CustomOrigin; methods?: string | string[]; allowedHeaders?: string | string[]; exposedHeaders?: string | string[]; diff --git a/types/cors/tslint.json b/types/cors/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cors/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cote/package.json b/types/cote/package.json index 951fb5721e..43f5ba51cf 100644 --- a/types/cote/package.json +++ b/types/cote/package.json @@ -3,4 +3,4 @@ "dependencies": { "eventemitter2": "^4.1.0" } -} \ No newline at end of file +} diff --git a/types/couchbase/tslint.json b/types/couchbase/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/couchbase/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/countdown/tslint.json b/types/countdown/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/countdown/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/coverup/coverup-tests.ts b/types/coverup/coverup-tests.ts new file mode 100644 index 0000000000..dc9ab7022f --- /dev/null +++ b/types/coverup/coverup-tests.ts @@ -0,0 +1,38 @@ +import coverup = require("coverup"); + +coverup("4242-4242-4242-4242"); // $ExpectType string +// => ******************* + +coverup("4242-4242-4242-4242", { char: "%" }); // $ExpectType string +// => %%%%%%%%%%%%%%%%%%% + +coverup("4242-4242-4242-4242", { keepSymbols: true }); // $ExpectType string +// => ****-****-****-**** + +coverup("4242-4242-4242-4242", { keepLeft: 1, keepRight: 1, compactTo: 4 }); // $ExpectType string +// => 4****2 + +coverup("4242-4242-4242-4242", { keepLeft: 4 }); // $ExpectType string +// => 4242*************** + +coverup("4242-4242-4242-4242", { keepRight: 4 }); // $ExpectType string +// => ***************4242 + +let options: coverup.Options = { + char: "x", + keepLeft: 3, + keepRight: 3, +}; + +coverup("4242-4242-4242-4242", options); // $ExpectType string +// => 424xxxxxxxxxxxxx242 + +options = { + keepLeft: 1, + keepRight: 1, + compactTo: 4, + keepSymbols: true, +}; + +coverup("4242-4242-4242-4242", options); // $ExpectError "you cannot define both compactTo and keepSymbols" +// => Error: you cannot define both compactTo and keepSymbols diff --git a/types/coverup/index.d.ts b/types/coverup/index.d.ts new file mode 100644 index 0000000000..d813984799 --- /dev/null +++ b/types/coverup/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for coverup 0.1 +// Project: https://github.com/jsonmaur/coverup +// Definitions by: Vadim Belorussov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export as namespace Coverup; + +export = coverup; + +declare function coverup(value: string, options?: coverup.Options): string; + +declare namespace coverup { + interface Options { + char?: string; + keepLeft?: number; + keepRight?: number; + compactTo?: number; + keepSymbols?: boolean; + } +} diff --git a/types/coverup/tsconfig.json b/types/coverup/tsconfig.json new file mode 100644 index 0000000000..6102ad61b3 --- /dev/null +++ b/types/coverup/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", + "coverup-tests.ts" + ] +} diff --git a/types/coverup/tslint.json b/types/coverup/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/coverup/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cpx/cpx-tests.ts b/types/cpx/cpx-tests.ts new file mode 100644 index 0000000000..dc92643fcc --- /dev/null +++ b/types/cpx/cpx-tests.ts @@ -0,0 +1,21 @@ +import * as cpx from "cpx"; + +const SRC = "**/.js"; +const DEST = ".tmp/"; +const callback = (error: Error | null) => { }; +const ASYNC_OPTIONS: cpx.AsyncOptions = { includeEmptyDirs: true }; +const SYNC_OPTIONS: cpx.SyncOptions = { preserve: true }; +const WATCH_OPTIONS: cpx.WatchOptions = { initialCopy: true }; + +cpx.copy(SRC, DEST); +cpx.copy(SRC, DEST, callback); +cpx.copy(SRC, DEST, ASYNC_OPTIONS); +cpx.copy(SRC, DEST, ASYNC_OPTIONS, callback); + +cpx.copySync(SRC, DEST, SYNC_OPTIONS); +cpx.copySync(SRC, DEST); + +const watch = cpx.watch(SRC, DEST, WATCH_OPTIONS); +watch.close(); +watch.open(); +watch.on("copy", (x) => x); diff --git a/types/cpx/index.d.ts b/types/cpx/index.d.ts new file mode 100644 index 0000000000..9a04cf1242 --- /dev/null +++ b/types/cpx/index.d.ts @@ -0,0 +1,44 @@ +// Type definitions for cpx 1.5 +// Project: https://github.com/mysticatea/cpx +// Definitions by: Alan Agius +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import * as stream from "stream"; + +export interface SyncOptions { + /** remove files that copied on past before copy. */ + clean?: boolean; + /** Follow symbolic links when copying from them. */ + dereference?: boolean; + /** Copy empty directories which is matched with the glob. */ + includeEmptyDirs?: boolean; + /** Preserve UID, GID, ATIME, and MTIME of files. */ + preserve?: boolean; + /** Do not overwrite files on destination if the source file is older. */ + update?: boolean; +} + +export interface AsyncOptions extends SyncOptions { + /** Function that creates a `stream.Transform` object to transform each copying file. */ + transform?(filepath: string): stream.Transform[]; +} + +export interface WatchOptions extends AsyncOptions, SyncOptions { + /** Flag to not copy at the initial time of watch. */ + initialCopy?: boolean; +} + +export class Watcher extends NodeJS.EventEmitter { + constructor(options: WatchOptions); + open(): void; + close(): void; +} + +export function copy(source: string, dest: string, options?: AsyncOptions, callback?: (error: Error | null) => void): void; +export function copy(source: string, dest: string, callback?: (error: Error | null) => void): void; + +export function copySync(source: string, dest: string, options?: SyncOptions): void; + +export function watch(source: string, dest: string, options?: WatchOptions): Watcher; diff --git a/types/cpx/tsconfig.json b/types/cpx/tsconfig.json new file mode 100644 index 0000000000..d22546d432 --- /dev/null +++ b/types/cpx/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", + "cpx-tests.ts" + ] +} diff --git a/types/cpx/tslint.json b/types/cpx/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cpx/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/cradle/tslint.json b/types/cradle/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cradle/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/create-error/tslint.json b/types/create-error/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/create-error/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/create-react-class/create-react-class-tests.ts b/types/create-react-class/create-react-class-tests.ts new file mode 100644 index 0000000000..c3f7c620ef --- /dev/null +++ b/types/create-react-class/create-react-class-tests.ts @@ -0,0 +1,106 @@ +import * as React from "react"; +import * as ReactDOM from "react-dom"; +import * as DOM from "react-dom-factories"; +import * as createReactClass from "create-react-class"; + +interface Props { + foo: string; +} + +interface State { + bar: number; +} + +const props: Props & React.ClassAttributes<{}> = { + foo: "foo" +}; + +const container: Element = document.createElement("div"); + +// +// Top-Level API +// -------------------------------------------------------------------------- + +const ClassicComponent: React.ClassicComponentClass = createReactClass({ + childContextTypes: {}, + componentDidCatch(err, errorInfo) { + const msg: string = err.message; + const name: string = err.name; + const stack: string | undefined = err.stack; + const componentStack: string = errorInfo.componentStack; + }, + componentDidMount() {}, + componentDidUpdate(props, state) { + const foo: string = props.foo; + const bar: number = state.bar; + }, + componentWillMount() {}, + componentWillReceiveProps(nextProps) { + const oldFoo: string = nextProps.foo; + }, + componentWillUnmount() {}, + componentWillUpdate(props, state) { + const foo: string = props.foo; + const bar: number = state.bar; + }, + contextTypes: {}, + displayName: "Test", + getDefaultProps() { + return { foo: "f" }; + }, + getInitialState() { + return { bar: 1 }; + }, + mixins: [], + propTypes: {}, + shouldComponentUpdate(this: React.ClassicComponent, nextProps, nextState) { + const newFoo: string = nextProps.foo; + const newBar: number = nextState.bar; + return newFoo !== this.props.foo && newBar !== this.state.bar; + }, + statics: { + test: 1 + }, + reset() { + this.replaceState(this.getInitialState!()); + }, + render() { + return DOM.div(null, + DOM.input({ + ref: input => this._input = input, + value: this.state.bar + })); + } +}); + +// React.createFactory +const classicFactory: React.ClassicFactory = + React.createFactory(ClassicComponent); +const classicFactoryElement: React.ClassicElement = + classicFactory(props); + +// React.createElement +const classicElement: React.ClassicElement = React.createElement(ClassicComponent, props); + +// React.cloneElement +const clonedClassicElement: React.ClassicElement = + React.cloneElement(classicElement, props); + +// ReactDOM.render +const classicComponent: React.ClassicComponent = ReactDOM.render(classicElement, container); + +// +// React Components +// -------------------------------------------------------------------------- + +const displayName: string | undefined = ClassicComponent.displayName; +const defaultProps: Props = ClassicComponent.getDefaultProps ? ClassicComponent.getDefaultProps() : {} as Props; +const propTypes: React.ValidationMap | undefined = ClassicComponent.propTypes; + +// +// Component API +// -------------------------------------------------------------------------- + +// classic +const isMounted: boolean = classicComponent.isMounted(); +classicComponent.replaceState({ inputValue: "???", seconds: 60 }); diff --git a/types/create-react-class/index.d.ts b/types/create-react-class/index.d.ts new file mode 100644 index 0000000000..211474ac16 --- /dev/null +++ b/types/create-react-class/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for create-react-class 15.6 +// Project: https://facebook.github.io/react/ +// Definitions by: John Gozde +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { ComponentSpec, ClassicComponentClass } from "react"; + +declare namespace createReactClass {} +declare function createReactClass(spec: ComponentSpec): ClassicComponentClass

    ; + +export as namespace createReactClass; +export = createReactClass; diff --git a/types/create-react-class/tsconfig.json b/types/create-react-class/tsconfig.json new file mode 100644 index 0000000000..b003c69e53 --- /dev/null +++ b/types/create-react-class/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, + "jsx": "preserve" + }, + "files": [ + "index.d.ts", + "create-react-class-tests.ts" + ] +} diff --git a/types/realm/tslint.json b/types/create-react-class/tslint.json similarity index 66% rename from types/realm/tslint.json rename to types/create-react-class/tslint.json index e6dc9b7f2f..08337e85f7 100644 --- a/types/realm/tslint.json +++ b/types/create-react-class/tslint.json @@ -1,8 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - // TODO - "no-any-union": false, + "no-object-literal-type-assertion": false, "no-unnecessary-generics": false } } diff --git a/types/createjs-lib/tslint.json b/types/createjs-lib/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/createjs-lib/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/createjs/tslint.json b/types/createjs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/createjs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/credential/tslint.json b/types/credential/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/credential/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/credit-card-type/tslint.json b/types/credit-card-type/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/credit-card-type/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cron/tslint.json b/types/cron/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cron/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cropperjs/cropperjs-tests.ts b/types/cropperjs/cropperjs-tests.ts index 2c57656b78..4895c3052c 100644 --- a/types/cropperjs/cropperjs-tests.ts +++ b/types/cropperjs/cropperjs-tests.ts @@ -1,9 +1,9 @@ import * as Cropper from 'cropperjs'; -var image = document.getElementById('image'); -var cropper = new Cropper(image, { +const image = document.getElementById('image'); +const cropper = new Cropper(image, { aspectRatio: 16 / 9, - crop: function(e) { + crop(e) { console.log(e.detail.x); console.log(e.detail.y); console.log(e.detail.width); diff --git a/types/cropperjs/index.d.ts b/types/cropperjs/index.d.ts index ca957ccc3f..e99dd88831 100644 --- a/types/cropperjs/index.d.ts +++ b/types/cropperjs/index.d.ts @@ -1,259 +1,260 @@ -// Type definitions for cropperjs +// Type definitions for cropperjs 1.1 // Project: https://github.com/fengyuanchen/cropperjs // Definitions by: Stepan Mikhaylyuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 declare namespace cropperjs { - export enum CropperViewMods { + enum CropperViewMods { CropBoxIsJustWithInTheContainer = 0, CropBoxShouldBeWithInTheCanvas = 1, CanvasShouldNotBeWithInTheContainer = 2, ContainerSshouldBeWithInTheCanvas = 3 } - export interface CropperReadyEvent extends CustomEvent { } - export interface CropperCropEvent extends CustomEvent { + type CropperReadyEvent = CustomEvent; + interface CropperCropEvent extends CustomEvent { detail: Data; } - export interface CropperCropStepEvent extends CustomEvent { + interface CropperCropStepEvent extends CustomEvent { detail: CropStepData; } - export interface CropperZoomEvent extends CustomEvent { + interface CropperZoomEvent extends CustomEvent { detail: ZoomData; } - export interface CropperOptions { + interface CropperOptions { /** - * Function called when crop box is ready - */ - ready?: (event: CropperReadyEvent) => void; + * Function called when crop box is ready + */ + ready?(event: CropperReadyEvent): void; /** - * Function called when crop box is moved or resized - */ - crop?: (event: CropperCropEvent) => void; + * Function called when crop box is moved or resized + */ + crop?(event: CropperCropEvent): void; /** - * Function called at start of crop box being moved or resized - */ - cropstart?: (event: CropperCropStepEvent) => void; + * Function called at start of crop box being moved or resized + */ + cropstart?(event: CropperCropStepEvent): void; /** - * Function called when crop box is moved - */ - cropmove?: (event: CropperCropStepEvent) => void; + * Function called when crop box is moved + */ + cropmove?(event: CropperCropStepEvent): void; /** - * Function called when crop box is finished being moved or resized - */ - cropend?: (event: CropperCropStepEvent) => void; + * Function called when crop box is finished being moved or resized + */ + cropend?(event: CropperCropStepEvent): void; /** * Function called when a cropper instance starts to zoom in or zoom out its canvas (image wrapper). */ - zoom?: (event: CropperZoomEvent) => void; + zoom?(event: CropperZoomEvent): void; /** - * Define the view mode of the cropper. - * @default 0 - */ + * Define the view mode of the cropper. + * @default 0 + */ viewMode?: CropperViewMods; /** - * Define the dragging mode of the cropper. - * 'crop': create a new crop box - * 'move': move the canvas - * 'none': do nothing - */ + * Define the dragging mode of the cropper. + * 'crop': create a new crop box + * 'move': move the canvas + * 'none': do nothing + */ dragMode?: string; /** - * Set the aspect ratio of the crop box. By default, the crop box is free ratio. - * @default Nan - */ + * Set the aspect ratio of the crop box. By default, the crop box is free ratio. + * @default Nan + */ aspectRatio?: number; /** - * The previous cropped data if you had stored, will be passed to setData method automatically. - * @default null - */ - data?: Object; + * The previous cropped data if you had stored, will be passed to setData method automatically. + * @default null + */ + data?: object; /** - * Add extra elements (containers) for previewing. - * Valid selector for Document.querySelectorAll - * @default '' - */ + * Add extra elements (containers) for previewing. + * Valid selector for Document.querySelectorAll + * @default '' + */ preview?: string; /** - * Rebuild the cropper when resize the window. - * @default true - */ + * Rebuild the cropper when resize the window. + * @default true + */ responsive?: boolean; /** - * By default, the plugin will check the image origin, and if it is a cross-origin image, - * a crossOrigin attribute will be added to the image element and a timestamp will be added to the image url to reload the image for "getCroppedCanvas". - * By adding crossOrigin attribute to image will stop adding timestamp to image url, and stop reload of image. - * @default true - */ + * By default, the plugin will check the image origin, and if it is a cross-origin image, + * a crossOrigin attribute will be added to the image element and a timestamp will be added to the image url to reload the image for "getCroppedCanvas". + * By adding crossOrigin attribute to image will stop adding timestamp to image url, and stop reload of image. + * @default true + */ checkCrossOrigin?: boolean; /** - * Check the current image's Exif Orientation information. - * More exactly, read the Orientation value for rotating or flipping the image, and then override the Orientation - * value with 1 (the default value) to avoid some issues (1, 2) on iOS devices. - * Requires to set both the rotatable and scalable options to true at the same time. - * Note: Don't trust this all the time as some JPG images have incorrect (not standard) Orientation values. - * @default true - */ + * Check the current image's Exif Orientation information. + * More exactly, read the Orientation value for rotating or flipping the image, and then override the Orientation + * value with 1 (the default value) to avoid some issues (1, 2) on iOS devices. + * Requires to set both the rotatable and scalable options to true at the same time. + * Note: Don't trust this all the time as some JPG images have incorrect (not standard) Orientation values. + * @default true + */ checkOrientation?: boolean; /** - * Show the black modal above the image and under the crop box. - * @default true - */ + * Show the black modal above the image and under the crop box. + * @default true + */ modal?: boolean; /** - * Show the dashed lines above the crop box. - * @default true - */ + * Show the dashed lines above the crop box. + * @default true + */ guides?: boolean; /** - * Show the center indicator above the crop box. - * @default true - */ + * Show the center indicator above the crop box. + * @default true + */ center?: boolean; /** - * Show the white modal above the crop box (highlight the crop box). - * @default true - */ + * Show the white modal above the crop box (highlight the crop box). + * @default true + */ highlight?: boolean; /** - * Show the grid background of the container. - * @default true - */ + * Show the grid background of the container. + * @default true + */ background?: boolean; /** - * Enable to crop the image automatically when initialize. - * @default true - */ + * Enable to crop the image automatically when initialize. + * @default true + */ autoCrop?: boolean; /** - * A number between 0 and 1. Define the automatic cropping area size (percentage). - * @default 0.8 (80% of the image) - */ + * A number between 0 and 1. Define the automatic cropping area size (percentage). + * @default 0.8 (80% of the image) + */ autoCropArea?: number; /** - * Enable to move the image. - * @default true - */ + * Enable to move the image. + * @default true + */ movable?: boolean; /** - * Enable to rotate the image. - * @default true - */ + * Enable to rotate the image. + * @default true + */ rotatable?: boolean; /** - * Enable to restore the cropped area after resizing the window. - * @default true - */ + * Enable to restore the cropped area after resizing the window. + * @default true + */ restore?: boolean; /** - * Enable to scale the image. - * @default true - */ + * Enable to scale the image. + * @default true + */ scalable?: boolean; /** - * Enable to zoom the image. - * @default true - */ + * Enable to zoom the image. + * @default true + */ zoomable?: boolean; /** - * Enable to zoom the image by dragging touch. - * @default true - */ + * Enable to zoom the image by dragging touch. + * @default true + */ zoomOnTouch?: boolean; /** - * Enable to zoom the image by wheeling mouse. - * @default true - */ + * Enable to zoom the image by wheeling mouse. + * @default true + */ zoomOnWheel?: boolean; /** - * Define zoom ratio when zoom the image by wheeling mouse. - * @default 0.1 - */ + * Define zoom ratio when zoom the image by wheeling mouse. + * @default 0.1 + */ wheelZoomRatio?: number; /** - * Enable to move the crop box. - * @default true - */ + * Enable to move the crop box. + * @default true + */ cropBoxMovable?: boolean; /** - * Enable to resize the crop box. - * @default true - */ + * Enable to resize the crop box. + * @default true + */ cropBoxResizable?: boolean; /** - * Enable to toggle drag mode between "crop" and "move" when click twice on the cropper. - * @default true - */ + * Enable to toggle drag mode between "crop" and "move" when click twice on the cropper. + * @default true + */ toggleDragModeOnDblclick?: boolean; /** - * The minimum width of the container - * @default 200 - */ + * The minimum width of the container + * @default 200 + */ minContainerWidth?: number; /** - * The minimum height of the container. - * @default 100 - */ + * The minimum height of the container. + * @default 100 + */ minContainerHeight?: number; /** - * The minimum width of the canvas (image wrapper). - * @default 0 - */ + * The minimum width of the canvas (image wrapper). + * @default 0 + */ minCanvasWidth?: number; /** - * The minimum height of the canvas (image wrapper). - * @default 0 - */ + * The minimum height of the canvas (image wrapper). + * @default 0 + */ minCanvasHeight?: number; /** - * The minimum width of the crop box. - * @default 0 - */ + * The minimum width of the crop box. + * @default 0 + */ minCropBoxWidth?: number; /** - * The minimum height of the crop box. - * @default 0 - */ + * The minimum height of the crop box. + * @default 0 + */ minCropBoxHeight?: number; /** - * This function will be called when a cropper instance starts to load an image. - * Return false to prevent to build - * @default null - */ - build?: () => boolean; + * This function will be called when a cropper instance starts to load an image. + * Return false to prevent to build + * @default null + */ + build?(): boolean; /** - * This function will be called when a cropper instance has built completely. - * @default null - */ - built?: () => void; + * This function will be called when a cropper instance has built completely. + * @default null + */ + built?(): void; } interface Data { /** - * the offset left of the cropped area - */ + * the offset left of the cropped area + */ x: number; /** - * the offset top of the cropped area - */ + * the offset top of the cropped area + */ y: number; /** - * the width of the cropped area - */ + * the width of the cropped area + */ width: number; /** - * the height of the cropped area - */ + * the height of the cropped area + */ height: number; /** - * the rotated degrees of the image - */ + * the rotated degrees of the image + */ rotate: number; /** - * the scaling factor to apply on the abscissa of the image - */ + * the scaling factor to apply on the abscissa of the image + */ scaleX: number; /** - * the scaling factor to apply on the ordinate of the image - */ + * the scaling factor to apply on the ordinate of the image + */ scaleY: number; } interface CropStepData { @@ -284,7 +285,7 @@ declare namespace cropperjs { } interface ZoomData { /** - * The original event that was triggered + * The original event that was triggered * Options: wheel, touchmove */ originalEvent: Event; @@ -299,104 +300,108 @@ declare namespace cropperjs { } interface ContainerData { /** - * The current width of the container - */ + * The current width of the container + */ width: number; /** - * The current height of the container - */ + * The current height of the container + */ height: number; } interface CropBoxData { /** - * the offset left of the crop box - */ - left: number; + * the offset left of the crop box + */ + left?: number; /** - * the offset top of the crop box - */ - top: number; + * the offset top of the crop box + */ + top?: number; /** - * the width of the crop box - */ - width: number; + * the width of the crop box + */ + width?: number; /** - * the height of the crop box - */ - height: number; + * the height of the crop box + */ + height?: number; } interface CanvasData { /** - * offset left of the canvas - */ + * offset left of the canvas + */ left: number; /** - * new offset top of the canvas - */ + * new offset top of the canvas + */ top: number; /** - * new width of the canvas - */ + * new width of the canvas + */ width: number; /** - * new height of the canvas - */ + * new height of the canvas + */ height: number; } interface ImageData { /** - * the offset left of the image - */ + * the offset left of the image + */ left: number; /** - * the offset top of the image - */ + * the offset top of the image + */ top: number; /** - * the width of the image - */ + * the width of the image + */ width: number; /** - * the height of the image - */ + * the height of the image + */ height: number; /** - * the natural width of the image - */ + * the natural width of the image + */ naturalWidth: number; /** - * the natural height of the image - */ + * the natural height of the image + */ naturalHeight: number; /** - * the aspect ratio of the image - */ + * the aspect ratio of the image + */ aspectRatio: number; /** - * the rotated degrees of the image if rotated - */ + * the rotated degrees of the image if rotated + */ rotate: number; /** - * the scaling factor to apply on the abscissa of the image if scaled - */ + * the scaling factor to apply on the abscissa of the image if scaled + */ scaleX: number; /** - * the scaling factor to apply on the ordinate of the image if scaled - */ + * the scaling factor to apply on the ordinate of the image if scaled + */ scaleY: number; } interface CroppedCanvasOptions { /** - * the destination width of the output canvas - */ + * the destination width of the output canvas + */ width?: number; + minWidth?: number; + maxWidth?: number; /** - * the destination height of the output canvas - */ + * the destination height of the output canvas + */ height?: number; + minHeight?: number; + maxHeight?: number; /** - * a color to fill any alpha values in the output canvas - */ + * a color to fill any alpha values in the output canvas + */ fillColor?: string; } } @@ -409,144 +414,143 @@ declare class cropperjs { crop(): void; /** - * Clear the crop box. - */ + * Clear the crop box. + */ reset(): void; /** - * Replace the image's src and rebuild the cropper. - * @param url A new image url - */ + * Replace the image's src and rebuild the cropper. + * @param url A new image url + */ replace(url: string): void; /** - * Enable (unfreeze) the cropper. - */ + * Enable (unfreeze) the cropper. + */ enable(): void; /** - * Disable (freeze) the cropper - */ + * Disable (freeze) the cropper + */ disable(): void; /** - * Destroy the cropper and remove the instance from the image. - */ + * Destroy the cropper and remove the instance from the image. + */ destroy(): void; /** - * Move the canvas (image wrapper) with relative offsets. - * @param offsetX Moving size (px) in the horizontal direction. - * @param offsetY Moving size (px) in the vertical direction. - * If not present, its default value is offsetX. - */ + * Move the canvas (image wrapper) with relative offsets. + * @param offsetX Moving size (px) in the horizontal direction. + * @param offsetY Moving size (px) in the vertical direction. + * If not present, its default value is offsetX. + */ move(offsetX: number, offsetY?: number): void; /** - * Move the canvas (image wrapper) to an absolute point. - * @param x The left value of the canvas - * @param y The top value of the canvas - * If not present, its default value is x. - */ + * Move the canvas (image wrapper) to an absolute point. + * @param x The left value of the canvas + * @param y The top value of the canvas + * If not present, its default value is x. + */ moveTo(x: number, y?: number): void; /** - * Zoom the canvas (image wrapper) with a relative ratio. - * Zoom in: requires a positive number (ratio > 0) - * Zoom out: requires a negative number (ratio < 0) - */ + * Zoom the canvas (image wrapper) with a relative ratio. + * Zoom in: requires a positive number (ratio > 0) + * Zoom out: requires a negative number (ratio < 0) + */ zoom(ratio: number): void; /** - * Zoom the canvas (image wrapper) to an absolute ratio. - * Zoom in: requires a positive number (ratio > 0) - * Zoom out: requires a negative number (ratio < 0) - */ + * Zoom the canvas (image wrapper) to an absolute ratio. + * Zoom in: requires a positive number (ratio > 0) + * Zoom out: requires a negative number (ratio < 0) + */ zoomTo(ratio: number): void; /** - * Rotate the canvas (image wrapper) with a relative degree. - * Rotate right: requires a positive number (degree > 0) - * Rotate left: requires a negative number (degree < 0) - */ + * Rotate the canvas (image wrapper) with a relative degree. + * Rotate right: requires a positive number (degree > 0) + * Rotate left: requires a negative number (degree < 0) + */ rotate(degree: number): void; /** - * Rotate the canvas (image wrapper) to an absolute degree. - * Rotate right: requires a positive number (degree > 0) - * Rotate left: requires a negative number (degree < 0) - */ + * Rotate the canvas (image wrapper) to an absolute degree. + * Rotate right: requires a positive number (degree > 0) + * Rotate left: requires a negative number (degree < 0) + */ rotateTo(degree: number): void; /** - * Clear the crop box. - */ + * Clear the crop box. + */ clear(): void; /** - * Output the cropped area position and size data (base on the original image). - */ + * Output the cropped area position and size data (base on the original image). + */ getData(rounded?: boolean): cropperjs.Data; /** - * Change the cropped area position and size with new data (base on the original image). - */ + * Change the cropped area position and size with new data (base on the original image). + */ setData(data: cropperjs.Data): void; /** - * Output the container size data. - */ + * Output the container size data. + */ getContainerData(): cropperjs.ContainerData; /** - * Output the image position, size and other related data. - */ + * Output the image position, size and other related data. + */ getImageData(): cropperjs.ImageData; /** - * Output the canvas (image wrapper) position and size data. - */ + * Output the canvas (image wrapper) position and size data. + */ getCanvasData(): cropperjs.CanvasData & { /** - * the natural width of the canvas (read only) - */ + * the natural width of the canvas (read only) + */ naturalWidth: number; /** - * the natural height of the canvas (read only) - */ + * the natural height of the canvas (read only) + */ naturalHeight: number; }; /** - * Change the canvas (image wrapper) position and size with new data. - */ + * Change the canvas (image wrapper) position and size with new data. + */ setCanvasData(data: cropperjs.CanvasData): void; /** - * Output the crop box position and size data. - */ + * Output the crop box position and size data. + */ getCropBoxData(): cropperjs.CropBoxData; /** - * Change the crop box position and size with new data. - */ + * Change the crop box position and size with new data. + */ setCropBoxData(data: cropperjs.CropBoxData): void; /** - * Get a canvas drawn the cropped image. - */ + * Get a canvas drawn the cropped image. + */ getCroppedCanvas(options?: cropperjs.CroppedCanvasOptions): HTMLCanvasElement; /** - * Change the aspect ratio of the crop box. - */ + * Change the aspect ratio of the crop box. + */ setAspectRatio(aspectRatio: number): void; /** - * Change the drag mode. - */ + * Change the drag mode. + */ setDragMode(mode?: 'none' | 'crop' | 'move'): void; - } export = cropperjs; diff --git a/types/cropperjs/tslint.json b/types/cropperjs/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cropperjs/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/croppie/index.d.ts b/types/croppie/index.d.ts index 78ab07ad61..e2e207db4c 100644 --- a/types/croppie/index.d.ts +++ b/types/croppie/index.d.ts @@ -1,6 +1,8 @@ -// Type definitions for croppie 2.4 +// Type definitions for croppie 2.5 // Project: https://github.com/Foliotek/Croppie // Definitions by: Connor Peet +// dklmuc +// Sarun Intaralawan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export default class Croppie { @@ -14,10 +16,10 @@ export default class Croppie { useCanvas?: boolean, }): Promise; - result(options: ResultOptions & { type: 'base64' }): Promise; + result(options: ResultOptions & { type: 'base64' | 'canvas' }): Promise; result(options: ResultOptions & { type: 'html' }): Promise; result(options: ResultOptions & { type: 'blob' }): Promise; - result(options: ResultOptions & { type: 'canvas' }): Promise; + result(options: ResultOptions & { type: 'rawcanvas' }): Promise; result(options?: ResultOptions): Promise; rotate(degrees: 90 | 180 | 270 | -90 | -180 | -270): void; @@ -31,7 +33,10 @@ export type CropType = 'square' | 'circle'; export type Format = 'jpeg' | 'png' | 'webp'; +export type Type = 'canvas' | 'base64' | 'html' | 'blob' | 'rawcanvas'; + export interface ResultOptions { + type?: Type; size?: 'viewport' | 'original' | { width: number, height: number }; format?: Format; quality?: number; diff --git a/types/cross-storage/tslint.json b/types/cross-storage/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cross-storage/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/crossfilter/crossfilter-tests.ts b/types/crossfilter/crossfilter-tests.ts index 813ddae2b9..5d9981b6d1 100644 --- a/types/crossfilter/crossfilter-tests.ts +++ b/types/crossfilter/crossfilter-tests.ts @@ -118,10 +118,10 @@ var types = paymentCountByType.all(); paymentsByTotal.dispose(); crossfilter.bisect([], null, 0, 0); -var bisectBy = crossfilter.bisect.by(t => t); -bisectBy([], null, 0, 0); -bisectBy.left([], null, 0, 0); -bisectBy.right([], null, 0, 0); +var bisectBy = crossfilter.bisect.by<{value: string}, string>(t => t.value); +bisectBy([{value: 'a'}, {value: 'b'}], 'c', 0, 0); // 2 +bisectBy.left([], 'string', 0, 0); // 0 +bisectBy.right([], 'string', 0, 0); // 0 crossfilter.heap([], 0, 0); var heapBy = crossfilter.heap.by(t => t); diff --git a/types/crossfilter/index.d.ts b/types/crossfilter/index.d.ts index ed888f6959..a009e920dd 100644 --- a/types/crossfilter/index.d.ts +++ b/types/crossfilter/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for CrossFilter // Project: https://github.com/square/crossfilter -// Definitions by: Schmulik Raskin , Izaak Baker +// Definitions by: Schmulik Raskin , Izaak Baker , Einar Norðfjörð // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace CrossFilter { @@ -15,7 +15,7 @@ declare namespace CrossFilter { permute(array: T[], index: number[]): T[]; bisect: { (array: T[], value: T, lo: number, hi: number): number; - by(value: Selector): Bisector; + by(accessor: (x: T)=> U): Bisector; } heap: { (array: T[], lo: number, hi: number): T[]; @@ -36,13 +36,13 @@ declare namespace CrossFilter { } } - export interface Bisection { - (array: T[], value: T, lo: number, hi: number): number; + export interface Bisection { + (array: T[], value: U, lo: number, hi: number): number; } - export interface Bisector extends Bisection { - left: Bisection - right: Bisection + export interface Bisector extends Bisection { + left: Bisection + right: Bisection } export interface Heap { diff --git a/types/crossfilter/tslint.json b/types/crossfilter/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/crossfilter/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/crossroads/index.d.ts b/types/crossroads/index.d.ts index 42a631599e..ef93fe86a5 100644 --- a/types/crossroads/index.d.ts +++ b/types/crossroads/index.d.ts @@ -2,6 +2,7 @@ // Project: http://millermedeiros.github.io/crossroads.js/ // Definitions by: Diullei Gomes // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/crossroads/tslint.json b/types/crossroads/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/crossroads/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/crypto-js/index.d.ts b/types/crypto-js/index.d.ts index 4e35dfbdfb..c3dad4637b 100644 --- a/types/crypto-js/index.d.ts +++ b/types/crypto-js/index.d.ts @@ -10,8 +10,8 @@ declare var CryptoJS: CryptoJS.Hashes; declare namespace CryptoJS { type Hash = (message: string | LibWordArray, key?: string, ...options: any[]) => WordArray; interface Cipher { - encrypt(message: string, secretPassphrase: string, option?: CipherOption): WordArray; - decrypt(encryptedMessage: string | WordArray, secretPassphrase: string, option?: CipherOption): DecryptedMessage; + encrypt(message: string, secretPassphrase: string | WordArray, option?: CipherOption): WordArray; + decrypt(encryptedMessage: string | WordArray, secretPassphrase: string | WordArray, option?: CipherOption): DecryptedMessage; } interface CipherAlgorythm { createEncryptor(secretPassphrase: string, option?: CipherOption): Encriptor; diff --git a/types/crypto-js/tslint.json b/types/crypto-js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/crypto-js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cryptojs/tslint.json b/types/cryptojs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cryptojs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cson/cson-tests.ts b/types/cson/cson-tests.ts index e5bdc67069..8d196e33c7 100644 --- a/types/cson/cson-tests.ts +++ b/types/cson/cson-tests.ts @@ -13,7 +13,7 @@ console.log('cson.createJSONString => %s', data); data = cson.createCSONString({hello: 'world'}); console.log('cson.createCSONString => %s', data); -var obj: Object = cson.parse(data); +var obj = cson.parse(data); console.log('cson.parse => %s', JSON.stringify(obj)); obj = cson.parseCSONString(data); diff --git a/types/cson/index.d.ts b/types/cson/index.d.ts index 72b985a82d..3366283721 100644 --- a/types/cson/index.d.ts +++ b/types/cson/index.d.ts @@ -5,27 +5,27 @@ // Create Strings -export declare function stringify(data: Object, opts?: Object, indent?: any): string; -export declare function createCSONString(data: Object, opts?: Object, next?: any): string; -export declare function createJSONString(data: Object, opts?: Object, next?: any): string; -export declare function createString(data: Object, opts?: Object, next?: any): string; +export declare function stringify(data: any, opts?: Object, indent?: any): string; +export declare function createCSONString(data: any, opts?: Object, next?: any): string; +export declare function createJSONString(data: any, opts?: Object, next?: any): string; +export declare function createString(data: any, opts?: Object, next?: any): string; // Parse Strings -export declare function parse(data: string, opts?: Object, next?: any): Object; -export declare function parseCSONString(data: string, opts?: Object, next?: any): Object; -export declare function parseJSONString(data: string, opts?: Object, next?: any): Object; -export declare function parseCSString(data: string, opts?: Object, next?: any): Object; -export declare function parseJSString(data: string, opts?: Object, next?: any): Object; -export declare function parseString(data: string, opts?: Object, next?: any): Object; +export declare function parse(data: string, opts?: Object, next?: any): any; +export declare function parseCSONString(data: string, opts?: Object, next?: any): any; +export declare function parseJSONString(data: string, opts?: Object, next?: any): any; +export declare function parseCSString(data: string, opts?: Object, next?: any): any; +export declare function parseJSString(data: string, opts?: Object, next?: any): any; +export declare function parseString(data: string, opts?: Object, next?: any): any; // Parse Files -export declare function load(filePath: string, opts?: Object, next?: any): Object; -export declare function parseCSONFile(filePath: string, opts?: Object, next?: any): Object; -export declare function parseJSONFile(filePath: string, opts?: Object, next?: any): Object; -export declare function parseCSFile(filePath: string, opts?: Object, next?: any): Object; -export declare function parseJSFile(filePath: string, opts?: Object, next?: any): Object; +export declare function load(filePath: string, opts?: Object, next?: any): any; +export declare function parseCSONFile(filePath: string, opts?: Object, next?: any): any; +export declare function parseJSONFile(filePath: string, opts?: Object, next?: any): any; +export declare function parseCSFile(filePath: string, opts?: Object, next?: any): any; +export declare function parseJSFile(filePath: string, opts?: Object, next?: any): any; // Require Files -export declare function requireCSFile(filePath: string, opts?: Object, next?: any): Object; -export declare function requireJSFile(filePath: string, opts?: Object, next?: any): Object; -export declare function requireFile(filePath: string, opts?: Object, next?: any): Object; +export declare function requireCSFile(filePath: string, opts?: Object, next?: any): any; +export declare function requireJSFile(filePath: string, opts?: Object, next?: any): any; +export declare function requireFile(filePath: string, opts?: Object, next?: any): any; diff --git a/types/cson/tslint.json b/types/cson/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cson/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/csrf/index.d.ts b/types/csrf/index.d.ts index df1e455eb8..d6c3b69006 100644 --- a/types/csrf/index.d.ts +++ b/types/csrf/index.d.ts @@ -17,44 +17,27 @@ interface TokensOptions { } declare class Tokens { - /** - * Token generation/verification class. - * - * @param {object} [options] - * @param {number} [options.saltLength=8] The string length of the salt - * @param {number} [options.secretLength=18] The byte length of the secret key - * @public - */ + /** Token generation/verification class. */ constructor(options?: TokensOptions) /** * Create a new CSRF token. * - * @param {string} secret The secret for the token. - * @public + * @param secret The secret for the token. */ create(secret: string): string; - /** - * Create a new secret key. - * - * @param {function} [callback] - * @public - */ + /** Create a new secret key. */ secret(callback?: SecretCallback): Promise; /** * Create a new secret key synchronously. - * @public */ secretSync(): string; /** * Verify if a given token is valid for a given secret. * - * @param {string} secret - * @param {string} token - * @public */ verify(secret: string, token: string): boolean; } diff --git a/types/css-modules-require-hook/tslint.json b/types/css-modules-require-hook/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/css-modules-require-hook/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/css/tslint.json b/types/css/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/css/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cssbeautify/tslint.json b/types/cssbeautify/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cssbeautify/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/csurf/index.d.ts b/types/csurf/index.d.ts index 362b4c6e8e..2a626d227b 100644 --- a/types/csurf/index.d.ts +++ b/types/csurf/index.d.ts @@ -2,6 +2,7 @@ // Project: https://www.npmjs.org/package/csurf // Definitions by: Hiroki Horiuchi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/csurf/tslint.json b/types/csurf/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/csurf/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/csvrow/csvrow-tests.ts b/types/csvrow/csvrow-tests.ts new file mode 100644 index 0000000000..133eab5937 --- /dev/null +++ b/types/csvrow/csvrow-tests.ts @@ -0,0 +1,10 @@ +import csvrow = require("csvrow"); + +let row = "a,b,c"; +let columns: string[]; + +columns = csvrow.parse(row); + +row = csvrow.stringify(columns); + +row = csvrow.normalize(row); diff --git a/types/csvrow/index.d.ts b/types/csvrow/index.d.ts new file mode 100644 index 0000000000..53df54a249 --- /dev/null +++ b/types/csvrow/index.d.ts @@ -0,0 +1,29 @@ +// Type definitions for csvrow 0.1 +// Project: https://github.com/trentm/node-csvrow +// Definitions by: Peter Harris +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Parse a CSV row (i.e. a single row) into an array of strings. + * + * c.f. http://en.wikipedia.org/wiki/Comma-separated_values + * + * Limitations/Opinions: + * - don't support elements with line-breaks + * - leading a trailing spaces are trimmed, unless the entry is quoted + * + * @throws {TypeError} if the given CSV row is invalid + * + * @summary Parse a CSV row into an array of strings. + */ +export function parse(row: string): string[]; + +/** + * Serialize the given array to a CSV row. + */ +export function stringify(columns: string[]): string; + +/** + * Normalize the given CSV line. + */ +export function normalize(row: string): string; diff --git a/types/csvrow/tsconfig.json b/types/csvrow/tsconfig.json new file mode 100644 index 0000000000..7fc1637725 --- /dev/null +++ b/types/csvrow/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", + "csvrow-tests.ts" + ] +} diff --git a/types/csvrow/tslint.json b/types/csvrow/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/csvrow/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/csvtojson/index.d.ts b/types/csvtojson/index.d.ts index 832a4acb6a..6d77c48c4f 100644 --- a/types/csvtojson/index.d.ts +++ b/types/csvtojson/index.d.ts @@ -179,50 +179,50 @@ declare namespace csvtojson { class Converter extends stream.Transform { /** * Initializes a new instance of a Converter - * @param {ConverterOptions} options converter options - * @param {StreamOptions} streamOptions stream options + * @param options converter options + * @param streamOptions stream options */ constructor(options?: ConverterOptions, streamOptions?: StreamOptions); /** * Reads in a CSV from a string. - * @param {string} str the string to convert - * @return {Converter} returns this object for chaining + * @param str the string to convert + * @return returns this object for chaining */ fromString(str: string): this; /** * Reads in a CSV from a string. - * @param {string} str the string to convert - * @param {ParseResultHandler} callback callback function to handle result or error + * @param str the string to convert + * @param callback callback function to handle result or error */ fromString(str: string, callback: ParseResultHandler): void; /** * Reads in a CSV from a file. - * @param {string} filePath the path to the CSV file - * @return {Converter} returns this object for chaining + * @param filePath the path to the CSV file + * @return returns this object for chaining */ fromFile(filePath: string): this; /** * Reads in a CSV from a file. - * @param {string} filePath the path to the CSV file - * @param {ParseResultHandler} callback callback function to handle result or error + * @param filePath the path to the CSV file + * @param callback callback function to handle result or error */ fromFile(filePath: string, callback: ParseResultHandler): void; /** * Reads in a CSV from a stream. - * @param {Stream} stream the stream - * @return {Converter} returns this object for chaining + * @param stream the stream + * @return returns this object for chaining */ fromStream(stream: NodeJS.ReadableStream): this; /** * Reads in a CSV from a stream. - * @param {Stream} stream the stream - * @param {ParseResultHandler} callback callback function to handle result or error + * @param stream the stream + * @param callback callback function to handle result or error */ fromStream(stream: stream.Stream, callback: ParseResultHandler): void; @@ -237,9 +237,9 @@ declare namespace csvtojson { * - end * - end_parsed * - done - * @param {Event} event name of event - * @param {Function} listener listener function - * @return {this} returns this object for chaining + * @param event name of event + * @param listener listener function + * @return returns this object for chaining */ // tslint:disable-next-line ban-types on(event: string, listener: Function | JsonEventHandler | CsvEventHandler | DataEventHandler | ErrorEventHandler @@ -247,22 +247,22 @@ declare namespace csvtojson { /** * Transform objects after CSV parsing but before result being emitted or pushed downstream. - * @param {Function} callback transform function - * @return {this} returns this object for chaining + * @param callback transform function + * @return returns this object for chaining */ transf(callback: (jsonObj: any, csvRow: string[], rowNumber: number) => void): this; /** * The function in preRawData will be called directly with the string from upper stream. - * @param {Function} callback callback function - * @return {this} returns this object for chaining + * @param callback callback function + * @return returns this object for chaining */ preRawData(callback: (csvRawData: string, cb: (newData: any) => void) => void): this; /** * The function is called each time a file line being found in csv stream. - * @param {Function} callback callback function - * @return {this} returns this object for chaining + * @param callback callback function + * @return returns this object for chaining */ preFileLine(callback: (line: string, rowNumber: number) => string): this; } @@ -270,9 +270,9 @@ declare namespace csvtojson { /** * Factory function which creates an instance of a Converter object. - * @param {ConverterOptions} options converter options - * @param {StreamOptions} streamOptions stream options - * @return {csvtojson.Converter} Converter object + * @param options converter options + * @param streamOptions stream options + * @return Converter object */ declare function csvtojson(options?: csvtojson.ConverterOptions, streamOptions?: csvtojson.StreamOptions): csvtojson.Converter; diff --git a/types/cuid/tslint.json b/types/cuid/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cuid/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/currency-formatter/currency-formatter-tests.ts b/types/currency-formatter/currency-formatter-tests.ts index f06f53ce05..83617a6404 100644 --- a/types/currency-formatter/currency-formatter-tests.ts +++ b/types/currency-formatter/currency-formatter-tests.ts @@ -3,12 +3,21 @@ import currencyFormatter = require('currency-formatter'); currencyFormatter.format(1000000, { code: 'USD' }); // => '$1,000,000.00' +currencyFormatter.unformat('$1,000,000.00', { code: 'USD' }); +// => 1000000 + currencyFormatter.format(1000000, { code: 'GBP' }); // => '£1,000,000.00' +currencyFormatter.unformat('£1,000,000.00', { code: 'GBP' }); +// => 1000000 + currencyFormatter.format(1000000, { code: 'EUR' }); // => '1 000 000,00 €' +currencyFormatter.unformat('1 000 000,00 €', { code: 'EUR' }); +// => 1000000 + currencyFormatter.findCurrency('USD'); // returns: // { diff --git a/types/currency-formatter/index.d.ts b/types/currency-formatter/index.d.ts index 67591738ab..d88f18ea7c 100644 --- a/types/currency-formatter/index.d.ts +++ b/types/currency-formatter/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for currency-formatter 1.0 +// Type definitions for currency-formatter 1.3 // Project: https://github.com/smirzaei/currency-formatter#readme // Definitions by: Mohamed Hegazy +// David Paz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export interface Currency { @@ -18,6 +19,7 @@ export const defaultCurrency: Currency; export function findCurrency(currencyCode: string): Currency; export function format(value: number, options: { code?: string, + locale?: string, symbol?: string, decimal?: string, thousand?: string, @@ -28,3 +30,17 @@ export function format(value: number, options: { zero: string } }): string; + +export function unformat(value: string, options: { + code?: string, + locale?: string, + symbol?: string, + decimal?: string, + thousand?: string, + precision?: number, + format?: string | { + pos: string, + neg: string, + zero: string + } +}): number; diff --git a/types/custom-error-generator/tslint.json b/types/custom-error-generator/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/custom-error-generator/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cybozulabs-md5/tslint.json b/types/cybozulabs-md5/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/cybozulabs-md5/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/cypress/cypress-tests.ts b/types/cypress/cypress-tests.ts index ac987e757a..806443474a 100644 --- a/types/cypress/cypress-tests.ts +++ b/types/cypress/cypress-tests.ts @@ -15,7 +15,8 @@ cy cy .get('form') .find('input') - .then($input => $input.click()); + .then($input => $input.click()) + .then($input => $input.click(), {timeout: 12}); cy .wrap({ sum: (a: number, b: number, c: number) => a + b + c }) diff --git a/types/cypress/index.d.ts b/types/cypress/index.d.ts index e7f2a59447..808c765e24 100644 --- a/types/cypress/index.d.ts +++ b/types/cypress/index.d.ts @@ -369,7 +369,7 @@ declare namespace Cypress { /** * @see https://on.cypress.io/api/then */ - then(fn: (currentSubject: any) => any): Chainable; + then(fn: (currentSubject: any) => any, options?: Timeoutable): Chainable; /** * @see https://on.cypress.io/api/title diff --git a/types/cytoscape/cytoscape-tests.ts b/types/cytoscape/cytoscape-tests.ts new file mode 100644 index 0000000000..0b7bac436e --- /dev/null +++ b/types/cytoscape/cytoscape-tests.ts @@ -0,0 +1,82 @@ +'use strict'; +import cytoscape = require('cytoscape'); + +const parentCSS = { + 'padding-top': '10px', + 'padding-left': '10px', + 'padding-bottom': '10px', + 'padding-right': '10px', + 'text-valign': 'top', + 'text-halign': 'center', + 'background-color': '#CCC', + 'font-size': 40, + 'min-zoomed-font-size': 15 +}; + +const showAllStyle: cytoscape.Stylesheet[] = [ + { + selector: 'node', + css: { + content: 'data(id)', + 'text-valign': 'center', + 'text-halign': 'center', + shape: 'rectangle', + 'min-zoomed-font-size': 20, + opacity: 1 + } + }, + { + selector: '$node > node', + css: parentCSS + }, + { + selector: 'edge', + css: { + 'target-arrow-shape': 'triangle' + } + }, + { + selector: ':selected', + css: { + 'background-color': 'black', + 'line-color': 'black', + 'target-arrow-color': 'black', + 'source-arrow-color': 'black' + } + } +]; + +const cy = cytoscape({ + container: document.getElementById('cy'), + + boxSelectionEnabled: false, + autounselectify: true, + + style: showAllStyle, + + elements: { + nodes: [ + { data: { id: 'a', parent: 'b' }, position: { x: 215, y: 85 } }, + { data: { id: 'b' } }, + { data: { id: 'c', parent: 'b' }, position: { x: 300, y: 85 } }, + { data: { id: 'd' }, position: { x: 215, y: 175 } }, + { data: { id: 'e' } }, + { data: { id: 'f', parent: 'e' }, position: { x: 300, y: 175 } } + ], + edges: [ + { data: { id: 'ad', source: 'a', target: 'd' } }, + { data: { id: 'eb', source: 'e', target: 'b' } } + ] + }, + + layout: { + name: 'preset', + padding: 5 + } +}); + +cy.on('zoom', (event) => { + if (cy.zoom() <= 1) { + cy.nodes('$node > node').style('opacity', 0); + } +}); diff --git a/types/cytoscape/index.d.ts b/types/cytoscape/index.d.ts new file mode 100644 index 0000000000..85b3a97e46 --- /dev/null +++ b/types/cytoscape/index.d.ts @@ -0,0 +1,4530 @@ +// Type definitions for Cytoscape.js 3.1 +// Project: http://js.cytoscape.org/ +// Definitions by: Fabian Schmidt and Fred Eisele +// Shenghan Gao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// +// Translation from Objects in help to Typescript interface. +// http://js.cytoscape.org/#notation/functions +// + +/** + * cy --> Cy.Core + * the core + * + * eles --> Cy.Collection + * a collection of one or more elements (nodes and edges) + * + * ele --> Cy.Singular + * a collection of a single element (node or edge) + * + * node --> Cy.NodeSingular + * a collection of a single node + * + * nodes -> Cy.NodeCollection + * a collection of one or more nodes + * + * edge --> Cy.EdgeSingular + * a collection of a single edge + * + * edges -> Cy.EdgeCollection + * a collection of one or more edges + * + * The library makes a distinction between input and output parameters + * due to the dynamic behaviour of the Cytoscape library. + * + * For a input parameter it will always expect: + * - Cy.Collection + * The input can be any element (node and edge) collection. + * - Cy.NodeCollection + * The input must be a node collection. + * - Cy.EdgeCollection + * The input must be a edge collection. + * - Cy.Singular + * The input must be a single element. + * - Cy.NodeSingular + * The inut must be a single node. + * - Cy.EdgeSingular + * The input must be a single edge. + * + * For a output of a function it will always give: + * - Cy.CollectionElements + * The output is a collection of node and edge elements OR single element. + * - Cy.EdgeCollection + * The output is a collection of edge elements OR single edge. + * - Cy.NodeCollection + * The output is a collection of node elements OR single node. + * + * A number of interfaces contain nothing as they server to collect interfaces. + * + */ +export = cytoscape; +export as namespace cytoscape; + +declare function cytoscape(options?: cytoscape.CytoscapeOptions): cytoscape.Core; +declare function cytoscape(extensionName: string, foo: string, bar: any): cytoscape.Core; + +declare namespace cytoscape { + interface Position { + x: number; + y: number; + } + + type CssStyleDeclaration = any; + + interface ElementDefinition { + group?: ElementGroup; + data: NodeDataDefinition | EdgeDataDefinition; + /** + * Scratchpad data (usually temp or nonserialisable data) + */ + scatch?: Scratchpad; + /** + * The model position of the node (optional on init, mandatory after) + */ + position?: Position; + /** + * can alternatively specify position in rendered on-screen pixels + */ + renderedPosition?: Position; + /** + * Whether the element is selected (default false) + */ + selected?: boolean; + /** + * Whether the selection state is mutable (default true) + */ + selectable?: boolean; + /** + * When locked a node's position is immutable (default false) + */ + locked?: boolean; + /** + * Wether the node can be grabbed and moved by the user + */ + grabbable?: boolean; + /** + * a space separated list of class names that the element has + */ + classes?: string; + /** + * CssStyleDeclaration; + */ + style?: CssStyleDeclaration; + /** + * you should only use `style`/`css` for very special cases; use classes instead + */ + css?: Css.Node | Css.Edge; + } + + interface ElementDataDefinition { + /** + * elided id => autogenerated id + */ + id?: string; + position?: Position; + } + + interface EdgeDefinition extends ElementDefinition { + data: EdgeDataDefinition; + } + + interface EdgeDataDefinition extends ElementDataDefinition { + /** + * the source node id (edge comes from this node) + */ + source: string; + /** + * the target node id (edge goes to this node) + */ + target: string; + } + + interface NodeDefinition extends ElementDefinition { + data: NodeDataDefinition; + } + + interface NodeDataDefinition extends ElementDataDefinition { + parent?: string; + } + + interface CytoscapeOptions { + /////////////////////////////////////// + // very commonly used options: + /** + * A HTML DOM element in which the graph should be rendered. + * This is optional if Cytoscape.js is run headlessly or if you initialise using jQuery (in which case your jQuery object already has an associated DOM element). + * + * The default is undefined. + */ + container?: HTMLElement | null; + + /** + * An array of [[Elements]] specified as plain objects. For convenience, this option can alternatively be specified as a promise that resolves to the elements JSON. + */ + elements?: ElementsDefinition | ElementDefinition[] | Promise | Promise; + /** + * The [[Stylesheet]] used to style the graph. For convenience, this option can alternatively be specified as a promise that resolves to the stylesheet. + */ + style?: Stylesheet[] | Promise; + /** + * A plain object that specifies layout options. + * Which layout is initially run is specified by the name field. + * Refer to a layout's documentation for the options it supports. + * If you want to specify your node positions yourself in your elements JSON, + * you can use the preset layout — by default it does not set any positions, + * leaving your nodes in their current positions + * (e.g. specified in options.elements at initialisation time) + */ + layout?: NullLayoutOptions | RandomLayoutOptions | PresetLayoutOptions | + GridLayoutOptions | CircleLayoutOptions | ConcentricLayoutOptions | + BreadthFirstLayoutOptions | CoseLayoutOptions | BaseLayoutOptions; + + /////////////////////////////////////// + // initial viewport state: + /** + * The initial zoom level of the graph. + * Make sure to disable viewport manipulation options, such as fit, in your layout so that it is not overridden when the layout is applied. + * You can set options.minZoom and options.maxZoom to set restrictions on the zoom level. + * + * The default value is 1. + */ + zoom?: number; + /** + * The initial panning position of the graph. Make sure to disable viewport manipulation options, such as fit, + * in your layout so that it is not overridden when the layout is applied. + */ + pan?: Position; + + /////////////////////////////////////// + // interaction options?: + /** + * A minimum bound on the zoom level of the graph. The viewport can not be scaled smaller than this zoom level. + * + * The default value is 1e-50. + */ + minZoom?: number; + /** + * A maximum bound on the zoom level of the graph. The viewport can not be scaled larger than this zoom level. + * + * The default value is 1e50. + */ + maxZoom?: number; + /** + * Whether zooming the graph is enabled, both by user events and programmatically. + * + * The default value is true. + */ + zoomingEnabled?: boolean; + /** + * Whether user events (e.g. mouse wheel, pinch-to-zoom) are allowed to zoom the graph. Programmatic changes to zoom are unaffected by this option. + * + * The default value is true. + */ + userZoomingEnabled?: boolean; + /** + * Whether panning the graph is enabled, both by user events and programmatically. + * + * The default value is true. + */ + panningEnabled?: boolean; + /** + * Whether user events (e.g. dragging the graph background) are allowed to pan the graph. Programmatic changes to pan are unaffected by this option. + * + * The default value is true. + */ + userPanningEnabled?: boolean; + /** + * Whether box selection (i.e. drag a box overlay around, and release it to select) is enabled. If enabled, the user must taphold to pan the graph. + * + * The default value is false. + */ + boxSelectionEnabled?: boolean; + /** + * A string indicating the selection behaviour from user input. + * By default, this is set automatically for you based on the type of input device detected. + * On touch devices, 'additive' is default — a new selection made by the user adds to the set of currenly selected elements. + * On mouse-input devices, 'single' is default — a new selection made by the user becomes the entire set of currently selected elements (i.e. the previous elements are unselected). + * + * The default value is (isTouchDevice ? 'additive' : 'single'). + */ + selectionType?: SelectionType; + /** + * A nonnegative integer that indicates the maximum allowable distance that a user may move during a tap gesture, + * on touch devices and desktop devices respectively. + * + * This makes tapping easier for users. + * These values have sane defaults, so it is not advised to change these options unless you have very good reason for doing so. + * Larger values will almost certainly have undesirable consequences. + * + * The default value is is 8. + */ + touchTapThreshold?: number; + /** + * A nonnegative integer that indicates the maximum allowable distance that a user may move during a tap gesture, + * on touch devices and desktop devices respectively. + * + * This makes tapping easier for users. + * These values have sane defaults, + * so it is not advised to change these options unless you have very good reason for doing so. + * Larger values will almost certainly have undesirable consequences. + * + * The default value is 4. + */ + desktopTapThreshold?: number; + /** + * Whether nodes should be locked (not draggable at all) by default (if true, overrides individual node state). + * + * The default value is false. + */ + autolock?: boolean; + /** + * Whether nodes should be ungrabified (not grabbable by user) by default (if true, overrides individual node state). + * + * The default value is false. + */ + autoungrabify?: boolean; + /** + * Whether nodes should be unselectified (immutable selection state) by default (if true, overrides individual element state). + * + * The default value is false. + */ + autounselectify?: boolean; + + /////////////////////////////////////// + // rendering options: + /** + * A convenience option that initialises the Core to run headlessly. + * You do not need to set this in environments that are implicitly headless (e.g. Node.js). + * However, it is handy to set headless: true if you want a headless Core in a browser. + * + * The default value is false. + */ + headless?: boolean; + /** + * A boolean that indicates whether styling should be used. + * For headless (i.e. outside the browser) environments, + * display is not necessary and so neither is styling necessary — thereby speeding up your code. + * You can manually enable styling in headless environments if you require it for a special case. + * Note that it does not make sense to disable style if you plan on rendering the graph. + * + * The default value is true. + */ + styleEnabled?: boolean; + /** + * When set to true, the renderer does not render edges while the viewport is being manipulated. + * This makes panning, zooming, dragging, et cetera more responsive for large graphs. + * + * The default value is false. + */ + hideEdgesOnViewport?: boolean; + /** + * when set to true, the renderer does not render labels while the viewport is being manipulated. + * This makes panning, zooming, dragging, et cetera more responsive for large graphs. + * + * The default value is false. + */ + hideLabelsOnViewport?: boolean; + /** + * When set to true, the renderer uses a texture (if supported) during panning and zooming instead of drawing the elements, + * making large graphs more responsive. + * + * The default value is false. + */ + textureOnViewport?: boolean; + /** + * When set to true, the renderer will use a motion blur effect to make the transition between frames seem smoother. + * This can significantly increase the perceived performance for a large graphs. + * + * The default value is false. + */ + motionBlur?: boolean; + /** + * When motionBlur: true, this value controls the opacity of motion blur frames. + * Higher values make the motion blur effect more pronounced. + * + * The default value is 0.2. + */ + motionBlurOpacity?: number; + /** + * Changes the scroll wheel sensitivity when zooming. This is a multiplicative modifier. + * So, a value between 0 and 1 reduces the sensitivity (zooms slower), and a value greater than 1 increases the sensitivity (zooms faster). + * + * The default value is 1. + */ + wheelSensitivity?: number; + /** + * Overrides the screen pixel ratio with a manually set value (1.0 or 0.666 recommended, if set). + * This can be used to increase performance on high density displays by reducing the effective area that needs to be rendered. + * If you want to use the hardware's actual pixel ratio at the expense of performance, you can set pixelRatio: 'auto'. + * + * The default value is 1. + */ + pixelRatio?: number; + } + + /** + * cy --> Cy.Core + * The core object is your interface to a graph. + * + * It is your entry point to Cytoscape.js: + * All of the library’s features are accessed through this object. + * http://js.cytoscape.org/#core + */ + interface Core extends + CoreGraphManipulation, CoreGraphManipulationExt, + CoreEvents, CoreViewportManipulation, CoreAnimation, + CoreLayout, CoreStyle, CoreExport { } + + /** + * These are the principle functions used to interact with the graph model. + * + * http://js.cytoscape.org/#core/graph-manipulation + */ + interface CoreGraphManipulation { + /** + * Add elements to the graph and return them. + */ + add(eles: ElementDefinition | ElementDefinition[] | Collection): CollectionElements; + + /** + * Remove elements in collecion or match the selector from the graph and return them. + */ + remove(eles: Collection | Selector): CollectionElements; + + /** + * Get a collection from elements in the graph matching the specified selector or from an array of elements. + * If no parameter specified, an empty collection will be returned + */ + collection(eles?: Selector | CollectionElements[]): CollectionElements; + + /** + * Get an element from its ID in a very performant way. + */ + getElementById(id: string): CollectionElements; + + /** + * Get elements in the graph matching the specified selector. + * http://js.cytoscape.org/#cy.$ + */ + $(selector: Selector): CollectionElements; + + /** + * Get elements in the graph matching the specified selector. + * http://js.cytoscape.org/#cy.$ + */ + elements(selector?: Selector): CollectionElements; + + /** + * Get nodes in the graph matching the specified selector. + */ + nodes(selector?: Selector): NodeCollection; + + /** + * Get edges in the graph matching the specified selector. + */ + edges(selector?: Selector): EdgeCollection; + /** + * Get elements in the graph matching the specified selector or filter function. + */ + filter(selector: Selector | ((i: number, ele: Singular) => boolean)): CollectionElements; + + /** + * Allow for manipulation of elements without triggering multiple style calculations or multiple redraws. + * http://js.cytoscape.org/#cy.batch + * A callback within which you can make batch updates to elements. + */ + batch(callback: () => void): void; + /** + * Allow for manipulation of elements without triggering multiple style calculations or multiple redraws. + * http://js.cytoscape.org/#cy.batch + * + * Starts batching manually (useful for asynchronous cases). + */ + startBatch(): void; + /** + * Allow for manipulation of elements without triggering multiple style calculations or multiple redraws. + * http://js.cytoscape.org/#cy.batch + * + * Ends batching manually (useful for asynchronous cases). + */ + endBatch(): void; + + /** + * A convenience function to explicitly destroy the Core. + * http://js.cytoscape.org/#cy.destroy + */ + destroy(): void; + } + + /** + * http://js.cytoscape.org/#core/graph-manipulation + * http://js.cytoscape.org/#extensions + * These functions are intended for use in extensions. + */ + interface CoreGraphManipulationExt { + /** + * Set the scratchpad at a particular namespace, + * where temporary or non-JSON data can be stored. + * App-level scratchpad data should use namespaces prefixed with underscore, like '_foo'. + * + * If no parameter provided, the entire scratchpad will be returned. + * If only namespace provided, the scratchpad with the namespace will be returned. + * + * @param namespace A namespace string. + * @param value The value to set at the specified namespace. + */ + scratch(namespace?: string, value?: any): Scratchpad; + + /** + * Remove scratchpad data. You should remove scratchpad data only at your own namespaces. + * http://js.cytoscape.org/#cy.removeScratch + * + * @param namespace A namespace string. + */ + removeScratch(namespace: string): void; + } + + /** + * The principle events from the graph model. + * http://js.cytoscape.org/#core/events + */ + interface CoreEvents { + /** + * Bind to events that occur in the graph. + * + * @param events A space separated list of event names. + * @param handler The handler function that is called when one of the specified events occurs. + * @param selector A selector to specify elements for which the handler is triggered. + * @param data A plain object which is passed to the handler in the event object argument. + * @param eventsMap A map of event names to handler functions. + */ + + on(events: EventNames, handler: EventHandler): void; + on(events: EventNames, selector: Selector, handler: EventHandler): void; + on(events: EventNames, selector: Selector, data: any, handler: EventHandler): void; + on(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): void; + + bind(events: EventNames, handler: EventHandler): void; + bind(events: EventNames, selector: Selector, handler: EventHandler): void; + bind(events: EventNames, selector: Selector, data: any, handler: EventHandler): void; + bind(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): void; + + listen(events: EventNames, handler: EventHandler): void; + listen(events: EventNames, selector: Selector, handler: EventHandler): void; + listen(events: EventNames, selector: Selector, data: any, handler: EventHandler): void; + listen(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): void; + + addListener(events: EventNames, handler: EventHandler): void; + addListener(events: EventNames, selector: Selector, handler: EventHandler): void; + addListener(events: EventNames, selector: Selector, data: any, handler: EventHandler): void; + addListener(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): void; + + /** + * Get a promise that is resolved with the first + * of any of the specified events triggered on the graph. + * @param events A space separated list of event names. + * @param selector [optional] A selector to specify elements for which the handler is triggered. + */ + promiseOn(events: EventNames, selector?: Selector): Promise; + pon(events: EventNames, selector?: Selector): Promise; + /** + * Bind to events that occur in the graph, and trigger the handler only once. + * + * @param events A space separated list of event names. + * @param handler The handler function that is called when one of the specified events occurs. + */ + one(events: EventNames, handler: EventHandler): void; + /** + * Bind to events that occur in the graph, and trigger the handler only once. + * + * @param events A space separated list of event names. + * @param handler The handler function that is called when one of the specified events occurs. + * @param selector A selector to specify elements for which the handler is triggered. + */ + one(events: EventNames, selector: Selector, handler: EventHandler): void; + /** + * Bind to events that occur in the graph, and trigger the handler only once. + * + * @param events A space separated list of event names. + * @param handler The handler function that is called when one of the specified events occurs. + * @param selector A selector to specify elements for which the handler is triggered. + * @param data A plain object which is passed to the handler in the event object argument. + */ + one(events: EventNames, selector: Selector, data: any, handler: EventHandler): void; + /** + * Bind to events that occur in the graph, and trigger the handler only once. + * + * @param eventsMap A map of event names to handler functions. + * @param selector A selector to specify elements for which the handler is triggered. + * @param data A plain object which is passed to the handler in the event object argument. + */ + one(eventsMap: { [value: string]: EventHandler }, selector?: Selector, data?: any): void; + + /** + * Remove event handlers. + * http://js.cytoscape.org/#cy.off + * + * @param events A space separated list of event names. + * @param selector [optional] The same selector used to bind to the events. + * @param handler [optional] A reference to the handler function to remove. + * @param eventsMap A map of event names to handler functions to remove. + */ + off(events: EventNames, selector?: Selector, handler?: EventHandler): void; + off(eventsMap: { [value: string]: EventHandler }, selector?: Selector): void; + + unbind(events: EventNames, selector?: Selector, handler?: EventHandler): void; + unbind(eventsMap: { [value: string]: EventHandler }, selector?: Selector): void; + + unlisten(events: EventNames, selector?: Selector, handler?: EventHandler): void; + unlisten(eventsMap: { [value: string]: EventHandler }, selector?: Selector): void; + + removeListener(events: EventNames, selector?: Selector, handler?: EventHandler): void; + removeListener(eventsMap: { [value: string]: EventHandler }, selector?: Selector): void; + + /** + * Trigger one or more events. + * + * @param events A space separated list of event names to trigger. + * @param extraParams [optional] An array of additional parameters to pass to the handler. + */ + trigger(events: EventNames, extraParams?: any[]): void; + emit(events: EventNames, extraParams?: any[]): void; + + /** + * Run a callback as soon as the graph becomes ready. If the graph is already ready, then the callback is called immediately. + * @param fn The callback run as soon as the graph is ready, inside which this refers to the core (cy). + */ + ready(fn: EventHandler): void; + } + + interface ZoomOptions { + /** The zoom level to set. */ + level: number; + /** The position about which to zoom. */ + position: Position; + /** The rendered position about which to zoom. */ + renderedPosition: Position; + } + /** + * http://js.cytoscape.org/#core/viewport-manipulation + */ + interface CoreViewportManipulation { + /** + * Get the HTML DOM element in which the graph is visualised. + * A null value is returned if the Core is headless. + */ + container(): any; + + /** + * Pan the graph to the centre of a collection. + * + * @param eles The collection to centre upon. + */ + center(eles?: Collection): CollectionElements; + + /** + * Pan and zooms the graph to fit to a collection. + * http://js.cytoscape.org/#cy.fit + * + * @param eles [optional] The collection to fit to. + * @param padding [optional] An amount of padding (in pixels) to have around the graph + */ + fit(eles?: Collection, padding?: number): CollectionElements; + + /** + * Reset the graph to the default zoom level and panning position. + * http://js.cytoscape.org/#cy.reset + */ + reset(): CollectionElements; + + /** + * Get the panning position of the graph. + * http://js.cytoscape.org/#cy.pan + */ + pan(): Position; + + /** + * Set the panning position of the graph. + * http://js.cytoscape.org/#cy.pan + * + * @param renderedPosition The rendered position to pan the graph to. + */ + pan(renderedPosition?: Position): void; + + /** + * Relatively pan the graph by a specified rendered position vector. + * http://js.cytoscape.org/#cy.panBy + * + * @param renderedPosition The rendered position vector to pan the graph by. + */ + panBy(renderedPosition: Position): void; + + /** + * Get whether panning is enabled. + * If cy.boxSelectionEnabled() === true, then the user + * must taphold to initiate panning. + * http://js.cytoscape.org/#cy.panningEnabled + */ + panningEnabled(): boolean; + + /** + * Set whether panning is enabled. If cy.boxSelectionEnabled() === true, then the user must taphold to initiate panning. + * http://js.cytoscape.org/#cy.panningEnabled + * + * @param bool A truthy value enables panning; a falsey value disables it. + */ + panningEnabled(bool: boolean): void; + + /** + * Get whether panning by user events (e.g. dragging the graph background) is enabled. If cy.boxSelectionEnabled() === true, then the user must taphold to initiate panning. + * http://js.cytoscape.org/#cy.userPanningEnabled + */ + userPanningEnabled(): boolean; + + /** + * Set whether panning by user events (e.g. dragging the graph background) is enabled. If cy.boxSelectionEnabled() === true, then the user must taphold to initiate panning. + * http://js.cytoscape.org/#cy.userPanningEnabled + * + * @param bool A truthy value enables user panning; a falsey value disables it. + */ + userPanningEnabled(bool: boolean): void; + /** + * Get the zoom level. + * http://js.cytoscape.org/#cy.zoom + */ + zoom(): number; + /** + * Set the zoom level. + * http://js.cytoscape.org/#cy.zoom + * + * @param level The zoom level to set. + * @param options The options for zooming. + */ + zoom(level?: number | ZoomOptions): void; + + /** + * Set or get whether zooming is enabled. Get if no parameter provided. + * http://js.cytoscape.org/#cy.zoomingEnabled + * + * @param bool A truthy value enables zooming; a falsey value disables it. + */ + zoomingEnabled(bool?: boolean): void; + + /** + * Get whether zooming by user events (e.g. mouse wheel, pinch-to-zoom) + * is enabled. + * http://js.cytoscape.org/#cy.userZoomingEnabled + */ + userZoomingEnabled(): boolean; + /** + * Get or set whether zooming by user events get if no parameter provided + * (e.g. mouse wheel, pinch-to-zoom) is enabled. + * http://js.cytoscape.org/#cy.userZoomingEnabled + * + * @param bool A truthy value enables user zooming; a falsey value disables it. + */ + userZoomingEnabled(bool?: boolean): void; + + /** + * Get the minimum zoom level. + * http://js.cytoscape.org/#cy.minZoom + */ + minZoom(): number; + /** + * Set the minimum zoom level. + * http://js.cytoscape.org/#cy.minZoom + * + * @param zoom The new minimum zoom level to use. + */ + minZoom(zoom: number): void; + + /** + * Get the maximum zoom level. + * http://js.cytoscape.org/#cy.maxZoom + */ + maxZoom(): number; + /** + * Set the maximum zoom level. + * http://js.cytoscape.org/#cy.maxZoom + * + * @param zoom The new maximum zoom level to use. + */ + maxZoom(zoom: number): void; + + /** + * Set the viewport state (pan & zoom) in one call. + * http://js.cytoscape.org/#cy.viewport + * + * @param zoom The zoom level to set. + * @param pan The pan to set (a rendered position). + */ + viewport(zoom: number, pan: Position): void; + + /** + * Get whether box selection is enabled. + * If enabled, the user must hold left-click to initiate panning. + * http://js.cytoscape.org/#cy.boxSelectionEnabled + */ + boxSelectionEnabled(): boolean; + /** + * Set whether box selection is enabled. + * If enabled, the user must hold left-click to initiate panning. + * http://js.cytoscape.org/#cy.boxSelectionEnabled + * + * @param bool A truthy value enables box selection; a falsey value disables it. + */ + boxSelectionEnabled(bool: boolean): void; + + /** + * Get the on-screen width of the viewport in pixels. + * http://js.cytoscape.org/#cy.width + */ + width(): number; + + /** + * Get the on-screen height of the viewport in pixels. + * http://js.cytoscape.org/#cy.height + */ + height(): number; + + /** + * Get the extent of the viewport, a bounding box in model + * coordinates that lets you know what model + * positions are visible in the viewport. + * http://js.cytoscape.org/#cy.extent + */ + extent(): { + x1: number, y1: number, x2: number, y2: number, w: number, h: number + }; + + /** + * Get whether nodes are automatically locked + * (i.e. if true, nodes are locked despite their individual state). + * http://js.cytoscape.org/#cy.autolock + */ + autolock(): boolean; + /** + * Set whether nodes are automatically locked + * (i.e. if true, nodes are locked despite their individual state). + * http://js.cytoscape.org/#cy.autolock + * + * @param bool A truthy value enables autolocking; a falsey value disables it. + */ + autolock(bool: boolean): void; + + /** + * Get whether nodes are automatically ungrabified + * (i.e. if true, nodes are ungrabbale despite their individual state). + * http://js.cytoscape.org/#cy.autoungrabify + */ + autoungrabify(): boolean; + /** + * Set whether nodes are automatically ungrabified + * (i.e. if true, nodes are ungrabbale despite their individual state). + * http://js.cytoscape.org/#cy.autoungrabify + * + * @param bool A truthy value enables autolocking; a falsey value disables it. + */ + autoungrabify(bool: boolean): void; + + /** + * Get whether nodes are automatically unselectified + * (i.e. if true, nodes are unselectable despite their individual state). + * http://js.cytoscape.org/#cy.autounselectify + */ + autounselectify(): boolean; + /** + * Set whether nodes are automatically unselectified + * (i.e. if true, nodes are unselectable despite their individual state). + * http://js.cytoscape.org/#cy.autounselectify + * + * @param bool A truthy value enables autolocking; a falsey value disables it. + */ + autounselectify(bool: boolean): void; + + /** + * Force the renderer to redraw (i.e. draw a new frame). + * + * This function forces the renderer to draw a new frame. + * It is useful for very specific edgecases, such as in certain UI plugins, + * but it should not be needed for most developers. + * http://js.cytoscape.org/#cy.forceRender + */ + forceRender(): void; + + /** + * Force the renderer to recalculate the viewport bounds. + * + * If your code resizes the graph's dimensions or position + * (i.e. by changing the style of the HTML DOM element that holds the graph), + * you will want to call cy.resize() to have the graph resize and redraw itself. + * + * Cytoscape.js can not automatically monitor the bounding box of the viewport, + * as querying the DOM for those dimensions can be expensive. + * Although cy.resize() is automatically called for you on the window's resize event, + * there is no resize or style event for arbitrary DOM elements. + * http://js.cytoscape.org/#cy.resize + */ + resize(): CollectionElements; + } + + /** + * http://js.cytoscape.org/#core/animation + * + */ + interface AnimationFitOptions { + eles: CollectionElements | Selector; // to which the viewport will be fitted. + padding: number; // Padding to use with the fitting. + } + interface CenterOptions { + eles: CollectionElements | Selector; // to which the viewport will be selected. + } + interface AnimateOptionsCommon { + /** A zoom level to which the graph will be animated. */ + zoom?: number; + /** A panning position to which the graph will be animated. */ + pan?: Position; + /** A relative panning position to which the graph will be animated. */ + panBy?: Position; + /** An object containing fitting options from which the graph will be animated. */ + fit?: AnimationFitOptions; + /** An object containing centring options from which the graph will be animated. */ + center?: CenterOptions; + + /** duration - The duration of the animation in milliseconds. */ + duration?: number; + } + interface AnimateOptions extends AnimateOptionsCommon { + /** queue - A boolean indicating whether to queue the animation. */ + queue?: boolean; + /** complete - A function to call when the animation is done. */ + complete?(): void; + /** step - A function to call each time the animation steps. */ + step(): void; + } + interface AnimationOptions extends AnimateOptionsCommon { + /** queue - A transition-timing-function easing style string that shapes the animation progress curve. */ + easing?: boolean; + /** complete - A function to call when the animation is done. */ + complete?(): void; + /** step - A function to call each time the animation steps. */ + step?(): void; + } + + interface CoreAnimation { + /** + * Get whether the viewport is currently being animated. + * http://js.cytoscape.org/#cy.animated + */ + animated(): boolean; + + /** + * Animate the viewport. + * http://js.cytoscape.org/#cy.animate + * + * @param anis An object containing the details of the animation. + * + * @param options An object containing animation options. + */ + animate(anis: AnimateOptions, options?: AnimateOptions): Core; + + /** + * Get an animation of the viewport. + * http://js.cytoscape.org/#cy.animation + */ + animation(options: AnimationOptions): any; + + /** + * Add a delay between animations for the viewport. + * + * @param duration How long the delay should be in milliseconds. + * @param complete A function to call when the delay is complete. + */ + delay(duration: number, complete?: () => void): Core; + + /** + * Get a delay animation of the viewport. + * http://js.cytoscape.org/#cy.delayAnimation + */ + delayAnimation(duration: number): void; + + /** + * Stop all viewport animations that are currently running. + * http://js.cytoscape.org/#cy.stop + * + * @param clearQueue A boolean, indicating whether the queue of animations should be emptied. + * @param jumpToEnd A boolean, indicating whether the currently-running animations should jump to their ends rather than just stopping midway. + */ + stop(clearQueue?: boolean, jumpToEnd?: boolean): Core; + + /** + * Remove all queued animations for the viewport. + * http://js.cytoscape.org/#cy.clearQueue + */ + clearQueue(): Core; + } + + /** + * http://js.cytoscape.org/#core/layout + */ + interface CoreLayout { + /** + * Run a layout, which algorithmically positions the nodes in the graph. + * For layouts included with Cytoscape.js, you can find their + * options documented in the Layouts section. + * For external layouts, please refer to their accompanying documentation. + * + * An analogue to run a layout on a subset of the graph exists as eles.layout(). + * http://js.cytoscape.org/#cy.layout + */ + layout(layout: LayoutOptions): LayoutManipulation; + /** + * Get a new layout, which can be used to algorithmically + * position the nodes in the graph. + * + * You must specify options.name with the name of the layout you wish to use. + * + * This function creates and returns a layout object. + * You may want to keep a reference to the layout for more advanced usecases, + * such as running multiple layouts simultaneously. + * Note that you must call layout.run() in order for it to affect the graph. + * An analogue to make a layout on a subset of the graph exists as eles.makeLayout(). + */ + makeLayout(options: LayoutOptions): LayoutManipulation; + } + + /** + * Get the entry point to modify the visual style of the graph after initialisation. + * http://js.cytoscape.org/#core/style + */ + interface ElementStylesheet extends StylesheetStyle { + json(): any; + } + + interface CoreStyle { + /** + * Get the current style object. + */ + style(): ElementStylesheet | string; + /** + * Assign a new stylesheet to replace the existing one. + */ + style(sheet: Stylesheet): Stylesheet; + } + + /** + * http://js.cytoscape.org/#cy.style + */ + type Stylesheet = StylesheetStyle | StylesheetCSS; + + interface StylesheetStyle { + selector: string; + style: Css.Node | Css.Edge; + } + + /** + * http://js.cytoscape.org/#cy.style + */ + interface StylesheetCSS { + selector: string; + css: Css.Node | Css.Edge; + } + + /** + * http://js.cytoscape.org/#core/export + */ + interface ExportOptions { + /** + * output Whether the output should be 'base64uri' (default), 'base64', or 'blob'. + */ + output?: "base64uri" | "base64" | "blob"; + /** + * The background colour of the image (transparent by default). + */ + bg?: string; + /** + * Whether to export the current viewport view (false, default) or the entire graph (true). + */ + full?: boolean; + /** + * This value specifies a positive number that scales the size of the resultant image. + */ + scale?: number; + /** + * Specifies the scale automatically in combination with maxHeight such that the resultant image is no wider than maxWidth. + */ + maxWidth?: number; + /** + * Specifies the scale automatically in combination with maxWidth such that the resultant image is no taller than maxHeight. + */ + maxHeight?: number; + } + + interface ExportJpgOptions extends ExportOptions { + /** + * quality Specifies the quality of the image from 0 + * (low quality, low filesize) to 1 (high quality, high filesize). + * If not set, the browser's default quality value is used. + */ + quality?: number; + } + + interface CoreExport { + /** + * Export the current graph view as a PNG image in Base64 representation. + */ + png(options?: ExportOptions): string; + + /** + * Export the current graph view as a JPG image in Base64 representation. + */ + jpg(options?: ExportOptions): string; + + /** + * Export the current graph view as a JPG image in Base64 representation. + */ + jpeg(options?: ExportOptions): string; + + /** + * Export the graph as JSON, the same format used at initialisation. + */ + json(): string; + } + + /** + * eles --> Cy.Collection + * a collection of one or more elements (nodes and edges) + * + * The input can be any element (node and edge) collection. + * http://js.cytoscape.org/#collection + */ + interface Collection extends Singular, + CollectionGraphManipulation, CollectionEvents, + CollectionData, CollectionPosition, + CollectionLayout, + CollectionSelection, CollectionStyle, CollectionAnimation, + CollectionComparision, CollectionIteration, + CollectionBuildingUnion, CollectionAlgorithms { } + + /** + * ele --> Cy.Singular + * a collection of a single element (node or edge) + */ + interface Singular extends + SingularGraphManipulation, + SingularData, SingularPosition, + SingularSelection, SingularStyle, SingularAnimation { } + + interface ElementsDefinition { + nodes: NodeDefinition[]; + edges: EdgeDefinition[]; + } + + type EventHandler = (event: EventObject) => void; + + /** + * The output is a collection of node and edge elements OR single element. + */ + interface CollectionElements extends + EdgeCollection, NodeCollection, SingularElement { } + + /** + * edges -> Cy.EdgeCollection + * a collection of one or more edges + * + * The output is a collection of edge elements OR single edge. + */ + interface EdgeCollection extends Collection, EdgeSingular, + EdgeCollectionTraversing { } + /** + * nodes -> Cy.NodeCollection + * a collection of one or more nodes + * + * The output is a collection of node elements OR single node. + */ + interface NodeCollection extends Collection, NodeSingular, + NodeCollectionMetadata, NodeCollectionPosition, NodeCollectionTraversing, + NodeCollectionCompound { } + + interface SingularElement extends EdgeSingular, NodeSingular { + // Intentionally empty. + } + /** + * edge --> Cy.EdgeSingular + * a collection of a single edge + */ + interface EdgeSingular extends Singular, + EdgeSingularData, EdgeSingularTraversing { } + + /** + * node --> Cy.NodeSingular + * a collection of a single node + */ + interface NodeSingular extends Singular, + NodeSingularMetadata, NodeSingularPosition, NodeSingularCompound { } + + /** + * http://js.cytoscape.org/#collection/graph-manipulation + */ + interface CollectionGraphManipulation { + /** + * Remove the elements from the graph. + * http://js.cytoscape.org/#eles.remove + */ + remove(): CollectionElements; + + /** + * Put removed elements back into the graph. + * http://js.cytoscape.org/#eles.restore + */ + restore(): CollectionElements; + + /** + * Get a new collection containing clones (i.e. copies) of the elements in the calling collection. + * http://js.cytoscape.org/#eles.clone + */ + clone(): CollectionElements; + /** + * Get a new collection containing clones (i.e. copies) of the elements in the calling collection. + * http://js.cytoscape.org/#eles.clone + */ + copy(): CollectionElements; + + /** + * Effectively move edges to different nodes. The modified (actually new) elements are returned. + * http://js.cytoscape.org/#eles.move + */ + move(location: { source?: string, target?: string }): EdgeCollection; + /** + * Effectively move nodes to different parent node. The modified (actually new) elements are returned. + * http://js.cytoscape.org/#eles.move + */ + move(location: { parent: string }): NodeCollection; + } + + /** + * http://js.cytoscape.org/#collection/graph-manipulation + */ + interface SingularGraphManipulation { + /** + * Get whether the element has been removed from the graph. + * http://js.cytoscape.org/#ele.removed + */ + removed(): boolean; + /** + * Get whether the element is inside the graph (i.e. not removed). + * http://js.cytoscape.org/#ele.inside + */ + inside(): boolean; + } + + /** + * http://js.cytoscape.org/#collection/events + */ + interface CollectionEvents { + /** + * http://js.cytoscape.org/#eles.on + */ + on(events: EventNames, selector: string, data: any, handler: EventHandler): void; + on(events: EventNames, selector: string, handler: EventHandler): void; + on(events: EventNames, handler: EventHandler): void; + /** + * http://js.cytoscape.org/#eles.promiseOn + * alias: pon + */ + promiseOn(events: EventNames, selector?: string): Promise; + pon(events: EventNames, selector?: string): Promise; + + /** + * @param events A space separated list of event names. + * @param selector [optional] A delegate selector to specify child elements for which the handler is triggered. + * @param data [optional] A plain object which is passed to the handler in the event object argument. + * @param function(event) The handler function that is called when one of the specified events occurs. + * @param event The event object. + * http://js.cytoscape.org/#eles.one + */ + one(events: EventNames, selector: string, data: any, handler: EventHandler): void; + one(events: EventNames, selector: string, handler: EventHandler): void; + one(events: EventNames, handler: EventHandler): void; + /** + * http://js.cytoscape.org/#eles.once + */ + once(events: EventNames, selector: string, data: any, handler: EventHandler): void; + once(events: EventNames, selector: string, handler: EventHandler): void; + once(events: EventNames, handler: EventHandler): void; + /** + * http://js.cytoscape.org/#eles.off + * alias unbind, unlisten, removeListener + */ + off(events: EventNames, selector?: string, handler?: EventHandler): void; + /** + * http://js.cytoscape.org/#eles.trigger + * alias: emit + */ + trigger(events: EventNames, extra?: string[]): void; + } + + /** + * http://js.cytoscape.org/#collection/data + * + * The following fields are immutable: + * id: The id field is used to uniquely identify an element in the graph. + * source & target : These fields define an edge's relationship to nodes, and this relationship can not be changed after creation. + * parent: The parent field defines the parent (compound) node. + */ + interface CollectionData { + /** + * Remove developer-defined data associated with the elements. + * http://js.cytoscape.org/#eles.removeData + * @param names A space-separated list of fields to delete. + */ + removeData(names?: string): CollectionElements; + removeAttr(names?: string): CollectionElements; + + /** + * Get an array of the plain JavaScript object + * representation of all elements in the collection. + */ + jsons(): string[]; + } + /** + * http://js.cytoscape.org/#collection/data + */ + interface SingularData { + /** + * Read and write developer-defined data associated with the elements + * http://js.cytoscape.org/#eles.data + */ + + /** + * Get a particular data field for the element. + * @param name The name of the field to get. + */ + data(name?: string): any; + /** + * Set a particular data field for the element. + * @param name The name of the field to set. + * @param value The value to set for the field. + */ + data(name: string, value: any): void; + /** + * Update multiple data fields at once via an object. + * @param obj The object containing name- value pairs to update data fields. + */ + data(obj: any): void; + + /** + * Get or set the scratchpad at a particular namespace, + * where temporary or non-JSON data can be stored. + * Get scratchpad if one or no parameter provided. + * App-level scratchpad data should use namespaces + * prefixed with underscore, like '_foo'. + * http://js.cytoscape.org/#ele.scratch + * @param namespace A namespace string. + * @param value The value to set at the specified namespace. + */ + scratch(namespace?: string, value?: any): Scratchpad; + + /** + * Remove scratchpad data. + * You should remove scratchpad data only at your own namespaces. + * http://js.cytoscape.org/#ele.removeScratch + * @param namespace A namespace string. + */ + removeScratch(namespace: string): void; + + /** + * A shortcut to get the ID of an element. + * http://js.cytoscape.org/#ele.id + */ + id(): string; + + /** + * Get the element's plain JavaScript object representation. + * http://js.cytoscape.org/#ele.json + */ + json(): string; + + /** + * Get the group string that defines the type of the element. + * + * The group strings are 'nodes' for nodes and 'edges' for edges. + * In general, you should be using ele.isEdge() + * and ele.isNode() instead of ele.group(). + * http://js.cytoscape.org/#ele.group + */ + group(): ElementGroup; + + /** + * Get whether the element is a node. + * http://js.cytoscape.org/#ele.isNode + */ + isNode(): boolean; + + /** + * Get whether the element is an edge. + * http://js.cytoscape.org/#ele.isEdge + */ + isEdge(): boolean; + } + /** + * http://js.cytoscape.org/#collection/data + */ + interface EdgeSingularData { + /** + * Get whether the edge is a loop (i.e. source same as target). + * http://js.cytoscape.org/#edge.isLoop + */ + isLoop(): boolean; + + /** + * Get whether the edge is simple (i.e. source different than target). + * http://js.cytoscape.org/#edge.isSimple + */ + isSimple(): boolean; + } + + /** + * http://js.cytoscape.org/#collection/metadata + */ + interface NodeSingularMetadata { + /** + * Get the degree of a node. + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + degree(includeLoops: boolean): number; + /** + * Get the indegree of a node. + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + indegree(includeLoops: boolean): number; + /** + * Get the outdegree of a node. + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + outdegree(includeLoops: boolean): number; + } + + /** + * http://js.cytoscape.org/#collection/metadata + */ + interface NodeCollectionMetadata { + /** + * Get the total degree of a collection of nodes. + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + totalDegree(includeLoops: boolean): number; + + /** + * Get the minimum degree of the nodes in the collection. + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + minDegree(includeLoops: boolean): number; + + /** + * Get the maximum degree of the nodes in the collection. + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + maxDegree(includeLoops: boolean): number; + + /** + * Get the minimum indegree of the nodes in the collection. + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + minIndegree(includeLoops: boolean): number; + + /** + * Get the maximum indegree of the nodes in the collection. + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + maxIndegree(includeLoops: boolean): number; + + /** + * Get the minimum outdegree of the nodes in the collection. + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + minOutdegree(includeLoops: boolean): number; + + /** + * Get the maximum outdegree of the nodes in the collection. + * @param includeLoops A boolean, indicating whether loops are to be included in degree calculations. + */ + maxOutdegree(includeLoops: boolean): number; + } + + /** + * http://js.cytoscape.org/#collection/position--dimensions + */ + interface NodeSingularPosition { + /** + * Get the (model) position of a node. + */ + position(): Position; + /** + * Set the value of a specified position dimension. + * @param dimension The position dimension to set. + * @param value The value to set to the dimension. + */ + position(dimension: PositionDimension, value?: Position): void; + /** + * Set the position using name-value pairs in the specified object. + * @param pos An object specifying name-value pairs representing dimensions to set. + */ + position(pos: Position): void; + + /** + * Get or set the rendered (on-screen) position of a node. + * http://js.cytoscape.org/#node.renderedPosition + */ + /** + * Get the value of a specified rendered position dimension. + * @param dimension The position dimension to get. + * @param value The value to set to the dimension. + * @param pos An object specifying name-value pairs representing dimensions to set. + */ + renderedPosition(dimension?: PositionDimension): Position; + renderedPosition(dimension: PositionDimension, value: Position): void; + renderedPosition(pos: { [name: string]: number }): void; + + /** + * Set the value of a specified rendered position dimension. + * @param dimension The position dimension to set. + * @param value The value to set to the dimension. + * @param pos An object specifying name-value pairs representing dimensions to set. + */ + renderedPoint(dimension?: PositionDimension): Position; + renderedPoint(dimension: PositionDimension, value: Position): void; + renderedPoint(pos: { [name: string]: number }): void; + + /** + * + * http://js.cytoscape.org/#node.relativePosition + */ + /** + * Get the value of a specified relative position dimension. + * @param dimension The position dimension to get. + * @param value The value to set to the dimension. + * @param pos An object specifying name-value pairs representing dimensions to set. + */ + relativePosition(dimension?: PositionDimension): Position; + relativePosition(dimension: PositionDimension, value: Position): void; + relativePosition(pos: { [name: string]: number }): void; + + /** + * Get the value of a specified relative position dimension. + * @param dimension The position dimension to get. + * @param value The value to set to the dimension. + * @param pos An object specifying name-value pairs representing dimensions to set. + */ + relativePoint(dimension?: PositionDimension): Position; + relativePoint(dimension: PositionDimension, value: Position): void; + relativePoint(pos: { [name: string]: number }): void; + + /** + * Get whether a node is currently grabbed, meaning the user has hold of the node. + * http://js.cytoscape.org/#node.grabbed + */ + grabbed(): boolean; + /** + * Get whether the user can grab a node. + * http://js.cytoscape.org/#node.grabbable + */ + grabbable(): boolean; + /** + * Get whether a node is locked, meaning that its position can not be changed. + * http://js.cytoscape.org/#node.locked + */ + locked(): boolean; + } + + /** + * @param ele The element being iterated over for which the function should return a position to set. + * @param ix The index of the element when iterating over the elements in the collection. + */ + type ElementPositionFunction = (ele: CollectionElements, ix: number) => void; + type ElementCollectionFunction = (ele: CollectionElements, ix: number, eles: CollectionElements) => void; + + /** + * http://js.cytoscape.org/#collection/position--dimensions + */ + interface NodeCollectionPosition { + /** + * Set the positions via a function. + * @param handler A callback function that returns the position to set for each element. + * @param pos An object specifying name-value pairs representing dimensions to set. + * http://js.cytoscape.org/#nodes.positions + */ + positions(handler: ElementPositionFunction | Position): void; + + modelPositions(handler: ElementPositionFunction | Position): void; + + points(handler: ElementPositionFunction | Position): void; + + /** + * Allow the user to grab the nodes. + * http://js.cytoscape.org/#nodes.grabify + */ + grabify(): void; + /** + * Disallow the user to grab the nodes. + * http://js.cytoscape.org/#nodes.ungrabify + */ + ungrabify(): void; + /** + * Lock the nodes such that their positions can not be changed. + * http://js.cytoscape.org/#nodes.lock + */ + lock(): void; + /** + * Unlock the nodes such that their positions can be changed. + * http://js.cytoscape.org/#nodes.unlock + */ + unlock(): void; + } + /** + * http://js.cytoscape.org/#collection/position--dimensions + */ + interface SingularPosition { + /** + * Get the width of the element. + */ + width(): number; + /** + * Get the outer width of the element (includes width, padding, & border). + */ + outerWidth(): number; + + /** + * Get the width of the element in rendered dimensions. + */ + renderedWidth(): number; + + /** + * Get the outer width of the element (includes width, padding, & border) in rendered dimensions. + */ + renderedOuterWidth(): number; + + /** + * Get the height of the element. + */ + height(): number; + /** + * Get the outer height of the element (includes height, padding, & border). + */ + outerHeight(): number; + /** + * Get the height of the element in rendered dimensions. + */ + renderedHeight(): number; + + /** + * Get the outer height of the element (includes height, padding, & border) in rendered dimensions. + */ + renderedOuterHeight(): number; + /** + * Gets whether the element is active (e.g. on user tap, grab, etc). + * http://js.cytoscape.org/#ele.active + */ + active(): boolean; + } + + interface BoundingBoxOptions { + /** A boolean indicating whether to include nodes in the bounding box (default true). */ + includeNodes?: boolean; + /** A boolean indicating whether to include edges in the bounding box (default true). */ + includeEdges?: boolean; + /** A boolean indicating whether to include labels in the bounding box (default true). */ + includeLabels?: boolean; + } + /** + * http://js.cytoscape.org/#collection/position--dimensions + */ + interface CollectionPosition { + /** + * Get the bounding box of the elements in model coordinates. + * @param options An object containing options for the function. + * http://js.cytoscape.org/#eles.boundingBox + */ + boundingBox(options: BoundingBoxOptions): BoundingBox12 | BoundingBoxWH; + /** + * Get the bounding box of the elements in rendered coordinates. + * @param options An object containing options for the function. + */ + renderedBoundingBox(options: BoundingBoxOptions): BoundingBox12 | BoundingBoxWH; + } + + /** + * http://js.cytoscape.org/#collection/layout + */ + interface CollectionLayout { + /** + * Get a new layout, which can be used to algorithmically position the nodes in the collection. + * This function is useful for running a layout on a subset of the elements in the graph, perhaps in parallel to other layouts. + * + * You must specify options.name with the name of the layout you wish to use. + * + * Note: that you must call layout.run() in order for it to affect the graph. + * + * @param options The layout options. + */ + layout(options: LayoutOptions): CollectionElements; + makeLayout(options: LayoutOptions): CoreLayout; + createLayout(options: LayoutOptions): CoreLayout; + } + + /** + * http://js.cytoscape.org/#collection/layout + */ + interface LayoutPositionOptions { + // whether to animate changes to the layout + animate?: boolean; + // duration of animation in ms, if enabled + animationDuration?: number; + // easing of animation, if enabled + animationEasing?: number; + // collection of elements involved in the layout; set by cy.layout() or eles.layout() + eles: CollectionElements; + // whether to fit the viewport to the graph + fit?: boolean; + // padding to leave between graph and viewport + padding?: number; + // pan the graph to the provided position, given as { x, y } + pan?: Position; + // callback for the layoutready event + ready?: undefined; + // callback for the layoutstop event + stop?: undefined; + // a positive value which adjusts spacing between nodes (>1 means greater than usual spacing) + spacingFactor?: number; + // zoom level as a positive number to set after animation + zoom?: number; + } + interface NodeCollectionLayout { + /** + * Position the nodes for a discrete/synchronous layout. + * http://js.cytoscape.org/#nodes.layoutPositions + * @param layout The layout. + * @param options The layout options object. + */ + layoutPositions(layout: string, options: LayoutPositionOptions, handler: ElementPositionFunction): void; + } + /** + * http://js.cytoscape.org/#collection/layout + */ + interface LayoutDimensionOptions { + // Boolean which changes whether label dimensions are included when calculating node dimensions + nodeDimensionsIncludeLabels: boolean; + } + interface NodeSingularLayout { + /** + * Returns the node width and height. + * Meant for use in layout positioning to do overlap detection. + * @param options The layout options object. + */ + layoutDimensions(options: LayoutDimensionOptions): { x: number; y: number }; + } + + /** + * http://js.cytoscape.org/#collection/selection + */ + interface SingularSelection { + /** + * Get whether the element is selected. + * http://js.cytoscape.org/#ele.selected + */ + selected(): boolean; + + /** + * Get whether the element's selection state is mutable. + * http://js.cytoscape.org/#ele.selectable + */ + selectable(): boolean; + } + /** + * http://js.cytoscape.org/#collection/layout + */ + interface CollectionSelection { + /** + * Make the elements selected (NB other elements outside the collection are not affected). + * http://js.cytoscape.org/#eles.select + */ + select(): void; + /** + * Make the elements not selected (NB other elements outside the collection are not affected). + * http://js.cytoscape.org/#eles.unselect + */ + unselect(): void; + deselect(): void; + /** + * Make the selection states of the elements mutable. + * http://js.cytoscape.org/#eles.selectify + */ + selectify(): void; + /** + * Make the selection states of the elements immutable. + * http://js.cytoscape.org/#eles.unselectify + */ + unselectify(): void; + } + + /** + * http://js.cytoscape.org/#collection/style + */ + type ClassName = string; + /** A space-separated list of class names */ + type ClassNames = string; + + interface CollectionStyle { + /** + * Add classes to elements. + * http://js.cytoscape.org/#eles.addClass + * @param classes A space-separated list of class names to add to the elements. + */ + addClass(classes: ClassNames): void; + /** + * Remove classes from elements. + * @param classes A space-separated list of class names to remove from the elements. + * http://js.cytoscape.org/#eles.removeClass + */ + removeClass(classes: ClassNames): void; + /** + * Toggle whether the elements have the specified classes. + * @param classes A space-separated list of class names to toggle on the elements. + * @param toggle [optional] Instead of automatically toggling, adds the classes on truthy values or removes them on falsey values. + * http://js.cytoscape.org/#eles.toggleClass + */ + toggleClass(classes: ClassNames, toggle?: boolean): void; + /** + * Replace the current list of classes on the elements with the specified list. + * @param classes A space-separated list of class names that replaces the current class list. + * http://js.cytoscape.org/#eles.classes + * Note: can be used to clear all classes (no arguments). + */ + classes(classes?: ClassNames): void; + /** + * Add classes to the elements, and then remove the classes after a specified duration. + * @param classes A space-separated list of class names to flash on the elements. + * @param duration [optional] The duration in milliseconds that the classes should be added on the elements. After the duration, the classes are removed. + * http://js.cytoscape.org/#eles.flashClass + */ + flashClass(classes: ClassNames, duration?: number): void; + + /** + * Get or set a particular style property value. + * @param name The name of the visual style property to get. + * @param value The value to which the property is set. + */ + style(name?: string, value?: any): any; + } + + /** + * http://js.cytoscape.org/#collection/style + */ + interface SingularStyle { + /** + * Get whether an element has a particular class. + * @param className The name of the class to test for. + * http://js.cytoscape.org/#ele.hasClass + */ + hasClass(className: ClassName): boolean; + + /** + * Get a name-value pair object containing rendered visual + * style properties and their values for the element. + * @param name The name of the visual style property to get. + */ + renderedStyle(): { [name: string]: any }; + renderedStyle(name: string): any; + + renderedCss(): { [name: string]: any }; + renderedCss(name: string): any; + + /** + * Get the numeric value of a style property in + * preferred units that can be used for calculations. + * @param name The name of the style property to get. + * http://js.cytoscape.org/#ele.numericStyle + */ + numericStyle(name: string): any; + + /** + * Get the units that ele.numericStyle() is expressed in, for a particular property. + * @param name The name of the style property to get. + * http://js.cytoscape.org/#ele.numericStyleUnits + */ + numericStyleUnits(name: string): any; + /** + * Get whether the element is visible. + * http://js.cytoscape.org/#ele.visible + */ + visible(): boolean; + /** + * Get whether the element is hidden. + * http://js.cytoscape.org/#ele.visible + */ + hidden(): boolean; + /** + * Get the effective opacity of the element + * (i.e. on-screen opacity), + * which takes into consideration parent node opacity. + * http://js.cytoscape.org/#ele.effectiveOpacity + */ + effectiveOpacity(): number; + /** + * Get whether the element's effective opacity is completely transparent, + * which takes into consideration parent node opacity. + * http://js.cytoscape.org/#ele.transparent + */ + transparent(): number; + } + + /** + * http://js.cytoscape.org/#collection/animation + */ + interface ElementAnimateOptionsBase { + /** An object containing name-value pairs of style properties to animate. */ + style?: { [name: string]: any }; + /** The duration of the animation in milliseconds. */ + duration?: number; + /** A boolean indicating whether to queue the animation. */ + queue?: boolean; + /** A function to call when the animation is done. */ + complete?(): void; + /** A function to call each time the animation steps. */ + step?(): void; + /** A transition-timing-function easing style string that shapes the animation progress curve. */ + easing?(): void; + } + interface ElementAnimateOptionPos { + /** A position to which the elements will be animated. */ + position?: Position; + /** A rendered position to which the elements will be animated. */ + renderedPosition?: Position; + } + interface ElementAnimateOptionRen { + /** A position to which the elements will be animated. */ + position?: Position; + /** A rendered position to which the elements will be animated. */ + renderedPosition?: Position; + } + interface CollectionAnimation { + /** + * Animate the elements. + * @param options An object containing the details of the animation. + * http://js.cytoscape.org/#eles.animate + */ + animate(options: ElementAnimateOptionPos | ElementAnimateOptionRen): void; + /** + * Add a delay between animations for the elements. + * @param duration How long the delay should be in milliseconds. + * @param complete A function to call when the delay is complete. + * http://js.cytoscape.org/#eles.delay + */ + delay(duration: number, complete: () => void): void; + /** + * Stop all animations that are currently running. + * @param clearQueue A boolean, indicating whether the queue of animations should be emptied. + * @param jumpToEnd A boolean, indicating whether the currently-running animations should jump to their ends rather than just stopping midway. + * http://js.cytoscape.org/#eles.stop + */ + stop(clearQueue: boolean, jumpToEnd: boolean): void; + /** + * Remove all queued animations for the elements. + * http://js.cytoscape.org/#eles.clearQueue + */ + clearQueue(): void; + } + interface SingularAnimationOptions { + /** A position to which the elements will be animated. */ + position: Position; + /** A rendered position to which the elements will be animated. */ + renderedPosition: Position; + /** An object containing name-value pairs of style properties to animate. */ + style: any; + /** The duration of the animation in milliseconds. */ + duration: number; + /** A transition-timing-function easing style string that shapes the animation progress curve. */ + easing(): void; + } + interface SingularAnimation { + /** + * Get whether the element is currently being animated. + */ + animated(): boolean; + /** + * Get an animation for the element. + * @param options An object containing the details of the animation. + */ + animation(options: SingularAnimationOptions): void; + + /** + * Get a delay animation for the element. + * @param duration How long the delay should be in milliseconds. + * http://js.cytoscape.org/#ele.delayAnimation + */ + delayAnimation(duration: number): void; + } + + /** + * http://js.cytoscape.org/#collection/comparison + */ + interface CollectionComparision { + // http://js.cytoscape.org/#collection/comparison + + /** + * Determine whether this collection contains exactly the same elements as another collection. + * + * @param eles The other elements to compare to. + */ + same(eles: Collection): boolean; + + /** + * Determine whether this collection contains any of the same elements as another collection. + * + * @param eles The other elements to compare to. + */ + anySame(eles: Collection): boolean; + + /** + * Determine whether all elements in the specified collection are in the neighbourhood of the calling collection. + * + * @param eles The other elements to compare to. + */ + allAreNeighbors(eles: Collection): boolean; + /** + * Determine whether all elements in the specified collection are in the neighbourhood of the calling collection. + * + * @param eles The other elements to compare to. + */ + allAreNeighbours(eles: Collection): boolean; + + /** + * Determine whether any element in this collection matches a selector. + * + * @param selector The selector to match against. + */ + is(selector: Selector): boolean; + + /** + * Determine whether all elements in the collection match a selector. + * @param selector The selector to match against. + */ + allAre(selector: Selector): boolean; + + /** + * Determine whether any element in this collection satisfies the specified test function. + * + * @param test The test function that returns truthy values for elements that satisfy the test and falsey values for elements that do not satisfy the test. + * ele - The current element. + * i - The index of the current element. + * eles - The collection of elements being tested. + * @param thisArg [optional] The value for this within the test function. + */ + some(test: (ele: CollectionElements, i: number, eles: CollectionElements) => boolean, thisArg?: any): boolean; + + /** + * Determine whether all elements in this collection satisfy the specified test function. + * + * @param test The test function that returns truthy values for elements that satisfy the test and falsey values for elements that do not satisfy the test. + * ele - The current element. + * i - The index of the current element. + * eles - The collection of elements being tested. + * @param thisArg [optional] The value for this within the test function. + */ + every(test: (ele: CollectionElements, i: number, eles: CollectionElements) => boolean, thisArg?: any): boolean; + } + + /** + * http://js.cytoscape.org/#collection/iteration + */ + interface CollectionIteration { + /** + * Get the number of elements in the collection. + */ + size(): number; + /** + * Get the number of elements in the collection. + */ + length: number; + + /** + * Get whether the collection is empty, meaning it has no elements. + */ + empty(): boolean; + /** + * Get whether the collection is nonempty, meaning it has elements. + */ + nonempty(): boolean; + + /** + * Iterate over the elements in the collection using an implementation like the native array function namesake. + * + * This function behaves like Array.prototype.forEach() with minor changes for convenience: + * You can exit the iteration early by returning false in the iterating function. + * The Array.prototype.forEach() implementation does not support this, but it is included anyway on account of its utility. + * + * @param each The function executed each iteration. + * ele - The current element. + * i - The index of the current element. + * eles - The collection of elements being iterated. + * @param thisArg [optional] The value for this within the iterating function. + */ + each(each: (ele: CollectionElements, i: number, eles: CollectionElements) => void | boolean, thisArg?: any): void; + forEach(each: (ele: CollectionElements, i: number, eles: CollectionElements) => void | boolean, thisArg?: any): void; + + /** + * Get an element at a particular index in the collection. + * + * You may use eles[i] in place of eles.eq(i) as a more performant alternative. + * + * @param index The index of the element to get. + */ + eq(index: number): CollectionElements; + /** + * Get an element at a particular index in the collection. + * + * @param index The index of the element to get. + */ + [index: number]: CollectionElements; + /** + * Get the first element in the collection. + */ + first(): CollectionElements; + /** + * Get the last element in the collection. + */ + last(): CollectionElements; + + /** + * Get a subset of the elements in the collection based on specified indices. + * + * @param start [optional] An integer that specifies where to start the selection. + * The first element has an index of 0. + * Use negative numbers to select from the end of an array. + * @param end [optional] An integer that specifies where to end the selection. + * If omitted, all elements from the start position and to the end of the array will be selected. + * Use negative numbers to select from the end of an array. + */ + slice(start?: number, end?: number): CollectionElements; + } + + /** + * http://js.cytoscape.org/#collection/building--filtering + */ + /** + * Get a new collection, resulting from adding the collection with another one + * + * @param eles The elements or array of elements to add or elements in the graph matching the selector. + * http://js.cytoscape.org/#eles.union + */ + type CollectionBuildingUnionFunc = (eles: Collection | Collection[] | Selector) => CollectionElements; + + /** + * Get a new collection, resulting from the collection without some specified elements. + * http://js.cytoscape.org/#eles.difference + * @param eles The elements that will not be in the resultant collection. + * Elements from the calling collection matching this selector will not be in the resultant collection. + */ + type CollectionBuildingDifferenceFunc = (eles: Collection | Selector) => CollectionElements; + + /** + * Get the elements in both this collection and another specified collection. + * http://js.cytoscape.org/#eles.intersection + * @param eles The elements to intersect with. + * A selector representing the elements to intersect with. + * All elements in the graph matching the selector are used as the passed collection. + */ + type CollectionBuildingIntersectionFunc = (eles: Collection | Selector) => CollectionElements; + + /** + * Get the elements that are in the calling collection or the passed collection but not in both. + * http://js.cytoscape.org/#eles.symmetricDifference + * @param eles The elements to apply the symmetric difference with. + * A selector representing the elements to apply the symmetric difference with. + * All elements in the graph matching the selector are used as the passed collection. + */ + type CollectionSymmetricDifferenceFunc = (eles: Collection | Selector) => CollectionElements; + /** + * http://js.cytoscape.org/#collection/building--filtering + */ + interface CollectionBuildingUnion { + /** + * Get a new collection, resulting from adding the collection with another one + * http://js.cytoscape.org/#eles.union + */ + union: CollectionBuildingUnionFunc; + // [index: "u"]: CollectionBuildingUnionFunc; + add: CollectionBuildingUnionFunc; + // [index: "+"]: CollectionBuildingUnionFunc; + or: CollectionBuildingUnionFunc; + // [index: "|"]: CollectionBuildingUnionFunc; + + /** + * Get a new collection, resulting from the collection without some specified elements. + * http://js.cytoscape.org/#eles.difference + */ + difference: CollectionBuildingDifferenceFunc; + // [index: "\\"]: CollectionBuildingDifferenceFunc; + not: CollectionBuildingDifferenceFunc; + // [index: "!"]: CollectionBuildingDifferenceFunc; + relativeComplement: CollectionBuildingDifferenceFunc; + // [index: "-"]: CollectionBuildingDifferenceFunc; + + /** + * Get all elements in the graph that are not in the calling collection. + * http://js.cytoscape.org/#eles.absoluteComplement + */ + absoluteComplement(): CollectionElements; + abscomp(): CollectionElements; + complement(): CollectionElements; + + /** + * Get the elements in both this collection and another specified collection. + * http://js.cytoscape.org/#eles.intersection + */ + intersection: CollectionSymmetricDifferenceFunc; + intersect: CollectionSymmetricDifferenceFunc; + and: CollectionSymmetricDifferenceFunc; + // [index: "n"]: CollectionSymmetricDifferenceFunc; + // [index: "&"]: CollectionSymmetricDifferenceFunc; + // [index: "."]: CollectionSymmetricDifferenceFunc; + + /** + * Get the elements that are in the calling collection + * or the passed collection but not in both. + * http://js.cytoscape.org/#eles.symmetricDifference + */ + symmetricDifference: CollectionSymmetricDifferenceFunc; + symdiff: CollectionSymmetricDifferenceFunc; + xor: CollectionSymmetricDifferenceFunc; + // [index: "^"]: CollectionSymmetricDifferenceFunc; + // [index: "(+)"]: CollectionSymmetricDifferenceFunc; + // [index: "(-)"]: CollectionSymmetricDifferenceFunc; + + // [index: string]: CollectionBuildingDifferenceFunc |CollectionBuildingUnionFunc | CollectionBuildingDifferenceFunc | CollectionSymmetricDifferenceFunc; + + /** + * Perform a traditional left/right diff on the two collections. + * + * @param selector + * A selector representing the elements on the right side of the diff. All elements in the graph matching the selector are used as the passed collection. + * The elements on the right side of the diff. + * @return This function returns a plain object of the form { left, right, both } where + * left - is the set of elements only in the calling (i.e. left) collection, + * right - is the set of elements only in the passed (i.e. right) collection, and + * both - is the set of elements in both collections. + * http://js.cytoscape.org/#eles.diff + */ + diff(selector: Selector | Collection): { + left: CollectionElements, + right: CollectionElements, + both: CollectionElements + }; + + /** + * Get a new collection containing elements that are accepted by the specified filter. + * + * @param selector The selector to match against. + * @param filter selector The filter function that returns true for elements to include. + * i - The index of the current element being considered. + * ele - The element being considered. + * http://js.cytoscape.org/#eles.filter + */ + filter(selector: Selector | ((i: number, ele: CollectionElements) => boolean)): CollectionElements; + /** + * Get the nodes that match the specified selector. + * + * @param selector The selector to match against. + * http://js.cytoscape.org/#eles.filter + */ + nodes(selector: Selector): NodeCollection; + /** + * Get the edges that match the specified selector. + * + * @param selector The selector to match against. + * http://js.cytoscape.org/#eles.filter + */ + edges(selector: Selector): EdgeCollection; + + /** + * Get a new collection containing the elements sorted by the + * specified comparison function. + * + * @param sort The sorting comparison function that returns a negative number + * for ele1 before ele2, 0 for ele1 same as ele2, + * or a positive number for ele1 after ele2. + * + * http://js.cytoscape.org/#eles.sort + */ + sort(sort: (ele1: CollectionElements, ele2: CollectionElements) => number): CollectionElements; + + /** + * Get an array containing values mapped from the collection. + * + * @param fn The function that returns the mapped value for each element. + * ele - The current element. + * i - The index of the current element. + * eles - The collection of elements being mapped. + * @param thisArg [optional] The value for this within the iterating function. + * + * http://js.cytoscape.org/#eles.map + */ + map(fn: (ele: CollectionElements, i: number, eles: CollectionElements) => any, thisArg?: any): any[]; + + /** + * Reduce a single value by applying a + * function against an accumulator and each value of the collection. + * + * @param fn The function that returns the accumulated value + * given the previous value and the current element. + * prevVal The value accumulated from previous elements. + * ele The current element. + * ix The index of the current element. + * eles The collection of elements being reduced. + * + * http://js.cytoscape.org/#eles.reduce + */ + reduce(fn: (prevVal: any, ele: CollectionElements, + ix: number, eles: CollectionElements) => any): number[]; + + /** + * Find a minimum value in a collection. + * + * @param fn The function that returns the value to compare for each element. + * ele - The current element. + * i - The index of the current element. + * eles - The collection of elements being mapped. + * @param thisArg [optional] The value for this within the iterating function. + * + * http://js.cytoscape.org/#eles.min + */ + min(fn: (ele: CollectionElements, i: number, eles: CollectionElements) => any, thisArg?: any): { + /** + * The minimum value found. + */ + value: any, + /** + * The element that corresponds to the minimum value. + */ + ele: CollectionElements + }; + + /** + * Find a maximum value and the corresponding element. + * + * @param fn The function that returns the value to compare for each element. + * ele - The current element. + * i - The index of the current element. + * eles - The collection of elements being mapped. + * @param thisArg [optional] The value for this within the iterating function. + * + * http://js.cytoscape.org/#eles.max + */ + max(fn: (ele: CollectionElements, i: number, eles: CollectionElements) => any, thisArg?: any): { + /** + * The maximum value found. + */ + value: any, + /** + * The element that corresponds to the maximum value. + */ + ele: CollectionElements + }; + } + + /** + * http://js.cytoscape.org/#collection/traversing + */ + + type MinumumSpanningTree = any; + + interface CollectionTraversing { + // http://js.cytoscape.org/#collection/traversing + + /** + * Get the open neighbourhood of the elements. + * + * The neighbourhood returned by this function is a bit different than the traditional definition of a "neighbourhood": + * This returned neighbourhood includes the edges connecting the collection to the neighbourhood. This gives you more flexibility. + * An open neighbourhood is one that does not include the original set of elements. If unspecified, a neighbourhood is open by default. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + neighborhood(selector?: Selector): CollectionElements; + + /** + * Get the open neighbourhood of the elements. + * + * The neighbourhood returned by this function is a bit different than the traditional definition of a "neighbourhood": + * This returned neighbourhood includes the edges connecting the collection to the neighbourhood. This gives you more flexibility. + * An open neighbourhood is one that does not include the original set of elements. If unspecified, a neighbourhood is open by default. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + openNeighborhood(selector?: Selector): CollectionElements; + /** + * Get the closed neighbourhood of the elements. + * + * The neighbourhood returned by this function is a bit different than the traditional definition of a "neighbourhood": + * This returned neighbourhood includes the edges connecting the collection to the neighbourhood. This gives you more flexibility. + * A closed neighbourhood is one that does include the original set of elements. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + closedNeighborhood(selector?: Selector): CollectionElements; + + /** + * Get the connected components, considering only the elements in the calling collection. + * An array of collections is returned, with each collection representing a component. + */ + components(): Collection; + } + interface EdgeSingularTraversing { + /** + * Get source node of this edge. + * @param selector An optional selector that is used to filter the resultant collection. + * http://js.cytoscape.org/#edge.source + */ + source(selector?: Selector): NodeCollection; + + /** + * Get target node of this edge. + * @param selector An optional selector that is used to filter the resultant collection. + * http://js.cytoscape.org/#edge.target + */ + target(selector?: Selector): NodeCollection; + } + interface EdgeCollectionTraversing { + // http://js.cytoscape.org/#collection/traversing + + /** + * Get the nodes connected to the edges in the collection + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + connectedNodes(selector?: Selector): NodeCollection; + + /** + * Get source nodes connected to the edges in the collection. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + sources(selector?: Selector): NodeCollection; + + /** + * Get target nodes connected to the edges in the collection. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + targets(selector?: Selector): NodeCollection; + + /** + * Get edges parallel to those in the collection. + * + * Two edges are said to be parallel if they connect the same two nodes. + * Any two parallel edges may connect nodes in the same direction, in which case the edges share the same source and target. + * They may alternatively connect nodes in the opposite direction, in which case the source and target are reversed in the second edge. + * That is: + * - edge1.source().id() === edge2.source().id() + * && edge1.target().id() === edge2.target().id() + * OR + * - edge1.source().id() === edge2.target().id() + * && edge1.target().id() === edge2.source().id() + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + parallelEdges(selector?: Selector): EdgeCollection; + + /** + * Get edges codirected to those in the collection. + * + * Two edges are said to be codirected if they connect the same two nodes in the same direction: The edges have the same source and target. + * That is: + * - edge1.source().id() === edge2.source().id() + * && edge1.target().id() === edge2.target().id() + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + codirectedEdges(selector?: Selector): EdgeCollection; + } + interface NodeCollectionTraversing { + // http://js.cytoscape.org/#collection/traversing + + /** + * Get the edges connecting the collection to another collection. Direction of the edges does not matter. + * + * @param eles The other collection. + * @param selector The other collection, specified as a selector which is matched against all elements in the graph. + */ + edgesWith(eles: Collection | Selector): EdgeCollection; + + /** + * Get the edges coming from the collection (i.e. the source) going to another collection (i.e. the target). + * + * @param eles The other collection. + * @param selector The other collection, specified as a selector which is matched against all elements in the graph. + */ + edgesTo(eles: Collection | Selector): EdgeCollection; + + /** + * Get the edges connected to the nodes in the collection. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + connectedEdges(selector?: Selector): EdgeCollection; + + /** + * From the set of calling nodes, get the nodes which are roots (i.e. no incoming edges, as in a directed acyclic graph). + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + roots(selector?: Selector): NodeCollection; + + /** + * From the set of calling nodes, get the nodes which are leaves (i.e. no outgoing edges, as in a directed acyclic graph). + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + leaves(selector?: Selector): NodeCollection; + + /** + * Get edges (and their targets) coming out of the nodes in the collection. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + outgoers(selector?: Selector): EdgeCollection; + + /** + * Recursively get edges (and their targets) coming out of the nodes in the collection (i.e. the outgoers, the outgoers' outgoers, ...). + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + successors(selector?: Selector): EdgeCollection; + + /** + * Get edges (and their sources) coming into the nodes in the collection. + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + incomers(selector?: Selector): EdgeCollection; + + /** + * Recursively get edges (and their sources) coming into the nodes in the collection (i.e. the incomers, the incomers' incomers, ...). + * + * @param selector [optional] An optional selector that is used to filter the resultant collection. + */ + predecessors(selector?: Selector): EdgeCollection; + } + + /** + * + * http://js.cytoscape.org/#collection/algorithms + */ + + type WeightFn = (edge: EdgeCollection) => number; + + /** + * The handler returns true when it finds the desired node, and it returns false to cancel the search. + * i - The index indicating this node is the ith visited node. + * depth - How many edge hops away this node is from the root nodes. + * v - The current node. + * e - The edge connecting the previous node to the current node. + * u - The previous node. + */ + type SearchVisitFunction = (i: number, depth: number, v: NodeCollection, e: EdgeCollection, u: NodeCollection) => boolean; + interface SearchFirstOptions { + /** + * The root nodes (selector or collection) to start the search from. + */ + roots: Selector | Collection; + /** + * A handler function that is called when a node is visited in the search. + */ + visit?: SearchVisitFunction; + /** + * A boolean indicating whether the algorithm should only go along edges from source to target (default false). + */ + directed?: boolean; + } + interface SearchFirstResult { + /** + * The path of the search. + * - The path returned includes edges such that if path[i] is a node, then path[i - 1] is the edge used to get to that node. + */ + path: CollectionElements; + /** + * The node found by the search + * - If no node was found, then found is empty. + * - If your handler function returns false, then the only the path up to that point is returned. + */ + found: NodeCollection; + } + + /** + * http://js.cytoscape.org/#eles.dijkstra + */ + interface SearchDijkstraOptions { + /** + * The root node (selector or collection) where the algorithm starts. + */ + root: Selector | Collection; + + /** + * A function that returns the positive numeric weight for this edge. + * + * If no weight function is defined, a constant weight of 1 is used for each edge. + */ + weight?: WeightFn; + + /** + * A boolean indicating whether the algorithm should only go along edges from source to target (default false). + */ + directed?: boolean; + } + /** + * http://js.cytoscape.org/#eles.dijkstra + */ + interface SearchDijkstraResult { + /** + * Returns the distance from the source node to node. + */ + distanceTo(node: NodeSingular): number; + + /** + * Returns a collection containing the shortest path from the source node to node. + * The path starts with the source node and includes the edges between the nodes in the path such that if pathTo(node)[i] is an edge, + * then pathTo(node)[i-1] is the previous node in the path and pathTo(node)[i+1] is the next node in the path. + */ + pathTo(node: NodeSingular): Collection; + } + /** + * http://js.cytoscape.org/#eles.aStar + */ + interface SearchAStarOptions { + root: Selector | Collection; + goal: Selector | Collection; + weight?: WeightFn; + heuristic?(node: NodeCollection): number; + directed?: boolean; + } + /** + * http://js.cytoscape.org/#eles.aStar + */ + interface SearchAStarResult { + found: boolean; + distance: number; + path: Collection; + } + + /** + * http://js.cytoscape.org/#eles.floydWarshall + */ + interface SearchFloydWarshallOptions { + weight: WeightFn; + directed?: boolean; + } + + /** + * http://js.cytoscape.org/#eles.floydWarshall + */ + interface SearchFloydWarshallResult { + /** + * Returns the distance from the source node to node. + */ + distance(fromNode: NodeSingular | CollectionSelection, toNode: NodeSingular | Selector): number; + + /** + * Returns a collection containing the shortest path from the source node to node. + * The path starts with the source node and includes the edges + * between the nodes in the path such that if pathTo(node)[i] is an edge, + * then pathTo(node)[i-1] is the previous node in the path and pathTo(node)[i+1] + * is the next node in the path. + */ + path(fromNode: NodeSingular | CollectionSelection, toNode: NodeSingular | Selector): Collection; + } + + /** + * http://js.cytoscape.org/#eles.bellmanFord + */ + interface SearchBellmanFordOptions { + /** + * The root node (selector or collection) where the search starts. + */ + "root": any; + /** + * A function that returns the positive numeric weight for this edge. + */ + "weight"?: WeightFn; + /** + * Indicating whether the algorithm should only go along + * edges from source to target (default false). + */ + "directed": boolean; + } + /** + * http://js.cytoscape.org/#eles.bellmanFord + */ + interface SearchBellmanFordResult { + /** + * function that computes the shortest path from root node to the argument node + * (either objects or selector string) + */ + pathTo(node: NodeSingular | Selector): Collection; + + /** + * function that computes the shortest distance from root node to argument node + * (either objects or selector string) + * + */ + distanceTo(node: NodeSingular | Selector): number; + + /* true/false. If true, pathTo and distanceTo will be undefined */ + hasNegativeWeightCycle: boolean; + } + + /** + * http://js.cytoscape.org/#eles.kruskal + * trivial so implemented in the function + */ + + /** + * http://js.cytoscape.org/#eles.pageRank + */ + interface SearchPageRankOptions { + /** Numeric parameter for the algorithm. */ + dampingFactor?: number; + /** Numeric parameter that represents the required precision. */ + precision?: number; + /** Maximum number of iterations to perform. */ + iterations?: number; + } + /** + * http://js.cytoscape.org/#eles.pageRank + */ + interface SearchPageRankResult { + /** function that computes the rank of a given node (either object or selector string) */ + rank(node: NodeCollection): void; + } + + /** + * http://js.cytoscape.org/#eles.degreeCentrality + */ + interface SearchDegreeCentralityOptions { + /** + * The root node (selector or collection) for which the + * centrality calculation is made. + */ + root: NodeSingular | Selector; + /** A function that returns the weight for the edge. */ + weight?(edge: EdgeSingular): number; + /** + * The alpha value for the centrality calculation, ranging on [0, 1]. + * With value 0 (default), disregards edge weights and solely uses + * number of edges in the centrality calculation. With value 1, + * disregards number of edges and solely uses the edge weights + * in the centrality calculation. + */ + alpha?: number; + /** + * Whether the directed indegree and outdegree centrality is calculated (true) or + * whether the undirected centrality is calculated (false, default). + */ + directed?: boolean; + } + /** + * http://js.cytoscape.org/#eles.degreeCentrality + */ + interface SearchDegreeCentralityResultUndirected { + /** the degree centrality of the root node */ + degree: number; + } + interface SearchDegreeCentralityResultDirected { + /* the indegree centrality of the root node */ + indegree: number; + /* the outdegree centrality of the root node */ + outdegree: number; + } + /** + * http://js.cytoscape.org/#eles.degreeCentralityNormalized + */ + interface SearchDegreeCentralityNormalizedOptions { + /** A function that returns the weight for the edge. */ + weight(edge: EdgeSingular): number; + /** + * The alpha value for the centrality calculation, ranging on [0, 1]. + * With value 0 (default), disregards edge weights and solely uses + * number of edges in the centrality calculation. With value 1, + * disregards number of edges and solely uses the edge weights + * in the centrality calculation. + */ + alpha?: number; + /** + * A boolean indicating whether the directed indegree and outdegree centrality is calculated (true) or + * whether the undirected centrality is calculated (false, default). + */ + directed?: boolean; + } + /** + * http://js.cytoscape.org/#eles.degreeCentralityNormalized + */ + interface SearchDegreeCentralityNormalizedResultUndirected { + /** the normalised degree centrality of the specified node */ + degree(node: NodeSingular): any; + } + interface SearchDegreeCentralityNormalizedResultDirected { + /** the normalised indegree centrality of the specified node */ + indegree(node: NodeSingular): any; + + /** the normalised outdegree centrality of the specified node */ + outdegree(node: NodeSingular): any; + } + /** + * http://js.cytoscape.org/#eles.closenessCentrality + */ + interface SearchClosenessCentralityOptions { + /** + * The root node (selector or collection) for which the + * centrality calculation is made. + */ + root: NodeSingular | Selector; + /** A function that returns the weight for the edge. */ + weight?(edge: EdgeSingular): number; + + /** + * A boolean indicating whether the directed indegree and outdegree centrality is calculated (true) or + * whether the undirected centrality is calculated (false, default). + */ + directed?: boolean; + /** + * A boolean indicating whether the algorithm calculates the + * harmonic mean (true, default) or the arithmetic mean (false) of distances. + * The harmonic mean is very useful for graphs that are not strongly connected. + */ + harmonic?: boolean; + } + /** + * http://js.cytoscape.org/#eles.closenessCentrality + * trivial + */ + + /** + * http://js.cytoscape.org/#eles.closenessCentralityNormalized + */ + interface SearchClosenessCentralityNormalizedOptions { + /** A function that returns the weight for the edge. */ + weight?(edge: EdgeSingular): number; + directed?: boolean; + /** + * A boolean indicating whether the algorithm calculates the + * harmonic mean (true, default) or the arithmetic mean (false) of distances. + * The harmonic mean is very useful for graphs that are not strongly connected. + */ + harmonic?: boolean; + } + /** + * http://js.cytoscape.org/#eles.closenessCentralityNormalized + * trivial + */ + + /** + * http://js.cytoscape.org/#eles.betweennessCentrality + */ + interface SearchBetweennessOptions { + /** A function that returns the weight for the edge. */ + weight?(edge: EdgeSingular): number; + + /** + * A boolean indicating whether the directed indegree and outdegree centrality is calculated (true) or + * whether the undirected centrality is calculated (false, default). + */ + directed?: boolean; + } + /** + * http://js.cytoscape.org/#eles.betweennessCentrality + */ + interface SearchBetweennessResult { + /** returns the betweenness centrality of the specified node */ + betweenness(node: NodeSingular): number; + + /** returns the normalised betweenness centrality of the specified node */ + betweennessNormalized(node: NodeSingular): number; + betweennessNormalised(node: NodeSingular): number; + } + + /** + * http://js.cytoscape.org/#eles.closenessCentralityNormalized + */ + interface SearchClosenessCentralityNormalizedOptions { + /** A function that returns the weight for the edge. */ + weight?(edge: EdgeSingular): number; + directed?: boolean; + /** + * A boolean indicating whether the algorithm calculates the + * harmonic mean (true, default) or the arithmetic mean (false) of distances. + * The harmonic mean is very useful for graphs that are not strongly connected. + */ + harmonic?: boolean; + } + /** + * http://js.cytoscape.org/#eles.closenessCentralityNormalized + * trivial + */ + + interface CollectionAlgorithms { + /** + * Perform a breadth-first search within the elements in the collection. + * @param options + * http://js.cytoscape.org/#eles.breadthFirstSearch + */ + breadthFirstSearch(options: SearchFirstOptions): SearchFirstResult; + /** + * Perform a depth-first search within the elements in the collection. + * http://js.cytoscape.org/#eles.depthFirstSearch + */ + depthFirstSearch(options: SearchFirstOptions): SearchFirstResult; + + /** + * Perform Dijkstra's algorithm on the elements in the collection. + * This finds the shortest paths to all other nodes in the collection from the root node. + * http://js.cytoscape.org/#eles.dijkstra + */ + dijkstra(options: SearchDijkstraOptions): SearchDijkstraResult; + + /** + * Perform the A* search algorithm on the elements in the collection. + * This finds the shortest path from the root node to the goal node. + * http://js.cytoscape.org/#eles.aStar + */ + aStar(options: SearchAStarOptions): SearchAStarResult; + /** + * Perform the Floyd Warshall search algorithm on the elements in the collection. + * This finds the shortest path between all pairs of nodes. + * http://js.cytoscape.org/#eles.floydWarshall + */ + aStar(options: SearchFloydWarshallOptions): SearchFloydWarshallResult; + /** + * Perform the Bellman-Ford search algorithm on the elements in the collection. + * This finds the shortest path from the starting node to all other nodes in the collection. + * http://js.cytoscape.org/#eles.bellmanFord + */ + bellmanFort(options: SearchBellmanFordOptions): SearchBellmanFordResult; + /** + * Perform Kruskal's algorithm on the elements in the collection, + * returning the minimum spanning tree, assuming undirected edges. + * http://js.cytoscape.org/#eles.kruskal + */ + kruskal(handler: (edge: EdgeCollection) => number): void; + /** + * Finds the minimum cut in a graph using the Karger-Stein algorithm. + * The optimal result is found with a high probability, but without guarantee. + * http://js.cytoscape.org/#eles.kargerStein + */ + kargerStein(): { cut: EdgeCollection; partitionFirst: NodeCollection; partitionSecond: NodeCollection; }; + /** + * Rank the nodes in the collection using the Page Rank algorithm. + * http://js.cytoscape.org/#eles.pageRank + */ + pageRank(options: SearchPageRankOptions): SearchPageRankResult; + /** + * Considering only the elements in the calling collection, + * calculate the degree centrality of the specified root node. + * http://js.cytoscape.org/#eles.degreeCentrality + */ + degreeCentrality(options: SearchDegreeCentralityOptions): + SearchDegreeCentralityResultDirected | SearchDegreeCentralityResultUndirected; + + /** + * Considering only the elements in the calling collection, + * calculate the normalised degree centrality of the nodes. + * http://js.cytoscape.org/#eles.degreeCentralityNormalized + */ + degreeCentralityNormalized(options: SearchDegreeCentralityNormalizedOptions): + SearchDegreeCentralityNormalizedResultDirected | SearchDegreeCentralityNormalizedResultUndirected; + + /** + * Considering only the elements in the calling collection, + * calculate the closeness centrality of the specified root node. + * http://js.cytoscape.org/#eles.closenessCentrality + */ + closenessCentrality(options: SearchClosenessCentralityOptions): number; + /** + * Considering only the elements in the calling collection, + * calculate the closeness centrality of the nodes. + * http://js.cytoscape.org/#eles.closenessCentralityNormalized + */ + closenessCentralityNormalized(options: SearchClosenessCentralityNormalizedOptions): + SearchDegreeCentralityNormalizedResultDirected | + SearchDegreeCentralityNormalizedResultUndirected; + /** + * Considering only the elements in the calling collection, + * calculate the betweenness centrality of the nodes. + * http://js.cytoscape.org/#eles.betweennessCentrality + */ + betweennessCentrality(options: SearchBetweennessOptions): SearchBetweennessResult; + } + + /** + * http://js.cytoscape.org/#collection/compound-nodes + */ + interface NodeSingularCompound { + /** + * Get whether the node is a compound parent + * (i.e. a node containing one or more child nodes) + * http://js.cytoscape.org/#node.isParent + */ + isParent(): boolean; + /** + * Get whether the node is childless (i.e. a node with no child nodes) + * http://js.cytoscape.org/#node.isChildless + */ + isChildless(): boolean; + /** + * Get whether the node is a compound child (i.e. contained within a node) + * http://js.cytoscape.org/#node.isChild + */ + isChild(): boolean; + /** + * Get whether the node is an orphan (i.e. a node with no parent) + * http://js.cytoscape.org/#node.isOrphan + */ + isOrphan(): boolean; + } + /** + * http://js.cytoscape.org/#collection/compound-nodes + */ + interface NodeCollectionCompound { + /** + * Get the compound parent node of each node in the collection. + * @param selector A selector used to filter the resultant collection. + * http://js.cytoscape.org/#nodes.parent + */ + parent(selector?: Selector): NodeCollection; + /** + * Get all compound ancestor nodes + * (i.e. parents, parents' parents, etc.) of each node in the collection. + * @param selector A selector used to filter the resultant collection. + * http://js.cytoscape.org/#nodes.ancestors + */ + ancestors(selector?: Selector): NodeCollection; + parents(selector?: Selector): NodeCollection; + /** + * Get all compound ancestors common to all the nodes in the collection, + * starting with the closest and getting progressively farther. + * @param selector A selector used to filter the resultant collection. + * http://js.cytoscape.org/#nodes.commonAncestors + */ + commonAncestors(selector?: Selector): NodeCollection; + /** + * Get all orphan (i.e. has no compound parent) nodes in the calling collection. + * @param selector A selector used to filter the resultant collection. + * http://js.cytoscape.org/#nodes.orphans + */ + orphans(selector?: Selector): NodeCollection; + /** + * Get all nonorphan (i.e. has a compound parent) nodes in the calling collection. + * @param selector A selector used to filter the resultant collection. + * http://js.cytoscape.org/#nodes.nonorphans + */ + nonorphans(selector?: Selector): NodeCollection; + /** + * Get all compound child (i.e. direct descendant) nodes of each node in the collection. + * @param selector A selector used to filter the resultant collection. + * http://js.cytoscape.org/#nodes.children + */ + children(selector?: Selector): NodeCollection; + /** + * Get all compound descendant (i.e. children, children's children, etc.) + * nodes of each node in the collection. + * @param selector A selector used to filter the resultant collection. + * http://js.cytoscape.org/#nodes.descendants + */ + descendants(selector?: Selector): NodeCollection; + /** + * Get all sibling (i.e. same compound parent) + * nodes of each node in the collection. + * @param selector A selector used to filter the resultant collection. + * http://js.cytoscape.org/#nodes.siblings + */ + siblings(selector?: Selector): NodeCollection; + } + + /** + * A selector functions similar to a CSS selector on DOM elements, + * but selectors in Cytoscape.js instead work on + * collections of graph elements. + * Note that wherever a selector may be specified + * as the argument to a function, + * a eles.filter()-style filter function may be + * used in place of the selector. + * + * See http://js.cytoscape.org/#selectors for + * details about writing selectors. + * Selectors are an island grammar. + */ + type Selector = string; + + /** + * A space separated list of event names. + * http://js.cytoscape.org/#cy.promiseOn + */ + type EventNames = string; + + /** + * A string indicating the selection behaviour from user input. + * http://js.cytoscape.org/#core/initialisation + * + * 'additive' : a new selection made by the user adds to the set of currently selected elements. + * 'single' : a new selection made by the user becomes the entire set of currently + * selected elements (i.e. the previous elements are unselected) + */ + type SelectionType = "additive" | "single"; + + /** + * http://js.cytoscape.org/#ele.group + * http://js.cytoscape.org/#notation/elements-json + * + * 'nodes' + * 'edges' + */ + type ElementGroup = "nodes" | "edges"; + + /** + * 'x' : x coordinate + * 'y' : y coordinate + */ + type PositionDimension = "x" | "y"; + + /** + * Usually temp or nonserialisable data can be stored. + * http://js.cytoscape.org/#notation/elements-json + * http://js.cytoscape.org/#cy.scratch + * http://js.cytoscape.org/#ele.scratch + */ + type Scratchpad = any; + + /** + * Style in Cytoscape.js follows CSS conventions as closely as possible. + * In most cases, a property has the same name and behaviour as its corresponding CSS namesake. + * However, the properties in CSS are not sufficient to specify the style of some parts of the graph. + * In that case, additional properties are introduced that are unique to Cytoscape.js. + * + * For simplicity and ease of use, specificity rules are completely ignored in stylesheets. + * For a given style property for a given element, the last matching selector wins. + * + * http://js.cytoscape.org/#style + */ + namespace Css { + type Colour = string; + + /** + * The shape of the node’s body. + * Note that each shape fits within the specified width and height, + * and so you may have to adjust width and height + * if you desire an equilateral shape + * (i.e. width !== height for several equilateral shapes). + * 'polygon' is a custom polygon specified via shape-polygon-points. + */ + type NodeShape = 'rectangle' | 'roundrectangle' | 'ellipse' | 'triangle' + | "pentagon" | "hexagon" | "heptagon" | "octagon" | "star" + | "diamond" | "vee" | "rhomboid" | "polygon"; + + /** + * A space-separated list of numbers ranging on [-1, 1], + * representing alternating x and y values (i.e. x1 y1 x2 y2, x3 y3 ...). + * This represents the points in the polygon for the node’s shape. + * The bounding box of the node is given by (-1, -1), (1, -1), (1, 1), (-1, 1). + */ + type ShapePolygonPoints = string; + + /** + * The line style; may be solid, dotted, dashed, or double + */ + type LineStyle = "solid" | "dotted" | "dashed" | "double"; + + /** + * http://js.cytoscape.org/#style/node-body + */ + interface Node extends PaddingNode { + "label"?: string; + /** + * The width of the node’s body. + * This property can take on the special value label + * so the width is automatically based on the node’s label. + */ + "width"?: number | "label"; + /** + * The height of the node’s body. + * This property can take on the special value label + * so the height is automatically based on the node’s label. + */ + "height"?: number | "label"; + /** + * The shape of the node’s body. + */ + "shape"?: NodeShape; + "shape-polygon-points"?: ShapePolygonPoints; + + "opacity"?: number; + + "backgroundColor"?: Colour; + /** + * The colour of the node’s body. + */ + "background-color"?: Colour; + /** + * Blackens the node’s body for values from 0 to 1; + * whitens the node’s body for values from 0 to -1. + */ + "background-blacken"?: number; + /** + * The opacity level of the node’s background colour. + */ + "background-opacity"?: number; + /** + * The size of the node’s border. + */ + "border-width"?: number; + /** + * The style of the node’s border. + */ + "border-style"?: LineStyle; + /** + * The colour of the node’s border. + */ + "border-color"?: Colour; + /** + * The opacity of the node’s border. + * A value between [0 1]. + */ + "border-opacity"?: number; + + "text-opacity"?: number; + } + + /** + * A padding defines an addition to a node’s dimension. + * For example, padding-left adds to a node’s outer (i.e. total) width. + * This can be used to add spacing around the label of width: label; height: label; nodes, + * or it can be used to add spacing between a compound node parent and its children. + */ + interface PaddingNode { + "padding-left"?: string; + "padding-right"?: string; + "padding-top"?: string; + "padding-bottom"?: string; + } + + interface Dictionary { [key: string]: any; } + + // export interface ElementCss extends CSSStyleDeclaration { } + /** + * A background image may be applied to a node’s body: + * + * http://js.cytoscape.org/#style/background-image + */ + interface BackgroundImage { + /** + * The URL that points to the image that should be used as the node’s background. + * PNG, JPG, and SVG are supported formats. + * You may use a data URI to use embedded images, + * thereby saving a HTTP request. + */ + "background-image"?: string; + /** + * The opacity of the background image. [0 1] + */ + "background-image-opacity"?: number; + /** + * Specifies the width of the image. + * A percent value (e.g. 50%) may be used to set + * the image width relative to the node width. + * If used in combination with background- fit, + * then this value overrides the width of the image + * in calculating the fitting — thereby overriding the aspect ratio. + * The auto value is used by default, which uses the width of the image. + */ + "background-width"?: number | string; + /** + * Specifies the height of the image. + * A percent value (e.g. 50%) may be used to set the image + * height relative to the node height. + * If used in combination with background- fit, + * then this value overrides the height of the image in calculating + * the fitting — thereby overriding the aspect ratio. + * The auto value is used by default, which uses the height of the image. + */ + "background-height"?: number | string; + /** + * How the background image is fit to the node; + * may be none for original size, + * contain to fit inside node, + * or cover to cover the node. + */ + "background-fit"?: "none" | "contain" | "cover"; + /** + * Whether to repeat the background image; + * may be no-repeat, repeat-x, repeat-y, or repeat. + */ + "background-repeat"?: "no-repeat" | "repeat-x" | "repeat-y" | "repeat"; + /** + * The x position of the background image, + * measured in percent(e.g. 50%) or pixels (e.g. 10px). + */ + "background-position-x"?: number | string; + /** + * The y position of the background image, + * measured in percent(e.g. 50%) or pixels (e.g. 10px). + */ + "background-position-y"?: number | string; + /** + * How background image clipping is handled; + * may be node for clipped to node shape or none for no clipping. + */ + "background-clip"?: "clipped" | "none"; + } + + /** + * These properties allow you to create pie chart backgrounds on nodes. + * Note that 16 slices maximum are supported per node, + * so in the properties 1 <= i <= 16. + * Of course, you must specify a numerical value for each property in place of i. + * Each nonzero sized slice is placed in order of i, + * starting from the 12 o’clock position and working clockwise. + * + * You may find it useful to reserve a number to a particular + * colour for all nodes in your stylesheet. + * Then you can specify values for pie-i-background-size + * accordingly for each node via a mapper. + * This would allow you to create consistently coloured + * pie charts in each node of the graph based on element data. + * + * http://js.cytoscape.org/#style/pie-chart-background + */ + interface PieChartBackground { + /** + * The diameter of the pie, measured as a percent of node size (e.g. 100%) or an absolute length (e.g. 25px). + */ + "pie-size": string; + /** + * The colour of the node’s ith pie chart slice. + */ + "pie-i-background-color": Colour; + /** + * The size of the node’s ith pie chart slice, measured in percent (e.g. 25% or 25). + */ + "pie-i-background-size": number; + /** + * The opacity of the node’s ith pie chart slice. + */ + "pie-i-background-opacity": number; + } + + interface Edge extends EdgeLine, EdgeArror { } + + /** + * These properties affect the styling of an edge’s line: + * + * http://js.cytoscape.org/#style/edge-line + */ + interface EdgeLine { + /** + * The width of an edge’s line. + */ + "width"?: number | "label"; + /** + * The curving method used to separate two or more edges between two nodes; + * may be + * - haystack (default, very fast, bundled straight edges for which loops and compounds are unsupported), + * - bezier(bundled curved edges), + * - unbundled - bezier(curved edges for use with manual control points), or + * - segments (a series of straight lines). + * Note that haystack edges work best with ellipse, rectangle, or similar nodes. + * Smaller node shapes, like triangle, will not be as aesthetically pleasing. + * Also note that edge arrows are unsupported for haystack edges. + */ + "curve-style"?: "haystack" | "bezier" | "unbundled" | "segments"; + /** + * The colour of the edge’s line. + */ + "line-color"?: Colour; + /** + * The style of the edge’s line. + */ + "line-style"?: LineStyle; + } + + /** + * For automatic, bundled bezier edges (curve - style: bezier): + * + * http://js.cytoscape.org/#style/bezier-edges + */ + interface BezierEdges { + /** + * From the line perpendicular from source to target, + * this value specifies the distance between successive bezier edges. + */ + "control-point-step-size": number; + /** + * A single value that overrides "control-point-step-size" with a manual value. + * Because it overrides the step size, bezier edges with the same value will overlap. + * Thus, it’s best to use this as a one- off value for particular edges if need be. + */ + "control-point-distance": number; + /** + * A single value that weights control points along the line from source to target. + * The value usually ranges on [0, 1], with + * 0 towards the source node and + * 1 towards the target node — + * but larger or smaller values can also be used. + */ + "control-point-weight": number; + /** + * With value intersection (default), + * the line from source to target for "control-point-weight" is + * from the outside of the source node’s shape to the outside of + * the target node’s shape.With value node- position, + * the line is from the source position to the target position. + * The "node-position" option makes calculating edge points easier + * — but it should be used carefully because you can create invalid + * points that intersection would have automatically corrected. + */ + "edge-distances": number; + } + /** + * Unbundled bezier edges + * For bezier edges with manual control points (curve - style: unbundled - bezier): + * + * http://js.cytoscape.org/#style/unbundled-bezier-edges + */ + interface UnbundledBezierEdges { + /** + * A series of values that specify for each control point the + * distance perpendicular to a line formed + * from source to target, e.g. -20 20 - 20. + */ + "control-point-distances": string; + /** + * A series of values that weights control points along + * a line from source to target, e.g. 0.25 0.5 0.75. + * A value usually ranges on [0, 1], with + * 0 towards the source node and + * 1 towards the target node + * — but larger or smaller values can also be used. + */ + "control-point-weights": string; + /** + * With value intersection (default), + * the line from source to target for "control-point-weights" + * is from the outside of the source node’s shape to the + * outside of the target node’s shape. + * With value + * "node-position", the line is from the source position to the target position. + * The "node-position" option makes calculating edge points easier + * — but it should be used carefully because you can create + * invalid points that intersection would have automatically corrected. + */ + "edge-distances": number; + } + /** + * Haystack edges + * Loop edges and compound parent nodes are not supported by haystack edges. + * Haystack edges are a more performant replacement for plain, straight line edges. + * + * For fast, straight line edges (curve - style: haystack): + * http://js.cytoscape.org/#style/haystack-edges + */ + interface HaystackEdges { + /** + * A value between 0 and 1 inclusive that indicates the relative radius used to position haystack edges on their connected nodes. + * The outside of the node is at 1, and the centre of the node is at 0. + */ + "haystack-radius": number; + } + /** + * Segments edges + * For edges made of several straight lines (curve - style: segments): + * http://js.cytoscape.org/#style/segments-edges + */ + interface SegmentsEdges { + /** + * A series of values that specify for each segment point the distance perpendicular to a line formed from source to target, e.g. -20 20 - 20. + */ + "segment-distances": string; + /** + * A series of values that weights segment points along a line from source to target, + * e.g. 0.25 0.5 0.75.A value usually ranges on [0, 1], + * with 0 towards the source node and 1 towards the target node — but larger or smaller values can also be used. + */ + "segment-weights": string; + /** + * With value + * * "intersection" (default), the line from source to target + * * for "segment-weights" is from the outside of the source node’s shape to the outside of the target node’s shape. + * * With value "node-position", the line is from the source position to the target position. + * The "node-position" option makes calculating edge points easier + * — but it should be used carefully because you can create + * invalid points that intersection would have automatically corrected. + */ + "edge-distances": "intersection" | "segment-weights" | "node-position"; + } + type ArrowShape = "tee" | "triangle" | "triangle-tee" | "triangle-backcurve" | "square" | "circle" | "diamond" | "none"; + + type ArrowFill = "filled" | "hollow"; + + /** + * Edge arrow + * * -arrow-color : The colour of the edge’s source arrow. + * * -arrow-shape : The shape of the edge’s source arrow. + * * -arrow-fill : The fill state of the edge’s source arrow. + * + * For each edge arrow property above, replace with one of + * * source : Pointing towards the source node, at the end of the edge. + * * mid-source : Pointing towards the source node, at the middle of the edge. + * * target : Pointing towards the target node, at the end of the edge. + * * mid-target: Pointing towards the target node, at the middle of the edge. + * + * Only mid arrows are supported on haystack edges. + * http://js.cytoscape.org/#style/edge-arrow + */ + interface EdgeArror { + /** The colour of the edge’s source arrow. */ + "source-arrow-color"?: Colour; + /** The colour of the edge’s "mid-source" arrow. */ + "mid-source-arrow-color"?: Colour; + /** The colour of the edge’s target arrow. */ + "target-arrow-color"?: Colour; + /** The colour of the edge’s "mid-target" arrow. */ + "mid-target-arrow-color"?: Colour; + + /** The shape of the edge’s source arrow. */ + "source-arrow-shape"?: ArrowShape; + /** The shape of the edge’s mid-source arrow. */ + "mid-source-arrow-shape"?: ArrowShape; + /** The shape of the edge’s target arrow. */ + "target-arrow-shape"?: ArrowShape; + /** The shape of the edge’s mid-target arrow. */ + "mid-target-arrow-shape"?: ArrowShape; + + /** The fill state of the edge’s source arrow. */ + "source-arrow-fill"?: ArrowFill; + /** The fill state of the edge’s mid-source arrow. */ + "mid-source-arrow-fill"?: ArrowFill; + /** The fill state of the edge’s target arrow. */ + "target-arrow-fill"?: ArrowFill; + /** The fill state of the edge’s mid-target arrow. */ + "mid-target-arrow-fill"?: ArrowFill; + } + + /** + * http://js.cytoscape.org/#style/visibility + */ + interface Visibility { + /** + * Whether to display the element; may be element for displayed or none for not displayed. + * Note that a "display: none" bezier edge does not take up space in its bundle. + */ + "display": "none" | "displayed"; + /** + * Whether the element is visible; may be visible or hidden. + * Note that a "visibility : hidden" bezier edge still takes up space in its bundle. + */ + "visibility": "none" | "visible"; + /** + * The opacity of the element, ranging from 0 to 1. + * Note that the opacity of a compound node parent affects the effective opacity of its children. + */ + "opacity": number; + /** + * An integer value that affects the relative draw order of elements. + * In general, an element with a higher "z-index" will be drawn on top of an element with a lower "z-index". + * Note that edges are under nodes despite "z-index", except when necessary for compound nodes. + */ + "z-index": number; + } + + /** https://developer.mozilla.org/en-US/docs/Web/CSS/font-style */ + type FontStyle = "normal" | "italic" | "oblique"; + + /** https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight */ + type FontWeight = number | "normal" | "bold" | "lighter" | "bolder"; + + /** http://js.cytoscape.org/#style/labels */ + type TextTranformation = "none" | "uppercase" | "lowercase"; + + /** + * Labels + * Label text: + * + * http://js.cytoscape.org/#style/labels + */ + interface Labels { + /** + * The text to display for an element’s label. + */ + "label": string; + /** + * The text to display for an edge’s source label. + */ + "source-label": string; + /** + * The text to display for an edge’s target label. + */ + "target-label": string; + /** + * Basic font styling: + */ + /** + * The colour of the element’s label. + */ + "color": Colour; + /** + * The opacity of the label text, including its outline. + */ + "text-opacity": number; + /** + * A comma-separated list of font names to use on the label text. + */ + "font-family": string; + /** + * The size of the label text. + * https://developer.mozilla.org/en-US/docs/Web/CSS/font-family + */ + "font-size": number; + /** + * A CSS font style to be applied to the label text. + * https://developer.mozilla.org/en-US/docs/Web/CSS/font-style + */ + "font-style": FontStyle; + /** + * A CSS font weight to be applied to the label text. + */ + "font-weight": FontWeight; + /** + * A transformation to apply to the label text. + */ + "text-transform": TextTranformation; + + /** + * Wrapping text: + */ + + /** + * A wrapping style to apply to the label text; may be + * * "none" for no wrapping (including manual newlines ) or + * * "wrap" for manual and/ or autowrapping. + */ + "text-wrap": "none" | "wrap"; + /** + * The maximum width for wrapped text, + * applied when "text-wrap" is set to wrap. + * For only manual newlines (i.e.\n), set a very large + * value like 1000px such that only your newline characters would apply. + */ + "text-max-width": string; + + /** + * Node label alignment: + */ + + /** + * The vertical alignment of a node’s label. + */ + "text-halign": "left" | "center" | "right"; + /** + * The vertical alignment of a node’s label. + */ + "text-valign": "top" | "center" | "bottom"; + + /** + * Edge label alignment: + */ + + /** + * For the source label of an edge, how far from the source node the label should be placed. + */ + "source-text-offset": number; + /** + * For the target label of an edge, how far from the target node the label should be placed. + */ + "target-text-offset": number; + /** + * Margins: + */ + + /** + * A margin that shifts the label along the x- axis. + */ + "text-margin-x": number; + /** + * A margin that shifts the label along the y- axis. + */ + "text-margin-y": number; + /** + * (For the source label of an edge.) + */ + "source-text-margin-x": number; + /** + * (For the source label of an edge.) + */ + "source-text-margin-y": number; + /** + * (For the target label of an edge.) + */ + "target-text-margin-x": number; + /** + * (For the target label of an edge.) + */ + "target-text-margin-y": number; + /** + * Rotating text: + */ + + /** + * A rotation angle that is applied to the label. + * * For edges, the special value autorotate can be used to align the label to the edge. + * * For nodes, the label is rotated along its anchor point on the node, so a label margin may help for some usecases. + * * The special value none can be used to denote 0deg. + * * Rotations works best with left- to - right text. + */ + "text-rotation": number; + + /** + * (For the source label of an edge.) + */ + "source-text-rotation": number; + /** + * (For the target label of an edge.) + */ + "target-text-rotation": number; + + /** + * Outline: + */ + + /** + * The colour of the outline around the element’s label text. + */ + "text-outline-color": Colour; + /** + * The opacity of the outline on label text. + */ + "text-outline-opacity": number; + /** + * The size of the outline on label text. + */ + "text-outline-width": number; + /** + * Shadow: + */ + /** + * The shadow blur distance. + */ + "text-shadow-blur": number; + /** + * The colour of the shadow. + */ + "text-shadow-color": Colour; + /** + * The x offset relative to the text where the shadow will be displayed, can be negative. + * If you set blur to 0, add an offset to view your shadow. + */ + "text-shadow-offset-x": number; + /** + * The y offset relative to the text where the shadow will be displayed, can be negative. + * If you set blur to 0, add an offset to view your shadow. + */ + "text-shadow-offset-y": number; + /** + * The opacity of the shadow on the text; the shadow is disabled for 0 (default value). + */ + "text-shadow-opacity": number; + + /** + * Background: + */ + + /** + * A colour to apply on the text background. + */ + "text-background-color": Colour; + /** + * The opacity of the label background; the background is disabled for 0 (default value). + */ + "text-background-opacity": number; + /** + * The shape to use for the label background. + */ + "text-background-shape": "ractangle" | "roundrectangle"; + + /** + * Border: + */ + + /** + * The width of the border around the label; the border is disabled for 0 (default value). + */ + "text-border-opacity": number; + /** + * The width of the border around the label. + */ + "text-border-width": number; + /** + * The style of the border around the label. + */ + "text-border-style": LineStyle; + /** + * The colour of the border around the label. + */ + "text-border-color": Colour; + + /** + * Interactivity: + */ + + /** + * If zooming makes the effective font size of the label smaller than this, + * then no label is shown.Note that because of performance optimisations, + * the label may be shown at font sizes slightly smaller than this value. + * + * This effect is more pronounced at larger screen pixel ratios.However, + * it is guaranteed that the label will be shown at sizes equal to or greater than the value specified. + */ + "min-zoomed-font-size": number; + /** + * Whether events should occur on an element if the label receives an event. + * You may want a style applied to the text onactive so you know the text is activatable. + */ + "text-events": "yes" | "no"; + } + + /** + * http://js.cytoscape.org/#style/events + */ + interface Events { + /** + * Whether events should occur on an element (e.g.tap, mouseover, etc.). + * * For "no", the element receives no events and events simply pass through to the core/viewport. + */ + "events": "yes" | "no"; + /** + * Whether events should occur on an element if the label receives an event. + * You may want a style applied to the text on active so you know the text is activatable. + */ + "text-events": "yes" | "no"; + } + + /** + * These properties allow for the creation of overlays on top of nodes or edges, + * and are often used in the :active state. + * http://js.cytoscape.org/#style/overlay + */ + interface Overlay { + /** + * The colour of the overlay. + */ + "overlay-color": Colour; + /** + * The area outside of the element within which the overlay is shown. + */ + "overlay-padding": number; + /** + * The opacity of the overlay. + */ + "overlay-opacity": number; + } + /** + * These properties allow for the creation of shadows on nodes or edges. + * Note that shadow-blur could seriously impact performance on large graph. + * http://js.cytoscape.org/#style/shadow + */ + interface Shadow { + /** + * The shadow blur, note that if greater than 0, this could impact performance. + */ + "shadow-blur": number; + /** + * The colour of the shadow. + */ + "shadow-color": Colour; + /** + * The x offset relative to the node/edge where the shadow will be displayed, can be negative. If you set blur to 0, add an offset to view your shadow. + */ + "shadow-offset-x": number; + /** + * The y offset relative to the node/edge where the shadow will be displayed, can be negative. If you set blur to 0, add an offset to view your shadow. + */ + "shadow-offset-y": number; + /** + * The opacity of the shadow. + */ + "shadow-opacity": number; + } + + /** + * Transition animation + */ + type TransitionTimingFunction = "linear" | "spring" | "cubic-bezier" | "ease" | "ease-in" | "ease-out" | + "ease-in-out" | "ease-in-sine" | "ease-out-sine" | "ease-in-out-sine" | "ease-in-quad" | + "ease-out-quad" | "ease-in-out-quad" | "ease-in-cubic" | "ease-out-cubic" | + "ease-in-out-cubic" | "ease-in-quart" | "ease-out-quart" | "ease-in-out-quart" | + "ease-in-quint" | "ease-out-quint" | "ease-in-out-quint" | "ease-in-expo" | + "ease-out-expo" | "ease-in-out-expo" | "ease-in-circ" | "ease-out-circ" | "ease-in-out-circ"; + + /** + * http://js.cytoscape.org/#style/transition-animation + */ + interface TransitionAnimation { + /** + * A comma separated list of style properties to animate in this state. + */ + "transition-property": string; + /** + * The length of the transition in seconds(e.g. 0.5s). + */ + "transition-duration": number; + /** + * The length of the delay in seconds before the transition occurs (e.g. 250ms). + */ + "transition-delay": number; + /** + * An easing function that controls the animation progress curve (a visualisation of easings serves as a reference). + */ + "transition-timing-function": TransitionTimingFunction; + } + + /** + * Core + * These properties affect UI global to the graph, and apply only to the core. + * You can use the special core selector string to set these properties. + * http://js.cytoscape.org/#style/core + */ + interface Core { + /** + * Indicator: + */ + + /** + * The colour of the indicator shown when the background is grabbed by the user. + */ + "active-bg-color": Colour; + /** + * The opacity of the active background indicator. + */ + "active-bg-opacity": number; + /** + * The size of the active background indicator. + */ + "active-bg-size": number; + /** + * Selection box: + */ + /** + * The background colour of the selection box used for drag selection. + */ + "selection-box-color": Colour; + /** + * The colour of the border on the selection box. + */ + "selection-box-border-color": Colour; + /** + * The size of the border on the selection box. + */ + "selection-box-border-width": number; + /** + * The opacity of the selection box. + */ + "selection-box-opacity": number; + /** + * Texture during viewport gestures: + */ + /** + * The colour of the area outside the viewport texture when initOptions.textureOnViewport === true. + */ + "outside-texture-bg-color": Colour; + /** + * The opacity of the area outside the viewport texture. + */ + "outside-texture-bg-opacity": number; + } + } + + /** + * Events passed to handler callbacks are similar to + * jQuery event objects in that they wrap native event objects, + * mimicking their API. + * + * http://js.cytoscape.org/#events + */ + interface EventObject extends InputEventObject, LayoutEventObject { } + + /** + * http://js.cytoscape.org/#events/event-object + */ + interface AbstractEventObject { + /** a reference to the corresponding core Core */ + cy: any; + /** indicates the element or core that first caused the event */ + target?: any; + /** the event type string (e.g. "tap") */ + type: UserInputDeviceEventName | UserInputDeviceEventNameExt; + /** the event namespace string (e.g. "foo" for "foo.tap") */ + namespace: string; + /** Unix epoch time of event in milliseconds */ + timeStamp: number; + } + interface InputEventObject extends AbstractEventObject { + /** position : indicates the model position of the event */ + position: Position; + /** renderedPosition : indicates the rendered position of the event */ + renderedPosition: Position; + /** originalEvent : the original user input device event object */ + originalEvent: EventObject; + } + interface LayoutEventObject extends AbstractEventObject { + /** + * layout : indicates the corresponding layout that triggered the event + * (useful if running multiple layouts simultaneously) + */ + layout: any; + } + + /** + * These are normal browser events that you can bind to via Cytoscape.js. + * You can bind these events to the core and to collections. + * http://js.cytoscape.org/#events/user-input-device-events + */ + type UserInputDeviceEventName = + // when the mouse button is pressed + "mousedown" | + // when the mouse button is released + "mouseup" | + // after mousedown then mouseup + "click" | + // when the cursor is put on top of the target + "mouseover" | + // when the cursor is moved off of the target + "mouseout" | + // when the cursor is moved somewhere on top of the target + "mousemove" | + // when one or more fingers starts to touch the screen + "touchstart" | + // when one or more fingers are moved on the screen + "touchmove" | + // when one or more fingers are removed from the screen + "touchend"; + + /** + * There are also some higher level events that you can use + * so you don’t have to bind to different events for + * mouse-input devices and for touch devices. + * http://js.cytoscape.org/#events/user-input-device-events + */ + type UserInputDeviceEventNameExt = + // normalised tap start event (either mousedown or touchstart) + "tapstart" | "vmousedown" | + // normalised move event (either touchmove or mousemove) + "tapdrag" | "vmousemove" | + // normalised over element event (either touchmove or mousemove/mouseover) + "tapdragover" | + // normalised off of element event (either touchmove or mousemove/mouseout) + "tapdragout" | + // normalised tap end event (either mouseup or touchend) + "tapend" | "vmouseup" | + // normalised tap event (either click, or touchstart followed by touchend without touchmove) + "tap" | "vclick" | + // normalised tap hold event + "taphold" | + // normalised right-click mousedown or two-finger tapstart + "cxttapstart" | + // normalised right-click mouseup or two-finger tapend + "cxttapend" | + // normalised right-click or two-finger tap + "cxttap" | + // normalised mousemove or two-finger drag after cxttapstart but before cxttapend + "cxtdrag" | + // when going over a node via cxtdrag + "cxtdragover" | + // when going off a node via cxtdrag + "cxtdragout" | + // when starting box selection + "boxstart" | + // when ending box selection + "boxend" | + // triggered on elements when selected by box selection + "boxselect" | + // triggered on elements when inside the box on boxend + "box"; + + /** + * These events are custom to Cytoscape.js. You can bind to these events for collections. + * http://js.cytoscape.org/#events/collection-events + */ + type CollectionEventName = + // when an element is added to the graph + "add" | + // when an element is removed from the graph + "remove" | + // when an element is selected + "select" | + // when an element is unselected + "unselect" | + // when an element is locked + "lock" | + // when an element is unlocked + "unlock" | + // when an element is grabbed directly (including only the one node directly under the cursor or the user’s finger) + "grabon" | + // when an element is grabbed (including all elements that would be dragged) + "grab" | + // when an element is grabbed and then moved + "drag" | + // when an element is freed (i.e. let go from being grabbed) + "free" | + // when an element changes position + "position" | + // when an element’s data is changed + "data" | + // when an element’s scratchpad data is changed + "scratch" | + // when an element’s style is changed + "style"; + + /** + * These events are custom to Cytoscape.js, and they occur on the core. + * http://js.cytoscape.org/#events/graph-events + */ + type GraphEventName = + // when a layout starts running + "layoutstart" | + // when a layout has set initial positions for all the nodes (but perhaps not final positions) + "layoutready" | + // when a layout has finished running completely or otherwise stopped running + "layoutstop" | + // when a new Core of Cytoscape.js is ready to be interacted with + "ready" | + // when the Core of Cytoscape.js was explicitly destroyed by calling .destroy(). + "destroy" | + // when the viewport is (re)rendered + "render" | + // when the viewport is panned + "pan" | + // when the viewport is zoomed + "zoom" | + // when the viewport is resized (usually by calling cy.resize(), a window resize, or toggling a class on the Cytoscape.js div) + "resize"; + + /** + * Layouts + * http://js.cytoscape.org/#layouts + * + * The function of a layout is to set the positions on the nodes in the graph. + * Layouts are extensions of Cytoscape.js such that it is possible for + * anyone to write a layout without modifying the library itself. + * Several layouts are included with Cytoscape.js by default, + * and their options are described in the sections that follow + * with the default values specified. + * Note that you must set options.name to the name of the + * layout to specify which one you want to run. + * Each layout has its own algorithm for setting the position for each node. + * This algorithm influences the overall shape of the graph and the lengths of the edges. + * A layout’s algorithm can be customised by setting its options. + * Therefore, edge lengths can be controlled by setting the layout options appropriately. + * For force-directed (physics) layouts, + * there is generally an option to set a weight to each edge + * to affect the relative edge lengths. + * Edge length can also be affected by options like spacing + * factors, angles, and overlap avoidance. + * Setting edge length depends on the particular layout, + * and some layouts will allow for more precise edge lengths than others. + */ + + interface Layouts extends LayoutManipulation, LayoutEvents { } + + type LayoutOptions = + NullLayoutOptions | PresetLayoutOptions | GridLayoutOptions | + CircleLayoutOptions | ConcentricLayoutOptions | BreadthFirstLayoutOptions | + CoseLayoutOptions | BaseLayoutOptions; + + type LayoutHandler = () => void; + + interface BaseLayoutOptions { + name: string; + // on layoutready event + ready?: LayoutHandler; + // on layoutstop event + stop?: LayoutHandler; + } + /** + * http://js.cytoscape.org/#layouts/null + */ + interface NullLayoutOptions { + name: "null"; + } + interface BoundingBox12 { + x1: number; + y1: number; + x2: number; + y2: number; + } + interface BoundingBoxWH { + x1: number; + y1: number; + w: number; + h: number; + } + interface AnimatedLayoutOptions { + // whether to transition the node positions + animate?: boolean; + // duration of animation in ms if enabled + animationDuration?: number; + // easing of animation if enabled + animationEasing?: boolean; + } + /** + * http://js.cytoscape.org/#layouts/random + */ + interface RandomLayoutOptions extends BaseLayoutOptions, AnimatedLayoutOptions { + name: "random"; + // whether to fit to viewport + fit: boolean; + // fit padding + padding?: number; + // constrain layout bounds + boundingBox: undefined | BoundingBox12 | BoundingBoxWH; + } + + /** + * http://js.cytoscape.org/#layouts/preset + */ + interface NodePositionMap { [nodeid: string]: Position; } + type NodePositionFunction = (nodeid: string) => Position; + interface PresetLayoutOptions extends BaseLayoutOptions, AnimatedLayoutOptions { + name: "preset"; + // map of (node id) => (position obj); or function(node){ return somPos; } + positions?: NodePositionMap | NodePositionFunction; + // the zoom level to set (prob want fit = false if set) + zoom?: number; + // the pan level to set (prob want fit = false if set) + pan?: number; + // whether to fit to viewport + fit?: boolean; + // padding on fit + padding?: number; + } + + interface SortableNode { + data: { weight: number; }; + } + + // function(a, b){ return a.data('weight') - b.data('weight') } + type SortingFunction = (a: SortableNode, b: SortableNode) => number; + + interface ShapedLayoutOptions extends BaseLayoutOptions, AnimatedLayoutOptions { + // whether to fit to viewport + fit: boolean; + // padding used on fit + padding?: number; + // constrain layout bounds + boundingBox?: BoundingBox12 | BoundingBoxWH; + + // prevents node overlap, may overflow boundingBox if not enough space + avoidOverlap?: boolean; + + // Excludes the label when calculating node bounding boxes for the layout algorithm + nodeDimensionsIncludeLabels: boolean; + // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up + spacingFactor?: number; + + // a sorting function to order the nodes + sort?: SortingFunction; + } + /** + * http://js.cytoscape.org/#layouts/grid + */ + interface GridLayoutOptions extends ShapedLayoutOptions { + name: "grid"; + + // extra spacing around nodes when avoidOverlap: true + avoidOverlapPadding?: number; + + // uses all available space on false, uses minimal space on true + condense: boolean; + // force num of rows in the grid + rows?: number; + // force num of columns in the grid + cols?: number; + // returns { row, col } for element + position(nodeid: string): { row: number; col: number; }; + } + + /** + * http://js.cytoscape.org/#layouts/circle + */ + interface CircleLayoutOptions extends ShapedLayoutOptions { + name: "circle"; + + // the radius of the circle + radius?: number; + + // where nodes start in radians, e.g. 3 / 2 * Math.PI, + startAngle: number; + // how many radians should be between the first and last node (defaults to full circle) + sweep?: number; + // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) + clockwise?: boolean; + } + /** + * http://js.cytoscape.org/#layouts/concentric + */ + interface ConcentricLayoutOptions extends ShapedLayoutOptions { + name: "concentric"; + + // where nodes start in radians, e.g. 3 / 2 * Math.PI, + startAngle: number; + // how many radians should be between the first and last node (defaults to full circle) + sweep?: number; + // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) + clockwise?: boolean; + + // whether levels have an equal radial distance betwen them, may cause bounding box overflow + equidistant: false; + minNodeSpacing: 10; // min spacing between outside of nodes (used for radius adjustment) + // height of layout area (overrides container height) + height: undefined; + // width of layout area (overrides container width) + width: undefined; + // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up + spacingFactor: undefined; + // returns numeric value for each node, placing higher nodes in levels towards the centre + concentric(node: { degree(): number; }): number; + // the variation of concentric values in each level + levelWidth(node: { maxDegree(): number; }): number; + } + + /** + * http://js.cytoscape.org/#layouts/breadthfirst + */ + interface BreadthFirstLayoutOptions extends ShapedLayoutOptions { + name: "breadthfirst"; + + // whether the tree is directed downwards (or edges can point in any direction if false) + directed: boolean; + // put depths in concentric circles if true, put depths top down if false + circle: boolean; + // the roots of the trees + roots?: string; + // how many times to try to position the nodes in a maximal way (i.e. no backtracking) + maximalAdjustments: number; + } + + /** + * http://js.cytoscape.org/#layouts/cose + */ + interface CoseLayoutOptions extends ShapedLayoutOptions { + name: "cose"; + + // Number of iterations between consecutive screen positions update + // (0 -> only updated on the end) + refresh: number; + // Randomize the initial positions of the nodes (true) or use existing positions (false) + randomize: boolean; + // Extra spacing between components in non-compound graphs + componentSpacing: number; + // Node repulsion (non overlapping) multiplier + nodeRepulsion(node: any): number; + + // Node repulsion (overlapping) multiplier + nodeOverlap: number; + // Ideal edge (non nested) length + idealEdgeLength(edge: any): number; + // Divisor to compute edge forces + edgeElasticity(edge: any): number; + + // Nesting factor (multiplier) to compute ideal edge length for nested edges + nestingFactor: number; + // Gravity force (constant) + gravity: number; + // Maximum number of iterations to perform + numIter: number; + // Initial temperature (maximum node displacement) + initialTemp: number; + // Cooling factor (how the temperature is reduced between consecutive iterations + coolingFactor: number; + // Lower temperature threshold (below this point the layout will end) + minTemp: number; + // Pass a reference to weaver to use threads for calculations + weaver: boolean; + } + + /** + * http://js.cytoscape.org/#layouts/layout-manipulation + * Layouts have a set of functions available to them, + * which allow for more complex behaviour than the primary run-one-layout-at-a-time usecase. + * A new, developer accessible layout can be made via cy.makeLayout(). + */ + interface LayoutManipulation { + /** + * Start running the layout + * http://js.cytoscape.org/#layout.run + */ + run(): void; + start(): void; + /** + * Stop running the (asynchronous/discrete) layout + * http://js.cytoscape.org/#layout.stop + */ + stop(): void; + } + interface LayoutEvents { + /** + * http://js.cytoscape.org/#layouts/layout-events + */ + /** + * @param events A space separated list of event names. + * @param data [optional] A plain object which is passed to the + * handler in the event object argument. + * @param handler The handler function that is called + * when one of the specified events occurs. + */ + on(events: EventNames, data: any, handler: EventHandler): void; + bind(events: EventNames, data: any, handler: EventHandler): void; + listen(events: EventNames, data: any, handler: EventHandler): void; + addListener(events: EventNames, data: any, handler: EventHandler): void; + + /** + * Get a promise that is resolved with the first of any of + * the specified events triggered on the layout. + * http://js.cytoscape.org/#layout.promiseOn + */ + promiseOn(events: EventNames): Promise; + pon(events: EventNames): Promise; + + /** + * Bind to events that are emitted by the layout, and trigger the handler only once. + * @param events A space separated list of event names. + * @param data [optional] A plain object which is passed to the handler in the event object argument. + * @param handler The handler function that is called when one of the specified events occurs. + */ + one(events: EventNames, handler: EventHandler): void; + one(events: EventNames, data: any, handler: EventHandler): void; + + /** + * Remove event handlers on the layout. + * http://js.cytoscape.org/#layout.off + * + * @param events A space separated list of event names. + * @param handler [optional] A reference to the handler function to remove. + */ + off(events: EventNames, handler?: EventHandler): void; + unbind(events: EventNames, handler?: EventHandler): void; + unlisten(events: EventNames, handler?: EventHandler): void; + removeListener(events: EventNames, handler?: EventHandler): void; + + /** + * Trigger one or more events on the layout. + * http://js.cytoscape.org/#layout.trigger + * @param events A space separated list of event names to trigger. + * @param extraParams [optional] An array of additional parameters to pass to the handler. + */ + trigger(events: EventNames, extraParams?: any[]): void; + } + + /** + * An animation represents a visible change in state over + * a duration of time for a single element. + * Animations can be generated via cy.animation() + * (for animations on the viewport) and ele.animation() + * (for animations on graph elements). + * http://js.cytoscape.org/#animations + */ + + /** + * http://js.cytoscape.org/#animations/animation-manipulation + */ + interface AnimationManipulation { + /** + * Requests that the animation be played, starting on the next frame. + * If the animation is complete, it restarts from the beginning. + * http://js.cytoscape.org/#ani.play + */ + play(): void; + /** + * Get whether the animation is currently playing. + * http://js.cytoscape.org/#ani.playing + */ + playing(): boolean; + /** + * Get or set how far along the animation has progressed. + * http://js.cytoscape.org/#ani.progress + */ + /** + * Get the progress of the animation in percent. + */ + progress(): number; + /** + * Set the progress of the animation in percent. + * @param progress The progress in percent (i.e. between 0 and 1 inclusive) to set to the animation. + */ + progress(progress: number): AnimationManipulation; + /** + * Get the progress of the animation in milliseconds. + */ + time(): number; + /** + * Set the progress of the animation in milliseconds. + * @param time The progress in milliseconds + * (i.e. between 0 and the duration inclusive) to set to the animation. + */ + time(time: number): AnimationManipulation; + /** + * Rewind the animation to the beginning. + */ + rewind(): AnimationManipulation; + /** + * Fastforward the animation to the end. + */ + fastforward(): AnimationManipulation; + + /** + * Pause the animation, maintaining the current progress. + * http://js.cytoscape.org/#ani.pause + */ + pause(): AnimationManipulation; + /** + * Stop the animation, maintaining the current progress + * and removing the animation from any associated queues. + * http://js.cytoscape.org/#ani.stop + */ + stop(): AnimationManipulation; + /** + * Get whether the animation has progressed to the end. + * http://js.cytoscape.org/#ani.completed + */ + completed(): AnimationManipulation; + complete(): AnimationManipulation; + /** + * Apply the animation at its current progress. + * http://js.cytoscape.org/#ani.apply + */ + apply(): AnimationManipulation; + /** + * Get whether the animation is currently applying. + * http://js.cytoscape.org/#ani.applying + */ + applying(): AnimationManipulation; + /** + * Reverse the animation such that its starting + * conditions and ending conditions are reversed. + * http://js.cytoscape.org/#ani.reverse + */ + reverse(): AnimationManipulation; + /** + * Get a promise that is fulfilled with the specified animation event. + * @param animationEvent A string for the event name; completed or complete for + * completing the animation or frame for the next frame of the animation. + * http://js.cytoscape.org/#ani.promise + */ + promise(animationEvent?: "completed" | "complete" | "frame"): Promise; + } +} diff --git a/types/chalk/tsconfig.json b/types/cytoscape/tsconfig.json similarity index 94% rename from types/chalk/tsconfig.json rename to types/cytoscape/tsconfig.json index 13ab93883b..348734c733 100644 --- a/types/chalk/tsconfig.json +++ b/types/cytoscape/tsconfig.json @@ -19,6 +19,6 @@ }, "files": [ "index.d.ts", - "chalk-tests.ts" + "cytoscape-tests.ts" ] } \ No newline at end of file diff --git a/types/cytoscape/tslint.json b/types/cytoscape/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cytoscape/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/d3-box/tslint.json b/types/d3-box/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/d3-box/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/d3-contour/d3-contour-tests.ts b/types/d3-contour/d3-contour-tests.ts index 588750bf29..2879e71e79 100644 --- a/types/d3-contour/d3-contour-tests.ts +++ b/types/d3-contour/d3-contour-tests.ts @@ -26,8 +26,9 @@ const n = 256; const m = 256; const values: number[] = new Array(n * m); for (let j = 0.5, k = 0; j < m; ++j) { - for (let i = 0.5; i < n; ++i, ++k) { + for (let i = 0.5; i < n; i++) { values[k] = goldsteinPrice(i / n * 4 - 2, 1 - j / m * 3); + k++; } } @@ -38,7 +39,7 @@ function goldsteinPrice(x: number, y: number) { let size: [number, number]; let boolFlag: boolean; -const thresholdArrayGen: ThresholdArrayGenerator = (values: number[], min: number, max: number) => { +const thresholdArrayGen: ThresholdArrayGenerator = (values: ArrayLike, min?: number, max?: number) => { let thresholds: number[]; thresholds = [values[1], values[2], values[4]]; return thresholds; diff --git a/types/d3-contour/index.d.ts b/types/d3-contour/index.d.ts index 789ff32a5f..1d82faae40 100644 --- a/types/d3-contour/index.d.ts +++ b/types/d3-contour/index.d.ts @@ -2,6 +2,7 @@ // Project: https://d3js.org/d3-contour/ // Definitions by: Tom Wanzek , Hugues Stefanski // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 // Last module patch version validated against: 1.1.0 diff --git a/types/d3-contour/tsconfig.json b/types/d3-contour/tsconfig.json index d367ee16c7..345a064caa 100644 --- a/types/d3-contour/tsconfig.json +++ b/types/d3-contour/tsconfig.json @@ -8,7 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/d3-drag/d3-drag-tests.ts b/types/d3-drag/d3-drag-tests.ts index 581b757717..848e3d1256 100644 --- a/types/d3-drag/d3-drag-tests.ts +++ b/types/d3-drag/d3-drag-tests.ts @@ -110,6 +110,24 @@ circleDrag = circleDrag.filter(function(d, i, group) { // getter filterFn = circleDrag.filter(); +// set and get touchable --------------------------------------------------------- + +let touchableFn: (this: SVGCircleElement, datum: CircleDatum, index: number, group: SVGCircleElement[] | NodeListOf) => boolean; + +// chainable + +circleDrag = circleDrag.touchable(true); + +circleDrag = circleDrag.touchable(function(d, i, group) { + const that: SVGCircleElement = this; + const datum: CircleDatum = d; + const g: SVGCircleElement[] | NodeListOf = group; + return "ontouchstart" in this && datum.color === 'green'; +}); + +// getter +touchableFn = circleDrag.touchable(); + // set and get subject --------------------------------------------------------- circleCustomDrag.subject(function(d, i, g) { diff --git a/types/d3-drag/index.d.ts b/types/d3-drag/index.d.ts index 7105bd4e4d..b930081d15 100644 --- a/types/d3-drag/index.d.ts +++ b/types/d3-drag/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for D3JS d3-drag module 1.1 +// Type definitions for D3JS d3-drag module 1.2 // Project: https://github.com/d3/d3-drag/ // Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Last module patch version validated against: 1.1.0 +// Last module patch version validated against: 1.2.1 import { ArrayLike, Selection, ValueFn } from 'd3-selection'; @@ -126,6 +126,34 @@ export interface DragBehavior): this; + /** + * Returns the current touch support detector, which defaults to a function returning true, + * if the "ontouchstart" event is supported on the current element. + */ + touchable(): ValueFn; + /** + * Sets the touch support detector to the specified boolean value and returns the drag behavior. + * + * Touch event listeners are only registered if the detector returns truthy for the corresponding element when the drag behavior is applied. + * The default detector works well for most browsers that are capable of touch input, but not all; Chrome’s mobile device emulator, for example, + * fails detection. + * + * @param touchable A boolean value. true when touch event listeners should be applied to the corresponding element, otherwise false. + */ + touchable(touchable: boolean): this; + /** + * Sets the touch support detector to the specified function and returns the drag behavior. + * + * Touch event listeners are only registered if the detector returns truthy for the corresponding element when the drag behavior is applied. + * The default detector works well for most browsers that are capable of touch input, but not all; Chrome’s mobile device emulator, for example, + * fails detection. + * + * @param touchable A touch support detector function, which returns true when touch event listeners should be applied to the corresponding element. + * The function is evaluated for each selected element to which the drag behavior was applied, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element. The function returns a boolean value. + */ + touchable(touchable: ValueFn): this; + /** * Returns the current subject accessor functions. */ diff --git a/types/d3-dsv/d3-dsv-tests.ts b/types/d3-dsv/d3-dsv-tests.ts index 51127b7266..459fa7291b 100644 --- a/types/d3-dsv/d3-dsv-tests.ts +++ b/types/d3-dsv/d3-dsv-tests.ts @@ -21,7 +21,7 @@ const tsvTestStringWithHeader = 'Year\tMake\tModel\tLength\n1997\tFord\tE350\t2. const pipedTestStringWithHeader = 'Year|Make|Model|Length\n1997|Ford|E350|2.34\n2000|Mercury|Cougar|2.38'; interface ParsedTestObject { - year: Date; + year: Date | null; make: string; model: string; length: number; @@ -35,8 +35,9 @@ let parseRowsMappedArray: ParsedTestObject[]; let columns: string[]; let num: number; -let date: Date; +let dateNull: Date | null; let str: string; +let strMaybe: string | undefined; // ------------------------------------------------------------------------------------------ // Test CSV @@ -50,7 +51,7 @@ parseArray = d3Dsv.csvParse(csvTestStringWithHeader); columns = parseArray.columns; -str = parseArray[0]['Year']; +strMaybe = parseArray[0]['Year']; // date = parseArray[0]['Year']; // fails, return value is string // with row mapper --------------------------------------------------------------------------- @@ -60,19 +61,39 @@ parseMappedArray = d3Dsv.csvParse(csvTestStringWithHeader, (rawRow, index, colum const i: number = index; const c: string[] = columns; const pr: ParsedTestObject = { - year: new Date(+rr['Year'], 0, 1), - make: rr['Make'], - model: rr['Model'], - length: +rr['Length'] + year: rr['Year'] ? new Date(+rr['Year']!, 0, 1) : null, + make: rr['Make'] ? rr['Make']! : "Missing Value", + model: rr['Model'] ? rr['Model']! : "Missing Value", + length: ['Length'] ? +rr['Length']! : NaN }; return pr; }); +parseMappedArray = d3Dsv.csvParse(csvTestStringWithHeader, (rawRow, index, columns) => { + const rr: d3Dsv.DSVRowString = rawRow; + const i: number = index; + const c: string[] = columns; + const d: number | null = rr['Year'] ? +rr['Year']! : null; + const pr: ParsedTestObject | null | undefined = d !== null + ? ( + d > 1997 + ? { + year: new Date(d, 0, 1), + make: rr['Make'] ? rr['Make']! : "Missing Value", + model: rr['Model'] ? rr['Model']! : "Missing Value", + length: ['Length'] ? +rr['Length']! : NaN + } + : undefined + ) + : null; + return pr; +}); + columns = parseMappedArray.columns; -date = parseMappedArray[0].year; -str = parseMappedArray[0].make; -str = parseMappedArray[0].model; +dateNull = parseMappedArray[0].year; +strMaybe = parseMappedArray[0].make; +strMaybe = parseMappedArray[0].model; num = parseMappedArray[0].length; // csvParseRows(...) ============================================================================ @@ -81,7 +102,7 @@ num = parseMappedArray[0].length; parseRowsArray = d3Dsv.csvParseRows(csvTestString); -str = parseRowsArray[0][0]; // 'Year' of first row +strMaybe = parseRowsArray[0][0]; // 'Year' of first row // date = parseRowsArray[0][0]; // fails, return value is string // with row mapper --------------------------------------------------------------------------- @@ -89,18 +110,25 @@ str = parseRowsArray[0][0]; // 'Year' of first row parseRowsMappedArray = d3Dsv.csvParseRows(csvTestString, (rawRow, index) => { const rr: string[] = rawRow; const i: number = index; - const pr: ParsedTestObject = { - year: new Date(+rr[0], 0, 1), - make: rr[1], - model: rr[2], - length: +rr[3] - }; + const d: number | null = rr[0].length ? +rr[0] : null; + const pr: ParsedTestObject | null | undefined = d !== null + ? ( + d > 1997 + ? { + year: new Date(d, 0, 1), + make: rr[1].length ? rr[1] : "Missing Value", + model: rr[2].length ? rr[2] : "Missing Value", + length: rr[3].length ? +rr[3] : NaN + } + : undefined + ) + : null; return pr; }); -date = parseRowsMappedArray[0].year; -str = parseRowsMappedArray[0].make; -str = parseRowsMappedArray[0].model; +dateNull = parseRowsMappedArray[0].year; +strMaybe = parseRowsMappedArray[0].make; +strMaybe = parseRowsMappedArray[0].model; num = parseRowsMappedArray[0].length; // csvFormat(...) ============================================================================ @@ -111,7 +139,7 @@ str = d3Dsv.csvFormat(parseRowsMappedArray, columns); // csvFormatRows(...) ======================================================================== str = d3Dsv.csvFormatRows(parseRowsMappedArray.map((d, i) => [ - d.year.getFullYear().toString(), + d.year ? d.year.getFullYear().toString() : '', d.make, d.model, d.length.toString() @@ -129,7 +157,7 @@ parseArray = d3Dsv.tsvParse(tsvTestStringWithHeader); columns = parseArray.columns; -str = parseArray[0]['Year']; +strMaybe = parseArray[0]['Year']; // date = parseArray[0]['Year']; // fails, return value is string // with row mapper --------------------------------------------------------------------------- @@ -138,20 +166,27 @@ parseMappedArray = d3Dsv.tsvParse(tsvTestStringWithHeader, (rawRow, index, colum const rr: d3Dsv.DSVRowString = rawRow; const i: number = index; const c: string[] = columns; - const pr: ParsedTestObject = { - year: new Date(+rr['Year'], 0, 1), - make: rr['Make'], - model: rr['Model'], - length: +rr['Length'] - }; + const d: number | null = rr['Year'] ? +rr['Year']! : null; + const pr: ParsedTestObject | null | undefined = d !== null + ? ( + d > 1997 + ? { + year: new Date(d, 0, 1), + make: rr['Make'] ? rr['Make']! : "Missing Value", + model: rr['Model'] ? rr['Model']! : "Missing Value", + length: ['Length'] ? +rr['Length']! : NaN + } + : undefined + ) + : null; return pr; }); columns = parseMappedArray.columns; -date = parseMappedArray[0].year; -str = parseMappedArray[0].make; -str = parseMappedArray[0].model; +dateNull = parseMappedArray[0].year; +strMaybe = parseMappedArray[0].make; +strMaybe = parseMappedArray[0].model; num = parseMappedArray[0].length; // tsvParseRows(...) ============================================================================ @@ -160,7 +195,7 @@ num = parseMappedArray[0].length; parseRowsArray = d3Dsv.tsvParseRows(tsvTestString); -str = parseRowsArray[0][0]; // 'Year' of first row +strMaybe = parseRowsArray[0][0]; // 'Year' of first row // date = parseRowsArray[0][0]; // fails, return value is string // with row mapper --------------------------------------------------------------------------- @@ -168,18 +203,25 @@ str = parseRowsArray[0][0]; // 'Year' of first row parseRowsMappedArray = d3Dsv.tsvParseRows(tsvTestString, (rawRow, index) => { const rr: string[] = rawRow; const i: number = index; - const pr: ParsedTestObject = { - year: new Date(+rr[0], 0, 1), - make: rr[1], - model: rr[2], - length: +rr[3] - }; + const d: number | null = rr[0].length ? +rr[0] : null; + const pr: ParsedTestObject | null | undefined = d !== null + ? ( + d > 1997 + ? { + year: new Date(d, 0, 1), + make: rr[1].length ? rr[1] : "Missing Value", + model: rr[2].length ? rr[2] : "Missing Value", + length: rr[3].length ? +rr[3] : NaN + } + : undefined + ) + : null; return pr; }); -date = parseRowsMappedArray[0].year; -str = parseRowsMappedArray[0].make; -str = parseRowsMappedArray[0].model; +dateNull = parseRowsMappedArray[0].year; +strMaybe = parseRowsMappedArray[0].make; +strMaybe = parseRowsMappedArray[0].model; num = parseRowsMappedArray[0].length; // tsvFormat(...) ============================================================================ @@ -190,7 +232,7 @@ str = d3Dsv.tsvFormat(parseRowsMappedArray, columns); // tsvFormatRows(...) ======================================================================== str = d3Dsv.tsvFormatRows(parseRowsMappedArray.map((d, i) => [ - d.year.getFullYear().toString(), + d.year ? d.year.getFullYear().toString() : '', d.make, d.model, d.length.toString() @@ -213,7 +255,7 @@ parseArray = dsv.parse(pipedTestStringWithHeader); columns = parseArray.columns; -str = parseArray[0]['Year']; +strMaybe = parseArray[0]['Year']; // date = parseArray[0]['Year']; // fails, return value is string // with row mapper --------------------------------------------------------------------------- @@ -222,20 +264,27 @@ parseMappedArray = dsv.parse(pipedTestStringWithHeader, (rawRow, index, columns) const rr: d3Dsv.DSVRowString = rawRow; const i: number = index; const c: string[] = columns; - const pr: ParsedTestObject = { - year: new Date(+rr['Year'], 0, 1), - make: rr['Make'], - model: rr['Model'], - length: +rr['Length'] - }; + const d: number | null = rr['Year'] ? +rr['Year']! : null; + const pr: ParsedTestObject | null | undefined = d !== null + ? ( + d > 1997 + ? { + year: new Date(d, 0, 1), + make: rr['Make'] ? rr['Make']! : "Missing Value", + model: rr['Model'] ? rr['Model']! : "Missing Value", + length: ['Length'] ? +rr['Length']! : NaN + } + : undefined + ) + : null; return pr; }); columns = parseMappedArray.columns; -date = parseMappedArray[0].year; -str = parseMappedArray[0].make; -str = parseMappedArray[0].model; +dateNull = parseMappedArray[0].year; +strMaybe = parseMappedArray[0].make; +strMaybe = parseMappedArray[0].model; num = parseMappedArray[0].length; // parseRows(...) ============================================================================ @@ -244,7 +293,7 @@ num = parseMappedArray[0].length; parseRowsArray = dsv.parseRows(pipedTestString); -str = parseRowsArray[0][0]; // 'Year' of first row +strMaybe = parseRowsArray[0][0]; // 'Year' of first row // date = parseRowsArray[0][0]; // fails, return value is string // with row mapper --------------------------------------------------------------------------- @@ -252,18 +301,25 @@ str = parseRowsArray[0][0]; // 'Year' of first row parseRowsMappedArray = dsv.parseRows(pipedTestString, (rawRow, index) => { const rr: string[] = rawRow; const i: number = index; - const pr: ParsedTestObject = { - year: new Date(+rr[0], 0, 1), - make: rr[1], - model: rr[2], - length: +rr[3] - }; + const d: number | null = rr[0].length ? +rr[0] : null; + const pr: ParsedTestObject | null | undefined = d !== null + ? ( + d > 1997 + ? { + year: new Date(d, 0, 1), + make: rr[1].length ? rr[1] : "Missing Value", + model: rr[2].length ? rr[2] : "Missing Value", + length: rr[3].length ? +rr[3] : NaN + } + : undefined + ) + : null; return pr; }); -date = parseRowsMappedArray[0].year; -str = parseRowsMappedArray[0].make; -str = parseRowsMappedArray[0].model; +dateNull = parseRowsMappedArray[0].year; +strMaybe = parseRowsMappedArray[0].make; +strMaybe = parseRowsMappedArray[0].model; num = parseRowsMappedArray[0].length; // format(...) ============================================================================ @@ -274,7 +330,7 @@ str = dsv.format(parseRowsMappedArray, columns); // formatRows(...) ======================================================================== str = dsv.formatRows(parseRowsMappedArray.map((d, i) => [ - d.year.getFullYear().toString(), + d.year ? d.year.getFullYear().toString() : '', d.make, d.model, d.length.toString() diff --git a/types/d3-dsv/index.d.ts b/types/d3-dsv/index.d.ts index eaf9797b02..80b2ebc54e 100644 --- a/types/d3-dsv/index.d.ts +++ b/types/d3-dsv/index.d.ts @@ -3,19 +3,35 @@ // Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Last module patch version validated against: 1.0.30 + // ------------------------------------------------------------------------------------------ // Shared Types and Interfaces // ------------------------------------------------------------------------------------------ +/** + * An object representing a DSV parsed row with values represented as strings. + */ export interface DSVRowString { - [key: string]: string; + [key: string]: string | undefined; } +/** + * An object representing a DSV parsed row with values represented as an arbitrary datatype, depending + * on the performed parsed row mapping. + */ export interface DSVRowAny { [key: string]: any; } +/** + * An array object representing all parsed rows. The array is enhanced with a property listing + * the names of the parsed columns. + */ export interface DSVParsedArray extends Array { + /** + * List of column names. + */ columns: string[]; } @@ -25,20 +41,108 @@ export interface DSVParsedArray extends Array { // csvParse(...) ============================================================================ +/** + * Parses the specified string, which must be in the comma-separated values format, returning an array of objects representing the parsed rows. + * + * Unlike csvParseRows, this method requires that the first line of the CSV content contains a comma-separated list of column names; + * these column names become the attributes on the returned objects. + * + * The returned array also exposes a columns property containing the column names in input order (in contrast to Object.keys, whose iteration order is arbitrary). + * + * Equivalent to dsvFormat(",").parse. + * + * @param csvString A string, which must be in the comma-separated values format. + */ export function csvParse(csvString: string): DSVParsedArray; -export function csvParse(csvString: string, row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow): DSVParsedArray; +/** + * Parses the specified string, which must be in the comma-separated values format, returning an array of objects representing the parsed rows. + * + * Unlike csvParseRows, this method requires that the first line of the CSV content contains a comma-separated list of column names; + * these column names become the attributes on the returned objects. + * + * The returned array also exposes a columns property containing the column names in input order (in contrast to Object.keys, whose iteration order is arbitrary). + * + * Equivalent to dsvFormat(",").parse. + * + * @param csvString A string, which must be in the comma-separated values format. + * @param row A row conversion function which is invoked for each row, being passed an object representing the current row (d), + * the index (i) starting at zero for the first non-header row, and the array of column names. If the returned value is null or undefined, + * the row is skipped and will be ommitted from the array returned by dsv.parse; otherwise, the returned value defines the corresponding row object. + * In effect, row is similar to applying a map and filter operator to the returned rows. + */ +export function csvParse( + csvString: string, + row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null +): DSVParsedArray; // csvParseRows(...) ======================================================================== +/** + * Parses the specified string, which must be in the comma-separated values format, returning an array of arrays representing the parsed rows. + * + * Unlike csvParse, this method treats the header line as a standard row, and should be used whenever CSV content does not contain a header. + * Each row is represented as an array rather than an object. Rows may have variable length. + * + * If a row conversion function is not specified, field values are strings. For safety, there is no automatic conversion to numbers, dates, or other types. + * In some cases, JavaScript may coerce strings to numbers for you automatically (for example, using the + operator), but better is to specify a row conversion function. + * + * Equivalent to dsvFormat(",").parseRows. + * + * @param csvString A string, which must be in the comma-separated values format. + */ export function csvParseRows(csvString: string): string[][]; -export function csvParseRows(csvString: string, row: (rawRow: string[], index: number) => ParsedRow): ParsedRow[]; +/** + * Parses the specified string, which must be in the comma-separated values format, returning an array of arrays representing the parsed rows. + * + * Unlike csvParse, this method treats the header line as a standard row, and should be used whenever CSV content does not contain a header. + * Each row is represented as an array rather than an object. Rows may have variable length. + * + * Equivalent to dsvFormat(",").parseRows. + * + * @param csvString A string, which must be in the comma-separated values format. + * @param row A row conversion function which is invoked for each row, being passed an array representing the current row (d), the index (i) + * starting at zero for the first row, and the array of column names. If the returned value is null or undefined, + * the row is skipped and will be ommitted from the array returned by dsv.parse; otherwise, the returned value defines the corresponding row object. + * In effect, row is similar to applying a map and filter operator to the returned rows. + */ +export function csvParseRows( + csvString: string, + row: (rawRow: string[], index: number) => ParsedRow | undefined | null +): ParsedRow[]; // csvFormat(...) ============================================================================ +/** + * Formats the specified array of object rows as comma-separated values, returning a string. + * This operation is the inverse of csvParse. Each row will be separated by a newline (\n), + * and each column within each row will be separated by the comma-delimiter. + * Values that contain either the comma-delimiter, a double-quote (") or a newline will be escaped using double-quotes. + * + * If columns is not specified, the list of column names that forms the header row is determined by the union of all properties on all objects in rows; + * the order of columns is nondeterministic. + * + * Equivalent to dsvFormat(",").format. + * + * @param rows Array of object rows. + * @param columns An array of strings representing the column names. + */ export function csvFormat(rows: DSVRowAny[], columns?: string[]): string; // csvFormatRows(...) ======================================================================== +/** + * Formats the specified array of array of string rows as comma-separated values, returning a string. + * This operation is the reverse of csvParseRows. Each row will be separated by a newline (\n), + * and each column within each row will be separated by the comma-delimiter. + * Values that contain either the comma-delimiter, a double-quote (") or a newline will be escaped using double-quotes. + * + * To convert an array of objects to an array of arrays while explicitly specifying the columns, use array.map. + * If you like, you can also array.concat this result with an array of column names to generate the first row. + * + * Equivalent to dsvFormat(",").formatRows. + * + * @param rows An array of array of string rows. + */ export function csvFormatRows(rows: string[][]): string; // ------------------------------------------------------------------------------------------ @@ -47,33 +151,209 @@ export function csvFormatRows(rows: string[][]): string; // tsvParse(...) ============================================================================ +/** + * Parses the specified string, which must be in the tab-separated values format, returning an array of objects representing the parsed rows. + * + * Unlike tsvParseRows, this method requires that the first line of the TSV content contains a tab-separated list of column names; + * these column names become the attributes on the returned objects. + * + * The returned array also exposes a columns property containing the column names in input order (in contrast to Object.keys, whose iteration order is arbitrary). + * + * Equivalent to dsvFormat("\t").parse. + * + * @param tsvString A string, which must be in the tab-separated values format. + */ export function tsvParse(tsvString: string): DSVParsedArray; -export function tsvParse(tsvString: string, row: (rawRow: DSVRowString, index: number, columns: string[]) => MappedRow): DSVParsedArray; +/** + * Parses the specified string, which must be in the tab-separated values format, returning an array of objects representing the parsed rows. + * + * Unlike tsvParseRows, this method requires that the first line of the TSV content contains a tab-separated list of column names; + * these column names become the attributes on the returned objects. + * + * The returned array also exposes a columns property containing the column names in input order (in contrast to Object.keys, whose iteration order is arbitrary). + * + * Equivalent to dsvFormat("\t").parse. + * + * @param tsvString A string, which must be in the tab-separated values format. + * @param row A row conversion function which is invoked for each row, being passed an object representing the current row (d), + * the index (i) starting at zero for the first non-header row, and the array of column names. If the returned value is null or undefined, + * the row is skipped and will be ommitted from the array returned by dsv.parse; otherwise, the returned value defines the corresponding row object. + * In effect, row is similar to applying a map and filter operator to the returned rows. + */ +export function tsvParse( + tsvString: string, + row: (rawRow: DSVRowString, index: number, columns: string[]) => MappedRow | undefined | null +): DSVParsedArray; // tsvParseRows(...) ======================================================================== +/** + * Parses the specified string, which must be in the tab-separated values format, returning an array of arrays representing the parsed rows. + * + * Unlike tsvParse, this method treats the header line as a standard row, and should be used whenever TSV content does not contain a header. + * Each row is represented as an array rather than an object. Rows may have variable length. + * + * If a row conversion function is not specified, field values are strings. For safety, there is no automatic conversion to numbers, dates, or other types. + * In some cases, JavaScript may coerce strings to numbers for you automatically (for example, using the + operator), but better is to specify a row conversion function. + * + * Equivalent to dsvFormat("\t").parseRows. + * + * @param tsvString A string, which must be in the tab-separated values format. + */ export function tsvParseRows(tsvString: string): string[][]; -export function tsvParseRows(tsvString: string, row: (rawRow: string[], index: number) => MappedRow): MappedRow[]; +/** + * Parses the specified string, which must be in the tab-separated values format, returning an array of arrays representing the parsed rows. + * + * Unlike tsvParse, this method treats the header line as a standard row, and should be used whenever TSV content does not contain a header. + * Each row is represented as an array rather than an object. Rows may have variable length. + * + * Equivalent to dsvFormat("\t").parseRows. + * + * @param tsvString A string, which must be in the tab-separated values format. + * @param row A row conversion function which is invoked for each row, being passed an array representing the current row (d), the index (i) + * starting at zero for the first row, and the array of column names. If the returned value is null or undefined, + * the row is skipped and will be ommitted from the array returned by dsv.parse; otherwise, the returned value defines the corresponding row object. + * In effect, row is similar to applying a map and filter operator to the returned rows. + */ +export function tsvParseRows( + tsvString: string, + row: (rawRow: string[], index: number) => MappedRow | undefined | null +): MappedRow[]; // tsvFormat(...) ============================================================================ +/** + * Formats the specified array of object rows as tab-separated values, returning a string. + * This operation is the inverse of tsvParse. Each row will be separated by a newline (\n), + * and each column within each row will be separated by the tab-delimiter. + * Values that contain either the tab-delimiter, a double-quote (") or a newline will be escaped using double-quotes. + * + * If columns is not specified, the list of column names that forms the header row is determined by the union of all properties on all objects in rows; + * the order of columns is nondeterministic. + * + * Equivalent to dsvFormat("\t").format. + * + * @param rows Array of object rows. + * @param columns An array of strings representing the column names. + */ export function tsvFormat(rows: DSVRowAny[], columns?: string[]): string; // tsvFormatRows(...) ======================================================================== +/** + * Formats the specified array of array of string rows as tab-separated values, returning a string. + * This operation is the reverse of tsvParseRows. Each row will be separated by a newline (\n), + * and each column within each row will be separated by the tab-delimiter. + * Values that contain either the tab-delimiter, a double-quote (") or a newline will be escaped using double-quotes. + * + * To convert an array of objects to an array of arrays while explicitly specifying the columns, use array.map. + * If you like, you can also array.concat this result with an array of column names to generate the first row. + * + * Equivalent to dsvFormat("\t").formatRows. + * + * @param rows An array of array of string rows. + */ export function tsvFormatRows(rows: string[][]): string; // ------------------------------------------------------------------------------------------ // DSV Generalized Parsers and Formatters // ------------------------------------------------------------------------------------------ +/** + * A DSV parser and formatter + */ export interface DSV { + /** + * Parses the specified string, which must be in the delimiter-separated values format with the appropriate delimiter, returning an array of objects representing the parsed rows. + * + * Unlike dsv.parseRows, this method requires that the first line of the DSV content contains a delimiter-separated list of column names; + * these column names become the attributes on the returned objects. + * + * The returned array also exposes a columns property containing the column names in input order (in contrast to Object.keys, whose iteration order is arbitrary). + * + * @param dsvString A string, which must be in the delimiter-separated values format with the appropriate delimiter. + */ parse(dsvString: string): DSVParsedArray; - parse(dsvString: string, row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow): DSVParsedArray; + /** + * Parses the specified string, which must be in the delimiter-separated values format with the appropriate delimiter, returning an array of objects representing the parsed rows. + * + * Unlike dsv.parseRows, this method requires that the first line of the DSV content contains a delimiter-separated list of column names; + * these column names become the attributes on the returned objects. + * + * The returned array also exposes a columns property containing the column names in input order (in contrast to Object.keys, whose iteration order is arbitrary). + * + * @param dsvString A string, which must be in the delimiter-separated values format with the appropriate delimiter. + * @param row A row conversion function which is invoked for each row, being passed an object representing the current row (d), + * the index (i) starting at zero for the first non-header row, and the array of column names. If the returned value is null or undefined, + * the row is skipped and will be ommitted from the array returned by dsv.parse; otherwise, the returned value defines the corresponding row object. + * In effect, row is similar to applying a map and filter operator to the returned rows. + */ + parse( + dsvString: string, + row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null + ): DSVParsedArray; + + /** + * Parses the specified string, which must be in the delimiter-separated values format with the appropriate delimiter, returning an array of arrays representing the parsed rows. + * + * Unlike dsv.parse, this method treats the header line as a standard row, and should be used whenever DSV content does not contain a header. + * Each row is represented as an array rather than an object. Rows may have variable length. + * + * If a row conversion function is not specified, field values are strings. For safety, there is no automatic conversion to numbers, dates, or other types. + * In some cases, JavaScript may coerce strings to numbers for you automatically (for example, using the + operator), but better is to specify a row conversion function. + * + * @param dsvString A string, which must be in the delimiter-separated values format with the appropriate delimiter. + */ parseRows(dsvString: string): string[][]; - parseRows(dsvString: string, row: (rawRow: string[], index: number) => ParsedRow): ParsedRow[]; + /** + * Parses the specified string, which must be in the delimiter-separated values format with the appropriate delimiter, returning an array of arrays representing the parsed rows. + * + * Unlike dsv.parse, this method treats the header line as a standard row, and should be used whenever DSV content does not contain a header. + * Each row is represented as an array rather than an object. Rows may have variable length. + * + * @param dsvString A string, which must be in the delimiter-separated values format with the appropriate delimiter. + * @param row A row conversion function which is invoked for each row, being passed an array representing the current row (d), the index (i) + * starting at zero for the first row, and the array of column names. If the returned value is null or undefined, + * the row is skipped and will be ommitted from the array returned by dsv.parse; otherwise, the returned value defines the corresponding row object. + * In effect, row is similar to applying a map and filter operator to the returned rows. + */ + parseRows( + dsvString: string, + row: (rawRow: string[], index: number) => ParsedRow | undefined | null + ): ParsedRow[]; + + /** + * Formats the specified array of object rows as delimiter-separated values, returning a string. + * This operation is the inverse of dsv.parse. Each row will be separated by a newline (\n), + * and each column within each row will be separated by the delimiter (such as a comma, ,). + * Values that contain either the delimiter, a double-quote (") or a newline will be escaped using double-quotes. + * + * If columns is not specified, the list of column names that forms the header row is determined by the union of all properties on all objects in rows; + * the order of columns is nondeterministic. + * + * @param rows Array of object rows. + * @param columns An array of strings representing the column names. + */ format(rows: DSVRowAny[], columns?: string[]): string; + + /** + * Formats the specified array of array of string rows as delimiter-separated values, returning a string. + * This operation is the reverse of dsv.parseRows. Each row will be separated by a newline (\n), + * and each column within each row will be separated by the delimiter (such as a comma, ,). + * Values that contain either the delimiter, a double-quote (") or a newline will be escaped using double-quotes. + * + * To convert an array of objects to an array of arrays while explicitly specifying the columns, use array.map. + * If you like, you can also array.concat this result with an array of column names to generate the first row. + * + * @param rows An array of array of string rows. + */ formatRows(rows: string[][]): string; } +/** + * Constructs a new DSV parser and formatter for the specified delimiter. + * + * @param delimiter A delimiter character. The delimiter must be a single character (i.e., a single 16-bit code unit); + * so, ASCII delimiters are fine, but emoji delimiters are not. + */ export function dsvFormat(delimiter: string): DSV; diff --git a/types/d3-dsv/tsconfig.json b/types/d3-dsv/tsconfig.json index 82e3ef399f..400095c38d 100644 --- a/types/d3-dsv/tsconfig.json +++ b/types/d3-dsv/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -20,4 +20,4 @@ "index.d.ts", "d3-dsv-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/d3-geo/index.d.ts b/types/d3-geo/index.d.ts index 40ec500f90..4093b696e9 100644 --- a/types/d3-geo/index.d.ts +++ b/types/d3-geo/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/d3/d3-geo/ // Definitions by: Hugues Stefanski , Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 // Last module patch version validated against: 1.9.0 @@ -46,7 +47,7 @@ export interface ExtendedGeometryCollection extends GeoJSON.GeoJsonObject { geometry: GeometryType; properties: Properties; - id?: string; + id?: string | number; } /** @@ -540,7 +541,7 @@ export interface GeoStream { * Streams the specified GeoJSON object to the specified projection stream. While both features and geometry objects are supported as input, * the stream interface only describes the geometry, and thus additional feature properties are not visible to streams. * - * @param object + * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). * @param stream A projection stream. */ export function geoStream(object: ExtendedFeature, stream: GeoStream): void; @@ -549,7 +550,7 @@ export function geoStream(object: ExtendedFeature, stre * Streams the specified GeoJSON object to the specified projection stream. While both features and geometry objects are supported as input, * the stream interface only describes the geometry, and thus additional feature properties are not visible to streams. * - * @param object + * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). * @param stream A projection stream. */ export function geoStream(object: ExtendedFeatureCollection>, stream: GeoStream): void; @@ -558,7 +559,7 @@ export function geoStream(object: ExtendedFeatureCollection, stream: GeoStream): void; @@ -1659,7 +1660,7 @@ export const geoClipAntimeridian: ((stream: GeoStream) => GeoStream); * Generates a clipping function transforming a stream such that geometries are bounded by a small circle of radius angle around the projection’s center. * Typically used for pre-clipping. * - * @param angle + * @param angle A clipping angle. */ export function geoClipCircle(angle: number): (stream: GeoStream) => GeoStream; diff --git a/types/d3-hexbin/tslint.json b/types/d3-hexbin/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/d3-hexbin/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/d3-hierarchy/tslint.json b/types/d3-hierarchy/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/d3-hierarchy/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/d3-sankey/index.d.ts b/types/d3-sankey/index.d.ts index a0ed07b615..237eb60f15 100644 --- a/types/d3-sankey/index.d.ts +++ b/types/d3-sankey/index.d.ts @@ -208,7 +208,7 @@ export interface SankeyLayout): SankeyGraph; diff --git a/types/d3-selection-multi/d3-selection-multi-tests.ts b/types/d3-selection-multi/d3-selection-multi-tests.ts index 515dd8e92e..f40c3723f2 100644 --- a/types/d3-selection-multi/d3-selection-multi-tests.ts +++ b/types/d3-selection-multi/d3-selection-multi-tests.ts @@ -34,7 +34,7 @@ selection = selection.attrs({ }); // Function that returns a map -selection = selection.attrs(function(d, i, g) { +selection = selection.attrs(function(d, i, g): {} | { id: string } { const that: HTMLAnchorElement = this; const index: number = i; const group: HTMLAnchorElement[] | ArrayLike = g; @@ -89,7 +89,7 @@ selection = selection.properties({ }); // Function that returns an object -selection = selection.properties(function(d, i, g) { +selection = selection.properties(function(d, i, g): {} | { href: string } { const that: HTMLAnchorElement = this; const index: number = i; const group: HTMLAnchorElement[] | ArrayLike = g; @@ -118,7 +118,7 @@ transition = transition.attrs({ }); // Function that returns a map -transition = transition.attrs(function(d, i, g) { +transition = transition.attrs(function(d, i, g): {} | { id: string } { const that: HTMLAnchorElement = this; const index: number = i; const group: HTMLAnchorElement[] | ArrayLike = g; diff --git a/types/d3-selection/d3-selection-tests.ts b/types/d3-selection/d3-selection-tests.ts index e2a4d6ffd9..96d421f828 100644 --- a/types/d3-selection/d3-selection-tests.ts +++ b/types/d3-selection/d3-selection-tests.ts @@ -325,7 +325,7 @@ let filterdGElements2: d3Selection.Selection filterdGElements2 = d3Selection.selectAll('.any-svg-type').filter('g'); // filterdGElements2 = d3Selection.selectAll('.any-type').filter('g'); // fails without using narrowing generic on filter method -filterdGElements2 = d3Selection.selectAll('.any-svg-type').filter(function(){ +filterdGElements2 = d3Selection.selectAll('.any-svg-type').filter(function() { const that: SVGElement = this; return that.tagName === 'g' || that.tagName === 'G'; }); diff --git a/types/d3-time-format/d3-time-format-tests.ts b/types/d3-time-format/d3-time-format-tests.ts index eb569dd779..723f035cc0 100644 --- a/types/d3-time-format/d3-time-format-tests.ts +++ b/types/d3-time-format/d3-time-format-tests.ts @@ -37,21 +37,12 @@ parseFn = d3TimeFormat.utcParse('.%L'); // iso ------------------------------------------------------------------ const dateString: string = d3TimeFormat.isoFormat(new Date(2016, 6, 6)); -const date: Date = d3TimeFormat.isoParse('2016-07-08T14:06:41.386Z'); +const date: Date | null = d3TimeFormat.isoParse('2016-07-08T14:06:41.386Z'); // ---------------------------------------------------------------------- // Test Locale Definition // ---------------------------------------------------------------------- -const dateTimeSpecifier: string = localeDef.dateTime; -const dateSpecifier: string = localeDef.date; -const timeSpecifier: string = localeDef.time; -const periods: [string, string] = localeDef.periods; -const days: [string, string, string, string, string, string, string] = localeDef.days; -const shortDays: [string, string, string, string, string, string, string] = localeDef.shortDays; -const months: [string, string, string, string, string, string, string, string, string, string, string, string] = localeDef.months; -const shortMonths: [string, string, string, string, string, string, string, string, string, string, string, string] = localeDef.shortMonths; - localeDef = { dateTime: '%a %b %e %X %Y', date: '%m/%d/%Y', @@ -63,12 +54,21 @@ localeDef = { shortMonths: ['Jan', 'Feb', 'Mrz', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'] }; +const dateTimeSpecifier: string = localeDef.dateTime; +const dateSpecifier: string = localeDef.date; +const timeSpecifier: string = localeDef.time; +const periods: [string, string] = localeDef.periods; +const days: [string, string, string, string, string, string, string] = localeDef.days; +const shortDays: [string, string, string, string, string, string, string] = localeDef.shortDays; +const months: [string, string, string, string, string, string, string, string, string, string, string, string] = localeDef.months; +const shortMonths: [string, string, string, string, string, string, string, string, string, string, string, string] = localeDef.shortMonths; + localeObj = d3TimeFormat.timeFormatLocale(localeDef); localeObj = d3TimeFormat.timeFormatDefaultLocale(localeDef); let formatFactory: (specifier: string) => ((date: Date) => string) = localeObj.format; -let parseFactory: (specifier: string) => ((dateString: string) => Date) = localeObj.parse; +let parseFactory: (specifier: string) => ((dateString: string) => Date | null) = localeObj.parse; formatFactory = localeObj.utcFormat; parseFactory = localeObj.utcParse; diff --git a/types/d3-time-format/index.d.ts b/types/d3-time-format/index.d.ts index 3d1cecf221..4ac6fc8469 100644 --- a/types/d3-time-format/index.d.ts +++ b/types/d3-time-format/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for d3JS d3-time-format module 2.0 +// Type definitions for d3JS d3-time-format module 2.1 // Project: https://github.com/d3/d3-time-format/ // Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Last module patch version validated against: 2.0.2 +// Last module patch version validated against: 2.1.0 /** * Specification of time locale to use when creating a new TimeLocaleObject @@ -43,16 +43,103 @@ export interface TimeLocaleDefinition { shortMonths: [string, string, string, string, string, string, string, string, string, string, string, string]; } +/** + * Interface describing a time-locale-based object which exposes time-formatting/parsing + * methods for a specified locale definition. + */ export interface TimeLocaleObject { + /** + * Returns a new formatter for the given string specifier. The specifier string may contain the following directives: + * - %a - abbreviated weekday name.* + * - %A - full weekday name.* + * - %b - abbreviated month name.* + * - %B - full month name.* + * - %c - the locale’s date and time, such as %x, %X.* + * - %d - zero-padded day of the month as a decimal number [01,31]. + * - %e - space-padded day of the month as a decimal number [ 1,31]; equivalent to %_d. + * - %f - microseconds as a decimal number [000000, 999999]. + * - %H - hour (24-hour clock) as a decimal number [00,23]. + * - %I - hour (12-hour clock) as a decimal number [01,12]. + * - %j - day of the year as a decimal number [001,366]. + * - %m - month as a decimal number [01,12]. + * - %M - minute as a decimal number [00,59]. + * - %L - milliseconds as a decimal number [000, 999]. + * - %p - either AM or PM.* + * - %Q - milliseconds since UNIX epoch. + * - %s - seconds since UNIX epoch. + * - %S - second as a decimal number [00,61]. + * - %u - Monday-based (ISO) weekday as a decimal number [1,7]. + * - %U - Sunday-based week of the year as a decimal number [00,53]. + * - %V - ISO 8601 week number of the year as a decimal number [01, 53]. + * - %w - Sunday-based weekday as a decimal number [0,6]. + * - %W - Monday-based week of the year as a decimal number [00,53]. + * - %x - the locale’s date, such as %-m/%-d/%Y.* + * - %X - the locale’s time, such as %-I:%M:%S %p.* + * - %y - year without century as a decimal number [00,99]. + * - %Y - year with century as a decimal number. + * - %Z - time zone offset, such as -0700, -07:00, -07, or Z. + * - %% - a literal percent sign (%). + * + * Directives marked with an asterisk (*) may be affected by the locale definition. + * + * For %U, all days in a new year preceding the first Sunday are considered to be in week 0. + * For %W, all days in a new year preceding the first Monday are considered to be in week 0. + * Week numbers are computed using interval.count. For example, 2015-52 and 2016-00 represent Monday, December 28, 2015, while 2015-53 and 2016-01 represent Monday, January 4, 2016. + * This differs from the ISO week date specification (%V), which uses a more complicated definition! + * + * For %V, per the strftime man page: + * + * In this system, weeks start on a Monday, and are numbered from 01, for the first week, up to 52 or 53, for the last week. + * Week 1 is the first week where four or more days fall within the new year (or, synonymously, week 01 is: the first week of the year that contains a Thursday; + * or, the week that has 4 January in it). + * + * The % sign indicating a directive may be immediately followed by a padding modifier: + * + * 1) 0 - zero-padding + * 2) _ - space-padding + * 3) - disable padding + * + * If no padding modifier is specified, the default is 0 for all directives except %e, which defaults to _. + * (In some implementations of strftime and strptime, a directive may include an optional field width or precision; this feature is not yet implemented.) + * + * The returned function formats a specified date, returning the corresponding string. + * + * @param specifier A specifier string for the date format. + */ format(specifier: string): (date: Date) => string; + /** + * Returns a new parser for the given string specifier. The specifier string may contain the same directives as locale.format (TimeLocaleObject.format). + * The %d and %e directives are considered equivalent for parsing. + * + * The returned function parses a specified string, returning the corresponding date or null if the string could not be parsed according to this format’s specifier. + * Parsing is strict: if the specified string does not exactly match the associated specifier, this method returns null. + * + * For example, if the associated specifier is %Y-%m-%dT%H:%M:%SZ, then the string "2011-07-01T19:15:28Z" will be parsed as expected, + * but "2011-07-01T19:15:28", "2011-07-01 19:15:28" and "2011-07-01" will return null. (Note that the literal Z here is different from the time zone offset directive %Z.) + * If a more flexible parser is desired, try multiple formats sequentially until one returns non-null. + * + * @param specifier A specifier string for the date format. + */ parse(specifier: string): (dateString: string) => (Date | null); + /** + * Equivalent to locale.format (TimeLocaleObject.format), except all directives are interpreted as Coordinated Universal Time (UTC) rather than local time. + * + * @param specifier A specifier string for the date format. + */ utcFormat(specifier: string): (date: Date) => string; + /** + * Equivalent to locale.parse (TimeLocaleObject.parse), except all directives are interpreted as Coordinated Universal Time (UTC) rather than local time. + * + * @param specifier A specifier string for the date format. + */ utcParse(specifier: string): (dateString: string) => (Date | null); } /** * Create a new time-locale-based object which exposes time-formatting * methods for the specified locale definition. + * + * @param timeLocale A time locale definition. */ export function timeFormatLocale(timeLocale: TimeLocaleDefinition): TimeLocaleObject; @@ -60,17 +147,58 @@ export function timeFormatLocale(timeLocale: TimeLocaleDefinition): TimeLocaleOb * Create a new time-locale-based object which exposes time-formatting * methods for the specified locale definition. The new time locale definition * will be set as the new default time locale. + * + * @param timeLocale A time locale definition. */ export function timeFormatDefaultLocale(defaultTimeLocale: TimeLocaleDefinition): TimeLocaleObject; +/** + * Returns a new formatter for the given string specifier. The returned function formats a specified date, returning the corresponding string. + * + * An alias for locale.format (TimeLocaleObject.format) on the default locale. + * + * @param specifier A specifier string for the date format. + */ export function timeFormat(specifier: string): (date: Date) => string; +/** + * Returns a new parser for the given string specifier. + * + * An alias for locale.parse (TimeLocaleObject.parse) on the default locale. + * + * @param specifier A specifier string for the date format. + */ export function timeParse(specifier: string): (dateString: string) => (Date | null); +/** + * Equivalent to timeFormat, except all directives are interpreted as Coordinated Universal Time (UTC) rather than local time. + * + * An alias for locale.utcFormat (TimeLocaleObject.utcFormat) on the default locale. + * + * @param specifier A specifier string for the date format. + */ export function utcFormat(specifier: string): (date: Date) => string; +/** + * Equivalent to timeParse, except all directives are interpreted as Coordinated Universal Time (UTC) rather than local time. + * + * An alias for locale.utcParse (TimeLocaleObject.utcParse) on the default locale. + * + * @param specifier A specifier string for the date format. + */ export function utcParse(specifier: string): (dateString: string) => (Date | null); +/** + * The full ISO 8601 UTC time formatter. Where available, this method will use Date.toISOString to format. + * + * @param date A date to format. + */ export function isoFormat(date: Date): string; -export function isoParse(dateString: string): Date; +/** + * The full ISO 8601 UTC time parser. Where available, this method will use the Date constructor to parse strings. + * If you depend on strict validation of the input format according to ISO 8601, you should construct a UTC parser function using utcParse. + * + * @param dateString A string encoded date to parse. + */ +export function isoParse(dateString: string): Date | null; diff --git a/types/d3-time-format/tsconfig.json b/types/d3-time-format/tsconfig.json index 8cdbe89fe0..782a3ab291 100644 --- a/types/d3-time-format/tsconfig.json +++ b/types/d3-time-format/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -20,4 +20,4 @@ "index.d.ts", "d3-time-format-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/d3-tip/tslint.json b/types/d3-tip/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/d3-tip/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/d3-transition/index.d.ts b/types/d3-transition/index.d.ts index 1ff8d46d04..eb60cec49f 100644 --- a/types/d3-transition/index.d.ts +++ b/types/d3-transition/index.d.ts @@ -569,7 +569,7 @@ export interface Transition(name: string): Transition; +export function transition(name?: string): Transition; /** * Returns a new transition from an existing transition. diff --git a/types/d3-zoom/d3-zoom-tests.ts b/types/d3-zoom/d3-zoom-tests.ts index 02f7120e79..669b4af8ff 100644 --- a/types/d3-zoom/d3-zoom-tests.ts +++ b/types/d3-zoom/d3-zoom-tests.ts @@ -121,6 +121,26 @@ let svgZoom: d3Zoom.ZoomBehavior; svgZoom = d3Zoom.zoom(); +// constrain() ------------------------------------------------------------- + +// chainable +svgZoom = svgZoom.constrain((transform, extent, translateExtent) => { + const t: d3Zoom.ZoomTransform = transform; + const ve: [[number, number], [number, number]] = extent; + const te: [[number, number], [number, number]] = translateExtent; + const dx0 = t.invertX(ve[0][0]) - te[0][0]; + const dx1 = t.invertX(ve[1][0]) - te[1][0]; + const dy0 = transform.invertY(ve[0][1]) - te[0][1]; + const dy1 = transform.invertY(ve[1][1]) - te[1][1]; + return t.translate( + dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1), + dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1) + ); +}); + +let constraintFn: (transform: d3Zoom.ZoomTransform, extent: [[number, number], [number, number]], translateExtent: [[number, number], [number, number]]) => d3Zoom.ZoomTransform; +constraintFn = svgZoom.constrain(); + // filter() ---------------------------------------------------------------- // chainable @@ -135,6 +155,24 @@ svgZoom = svgZoom.filter(function(d, i, group) { let filterFn: (this: SVGRectElement, d: SVGDatum, index: number, group: SVGRectElement[]) => boolean; filterFn = svgZoom.filter(); +// set and get touchable --------------------------------------------------------- + +let touchableFn: (this: SVGRectElement, d: SVGDatum, index: number, group: SVGRectElement[]) => boolean; + +// chainable + +svgZoom = svgZoom.touchable(true); + +svgZoom = svgZoom.touchable(function(d, i, group) { + const that: SVGRectElement = this; + const datum: SVGDatum = d; + const g: SVGRectElement[] | NodeListOf = group; + return "ontouchstart" in this && datum.height > 0; +}); + +// getter +touchableFn = svgZoom.touchable(); + // wheelDelta() ---------------------------------------------------------------- // chainable diff --git a/types/d3-zoom/index.d.ts b/types/d3-zoom/index.d.ts index a633644ded..cf9b1ac89d 100644 --- a/types/d3-zoom/index.d.ts +++ b/types/d3-zoom/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for d3JS d3-zoom module 1.5 +// Type definitions for d3JS d3-zoom module 1.7 // Project: https://github.com/d3/d3-zoom/ // Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Last module patch version validated against: 1.5.0 +// Last module patch version validated against: 1.7.0 import { ArrayLike, Selection, TransitionLike, ValueFn } from 'd3-selection'; import { ZoomView, ZoomInterpolator } from 'd3-interpolate'; @@ -499,6 +499,19 @@ export interface ZoomBehavior, k: ValueFn): void; + /** + * Returns the current constraint function. + * The default implementation attempts to ensure that the viewport extent does not go outside the translate extent. + */ + constrain(): (transform: ZoomTransform, extent: [[number, number], [number, number]], translateExtent: [[number, number], [number, number]]) => ZoomTransform; + /** + * Sets the transform constraint function to the specified function and returns the zoom behavior. + * + * @param constraint A constraint function which returns a transform given the current transform, viewport extent and translate extent. + * The default implementation attempts to ensure that the viewport extent does not go outside the translate extent. + */ + constrain(constraint: ((transform: ZoomTransform, extent: [[number, number], [number, number]], translateExtent: [[number, number], [number, number]]) => ZoomTransform)): this; + /** * Returns the current filter function. */ @@ -517,6 +530,34 @@ export interface ZoomBehavior): this; + /** + * Returns the current touch support detector, which defaults to a function returning true, + * if the "ontouchstart" event is supported on the current element. + */ + touchable(): ValueFn; + /** + * Sets the touch support detector to the specified boolean value and returns the zoom behavior. + * + * Touch event listeners are only registered if the detector returns truthy for the corresponding element when the zoom behavior is applied. + * The default detector works well for most browsers that are capable of touch input, but not all; Chrome’s mobile device emulator, for example, + * fails detection. + * + * @param touchable A boolean value. true when touch event listeners should be applied to the corresponding element, otherwise false. + */ + touchable(touchable: boolean): this; + /** + * Sets the touch support detector to the specified function and returns the zoom behavior. + * + * Touch event listeners are only registered if the detector returns truthy for the corresponding element when the zoom behavior is applied. + * The default detector works well for most browsers that are capable of touch input, but not all; Chrome’s mobile device emulator, for example, + * fails detection. + * + * @param touchable A touch support detector function, which returns true when touch event listeners should be applied to the corresponding element. + * The function is evaluated for each selected element to which the zoom behavior was applied, in order, being passed the current datum (d), + * the current index (i), and the current group (nodes), with this as the current DOM element. The function returns a boolean value. + */ + touchable(touchable: ValueFn): this; + /** * Returns the current wheelDelta function. */ @@ -619,7 +660,7 @@ export interface ZoomBehavior, Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 export as namespace d3; diff --git a/types/d3/v3/index.d.ts b/types/d3/v3/index.d.ts index 90afdd3938..0fbc7502b0 100644 --- a/types/d3/v3/index.d.ts +++ b/types/d3/v3/index.d.ts @@ -3,8 +3,6 @@ // Definitions by: Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/* tslint:disable */ - // Latest patch version of module validated against: 3.5.17 export = d3; diff --git a/types/d3/v3/tslint.json b/types/d3/v3/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/d3/v3/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/d3kit/index.d.ts b/types/d3kit/index.d.ts index c374a59501..5a07821700 100644 --- a/types/d3kit/index.d.ts +++ b/types/d3kit/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/twitter/d3kit // Definitions by: Morgan Benton // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/d3kit/v1/tslint.json b/types/d3kit/v1/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/d3kit/v1/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/d3pie/tslint.json b/types/d3pie/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/d3pie/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/dagre-d3/index.d.ts b/types/dagre-d3/index.d.ts index 9a14ecbae4..dc0d8ad639 100644 --- a/types/dagre-d3/index.d.ts +++ b/types/dagre-d3/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/cpettitt/dagre-d3 // Definitions by: Mark Wong Siang Kai // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 import * as d3 from "d3"; import * as dagre from "dagre"; diff --git a/types/dagre/index.d.ts b/types/dagre/index.d.ts index 55d98b0535..852fe33973 100644 --- a/types/dagre/index.d.ts +++ b/types/dagre/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Qinfeng Chen // Lisa Vallfors // Pete Vilter +// David Newell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -10,24 +11,69 @@ export as namespace dagre; export namespace graphlib { class Graph { - edges(): Edge[]; - edge(id: any): any; - nodes(): string[]; - node(id: any): any; - setDefaultEdgeLabel(callback: string|(() => string|object)): Graph; - setDefaultNodeLabel(callback: string|(() => string|object)): Graph; - setEdge(sourceId: string, targetId: string, options?: { [key: string]: any }, value?: string): Graph; - setEdge(params: {v: string, w: string, name?: string}, value?: string): Graph; - setGraph(label: GraphLabel): Graph; - setNode(id: string, node: { [key: string]: any }): Graph; - graph(): GraphLabel; - constructor(opt?: {directed?: boolean, multigraph?: boolean, compound?: boolean}); - setParent(name: string, parentName: string): void; + + graph(): GraphLabel; + isDirected(): boolean; + isMultiGraph(): boolean; + setGraph(label: GraphLabel): Graph; + + edge(edgeObj: Edge): GraphEdge; + edge(outNodeName: string, inNodeName: string, name?: string): GraphEdge; + edgeCount(): number; + edges(): Edge[]; + hasEdge(edgeObj: Edge): boolean; + hasEdge(outNodeName: string, inNodeName: string, name?: string): boolean; + inEdges(inNodeName: string, outNodeName?: string): Edge[]|undefined; + outEdges(outNodeName: string, inNodeName?: string): Edge[]|undefined; + removeEdge(outNodeName: string, inNodeName: string): Graph; + setDefaultEdgeLabel(callback: string|((edge: Edge) => string|Label)): Graph; + setEdge(params: Edge, value?: string|{[key: string]: any}): Graph; + setEdge(sourceId: string, targetId: string, value?: string|Label, name?: string): Graph; + + children(parentName: string): string|undefined; hasNode(name: string): boolean; + neighbors(name: string): Node[]|undefined; + node(id: string|Label): Node; + nodeCount(): number; + nodes(): string[]; + parent(childName: string): string|undefined; + predecessors(name: string): Node[]|undefined; + removeNode(name: string): Graph; + setDefaultNodeLabel(callback: string|((nodeId: string) => string|Label)): Graph; + setNode(id: string, node: NodeConfig): Graph; + setParent(childName: string, parentName: string): void; + sinks(): Node[]; + sources(): Node[]; + successors(name: string): Node[]|undefined; + } + + namespace json { + function read(graph: any): Graph; + function write(graph: Graph): any; + } + + namespace alg { + function components(graph: Graph): string[][]; + function dijkstra(graph: Graph, source: string, weightFn?: WeightFn, edgeFn?: EdgeFn): any; + function dijkstraAll(graph: Graph, weightFn?: WeightFn, edgeFn?: EdgeFn): any; + function findCycles(graph: Graph): string[][]; + function floydWarchall(graph: Graph, weightFn?: WeightFn, edgeFn?: EdgeFn): any; + function isAcyclic(graph: Graph): boolean; + function postorder(graph: Graph, nodeNames: string|string[]): string[]; + function preorder(graph: Graph, nodeNames: string|string[]): string[]; + function prim(graph: Graph, weightFn?: WeightFn): Graph; + function tarjam(graph: Graph): string[][]; + function topsort(graph: Graph): string[]; } } +export interface Label { + [key: string]: any; +} +export type WeightFn = (edge: Edge) => number; +export type EdgeFn = (outNodeName: string) => GraphEdge[]; + export interface GraphLabel { width?: number; height?: number; @@ -43,10 +89,37 @@ export interface GraphLabel { ranker?: string; } -export function layout(graph: graphlib.Graph): void; +export interface NodeConfig { + width?: number; + height?: number; +} + +export interface EdgeConfig { + minlen: number; + weight: number; + width: number; + height: number; + lablepos: 'l'|'c'|'r'; + labeloffest: number; +} + +export function layout(graph: graphlib.Graph, layout?: GraphLabel&NodeConfig&EdgeConfig): void; export interface Edge { v: string; w: string; name?: string; } + +export interface GraphEdge { + points: Array<{x: number, y: number}>; + [key: string]: any; +} + +export interface Node { + x: number; + y: number; + width: number; + height: number; + [key: string]: any; +} diff --git a/types/dat-gui/tslint.json b/types/dat-gui/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/dat-gui/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/data-driven/tslint.json b/types/data-driven/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/data-driven/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/datadog-metrics/datadog-metrics-tests.ts b/types/datadog-metrics/datadog-metrics-tests.ts index f783e22b8e..ffbeccda89 100644 --- a/types/datadog-metrics/datadog-metrics-tests.ts +++ b/types/datadog-metrics/datadog-metrics-tests.ts @@ -1,9 +1,12 @@ import metrics = require('datadog-metrics'); metrics.init({ host: 'myhost', prefix: 'myapp.' }); metrics.gauge('mygauge', 42); +metrics.gauge('mykey', 11, ['a', 'b', 'c'], Date.now()); metrics.increment('test.requests_served'); metrics.increment('test.awesomeness_factor', 10); -metrics.histogram('test.service_time', 0.248); +metrics.increment('test.service_time', 0.248); +metrics.histogram('mykey', 11, ['a', 'b', 'c'], Date.now()); +metrics.histogram('mykey', 11, ['a', 'b', 'c'], Date.now()); metrics.flush(); metrics.flush(() => {}); metrics.flush(() => {}, err => {}); @@ -16,9 +19,12 @@ const metricsLogger = new metrics.BufferedMetricsLogger({ defaultTags: ['env:staging', 'region:us-east-1'] }); metricsLogger.gauge('mygauge', 42); +metricsLogger.gauge('mykey', 11, ['a', 'b', 'c'], Date.now()); metricsLogger.increment('test.requests_served'); metricsLogger.increment('test.awesomeness_factor', 10); +metricsLogger.increment('mykey', 11, ['a', 'b', 'c'], Date.now()); metricsLogger.histogram('test.service_time', 0.248); +metricsLogger.histogram('mykey', 11, ['a', 'b', 'c'], Date.now()); metricsLogger.flush(); metricsLogger.flush(() => {}); metricsLogger.flush(() => {}, err => {}); diff --git a/types/datadog-metrics/index.d.ts b/types/datadog-metrics/index.d.ts index 43ab6f440a..2d7c910eba 100644 --- a/types/datadog-metrics/index.d.ts +++ b/types/datadog-metrics/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for datadog-metrics 0.4 +// Type definitions for datadog-metrics 0.6 // Project: https://github.com/dbader/node-datadog-metrics // Definitions by: Jeffery Grajkowski // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -44,21 +44,21 @@ export class BufferedMetricsLogger { * the metric. This should be used for sum values such as total hard disk space, * process uptime, total number of active users, or number of rows in a database table. */ - gauge(key: string, value: number, ...tags: string[]): void; + gauge(key: string, value: number, tags?: string[], timestamp?: number): void; /** * Increment the counter by the given value (or 1 by default). Optionally, specify a * list of tags to associate with the metric. This is useful for counting things such * as incrementing a counter each time a page is requested. */ - increment(key: string, value?: number, ...tags: string[]): void; + increment(key: string, value?: number, tags?: string[], timestamp?: number): void; /** * Sample a histogram value. Histograms will produce metrics that describe the distribution * of the recorded values, namely the minimum, maximum, average, count and the 75th, 85th, * 95th and 99th percentiles. Optionally, specify a list of tags to associate with the metric. */ - histogram(key: string, value: number, ...tags: string[]): void; + histogram(key: string, value: number, tags?: string[], timestamp?: number): void; /** * Calling flush sends any buffered metrics to DataDog. Unless you set flushIntervalSeconds @@ -77,21 +77,21 @@ export function init(options: BufferedMetricsLoggerOptions): void; * the metric. This should be used for sum values such as total hard disk space, * process uptime, total number of active users, or number of rows in a database table. */ -export function gauge(key: string, value: number, ...tags: string[]): void; +export function gauge(key: string, value: number, tags?: string[], timestamp?: number): void; /** * Increment the counter by the given value (or 1 by default). Optionally, specify a * list of tags to associate with the metric. This is useful for counting things such * as incrementing a counter each time a page is requested. */ -export function increment(key: string, value?: number, ...tags: string[]): void; +export function increment(key: string, value?: number, tags?: string[], timestamp?: number): void; /** * Sample a histogram value. Histograms will produce metrics that describe the distribution * of the recorded values, namely the minimum, maximum, average, count and the 75th, 85th, * 95th and 99th percentiles. Optionally, specify a list of tags to associate with the metric. */ -export function histogram(key: string, value: number, ...tags: string[]): void; +export function histogram(key: string, value: number, tags?: string[], timestamp?: number): void; /** * Calling flush sends any buffered metrics to DataDog. Unless you set flushIntervalSeconds diff --git a/types/datatables.net-buttons/datatables.net-buttons-tests.ts b/types/datatables.net-buttons/datatables.net-buttons-tests.ts index 3323f6fdb9..46a2069ad7 100644 --- a/types/datatables.net-buttons/datatables.net-buttons-tests.ts +++ b/types/datatables.net-buttons/datatables.net-buttons-tests.ts @@ -1,40 +1,187 @@ -$(document).ready(function () { - - var config: DataTables.Settings = - { - // Buttons extension options - buttons: [ - { - extend: 'excel', - text: 'Excel', - className: 'class', - filename: "exported_file.csv", - exportOptions: { - columns: ':visible' - } - }, - { - extend: 'excel', - text: 'Excel', - className: 'class', - filename: "exported_file.csv", - exportOptions: { - columns: [1, 6, 2, 3, 4] - } - }, - { - action: function (e, dt, node, config) { }, - available: function (dt, config) { return true; }, - destroy: function (dt, node, config) { }, - enabled: true, - init: function (dt, node, config) { }, - key: 'a', - name: 'name', - namespace: 'namespace', - titleAttr: 'title', - title: 'title' - } - ], +const config_1: DataTables.Settings = { + // Buttons extension options + buttons: [{ + extend: 'excel', + text: 'Excel', + className: 'class', + filename: "exported_file.csv", + exportOptions: { + columns: ':visible' } + }, + { + extend: 'excel', + text: 'Excel', + className: 'class', + filename: "exported_file.csv", + exportOptions: { + columns: [1, 6, 2, 3, 4] + } + }, + { + action(e, dt, node, config) { }, + available(dt, config) { return true; }, + destroy(dt, node, config) { }, + enabled: true, + init(dt, node, config) { }, + key: 'a', + name: 'name', + namespace: 'namespace', + titleAttr: 'title', + title: 'title' + }], +}; -}); \ No newline at end of file +const config_2: DataTables.Settings = { + // Buttons extension options + buttons: { + buttons: [ + "csv", + { + extend: "csv", + name: "CSV-Export", + className: "test-class" + }, + (dt) => { + return { + extend: "csv", + name: "CSV-Function", + className: "test-class" + }; + } + ], + } +}; + +const config_3: DataTables.ButtonsSettings = { + name: "Test", + tabIndex: 1, + buttons: [ + "copy", + { + extend: "csv", + name: "CSV-Export", + className: "test-class" + }, + (dt) => { + return { + extend: "csv", + name: "CSV-Function", + className: "test-class" + }; + }, + { + extend: 'colvis', + columnText(dt, idx, title) { + return (idx + 1) + title; + } + }, + { + extend: 'colvis', + columns: ':gt(0)' + }, + { + extend: 'copy', + text: 'Copy current page', + exportOptions: { + modifier: { + page: 'current' + } + } + }, + { + extend: 'csv', + // Name the CSV + filename: 'file_name', + text: 'Customized CSV', + exportOptions: { + columns: [0, 1, $("#name_column"), $("#test_column"), $("#height_column"), $("#area_column")] + }, + // Function which customize the CSV (input : csv is the object that you can preprocesss) + customize(csv) { + if (typeof (csv) !== "string") { + return; + } + // Split the csv to get the rows + const split_csv = csv.split("\n"); + + // Remove the row one to personnalize the headers + split_csv[0] = '"Latitude","Longitude","Site Name","Description","Antenna Height","Antenna gain","Env loss","Candidate"'; + + // For each row except the first one (header) + $.each(split_csv.slice(1), (index, csv_row) => { + // Split on quotes and comma to get each cell + const csv_cell_array = csv_row.split('","'); + + // Remove replace the two quotes which are left at the beginning and the end (first and last cell) + csv_cell_array[0] = csv_cell_array[0].replace(/"/g, ''); + csv_cell_array[5] = csv_cell_array[5].replace(/"/g, ''); + + // RANDOM EXAMPLE : Make some test, special cutomizing depending of the value of the cell (if cell 5 is equal to a certain value, give a value to row 6) + if (csv_cell_array[5].toLowerCase().trim() === "a certain value") { + csv_cell_array[6] = "2"; + } else if (csv_cell_array[5].toLowerCase() === "another value") { + csv_cell_array[6] = "5"; + } else { + csv_cell_array[6] = ""; + } + + // RANDOM EXAMPLE : Empty the 5th cell and set the 7th to true + csv_cell_array[5] = ""; + csv_cell_array[7] = "true"; + + // Join the table on the quotes and comma; add back the quotes at the beginning and end + const csv_cell_array_quotes = `"${csv_cell_array.join('","')}"`; + + // Insert the new row into the rows array at the previous index (index +1 because the header was sliced) + split_csv[index + 1] = csv_cell_array_quotes; + }); + + // Join the rows with line breck and return the final csv (datatables will take the returned csv and process it) + csv = split_csv.join("\n"); + return csv; + } + } + ], + dom: { + button: { + active: "active" + } + } +}; + +// Statics +const buttons = new $.fn.dataTable.Buttons($("selector").DataTable(), config_3); +const version = $.fn.dataTable.Buttons.version; + +$.fn.dataTable.Buttons.defaults = { + buttons: [] +}; + +$.fn.dataTable.ext.buttons.collection.className += ' dropdown-toggle'; + +// API +let dt = $("selector").DataTable(); + +const export_1 = dt.buttons.exportData({ + columns: '', +}); + +dt.buttons.resize(); + +dt.button(0).action((e, dt, button, config) => { + console.log('Button activated'); +}); + +dt.button().add(0, { + action: (e, dt, button, config) => { + dt.ajax.reload(); + }, + text: 'Reload table' +}); + +dt.button(0) + .nodes() + .css('background', 'blue'); + +dt.buttons().destroy(); diff --git a/types/datatables.net-buttons/index.d.ts b/types/datatables.net-buttons/index.d.ts index 1bdf212b03..e084a50c8d 100644 --- a/types/datatables.net-buttons/index.d.ts +++ b/types/datatables.net-buttons/index.d.ts @@ -1,109 +1,272 @@ -// Type definitions for JQuery DataTables Buttons extension 1.1.0 +// Type definitions for JQuery DataTables Buttons extension 1.4 // Project: http://datatables.net/extensions/buttons/ -// Definitions by: Sam Germano , Jim Hartford +// Definitions by: Kiarash Ghiaseddin , Sam Germano , Jim Hartford // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.4 /// /// declare namespace DataTables { - export interface Settings { + interface Settings { /** * Buttons extension options */ - buttons?: boolean | string[] | ButtonSettings[]; + buttons?: boolean | string[] | ButtonsSettings | ButtonSettings[]; } - //#region "button-settings" + interface StaticFunctions { + Buttons: ButtonStaticFunctions; + } + + interface ButtonStaticFunctions { + new (dt: Api, settings: boolean | string[] | ButtonsSettings | ButtonSettings[]): undefined; + version: string; + defaults: ButtonsSettings; + } + + interface ExtSettings { + buttons: ExtButtonsSettings; + } + + interface Api { + button(groupSelector?: any, buttonSelector?: any): ButtonApi; + buttons: ButtonsGlobalApi; + } + + interface ButtonsGlobalApi { + (groupSelector?: any, buttonSelector?: any): ButtonsApi; - /** - * Buttons extension options - */ - export interface ButtonSettings { /** - * Action to take when the button is activated - */ + * Resize the Flash movie clips to take account of the current button dimensions. + */ + resize(): Api; + + /** + * Display / hide an information message to the end user to indicate that something has happened. + */ + info(title: string, message?: string, time?: number): Api; + + /** + * Get meta information that is common to many different button types. + */ + exportInfo(options?: ButtonsApiExportInfoParameter): ButtonsApiExportInfoReturn; + + /** + * Obtain data from a DataTable that is suitable for exporting by saving into a file or copying to clipboard. + */ + exportData(options?: ButtonsApiExportDataParameter): ButtonsApiExportDataReturn; + } + + interface ButtonApi { + /** + * Get the action function for the selected button. + */ + action(): FunctionButtonAction; + + /** + * Set the action function for the selected button. + */ + action(set: FunctionButtonAction): Api; + + /** + * Get the active state for the selected button. + */ + active(): boolean; + + /** + * Set the active state for the selected button. + */ + active(state: boolean): Api; + + /** + * Create a new button, adding it to the selected button instance and inserting immediately into the document. + */ + add(index: number | string, config: string|FunctionButtom|ButtonSettings): Api; + + /** + * Disable the selected buttons. + */ + disable(): Api; + + /** + * Set the enabled state for the selected button. + */ + enable(state?: boolean): Api; + + /** + * Get a jQuery object that contains a reference to the node for the selected button. + */ + node(): JQuery; + nodes(): JQuery; + + /** + * Determine if a button is currently in the processing state or not. + */ + processing(): boolean; + + /** + * Set the processing state for the selected button. + */ + processing(set: boolean): Api; + + /** + * Set the processing state for the selected button. + */ + processing(set: boolean): Api; + + /** + * Remove the selected button from the display. The button is destroyed and can no longer be used once removed. + */ + remove(): Api; + + /** + * Get / Set the display text for the selected button + */ + text(title?: string | FunctionButtonText): Api; + + /** + * Programmatically trigger the action of the selected button. + */ + trigger(): Api; + } + + interface ButtonsApi extends ButtonApi { + /** + * Get a jQuery instance that contains a reference to the button container instance. + */ + container(): JQuery; + containers(): JQuery; + + /** + * Destroy the selected button instances, removing the container and all button elements from the document. + */ + destroy(): Api; + } + + interface ButtonsApiExportInfoParameter { + extension?: string | (() => string); + filename?: string | (() => string); + messageBottom?: null | string | (() => string); + messageTop?: null | string | (() => string); + title?: null | string | (() => string); + } + + interface ButtonsApiExportInfoReturn { + filename: string; + messageTop: string; + messageBottom: string; + title: string; + } + + interface ButtonsApiExportDataParameter { + rows?: any; + columns?: any; + modifier?: any; + orthogonal?: string; + stripHtml?: boolean; + stripNewlines?: boolean; + decodeEntities?: boolean; + trim?: boolean; + format?: any; + } + + interface ButtonsApiExportDataReturn { + header: string[]; + footer: string[]; + body: string[]; + } + + //#region "Button Settings" + + interface ButtonsSettings { + name?: string; + tabIndex?: number; + buttons: Array; + dom?: ButtonDomSettings; + } + + interface ButtonDomSettings { + button?: ButtonDomButtomButton; + buttonContainer?: ButtonDomButtomCommon; + buttonLiner?: ButtonDomButtomCommon; + collection?: ButtonDomButtomCommon; + container?: ButtonDomButtomCommon; + } + + interface ButtonDomButtomCommon { + className?: string; + tag?: string; + } + + interface ButtonDomButtomButton extends ButtonDomButtomCommon { + active?: string; + disabled?: string; + } + + interface ButtomSettingsCommon { + /** + * Action to take when the button is activated + */ action?: FunctionButtonAction; /** - * Ensure that any requirements have been satisfied before initialising a button - */ + * Ensure that any requirements have been satisfied before initialising a button + */ available?: FunctionButtonAvailable; /** - * Set the class name for the button - */ + * Set the class name for the button + */ className?: string; /** - * Function that is called when the button is destroyed - */ + * Function that is called when the button is destroyed + */ destroy?: FunctionButtonInit; /** - * Set a button's initial enabled state - */ + * Set a button's initial enabled state + */ enabled?: boolean; /** - * Define which button type the button should be based on - */ + * Define which button type the button should be based on + */ extend?: string; /** - * Initialisation function that can be used to add events specific to this button - */ + * Initialisation function that can be used to add events specific to this button + */ init?: FunctionButtonInit; /** - * Define an activation key for a button - */ + * Define an activation key for a button + */ key?: string | ButtonKey; /** - * Set a name for each selection - */ + * Set a name for each selection + */ name?: string; /** - * Unique namespace for every button - */ + * Unique namespace for every button + */ namespace?: string; /** - * The text to show in the button - */ - text?: string | ButtonText; + * The text to show in the button + */ + text?: string | FunctionButtonText; /** - * Button 'title' attribute text - */ + * Button 'title' attribute text + */ titleAttr?: string; - - /** - * Button 'title' text - */ - title?: string; - - /** - * Define what the exported filename should be - */ - filename?: string; - - exportOptions?: ButtonExportOptions; - autoPrint?: boolean; - customize?: FunctionButtonCustomize; } - export interface FunctionButtonAvailable { - (dt: DataTables.Api, config: any): boolean - } - export interface ButtonExportOptions { - columns?: string | number | string[] | number[]; - } - - export interface ButtonKey { + interface ButtonKey { key?: string; shiftKey?: boolean; altKey?: boolean; @@ -111,19 +274,176 @@ declare namespace DataTables { metaKey?: boolean; } - export interface ButtonText { - (dt: DataTables.Api, node: JQuery, config: any): string - } - export interface FunctionButtonInit { - (dt: DataTables.Api, node: JQuery, config: any): void - } - // api object? - export interface FunctionButtonAction { - (e: any, dt: DataTables.Api, node: JQuery, config: any): void + /** + * A function that will be executed upon creation of the buttons. + */ + type FunctionButtom = (dt: Api) => ButtomSettingsCommon; + + type FunctionButtonText = (dt: Api, node: JQuery, config: any) => string; + + type FunctionButtonAvailable = (dt: Api, config: any) => boolean; + + type FunctionButtonInit = (dt: Api, node: JQuery, config: any) => void; + + type FunctionButtonAction = (e: any, dt: Api, node: JQuery, config: ButtonSettings) => void; + + type FunctionButtonCustomize = (win: Window|string) => void; + + type FunctionExtButtonsCollectionText = (a: any) => string; + + interface ExtButtonsSettings { + collection: ExtButtonsCollectionSettings; } - export interface FunctionButtonCustomize { - (win: Window): void + interface ExtButtonsCollectionSettings { + action: FunctionButtonAction; + autoClose: boolean; + background: boolean; + backgroundClassName: string; + className: string; + collectionLayout: string; + fade: number; + text: FunctionExtButtonsCollectionText; } + + //#endregion "Button Defaults" + + //#region "Add-Ons" + + /** + * Buttons extension options + */ + interface ButtonSettings extends ButtomSettingsCommon { + //#region (HTML-)File-Export + + /** + * CSV / EXCEL: Define what the exported filename should be + */ + filename?: string; + + /** + * COPY / CSV: field separator + */ + fieldSeparator?: string; + + /** + * COPY / CSV: field boundary + */ + fieldBoundary?: string; + + /** + * COPY / CSV: field separator + */ + newLine?: string; + + /** + * CSV / EXCEL / PDF: file extension + */ + extension?: string; + + /** + * CSV: UTF-8 boom + */ + bom?: boolean; + + /** + * CSV: charset + */ + charset?: string|boolean; + + /** + * CSV: escape char + */ + escapeChar?: string; + + /** + * EXCEL + */ + customizeData?: FunctionButtonCustomizeData; + + /** + * PDF: portrait / landscape + */ + orientation?: string; + + /** + * PDF: A3 / A4 / A5 / LEGAL / LETTER / TABLOID + */ + pageSize?: string; + + //#endregion (HTML-)File-Export + + //#region Export and Print + + /** + * COPY / CSV / EXCEL / PDF / PRINT: show header + */ + exportOptions?: ButtonExportOptions | object; + + /** + * COPY / CSV / EXCEL / PDF / PRINT: show header + */ + customize?: FunctionButtonCustomize; + + /** + * COPY / CSV / EXCEL / PDF / PRINT: show header + */ + header?: boolean; + + /** + * COPY / CSV / EXCEL / PDF / PRINT: show footer + */ + footer?: boolean; + + /** + * COPY / PRINT: title + */ + title?: string; + + /** + * COPY / EXCEL / PDF / PRINT: field separator + */ + messageTop?: string; + + /** + * COPY / EXCEL / PDF / PRINT: field separator + */ + messageBottom?: string; + + /** + * PDF / PRINT: Extra message + */ + message?: string|Api|JQuery|object; + + /** + * PRINT: Show print dialoge on click + */ + autoPrint?: boolean; + + //#endregion Export and Print + + //#region ColVis + + /** + * COLVIS: Column selector + */ + columns?: any; + + /** + * COLVIS: + */ + columnText?: FunctionButtonColvisColumnText; + + //#endregion ColVis + } + + interface ButtonExportOptions { + columns?: string | number | string[] | number[]; + } + + type FunctionButtonCustomizeData = (content: any) => void; + + type FunctionButtonColvisColumnText = (dt: Api, i: number, title: string) => string; + //#endregion "button-settings } diff --git a/types/datatables.net-buttons/tslint.json b/types/datatables.net-buttons/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/datatables.net-buttons/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts b/types/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts index 72d8665838..4f3e2bfd30 100644 --- a/types/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts +++ b/types/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts @@ -1,11 +1,34 @@ -$(document).ready(() => { - const config: DataTables.Settings = { - // FixedHeader extension options - fixedHeader: { - footer: true, - footerOffset: 4, - header: true, - headerOffset: 3 - } - }; +let config_1: DataTables.Settings = { + // FixedHeader extension options + fixedHeader: { + footer: true, + footerOffset: 4, + header: true, + headerOffset: 3 + } +}; + +let dt: DataTables.Api = $("selector").DataTable({ + fixedHeader: true }); + +// Statics +let fixed_1 = new $.fn.dataTable.FixedHeader(dt, { + footer: true, +}); + +let fixed_2 = new $.fn.dataTable.FixedHeader(dt, true); + +let version = $.fn.dataTable.FixedHeader.version; + +$.fn.dataTable.FixedHeader.defaults.footer = false; + +// API +dt.fixedHeader.adjust(); +dt.fixedHeader.disable(); +dt.fixedHeader.enable(true); + +// Chaining +dt + .fixedHeader.footerOffset(10) + .fixedHeader.headerOffset(10); diff --git a/types/datatables.net-fixedheader/index.d.ts b/types/datatables.net-fixedheader/index.d.ts index cb0b363b65..aa6f87f3b7 100644 --- a/types/datatables.net-fixedheader/index.d.ts +++ b/types/datatables.net-fixedheader/index.d.ts @@ -1,7 +1,9 @@ // Type definitions for datatables.net-fixedheader 3.1 // Project: https://datatables.net/extensions/fixedheader/ -// Definitions by: Jared Szechy +// Definitions by: Jared Szechy , Kiarash Ghiaseddin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + /// /// @@ -13,6 +15,47 @@ declare namespace DataTables { fixedHeader?: boolean | FixedHeaderSettings; } + interface StaticFunctions { + FixedHeader: FixedHeaderStaticFunctions; + } + + interface FixedHeaderStaticFunctions { + new (dt: Api, settings: boolean | FixedHeaderSettings): undefined; + version: string; + defaults: FixedHeaderSettings; + } + + interface Api { + fixedHeader: FixedHeaderApi; + } + + interface FixedHeaderApi { + /** + * Recalculate the position of the DataTable on the page and adjust the fixed element as appropriate. + */ + adjust(): Api; + + /** + * Disable the fixed elements + */ + disable(): Api; + + /** + * Enable / disable the fixed elements + */ + enable(enable: boolean): Api; + + /** + * Get the fixed footer's offset. + */ + footerOffset(offset: number): Api; + + /** + * Get the fixed header's offset. + */ + headerOffset(offset: number): Api; + } + /* * FixedHeader extension options */ diff --git a/types/datatables.net-rowreorder/index.d.ts b/types/datatables.net-rowreorder/index.d.ts index 110da7a747..c95c7a1fb9 100644 --- a/types/datatables.net-rowreorder/index.d.ts +++ b/types/datatables.net-rowreorder/index.d.ts @@ -2,7 +2,7 @@ // Project: http://datatables.net/extensions/rowreorder/ // Definitions by: Vincent Biret // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.4 /// /// diff --git a/types/datatables.net-select/index.d.ts b/types/datatables.net-select/index.d.ts index 201d00ba27..e24f6b8ab6 100644 --- a/types/datatables.net-select/index.d.ts +++ b/types/datatables.net-select/index.d.ts @@ -2,6 +2,8 @@ // Project: https://datatables.net/extensions/select/ // Definitions by: Jared Szechy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + /// /// diff --git a/types/datatables.net/datatables.net-tests.ts b/types/datatables.net/datatables.net-tests.ts index f4e322dcfc..af722ab74f 100644 --- a/types/datatables.net/datatables.net-tests.ts +++ b/types/datatables.net/datatables.net-tests.ts @@ -1,972 +1,1033 @@ -$(document).ready(function () { - //#region "Language" +//#region "Language" - var lang: DataTables.LanguageSettings = { - "emptyTable": "No data available in table", - "info": "Showing _START_ to _END_ of _TOTAL_ entries", - "infoEmpty": "Showing 0 to 0 of 0 entries", - "infoFiltered": "(filtered from _MAX_ total entries)", - "infoPostFix": "", - "thousands": ",", - "lengthMenu": "Show _MENU_ entries", - "loadingRecords": "Loading...", - "processing": "Processing...", - "search": "Search:", - "searchPlaceholder": "Default text", - "zeroRecords": "No matching records found", - "paginate": { - "first": "First", - "last": "Last", - "next": "Next", - "previous": "Previous" +const lang: DataTables.LanguageSettings = { + emptyTable: "No data available in table", + info: "Showing _START_ to _END_ of _TOTAL_ entries", + infoEmpty: "Showing 0 to 0 of 0 entries", + infoFiltered: "(filtered from _MAX_ total entries)", + infoPostFix: "", + thousands: ",", + lengthMenu: "Show _MENU_ entries", + loadingRecords: "Loading...", + processing: "Processing...", + search: "Search:", + searchPlaceholder: "Default text", + zeroRecords: "No matching records found", + paginate: { + first: "First", + last: "Last", + next: "Next", + previous: "Previous" + }, + aria: { + sortAscending: ": activate to sort column ascending", + sortDescending: ": activate to sort column descending" + } +}; + +//#endregion "Language" + +//#region "Column" + +const colCreatedCellFunc: DataTables.FunctionColumnCreatedCell = (cell, cellData, rowData, rowIndex, colIndex) => {}; + +const colDataObject: DataTables.ObjectColumnData = { + _: "phone", + filter: "phone_filter", + display: "phone_display", + sort: "asc" +}; + +const colDataFunc: DataTables.FunctionColumnData = (row: any, type: 'set' | 'display' | 'sort' | 'filter' | 'type', set: any, meta: DataTables.CellMetaSettings) => { + meta.col; + meta.row; + meta.settings; + switch (type) { + case 'set': + row.value = set; + return; + default: + return row.value; + } +}; + +const colRenderObject: DataTables.ObjectColumnData = { + _: "phone", + filter: "phone_filter", + display: "phone_display", + sort: "asc" +}; + +const colRenderFunc: DataTables.FunctionColumnRender = (data: any, type: any, row: any, meta: DataTables.CellMetaSettings): any => { + meta.col; + meta.row; + meta.settings; + switch (type) { + case undefined: + return data.value; + case 'filter': + return data.filterValue; + case 'display': + return data.displayValue; + case 'type': + return data.typeValue; + case 'sort': + return data.sortValue; + default: + // Extensibility: the render type can be a custom value, useful for plugins that require custom rendering. + // Custom values are declared as any. + return data.valueForPlugin; + } +}; + +colRenderFunc({}, 'filter', {}, null); +colRenderFunc({}, 'display', {}, null); +colRenderFunc({}, 'type', {}, null); +colRenderFunc({}, 'sort', {}, null); +colRenderFunc({}, undefined, {}, null); +colRenderFunc({}, 'custom value', {}, null); + +let col: DataTables.ColumnSettings = { + cellType: "th", + className: "css", + contentPadding: "mmmm", + createdCell: colCreatedCellFunc, + data: 1, + defaultContent: "edit", + name: "name", + orderable: true, + orderData: 10, + orderDataType: "dom-checkbox", + orderSequence: ['asc', 'desc'], + render: 1, + searchable: true, + title: "title", + visible: true, + width: "200px" +}; +col = { + data: "", + orderData: [10, 11, 20], + render: "", +}; +col = { + data: colDataObject, + render: colRenderObject, +}; +col = { + data: colDataFunc, + render: colRenderFunc, +}; + +//#endregion "Column" + +//#region "ColumnDef" + +let colDef: DataTables.ColumnDefsSettings = { + targets: 1, + cellType: "th", + className: "css", + contentPadding: "mmmm", + createdCell: colCreatedCellFunc, + data: 1, + defaultContent: "edit", + name: "name", + orderable: true, + orderData: 10, + orderDataType: "dom-checkbox", + orderSequence: ['asc', 'desc'], + render: 1, + searchable: true, + title: "title", + visible: true, + width: "200px" + }; + +colDef = { + targets: "2", + cellType: "th", + }; + +colDef = { + targets: ["2", 5], + cellType: "th", + }; + +//#endregion "ColumnDef" + +//#region "Callbacks" + +const createRowFunc: DataTables.FunctionCreateRow = (row, data, dataIndex) => { }; +const drawCallbackFunc: DataTables.FunctionDrawCallback = (settings) => { }; +const footerCallbackFunc: DataTables.FunctionFooterCallback = (tfoot, data, start, end, display) => { }; +const formatNumberFunc: DataTables.FunctionFormatNumber = (toForm) => { }; +const headerCallbackFunc: DataTables.FunctionHeaderCallback = (thead, data, start, end, display) => { }; +const infoCallbackFunc: DataTables.FunctionInfoCallback = (settings, start, end, total, pre) => { }; +const initCallbackFunc: DataTables.FunctionInitComplete = (settings, json) => { }; +const preDrawFunc: DataTables.FunctionPreDrawCallback = (settings) => { }; +const rowCallbackFunc: DataTables.FunctionRowCallback = (row, data, index) => { }; +const stateLoadCallbackFunc: DataTables.FunctionStateLoadCallback = (settings) => { }; +const stateLoadedCallbackFunc: DataTables.FunctionStateLoaded = (settings, data) => { }; +const stateSaveCallbackFunc: DataTables.FunctionStateSaveCallback = (settings, data) => { }; +const stateSaveParamsFunc: DataTables.FunctionStateSaveParams = (settings, data) => { }; + +//#endregion "Callbacks + +//#region "Ajax" + +const ajaxFunc: DataTables.FunctionAjax = (data, callback, settings) => { }; + +let ajaxDataFunc: DataTables.FunctionAjaxData = (data, settings) => data; + +ajaxDataFunc = (data) => ""; + +//#endregion "Ajax" + +//#region "Settings" + +let config: DataTables.Settings = { + // columns + columns: [ + col, + null, + col, + null, + col, + col + ], + columnDefs: [ + null, + colDef, + colDef, + null, + ], + // Data + ajax: "url", + data: {}, + // Features + autoWidth: true, + deferRender: true, + info: true, + jQueryUI: false, + lengthChange: true, + ordering: true, + paging: true, + scrollX: true, + scrollY: "200px", + searching: true, + serverSide: true, + stateSave: true, + // Options + deferLoading: 10, + destroy: true, + displayStart: 1, + dom: "lrtip", + lengthMenu: [1, 2, 3, 4], + orderCellsTop: true, + orderClasses: true, + order: [[0, 'asc'], [1, 'asc']], + orderFixed: [[0, 'asc'], [1, 'asc']], + orderMulti: true, + pageLength: 10, + pagingType: "simple", + retrieve: true, + renderer: "bootstrap", + rowId: "custId", + scrollCollapse: true, + search: true, + searchCols: [{ search: "", smart: true, regex: false, caseInsensitive: true }], + searchDelay: 10, + stateDuration: 10, + tabIndex: 10, + }; + +config = { + ajax: ajaxFunc, + deferLoading: [10, 100], + lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]], + order: [0, 'asc'], + orderFixed: [[0, 'asc'], [1, 'asc']], + renderer: { + header: "bootstrap", + pageButton: "jqueryui" }, - "aria": { - "sortAscending": ": activate to sort column ascending", - "sortDescending": ": activate to sort column descending" - } + search: { search: "", smart: true, regex: false, caseInsensitive: true }, + searchCols: [ + null, + { search: "", smart: true, regex: false, caseInsensitive: true }, + { search: "" }, + { search: "", smart: true }, + null + ], }; - //#endregion "Language" - - //#region "Column" - - var colCreatedCellFunc: DataTables.FunctionColumnCreatedCell = function (cell, cellData, rowData, rowIndex, colIndex) { - - } - - var colDataObject: DataTables.ObjectColumnData = { - _: "phone", - filter: "phone_filter", - display: "phone_display", - sort: "asc" - }; - - var colDataFunc: DataTables.FunctionColumnData = (row: any, type: 'set' | 'display' | 'sort' | 'filter' | 'type', set: any, meta: DataTables.CellMetaSettings) => { - meta.col; - meta.row; - meta.settings; - switch (type) { - case 'set': - row.value = set; - return; - default: - return row.value; - } - }; - - var colRenderObject: DataTables.ObjectColumnRender = { - _: "phone", - filter: "phone_filter", - display: "phone_display", - sort: "asc" - }; - - var colRenderFunc: DataTables.FunctionColumnRender = (data: any, type: 'filter' | 'display' | 'type' | 'sort' | undefined | any, row: any, meta: DataTables.CellMetaSettings): any => { - meta.col; - meta.row; - meta.settings; - switch (type) { - case undefined: - return data.value; - case 'filter': - return data.filterValue; - case 'display': - return data.displayValue; - case 'type': - return data.typeValue; - case 'sort': - return data.sortValue; - default: - // Extensibility: the render type can be a custom value, useful for plugins that require custom rendering. - // Custom values are declared as any. - return data.valueForPlugin; - } - }; - - colRenderFunc({}, 'filter', {}, null); - colRenderFunc({}, 'display', {}, null); - colRenderFunc({}, 'type', {}, null); - colRenderFunc({}, 'sort', {}, null); - colRenderFunc({}, undefined, {}, null); - colRenderFunc({}, 'custom value', {}, null); - - var col: DataTables.ColumnSettings = - { - cellType: "th", - className: "css", - contentPadding: "mmmm", - createdCell: colCreatedCellFunc, - data: 1, - defaultContent: "edit", - name: "name", - orderable: true, - orderData: 10, - orderDataType: "dom-checkbox", - orderSequence: ['asc', 'desc'], - render: 1, - searchable: true, - title: "title", - visible: true, - width: "200px" - } - col = - { - data: "", - orderData: [10, 11, 20], - render: "", - } - col = - { - data: colDataObject, - render: colRenderObject, - } - col = - { - data: colDataFunc, - render: colRenderFunc, - } - - //#endregion "Column" - - //#region "ColumnDef" - - var colDef: DataTables.ColumnDefsSettings = - { - targets: 1, - cellType: "th", - className: "css", - contentPadding: "mmmm", - createdCell: colCreatedCellFunc, - data: 1, - defaultContent: "edit", - name: "name", - orderable: true, - orderData: 10, - orderDataType: "dom-checkbox", - orderSequence: ['asc', 'desc'], - render: 1, - searchable: true, - title: "title", - visible: true, - width: "200px" - }; - - colDef = - { - targets: "2", - cellType: "th", - }; - - colDef = - { - targets: ["2", 5], - cellType: "th", - }; - - //#endregion "ColumnDef" - - //#region "Callbacks" - - var createRowFunc: DataTables.FunctionCreateRow = function (row, data, dataIndex) { }; - var drawCallbackFunc: DataTables.FunctionDrawCallback = function (settings) { }; - var footerCallbackFunc: DataTables.FunctionFooterCallback = function (tfoot, data, start, end, display) { }; - var formatNumberFunc: DataTables.FunctionFormatNumber = function (toForm) { }; - var headerCallbackFunc: DataTables.FunctionHeaderCallback = function (thead, data, start, end, display) { }; - var infoCallbackFunc: DataTables.FunctionInfoCallback = function (settings, start, end, total, pre) { }; - var initCallbackFunc: DataTables.FunctionInitComplete = function (settings, json) { }; - var preDrawFunc: DataTables.FunctionPreDrawCallback = function (settings) { }; - var rowCallbackFunc: DataTables.FunctionRowCallback = function (row, data, index) { }; - var stateLoadCallbackFunc: DataTables.FunctionStateLoadCallback = function (settings) { }; - var stateLoadedCallbackFunc: DataTables.FunctionStateLoaded = function (settings, data) { }; - var stateSaveCallbackFunc: DataTables.FunctionStateSaveCallback = function (settings, data) { }; - var stateSaveParamsFunc: DataTables.FunctionStateSaveParams = function (settings, data) { }; - - //#endregion "Callbacks - - //#region "Ajax" - - var ajaxFunc: DataTables.FunctionAjax = function (data, callback, settings) { }; - - var ajaxDataFunc: DataTables.FunctionAjaxData = function (data, settings) { - return data; - }; - - ajaxDataFunc = function (data) { - return ""; - }; - - //#endregion "Ajax" - - //#region "Settings" - - var config: DataTables.Settings = - { - // columns - columns: [ - col, - null, - col, - null, - col, - col - ], - columnDefs: [ - null, - colDef, - colDef, - null, - ], - // Data - ajax: "url", +config = { + ajax: { data: {}, - // Features - autoWidth: true, - deferRender: true, - info: true, - jQueryUI: false, - lengthChange: true, - ordering: true, - paging: true, - scrollX: true, - scrollY: "200px", - searching: true, - serverSide: true, - stateSave: true, - // Options - deferLoading: 10, - destroy: true, - displayStart: 1, - dom: "lrtip", - lengthMenu: [1, 2, 3, 4], - orderCellsTop: true, - orderClasses: true, - order: [[0, 'asc'], [1, 'asc']], - orderFixed: [[0, 'asc'], [1, 'asc']], - orderMulti: true, - pageLength: 10, - pagingType: "simple", - retrieve: true, - renderer: "bootstrap", - rowId: "custId", - scrollCollapse: true, - search: true, - searchCols: [{ "search": "", "smart": true, "regex": false, "caseInsensitive": true }], - searchDelay: 10, - stateDuration: 10, - tabIndex: 10, - }; - - - config = - { - ajax: ajaxFunc, - deferLoading: [10, 100], - lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]], - order: [0, 'asc'], - orderFixed: [[0, 'asc'], [1, 'asc']], - renderer: { - header: "bootstrap", - pageButton: "jqueryui" - }, - search: { "search": "", "smart": true, "regex": false, "caseInsensitive": true }, - searchCols: [ - null, - { "search": "", "smart": true, "regex": false, "caseInsensitive": true }, - { "search": "" }, - { "search": "", "smart": true }, - null - ], - }; - - config = - { - ajax: { - data: {}, - dataSrc: "", - }, - }; - - config = - { - ajax: { - data: ajaxDataFunc, - dataSrc: function (data: any) { }, - }, - }; - - //#endregion "Settings" - - //#region "Settings-Legacy" - - var browserLegacy: DataTables.BrowserLegacy = { - barWidth: 10, - bBounding: true, - bScrollbarLeft: true, - bScrollOversize: true - } - - //#endregion - - //#region "Init" - - var dt = $('#example').DataTable(); - dt = $('#example1').DataTable(config); - dt = $('#example1').DataTable(config); - dt.$('tr:odd').css('backgroundColor', 'blue'); - - //#endregion "Init" - - //#region "Methods-Ajax" - - var json = dt.ajax.json(); - - var params = dt.ajax.params(); - - var reload = dt.ajax.reload(); - reload = dt.ajax.reload(function () { }); - reload = dt.ajax.reload(function () { }, true); - var test = reload.$(""); - - var url = dt.ajax.url(); - dt.ajax.url("url"); - dt.ajax.url("url").load(); - - //#endregion "Methods-Ajax" - - //#region "Methods-Core" - - var clear = dt.clear(); - clear.$(""); - - var data = dt.data(); - data.$(""); - - var destroy = dt.destroy(); - destroy = dt.destroy(true); - destroy.$(""); - - var draw: DataTables.Api = dt.draw(); - draw = dt.draw(true); - draw = dt.draw("page"); - draw.$(""); - - var initSettings = dt.init(); - - var i18n: string = dt.i18n('buttons.copy', 'Copy to clipboard'); - i18n = dt.i18n('select.rows', { _: '%d rows selected', 1: '1 row selected' }, 0); - - var off = dt.off("event"); - off = dt.off("event", function () { }); - off.$(""); - - var on = dt.on("event", function () { }); - on.$(""); - - var one = dt.one("event", function () { }); - one.$(""); - - var order_get = dt.order(); - var order_set = dt.order([0, "asc"]); - order_set = dt.order([0, "asc"], [1, "desc"]); // TODO: Fíx that - order_set = dt.order([[0, "asc"], [1, "desc"]]); - - var orderListerner = order_set.order.listener("node", 1, function () { }); - - var page_get = dt.page(); - var page_set = dt.page(1); - page_set = dt.page("next"); - - var page = dt.page.info(); - page = { - "page": 1, - "pages": 6, - "start": 10, - "end": 20, - "length": 10, - "recordsTotal": 57, - "recordsDisplay": 57, - "serverSide": false + dataSrc: "", + }, }; - var page_len_get = dt.page.len(); - var page_len_set = dt.page.len(10); - - var search_get = dt.search(); - var search_set = dt.search("searchStr"); - search_set = dt.search("searchStr", true); - search_set = dt.search("searchStr", true, false); - search_set = dt.search("searchStr", true, false, false); - - var settings = dt.settings(); - - var state = dt.state(); - state = { "time": 1423772610230, "start": 0, "length": 25, "order": [[0, "asc"]], "search": { "search": "", "smart": true, "regex": false, "caseInsensitive": true }, "columns": [{ "visible": true, "search": { "search": "", "smart": true, "regex": false, "caseInsensitive": true } }, { "visible": true, "search": { "search": "", "smart": true, "regex": false, "caseInsensitive": true } }, { "visible": true, "search": { "search": "", "smart": true, "regex": false, "caseInsensitive": true } }, { "visible": true, "search": { "search": "", "smart": true, "regex": false, "caseInsensitive": true } }, { "visible": true, "search": { "search": "", "smart": true, "regex": false, "caseInsensitive": true } }, { "visible": true, "search": { "search": "", "smart": true, "regex": false, "caseInsensitive": true } }, { "visible": true, "search": { "search": "", "smart": true, "regex": false, "caseInsensitive": true } }, { "visible": true, "search": { "search": "", "smart": true, "regex": false, "caseInsensitive": true } }] }; - state = dt.state.loaded(); - - var state_clear = dt.state.clear(); - state_clear.$(""); - - var state_save = dt.state.save(); - state_save.$(""); - - //#endregion "Methods-Core" - - var modifier: DataTables.ObjectSelectorModifier = { - order: "current", - search: "none", - searchPlaceholder: "Default text", - page: "all", +config = { + ajax: { + data: ajaxDataFunc, + dataSrc() { + return []; + }, + }, }; - //#region "Methods-Cell" +//#endregion "Settings" - var cells = dt.cells(); - cells = dt.cells(":contains('Not shipped')"); - cells = dt.cells(function () { }); - cells = dt.cells($("")); - cells = dt.cells({}); - cells = dt.cells(":contains('Not shipped')r", modifier); - cells = dt.cells("row-selector", "cells-selector", modifier); +//#region "Settings-Legacy" - var cells_cache = cells.cache("search"); - // Create the select list and search operation - var select = $('') + .appendTo('body') + .on('change', () => { + dt + .column(0) + .search($(this).val() as string) + .draw(); + }); +// Get the search data for the first column and add to the select list +const data_3 = dt + .cells('', 0) + .cache('search') + .sort() + .unique() + .each((d: any) => { + const tag = ``; + select.append($(tag)); + }); + +const cells_data = cells.data(); +const data_4 = dt + .cells(".info") + .data(); + +console.log(data_4); + +const cells_indexes = cells.indexes(); +const columns_d = dt + .cells(':contains("21")') + .indexes() + .pluck('column') + .sort() + .unique(); + +alert('Columns containing 21: ' + columns_d.join(', ')); + +const cells_invalidate_1 = cells.invalidate(); +const cells_invalidate_2 = cells.invalidate("data"); +const td = $('#example tbody td:eq(0)'); +td.html('Updated'); +dt.cell(td).invalidate().draw(); + +const cells_nodes = cells.nodes(); +const cells_d = dt + .cells(":contains('Not shipped')") + .nodes(); + +$(cells_d).addClass('warning'); + +const cells_render = cells.render("display"); +$('#example').on('click', 'tbody td', () => { + const idx = dt.cell(this).index().row; + const data = dt.cells(idx, '').render('display'); console.log(data); +}); - var cells_indexes = cells.indexes(); - var columns_d = dt - .cells(':contains("21")') - .indexes() - .pluck('column') - .sort() - .unique(); +cells.every(() => { }); +cells.every((cellRowIdx, cellColIdx, tableLoop, cellLoop) => { }); - alert('Columns containing 21: ' + columns_d.join(', ')); +let cell = dt.cell(":contains('Not shipped')"); +cell = dt.cell(() => { }); +cell = dt.cell($("")); +cell = dt.cell({}); +cell = dt.cell(":contains('Not shipped')r", modifier); +cell = dt.cell("row-selector", "cells-selector", modifier); - var cells_invalidate = cells.invalidate(); - var cells_invalidate = cells.invalidate("data"); - var td = $('#example tbody td:eq(0)'); - td.html('Updated'); - dt.cell(td).invalidate().draw(); +const cell_cache = cell.cache("search"); +$('#example tbody').on('click', 'td', () => { + alert(dt.cell(this).cache('order')); +}); - var cells_nodes = cells.nodes(); - var cells_d = dt - .cells(":contains('Not shipped')") - .nodes(); +const cell_data_get = cell.data(); +$('#example tbody').on('click', 'td', () => { + alert(dt.cell(this).data()); +}); - $(cells_d).addClass('warning'); +let cell_data_set = cell.data("string"); +cell_data_set = cell.data(1); +$('#example tbody').on('click', 'td', () => { + const cell = dt.cell(this); + cell.data(cell.data() + 1).draw(); +}); - var cells_render = cells.render("display"); - $('#example').on('click', 'tbody td', function () { - var idx = dt.cell(this).index().row; - var data = dt.cells(idx, '').render('display'); +const cell_index = cell.index(); +$('#example tbody').on('click', 'td', () => { + alert('Clicked on cell in visible column: ' + dt.cell(this).index().columnVisible); +}); +$('#example tbody').on('click', 'td', () => { + const rowIdx = dt + .cell(this) + .index().row; - console.log(data); - }); - - cells.every(function () { }); - cells.every(function (cellRowIdx, cellColIdx, tableLoop, cellLoop) { }); - - var cell = dt.cell(":contains('Not shipped')"); - cell = dt.cell(function () { }); - cell = dt.cell($("")); - cell = dt.cell({}); - cell = dt.cell(":contains('Not shipped')r", modifier); - cell = dt.cell("row-selector", "cells-selector", modifier); - - var cell_cache = cell.cache("search"); - $('#example tbody').on('click', 'td', function () { - alert(dt.cell(this).cache('order')); - }); - - var cell_data_get = cell.data(); - $('#example tbody').on('click', 'td', function () { - alert(dt.cell(this).data()); - }); - - var cell_data_set = cell.data("string"); - cell_data_set = cell.data(1); - $('#example tbody').on('click', 'td', function () { - var cell = dt.cell(this); - cell.data(cell.data() + 1).draw(); - }); - - var cell_index = cell.index(); - $('#example tbody').on('click', 'td', function () { - alert('Clicked on cell in visible column: ' + dt.cell(this).index().columnVisible); - }); - $('#example tbody').on('click', 'td', function () { - var rowIdx = dt - .cell(this) - .index().row; - - dt.rows(rowIdx) - .nodes() - .to$() - .addClass('clicked'); - }); - - var cell_invalidate = cell.invalidate(); - var cell_invalidate = cell.invalidate("data"); - $('#example tbody').on('click', 'td', function () { - this.innerHTML = (parseInt(this.innerHTML) + 1).toString(); - dt.cell(this).invalidate().draw(); - }); - - var cell_nodes = cell.node(); - var cell_n = dt - .cell("#importantCell") - .node(); - - $(cell_n).addClass('warning'); - - var cell_render = cell.render("display"); - $('#example').on('click', 'tbody td', function () { - var data = dt.cell(this).render('display'); - - console.log(data); - }); - $('#example').on('click', 'tbody td', function () { - var data = dt.cell(this).render('sort'); - - console.log(data); - }); - - //#endregion "Methods-Cell" - - //#region "Methods-Column" - - var columns = dt.columns(); - columns = dt.columns("selector"); - columns = dt.columns("selector", modifier); - - var columns_cache = columns.cache("order"); - dt.columns('.select-filter').eq(0).each(function (colIdx: any) { - // Create the select list and search operation - var select = $('') + const select = $('') + .appendTo( + dt.column(0).footer() + ) + .on('change', () => { dt - .column(4) - .data() - .reduce(function (a: any, b: any) { - return a + b; - }) - ); - - var column_dataSrc = column.dataSrc(); - $('#example').on('click', 'tbody td', function () { - var idx = dt.cell(this).index().column; - alert('Data source: ' + dt.column(idx).dataSrc()); - }); - - var column_footer = column.footer(); - var column_p = dt.column(0); - //$(column.footer()).html( - // column_p - // .data() - // .reduce(function (a, b) { - // return a + b; - // }) - // ); - - var column_header = column.header(); - $('#example tbody').on('click', 'td', function () { - var idx = dt.cell(this).index().column; - var title = dt.column(idx).header(); - - alert('Column title clicked on: ' + $(title).html()); - }); - - var column_index = column.index(); - column_index = column.index("visibile"); - dt.column(0).visible(false); - - var idx = dt.column(1).index('visible'); - alert(idx); // will show 0 - - dt.column('0:visible').order('asc'); - - var column_nodes = column.nodes(); - dt.column(-1) - .nodes() - //.to$() // Convert to a jQuery object - //.addClass('ready'); - - var column_search_get = column.search(); - var column_search_set = column.search("string"); - column_search_set = column.search("string", true); - column_search_set = column.search("string", true, false); - column_search_set = column.search("string", true, false, true); - $('#column3_search').on('keyup', function () { - dt - .columns(3) - .search((this as HTMLInputElement).value) + .column(0) + .search($(this).val() as string) .draw(); }); - dt.columns('.select-filter').eq(0).each(function (colIdx: any) { - // Create the select list and search operation - var select = $('') + .appendTo( + dt.column(colIdx).footer() + ) + .on('change', function() { + dt + .column(colIdx) + .search($(this).val() as string) + .draw(); + }); + + // Get the search data for the first column and add to the select list + dt + .column(colIdx) + .cache('search') + .sort() + .unique() + .each((d: any) => { + const tag = ``; + select.append($(tag)); + }); +}); + +const column_visible_get = column.visible(); +let column_visible_set = column.visible(false); +column_visible_set = column.visible(false, true); +alert('Column index 0 is ' + + (dt.column(0).visible() ? 'visible' : 'not visible') +); +for (let i = 0; i < 4; i++) { + dt.column(i).visible(false, false); +} +dt.columns.adjust().draw(false); // adjust column sizing and redraw + +dt.columns().every(() => { }); +dt.columns().every((colIdx, tableLoop, colLoop) => { }); + +//#endregion "Methods-Column" + +//#region "Methods-Row" + +const row_1 = dt.row("selector"); +const row_2 = dt.row("selector").child.hide(); +const row_3 = dt.row("selector").child.isShown(); +const row_4 = dt.row("selector").child.remove(); +const row_5 = dt.row("selector").child.show(); +const row_6 = dt.row("selector").child(); +const row_7 = dt.row("selector").child(false); +const row_8 = dt.row("selector").child(false).hide(); +const row_9 = dt.row("selector").child("data"); +const row_10 = dt.row("selector").child("data").remove(); +const row_11 = dt.row("selector").child("data", "css").show(); +const row_12 = dt.row("selector").child.remove(); +const row_13 = dt.row("selector").child.show(); +const row_14 = dt.row.add({}); +const row_15 = dt.row("selector").invalidate(); +const row_16 = dt.row("selector").invalidate("auto"); +const row_17 = dt.row("selector").data(); +const row_18 = dt.row("selector").data({}); +const row_19 = dt.row("selector").index(); +const row_20 = dt.row("selector").node(); +const row_21 = dt.row("selector").remove(); +const row_22: string = dt.row("selector").id(); +const row_23: string = dt.row("selector").id(false); + +const rows_1 = dt.rows(); +const rows_2 = dt.rows().remove(); +const rows_3 = dt.rows("selector"); +const rows_4 = dt.rows("selector").cache("type"); +const rows_5 = dt.rows("selector").data(); +const rows_6 = dt.rows("selector").data({}); +const rows_7 = dt.rows("selector").indexes(); +const rows_8 = dt.rows("selector").invalidate(); +const rows_9 = dt.rows("selector").invalidate("auto"); +const rows_10 = dt.rows("selector").indexes(); +const rows_11 = dt.rows("selector").remove(); +const rows_12 = dt.rows("selector").nodes(); +const rows_13 = dt.rows.add([{}, {}]); +dt.rows().every(() => { }); +dt.rows().every((rowIdx, tableLoop, rowLoop) => { }); +const rows_14: DataTables.Api = dt.rows("selector").ids(); +const rows_15: DataTables.Api = dt.rows("selector").ids(false); + +const table3 = $('#example').DataTable(); +table3.row.add({ + name: "Tiger Nixon", + position: "System Architect", + salary: "$3,120", + start_date: "2011/04/25", + office: "Edinburgh", + extn: "5421" +}).draw(); + +const table4 = $('#example').DataTable(); +table4.row.add([{ + name: "Tiger Nixon", + position: "System Architect", + salary: "$3,120", + start_date: "2011/04/25", + office: "Edinburgh", + extn: "5421" +}, { + name: "Garrett Winters", + position: "Director", + salary: "$5,300", + start_date: "2011/07/25", + office: "Edinburgh", + extn: "8422" +}]) + .draw(); + +let pupil: any; +const table5 = $('#example').DataTable(); +table5.rows.add([ + pupil, + pupil, + pupil, +]) + .draw(); +// .nodes() +// .to$() +// .addClass('new'); + +$('#example tbody').on('click', 'td.details-control', () => { + const tr = $(this).parents('tr'); + const row = dt.row(tr); + + if (row.child.isShown()) { + // This row is already open - close it + row.child.hide(); + tr.removeClass('shown'); + } else { + // Open this row (the format() function would return the data to be shown) + row.child("").show(); + tr.addClass('shown'); + } +}); + +dt.row(':eq(0)').child([ + 'First child row', + 'Second child row', + 'Third child row' +]) + .show(); + +dt.rows().eq(0).each((rowIdx: any) => { + const tag = `${rowIdx}.1${rowIdx}.2${rowIdx}.3${rowIdx}.4`; + dt + .row(rowIdx) + .child( + $(tag) + ) + .show(); +}); + +$('#example tbody').on('click', 'td.details-control', () => { + const tr = $(this).parents('tr'); + const row = dt.row(tr); + + if (row.child.isShown()) { + // This row is already open - close it + row.child.hide(); + tr.removeClass('shown'); + } else { + // Open this row (the format() function would return the data to be shown) + row.child("").show(); + tr.addClass('shown'); + } +}); + +$('#example tbody').on('click', 'td.details-control', () => { + const tr = $(this).parents('tr'); + const row = dt.row(tr); + + if (row.child.isShown()) { + // This row is already open - remove it + row.child.remove(); + tr.removeClass('shown'); + } else { + // Open this row (the format() function would return the data to be shown) + row.child("").show(); + tr.addClass('shown'); + } +}); + +//#endregion "Methods-Row" + +//#region "Methods-Static" + +// Variable is a stand-in for $.fn.dataTable. See extension of JQueryStatic at the top of index.d.ts. +let staticFn: DataTables.StaticFunctions; + +// With boolean parameter type, always returns DataTables.DataTable[]. +let static_1: DataTables.Api[] = staticFn.tables(true); + +// With object parameter type, returns DataTables.DataTable[] when "api" property is false. +static_1 = staticFn.tables({ visible: true, api: false }); + +// With object parameter type, returns DataTables.DataTable when "api" property is true. +const static_2: DataTables.Api = staticFn.tables({ visible: true, api: true }); + +const static_3: DataTables.Api = $("selector").DataTable(); +const static_4: DataTables.JQueryDataTables = $("selector").dataTable(); +const static_5: DataTables.Api = $("selector").dataTable().api(); + +const static_6 = new $.fn.dataTable.Api("selector"); + +const version: boolean = $.fn.dataTable.versionCheck("1.10.0"); +const isDataTable: boolean = $.fn.dataTable.isDataTable("selector"); +const escapeRegex: string = $.fn.dataTable.util.escapeRegex(""); + +const throttle_1 = $.fn.dataTable.util.throttle((data) => { + table.search(data).draw(); +}); + +const throttle_2 = $.fn.dataTable.util.throttle((data) => { + table.search(data).draw(); +}, 100); + +const defaults_1 = $.fn.dataTable.defaults; + +//#endregion "Methods-Static" + +//#region "Default Overwrite" + +/* Default table settings */ +const defaults_2: DataTables.Settings = { + dom: "<'row'<'col-lg-5'f><'col-lg-7'Bl>>" + + "<'row'<'col-lg-12't>>" + + "<'row'<'col-lg-5'i><'col-lg-7'p>>Ox", + paging: true, + pagingType: "bootstrap", + stateSave: true, + language: { + infoEmpty: "Empty" + } +}; + +/* Default class names */ +const default_classes: DataTables.ExtClassesSettings = { + sWrapper: "dataTables_wrapper dt-bootstrap4", + sFilterInput: "form-control", + sLength: "dataTables_length", + sLengthSelect: "form-control custom-select", + sProcessing: "dataTables_processing panel panel-default", + sPageButton: "paginate_button page-item", +}; + +//#endregion "Default Overwrite" + +//#region "Methods-Table" + +let tables = dt.tables(); +tables = dt.tables("selector"); + +const tables_body = tables.body(); +const tables_containers = tables.containers(); +const tables_footer = tables.footer(); +const tables_header = tables.header(); +const tables_nodes = tables.nodes(); + +const table = dt.table("selector"); + +const table_body = table.body(); +const table_container = table.container(); +const table_footer = table.footer(); +const table_header = table.header(); +const table_node = table.node(); + +//#endregion "Methods-Table" + +//#region "Methods-Util" + +const util_1: boolean = dt.any(); +const util_2: number = dt.count(); + +//#endregion "Methods-Util" diff --git a/types/datatables.net/index.d.ts b/types/datatables.net/index.d.ts index 85f6d05857..7cd4b8589b 100644 --- a/types/datatables.net/index.d.ts +++ b/types/datatables.net/index.d.ts @@ -1,91 +1,101 @@ -// Type definitions for JQuery DataTables 1.10.9 +// Type definitions for JQuery DataTables 1.10 // Project: http://www.datatables.net -// Definitions by: Kiarash Ghiaseddin , Omid Rad , Armin Sander , Denise Mauldin +// Definitions by: Kiarash Ghiaseddin , Omid Rad , Armin Sander // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.4 // missing: -// - Static methods that are defined in JQueryStatic.fn are not typed. -// - Plugin and extension definitions are not typed. // - Some return types are not fully working /// interface JQuery { DataTable(opts?: DataTables.Settings): DataTables.Api; + dataTable: DataTables.StaticFunctions; } -//TODO: Wrong, as jquery.d.ts has no interface for fn -//interface JQueryStatic { -// dataTable: DataTables.StaticFunctions; -//} - declare namespace DataTables { - export interface Api extends CoreMethods { + interface JQueryDataTables extends JQuery { /** - * Get the data for the whole table. - */ + * Returns DataTables API instance + * Usage: + * $( selector ).dataTable().api(); + */ + api(): Api; + } + + interface Api extends CoreMethods { + /** + * Returns DataTables API instance + * + * @param table Selector string for table + */ + (selector: string | Node | Node[] | JQuery): Api; + + /** + * Get the data for the whole table. + */ data(): Api; /** - * Order Methods / Object - */ + * Order Methods / object + */ order: OrderMethods; //#region "Cell/Cells" /** - * Select the cell found by a cell selector - * - * @param cellSelector Cell selector. - * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. - */ - cell(cellSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[], modifier?: ObjectSelectorModifier): CellMethods; + * Select the cell found by a cell selector + * + * @param cellSelector Cell selector. + * @param Option used to specify how the cells should be ordered, and if paging or filtering + */ + cell(cellSelector: any, modifier?: ObjectSelectorModifier): CellMethods; /** - * Select the cell found by a cell selector - * - * @param rowSelector Row selector. - * @param cellSelector Cell selector. - * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. - */ - cell(rowSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[], cellSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[], modifier?: ObjectSelectorModifier): CellMethods; + * Select the cell found by a cell selector + * + * @param rowSelector Row selector. + * @param cellSelector Cell selector. + * @param Option used to specify how the cells should be ordered, and if paging or filtering + */ + cell(rowSelector: any, cellSelector: any, modifier?: ObjectSelectorModifier): CellMethods; /** - * Select all cells - * - * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. - */ + * Select all cells + * + * @param Option used to specify how the cells should be ordered, and if paging or filtering + */ cells(modifier?: ObjectSelectorModifier): CellsMethods; /** - * Select cells found by a cell selector - * - * @param cellSelector Cell selector. - * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. - */ - cells(cellSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[], modifier?: ObjectSelectorModifier): CellsMethods; + * Select cells found by a cell selector + * + * @param cellSelector Cell selector. + * @param Option used to specify how the cells should be ordered, and if paging or filtering + */ + cells(cellSelector: any, modifier?: ObjectSelectorModifier): CellsMethods; /** - * Select cells found by both row and column selectors - * - * @param rowSelector Row selector. - * @param cellSelector Cell selector. - * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. - */ - cells(rowSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[], cellSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[], modifier?: ObjectSelectorModifier): CellsMethods; + * Select cells found by both row and column selectors + * + * @param rowSelector Row selector. + * @param cellSelector Cell selector. + * @param Option used to specify how the cells should be ordered, and if paging or filtering + */ + cells(rowSelector: any, cellSelector: any, modifier?: ObjectSelectorModifier): CellsMethods; //#endregion "Cell/Cells" //#region "Column/Columns" /** - * Column Methods / Object - */ + * Column Methods / object + */ column: ColumnMethodsModel; /** - * Columns Methods / Object - */ + * Columns Methods / object + */ columns: ColumnsMethodsModel; //#endregion "Column/Columns" @@ -93,67 +103,62 @@ declare namespace DataTables { //#region "Row/Rows" /** - * Row Methode / Object - */ - row: RowMethodsModel + * Row Methode / object + */ + row: RowMethodsModel; /** - * Rows Methods / Object - */ - rows: RowsMethodsModel + * Rows Methods / object + */ + rows: RowsMethodsModel; //#endregion "Row/Rows" //#region "Table/Tables" /** - * Select a table based on a selector from the API's context - * - * @param tableSelector Table selector. - */ - table(tableSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[]): TableMethods; + * Select a table based on a selector from the API's context + * + * @param tableSelector Table selector. + */ + table(tableSelector: any): TableMethods; /** - * Select all tables - */ - tables(): TablesMethods; - - /** - * Select tables based on the given selector - * - * @param tableSelector Table selector. - */ - tables(tableSelector: (string | Node | Function | JQuery | Object) | (string | Node | Function | JQuery | Object)[]): TablesMethods; + * Select tables based on the given selector + * + * @param tableSelector Table selector. + */ + tables(tableSelector?: any): TablesMethods; //#endregion "Table/Tables" } - export interface DataTables extends CoreMethods { + interface DataTables extends CoreMethods { [index: number]: Api; } interface ObjectSelectorModifier { /** - * The order modifier provides the ability to control which order the rows are processed in. - * Values: 'current', 'applied', 'index', 'original' - */ + * The order modifier provides the ability to control which order the rows are processed in. + * Values: 'current', 'applied', 'index', 'original' + */ order?: string; /** - * The search modifier provides the ability to govern which rows are used by the selector using the search options that are applied to the table. - * Values: 'none', 'applied', 'removed' - */ + * The search modifier provides the ability to govern which rows are used by the selector using the search options that are applied to the table. + * Values: 'none', 'applied', 'removed' + */ search?: string; /** - * The searchPlaceholder modifier provides the ability to provide informational text for an input control when it has no value. - */ + * The searchPlaceholder modifier provides the ability to provide informational text for an input control when it has no value. + */ searchPlaceholder?: string; /** - * The page modifier allows you to control if the selector should consider all data in the table, regardless of paging, or if only the rows in the currently disabled page should be used. - * Values: 'all', 'current' - */ + * The page modifier allows you to control if the selector should consider all data in the table, regardless of paging, or if only the rows in the currently disabled page should be used. + * Values: 'all', 'current' + */ page?: string; } @@ -163,105 +168,102 @@ declare namespace DataTables { interface CoreMethods extends UtilityMethods { /** - * Get jquery object - */ + * Get jquery object + */ $(selector: string | Node | Node[] | JQuery, modifier?: ObjectSelectorModifier): JQuery; - ///// Almost identical to $ in operation, but in this case returns the data for the matched rows. - //_(selector: string | Node | Node[] | JQuery, modifier?: ObjectSelectorModifier): JQuery; - /** - * Ajax Methods - */ + * Ajax Methods + */ ajax: AjaxMethodModel; /** - * Clear the table of all data. - */ + * Clear the table of all data. + */ clear(): Api; /** - * Destroy the DataTables in the current context. - * - * @param remove Completely remove the table from the DOM (true) or leave it in the DOM in its original plain un-enhanced HTML state (default, false). - */ + * Destroy the DataTables in the current context. + * + * @param remove Completely remove the table from the DOM (true) or leave it in the DOM in its original plain un-enhanced HTML state (default, false). + */ destroy(remove?: boolean): Api; /** - * Redraw the DataTables in the current context, optionally updating ordering, searching and paging as required. - * - * @param paging This parameter is used to determine what kind of draw DataTables will perform. - */ + * Redraw the DataTables in the current context, optionally updating ordering, searching and paging as required. + * + * @param paging This parameter is used to determine what kind of draw DataTables will perform. + */ draw(paging?: boolean | string): Api; /* - * Look up a language token that was defined in the DataTables' language initialisation object. - * - * @param token The language token to lookup from the language object. - * @param def The default value to use if the DataTables initialisation has not specified a value. - * @param numeric If handling numeric output, the number to be presented should be given in this parameter. If not numeric operator is required (for example button label text) this parameter is not required. - * - * @returns Resulting internationalised string. - */ - i18n(token: string, def: any | string, numeric?: number): string; + * Look up a language token that was defined in the DataTables' language initialisation object. + * + * @param token The language token to lookup from the language object. + * @param def The default value to use if the DataTables initialisation has not specified a value. + * @param numeric If handling numeric output, the number to be presented should be given in this parameter. + * + * @returns Resulting internationalised string. + */ + i18n(token: string, def: any, numeric?: number): string; /* - * Get the initialisation options used for the table. Since: DataTables 1.10.6 - */ + * Get the initialisation options used for the table. Since: DataTables 1.10.6 + */ init(): Settings; /** - * Table events removal. - * - * @param event Event name to remove. - * @param callback Specific callback function to remove if you want to unbind a single event listener. - */ - off(event: string, callback?: Function): Api; + * Table events removal. + * + * @param event Event name to remove. + * @param callback Specific callback function to remove if you want to unbind a single event listener. + */ + off(event: string, callback?: ((e: Event, settings: Settings, json: any) => void)): Api; /** - * Table events listener. - * - * @param event Event to listen for. - * @param callback Specific callback function to remove if you want to unbind a single event listener. - */ - on(event: string, callback: Function): Api; + * Table events listener. + * + * @param event Event to listen for. + * @param callback Specific callback function to remove if you want to unbind a single event listener. + */ + on(event: string, callback: ((e: Event, settings: Settings, json: any) => void)): Api; /** - * Listen for a table event once and then remove the listener. - * - * @param event Event to listen for. - * @param callback Specific callback function to remove if you want to unbind a single event listener. - */ - one(event: string, callback: Function): Api; + * Listen for a table event once and then remove the listener. + * + * @param event Event to listen for. + * @param callback Specific callback function to remove if you want to unbind a single event listener. + */ + one(event: string, callback: ((e: Event, settings: Settings, json: any) => void)): Api; /** - * Page Methods / Object - */ + * Page Methods / object + */ page: PageMethods; /** - * Get current search - */ + * Get current search + */ search(): string; /** - * Search for data in the table. - * - * @param input Search string to apply to the table. - * @param regex Treat as a regular expression (true) or not (default, false). - * @param smart Perform smart search. - * @param caseInsen Do case-insensitive matching (default, true) or not (false). - */ + * Search for data in the table. + * + * @param input Search string to apply to the table. + * @param regex Treat as a regular expression (true) or not (default, false). + * @param smart Perform smart search. + * @param caseInsen Do case-insensitive matching (default, true) or not (false). + */ search(input: string, regex?: boolean, smart?: boolean, caseInsen?: boolean): Api; /** - * Obtain the table's settings object - */ + * Obtain the table's settings object + */ settings(): Api; /** - * Page Methods / Object - */ + * Page Methods / object + */ state: StateMethods; } @@ -269,43 +271,43 @@ declare namespace DataTables { interface AjaxMethods extends Api { /** - * Reload the table data from the Ajax data source. - * - * @param callback Function which is executed when the data as been reloaded and the table fully redrawn. - * @param resetPaging Reset (default action or true) or hold the current paging position (false). - */ - load(callback?: Function, resetPaging?: boolean): Api; + * Reload the table data from the Ajax data source. + * + * @param callback Function which is executed when the data as been reloaded and the table fully redrawn. + * @param resetPaging Reset (default action or true) or hold the current paging position (false). + */ + load(callback?: ((json: any) => void), resetPaging?: boolean): Api; } interface AjaxMethodModel { /** - * Get the latest JSON data obtained from the last Ajax request DataTables made - */ - json(): Object; + * Get the latest JSON data obtained from the last Ajax request DataTables made + */ + json(): object; /** - * Get the data submitted by DataTables to the server in the last Ajax request - */ - params(): Object; + * Get the data submitted by DataTables to the server in the last Ajax request + */ + params(): object; /** - * Reload the table data from the Ajax data source. - * - * @param callback Function which is executed when the data as been reloaded and the table fully redrawn. - * @param resetPaging Reset (default action or true) or hold the current paging position (false). - */ - reload(callback?: Function, resetPaging?: boolean): Api; + * Reload the table data from the Ajax data source. + * + * @param callback Function which is executed when the data as been reloaded and the table fully redrawn. + * @param resetPaging Reset (default action or true) or hold the current paging position (false). + */ + reload(callback?: ((json: any) => void), resetPaging?: boolean): Api; /** - * Reload the table data from the Ajax data source - */ + * Reload the table data from the Ajax data source + */ url(): string; /** - * Reload the table data from the Ajax data source - * - * @param url URL to set to be the Ajax data source for the table. - */ + * Reload the table data from the Ajax data source + * + * @param url URL to set to be the Ajax data source for the table. + */ url(url: string): AjaxMethods; } @@ -315,27 +317,26 @@ declare namespace DataTables { interface OrderMethods { /** - * Get the ordering applied to the table. - */ - (): (string | number)[][]; + * Get the ordering applied to the table. + */ + (): Array>; /** - * Set the ordering applied to the table. - * - * @param order Order Model - */ - (order?: (string | number)[]): Api; - (order?: (string | number)[][]): Api; - (order: (string | number)[], ...args: any[]): Api; + * Set the ordering applied to the table. + * + * @param order Order Model + */ + (order?: Array<(string | number)> | Array>): Api; + (order: Array<(string | number)>, ...args: any[]): Api; /** - * Add an ordering listener to an element, for a given column. - * - * @param node Selector - * @param column Column index - * @param callback Callback function - */ - listener(node: string | Node | JQuery, column: number, callback: Function): Api; + * Add an ordering listener to an element, for a given column. + * + * @param node Selector + * @param column Column index + * @param callback Callback function + */ + listener(node: string | Node | JQuery, column: number, callback: (() => void)): Api; } //#endregion "order-methods" @@ -343,32 +344,32 @@ declare namespace DataTables { interface PageMethods { /** - * Get the current page of the table. - */ + * Get the current page of the table. + */ (): number; /** - * Set the current page of the table. - * - * @param page Index or 'first', 'next', 'previous', 'last' - */ + * Set the current page of the table. + * + * @param page Index or 'first', 'next', 'previous', 'last' + */ (page: number | string): Api; /** - * Get paging information about the table - */ + * Get paging information about the table + */ info(): PageMethodeModelInfoReturn; /** - * Get the table's page length. - */ + * Get the table's page length. + */ len(): number; /** - * Set the table's page length. - * - * @param length Page length to set. use -1 to show all records. - */ + * Set the table's page length. + * + * @param length Page length to set. use -1 to show all records. + */ len(length: number): Api; } @@ -380,7 +381,7 @@ declare namespace DataTables { length: number; recordsTotal: number; recordsDisplay: number; - serverSide: boolean + serverSide: boolean; } //#endregion "page-methods" @@ -389,23 +390,23 @@ declare namespace DataTables { interface StateMethods { /** - * Get the last saved state of the table - */ + * Get the last saved state of the table + */ (): StateReturnModel; /** - * Clear the saved state of the table. - */ + * Clear the saved state of the table. + */ clear(): Api; /** - * Get the table state that was loaded during initialisation. - */ + * Get the table state that was loaded during initialisation. + */ loaded(): StateReturnModel; /** - * Trigger a state save. - */ + * Trigger a state save. + */ save(): Api; } @@ -413,7 +414,7 @@ declare namespace DataTables { time: number; start: number; length: number; - order: (string | number)[][]; + order: Array>; search: SearchSettings; columns: StateReturnModelColumns[]; } @@ -431,179 +432,179 @@ declare namespace DataTables { interface UtilityMethods { /* - * Get a boolean value to indicate if there are any entries in the API instance's result set (i.e. any data, selected rows, etc). - */ + * Get a boolean value to indicate if there are any entries in the API instance's result set (i.e. any data, selected rows, etc). + */ any(): boolean; /** - * Concatenate two or more API instances together - * - * @param a API instance to concatenate to the initial instance. - * @param b Additional API instance(s) to concatenate to the initial instance. - */ - concat(a: Object, ...b: Object[]): Api; + * Concatenate two or more API instances together + * + * @param a API instance to concatenate to the initial instance. + * @param b Additional API instance(s) to concatenate to the initial instance. + */ + concat(a: object, ...b: object[]): Api; /** - * Get the number of entries in an API instance's result set, regardless of multi-table grouping (e.g. any data, selected rows, etc). Since: 1.10.8 - */ + * Get the number of entries in an API instance's result set, regardless of multi-table grouping (e.g. any data, selected rows, etc). Since: 1.10.8 + */ count(): number; /** - * Iterate over the contents of the API result set. - * - * @param fn Callback function which is called for each item in the API instance result set. The callback is called with three parameters - */ - each(fn: Function): Api; + * Iterate over the contents of the API result set. + * + * @param fn Callback function which is called for each item in the API instance result set. The callback is called with three parameters + */ + each(fn: ((value: any, index: number, dt: Api) => void)): Api; /** - * Reduce an Api instance to a single context and result set. - * - * @param idx Index to select - */ + * Reduce an Api instance to a single context and result set. + * + * @param idx Index to select + */ eq(idx: number): Api; /** - * Iterate over the result set of an API instance and test each item, creating a new instance from those items which pass. - * - * @param fn Callback function which is called for each item in the API instance result set. The callback is called with three parameters. - */ - filter(fn: Function): Api; + * Iterate over the result set of an API instance and test each item, creating a new instance from those items which pass. + * + * @param fn Callback function which is called for each item in the API instance result set. The callback is called with three parameters. + */ + filter(fn: ((value: any, index: number, dt: Api) => boolean)): Api; /** - * Flatten a 2D array structured API instance to a 1D array structure. - */ + * Flatten a 2D array structured API instance to a 1D array structure. + */ flatten(): Api; /** - * Find the first instance of a value in the API instance's result set. - * - * @param value Value to find in the instance's result set. - */ + * Find the first instance of a value in the API instance's result set. + * + * @param value Value to find in the instance's result set. + */ indexOf(value: any): number; /** - * Join the elements in the result set into a string. - * - * @param separator The string that will be used to separate each element of the result set. - */ + * Join the elements in the result set into a string. + * + * @param separator The string that will be used to separate each element of the result set. + */ join(separator: string): string; /** - * Find the last instance of a value in the API instance's result set. - * - * @param value Value to find in the instance's result set. - */ + * Find the last instance of a value in the API instance's result set. + * + * @param value Value to find in the instance's result set. + */ lastIndexOf(value: any): number; /** - * Number of elements in an API instance's result set. - */ + * Number of elements in an API instance's result set. + */ length: number; /** - * Iterate over the result set of an API instance, creating a new API instance from the values returned by the callback. - * - * @param fn Callback function which is called for each item in the API instance result set. The callback is called with three parameters. - */ - map(fn: Function): Api; + * Iterate over the result set of an API instance, creating a new API instance from the values returned by the callback. + * + * @param fn Callback function which is called for each item in the API instance result set. The callback is called with three parameters. + */ + map(fn: ((value: any, index: number, dt: Api) => any)): Api; /** - * Iterate over the result set of an API instance, creating a new API instance from the values retrieved from the original elements. - * - * @param property Object property name to use from the element in the original result set for the new result set. - */ + * Iterate over the result set of an API instance, creating a new API instance from the values retrieved from the original elements. + * + * @param property object property name to use from the element in the original result set for the new result set. + */ pluck(property: number | string): Api; /** - * Remove the last item from an API instance's result set. - */ + * Remove the last item from an API instance's result set. + */ pop(): any; /** - * Add one or more items to the end of an API instance's result set. - * - * @param value_1 Item to add to the API instance's result set. - */ - push(value_1: any | any[], ...value_2: any[]): number; + * Add one or more items to the end of an API instance's result set. + * + * @param value_1 Item to add to the API instance's result set. + */ + push(value_1: any, ...value_2: any[]): number; /** - * Apply a callback function against and accumulator and each element in the Api's result set (left-to-right). - * - * @param fn Callback function which is called for each item in the API instance result set. The callback is called with four parameters. - * @param initialValue Value to use as the first argument of the first call to the fn callback. - */ - reduce(fn: Function, initialValue?: any): any; + * Apply a callback function against and accumulator and each element in the Api's result set (left-to-right). + * + * @param fn Callback function which is called for each item in the API instance result set. The callback is called with four parameters. + * @param initialValue Value to use as the first argument of the first call to the fn callback. + */ + reduce(fn: ((current: number, value: any, index: number, dt: Api) => number), initialValue?: any): any; /** - * Apply a callback function against and accumulator and each element in the Api's result set (right-to-left). - * - * @param fn Callback function which is called for each item in the API instance result set. The callback is called with four parameters. - * @param initialValue Value to use as the first argument of the first call to the fn callback. - */ - reduceRight(fn: Function, initialValue?: any): any; + * Apply a callback function against and accumulator and each element in the Api's result set (right-to-left). + * + * @param fn Callback function which is called for each item in the API instance result set. The callback is called with four parameters. + * @param initialValue Value to use as the first argument of the first call to the fn callback. + */ + reduceRight(fn: ((current: number, value: any, index: number, dt: Api) => number), initialValue?: any): any; /** - * Reverse the result set of the API instance and return the original array. - */ + * Reverse the result set of the API instance and return the original array. + */ reverse(): Api; /** - * Remove the first item from an API instance's result set. - */ + * Remove the first item from an API instance's result set. + */ shift(): any; /** - * Sort the elements of the API instance's result set. - * - * @param fn This is a standard Javascript sort comparison function. It accepts two parameters. - */ - sort(fn?: Function): Api; + * Sort the elements of the API instance's result set. + * + * @param fn This is a standard Javascript sort comparison function. It accepts two parameters. + */ + sort(fn?: ((value1: any, value2: any) => number)): Api; /** - * Modify the contents of an Api instance's result set, adding or removing items from it as required. - * - * @param index Index at which to start modifying the Api instance's result set. - * @param howMany Number of elements to remove from the result set. - * @param value_1 Item to add to the result set at the index specified by the first parameter. - */ - splice(index: number, howMany: number, value_1?: any | any[], ...value_2: any[]): any[]; + * Modify the contents of an Api instance's result set, adding or removing items from it as required. + * + * @param index Index at which to start modifying the Api instance's result set. + * @param howMany Number of elements to remove from the result set. + * @param value_1 Item to add to the result set at the index specified by the first parameter. + */ + splice(index: number, howMany: number, value_1?: any, ...value_2: any[]): any[]; /** - * Convert the API instance to a jQuery object, with the objects from the instance's result set in the jQuery result set. - */ + * Convert the API instance to a jQuery object, with the objects from the instance's result set in the jQuery result set. + */ to$(): JQuery; /** - * Create a native Javascript array object from an API instance. - */ + * Create a native Javascript array object from an API instance. + */ toArray(): any[]; /** - * Convert the API instance to a jQuery object, with the objects from the instance's result set in the jQuery result set. - */ + * Convert the API instance to a jQuery object, with the objects from the instance's result set in the jQuery result set. + */ toJQuery(): JQuery; /** - * Create a new API instance containing only the unique items from a the elements in an instance's result set. - */ + * Create a new API instance containing only the unique items from a the elements in an instance's result set. + */ unique(): Api; /** - * Add one or more items to the start of an API instance's result set. - * - * @param value_1 Item to add to the API instance's result set. - */ - unshift(value_1: any | any[], ...value_2: any[]): number; + * Add one or more items to the start of an API instance's result set. + * + * @param value_1 Item to add to the API instance's result set. + */ + unshift(value_1: any, ...value_2: any[]): number; } //#endregion "util-methods" interface CommonSubMethods { /** - * Get the DataTables cached data for the selected cell - * - * @param t Specify which cache the data should be read from. Can take one of two values: search or order - */ + * Get the DataTables cached data for the selected cell + * + * @param t Specify which cache the data should be read from. Can take one of two values: search or order + */ cache(t: string): Api; } @@ -611,41 +612,41 @@ declare namespace DataTables { interface CommonCellMethods extends CommonSubMethods { /** - * Invalidate the data held in DataTables for the selected cells - * - * @param source Data source to read the new data from. - */ + * Invalidate the data held in DataTables for the selected cells + * + * @param source Data source to read the new data from. + */ invalidate(source?: string): Api; /** - * Get data for the selected cell - * - * @param f Data type to get. This can be one of: 'display', 'filter', 'sort', 'type' - */ + * Get data for the selected cell + * + * @param f Data type to get. This can be one of: 'display', 'filter', 'sort', 'type' + */ render(t: string): any; } interface CellMethods extends CoreMethods, CommonCellMethods { /** - * Get data for the selected cell - */ + * Get data for the selected cell + */ data(): any; /** - * Get data for the selected cell - * - * @param data Value to assign to the data for the cell - */ + * Get data for the selected cell + * + * @param data Value to assign to the data for the cell + */ data(data: any): Api; /** - * Get index information about the selected cell - */ + * Get index information about the selected cell + */ index(): CellIndexReturn; /** - * Get the DOM element for the selected cell - */ + * Get the DOM element for the selected cell + */ node(): Node; } @@ -657,25 +658,25 @@ declare namespace DataTables { interface CellsMethods extends CoreMethods, CommonCellMethods { /** - * Get data for the selected cells - */ + * Get data for the selected cells + */ data(): Api; /** - * Iterate over each selected cell, with the function context set to be the cell in question. Since: DataTables 1.10.6 - * - * @param fn Function to execute for every cell selected. - */ + * Iterate over each selected cell, with the function context set to be the cell in question. Since: DataTables 1.10.6 + * + * @param fn Function to execute for every cell selected. + */ every(fn: (cellRowIdx: number, cellColIdx: number, tableLoop: number, cellLoop: number) => void): Api; /** - * Get index information about the selected cells - */ + * Get index information about the selected cells + */ indexes(): Api; /** - * Get the DOM elements for the selected cells - */ + * Get the DOM elements for the selected cells + */ nodes(): Api; } //#endregion "cell-methods" @@ -684,128 +685,128 @@ declare namespace DataTables { interface CommonColumnMethod extends CommonSubMethods { /** - * Get the footer th / td cell for the selected column. - */ + * Get the footer th / td cell for the selected column. + */ footer(): any; /** - * Get the header th / td cell for a column. - */ + * Get the header th / td cell for a column. + */ header(): Node; /** - * Order the table, in the direction specified, by the column selected by the column()DT selector. - * - * @param direction Direction of sort to apply to the selected column - desc (descending) or asc (ascending). - */ + * Order the table, in the direction specified, by the column selected by the column()DT selector. + * + * @param direction Direction of sort to apply to the selected column - desc (descending) or asc (ascending). + */ order(direction: string): Api; /** - * Get the visibility of the selected column. - */ + * Get the visibility of the selected column. + */ visible(): boolean; /** - * Set the visibility of the selected column. - * - * @param show Specify if the column should be visible (true) or not (false). - * @param redrawCalculations Indicate if DataTables should recalculate the column layout (true - default) or not (false). Typically this would be left as the default value, but it can be useful to disable when using the method in a loop - so the calculations are performed on every call as they can hamper performance. - */ + * Set the visibility of the selected column. + * + * @param show Specify if the column should be visible (true) or not (false). + * @param redrawCalculations Indicate if DataTables should recalculate the column layout (true - default) or not (false). + */ visible(show: boolean, redrawCalculations?: boolean): Api; } interface ColumnMethodsModel { /** - * Select the column found by a column selector - * - * @param cellSelector Cell selector. - * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. - */ + * Select the column found by a column selector + * + * @param cellSelector Cell selector. + * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. + */ (columnSelector: any, modifier?: ObjectSelectorModifier): ColumnMethods; /** - * Convert from the input column index type to that required. - * - * @param t The type on conversion that should take place: 'fromVisible', 'toData', 'fromData', 'toVisible' - * @param index The index to be converted - */ + * Convert from the input column index type to that required. + * + * @param t The type on conversion that should take place: 'fromVisible', 'toData', 'fromData', 'toVisible' + * @param index The index to be converted + */ index(t: string, index: number): number; } interface ColumnMethods extends CoreMethods, CommonColumnMethod { /** - * Get the data for the cells in the selected column. - */ + * Get the data for the cells in the selected column. + */ data(): Api; /** - * Get the data source property for the selected column - */ - dataSrc(): number | string | Function; + * Get the data source property for the selected column + */ + dataSrc(): number | string | (() => string); /** - * Get index information about the selected cell - * - * @param t Specify if you want to get the column data index (default) or the visible index (visible). - */ + * Get index information about the selected cell + * + * @param t Specify if you want to get the column data index (default) or the visible index (visible). + */ index(t?: string): Api; /** - * Obtain the th / td nodes for the selected column - */ + * Obtain the th / td nodes for the selected column + */ nodes(): Api[]; } interface ColumnsMethodsModel { /** - * Select all columns - * - * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. - */ + * Select all columns + * + * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. + */ (modifier?: ObjectSelectorModifier): ColumnsMethods; /** - * Select columns found by a cell selector - * - * @param cellSelector Cell selector. - * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. - */ + * Select columns found by a cell selector + * + * @param cellSelector Cell selector. + * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. + */ (columnSelector: any, modifier?: ObjectSelectorModifier): ColumnsMethods; /** - * Recalculate the column widths for layout. - */ + * Recalculate the column widths for layout. + */ adjust(): Api; } interface ColumnsMethods extends CoreMethods, CommonColumnMethod { /** - * Obtain the data for the columns from the selector - */ + * Obtain the data for the columns from the selector + */ data(): Api; /** - * Get the data source property for the selected columns. - */ + * Get the data source property for the selected columns. + */ dataSrc(): Api; /** - * Iterate over each selected column, with the function context set to be the column in question. Since: DataTables 1.10.6 - * - * @param fn Function to execute for every column selected. - */ + * Iterate over each selected column, with the function context set to be the column in question. Since: DataTables 1.10.6 + * + * @param fn Function to execute for every column selected. + */ every(fn: (colIdx: number, tableLoop: number, colLoop: number) => void): Api; /** - * Get the column indexes of the selected columns. - * - * @param t Specify if you want to get the column data index (default) or the visible index (visible). - */ + * Get the column indexes of the selected columns. + * + * @param t Specify if you want to get the column data index (default) or the visible index (visible). + */ indexes(t?: string): Api; /** - * Obtain the th / td nodes for the selected columns - */ + * Obtain the th / td nodes for the selected columns + */ nodes(): Api[][]; } //#endregion "column-methods" @@ -814,199 +815,193 @@ declare namespace DataTables { interface CommonRowMethod extends CommonSubMethods { /** - * Obtain the th / td nodes for the selected column - * - * @param source Data source to read the new data from. Values: 'auto', 'data', 'dom' - */ + * Obtain the th / td nodes for the selected column + * + * @param source Data source to read the new data from. Values: 'auto', 'data', 'dom' + */ invalidate(source?: string): Api; } interface RowChildMethodModel { /** - * Get the child row(s) that have been set for a parent row - */ + * Get the child row(s) that have been set for a parent row + */ (): JQuery; /** - * Get the child row(s) that have been set for a parent row - * - * @param showRemove This parameter can be given as true or false - */ + * Get the child row(s) that have been set for a parent row + * + * @param showRemove This parameter can be given as true or false + */ (showRemove: boolean): RowChildMethods; /** - * Set the data to show in the child row(s). Note that calling this method will replace any child rows which are already attached to the parent row. - * - * @param data The data to be shown in the child row can be given in multiple different ways. - * @param className Class name that is added to the td cell node(s) of the child row(s). As of 1.10.1 it is also added to the tr row node of the child row(s). - */ - (data: (string | Node | JQuery) | (string | Node | JQuery)[], className?: string): RowChildMethods; + * Set the data to show in the child row(s). Note that calling this method will replace any child rows which are already attached to the parent row. + * + * @param data The data to be shown in the child row can be given in multiple different ways. + * @param className Class name that is added to the td cell node(s) of the child row(s). As of 1.10.1 it is also added to the tr row node of the child row(s). + */ + (data: (string | Node | JQuery) | Array<(string | number | JQuery)>, className?: string): RowChildMethods; /** - * Hide the child row(s) of a parent row - */ + * Hide the child row(s) of a parent row + */ hide(): Api; /** - * Check if the child rows of a parent row are visible - */ + * Check if the child rows of a parent row are visible + */ isShown(): Api; /** - * Remove child row(s) from display and release any allocated memory - */ + * Remove child row(s) from display and release any allocated memory + */ remove(): Api; /** - * Show the child row(s) of a parent row - */ + * Show the child row(s) of a parent row + */ show(): Api; } interface RowChildMethods extends CoreMethods { /** - * Hide the child row(s) of a parent row - */ + * Hide the child row(s) of a parent row + */ hide(): Api; /** - * Remove child row(s) from display and release any allocated memory - */ + * Remove child row(s) from display and release any allocated memory + */ remove(): Api; /** - * Make newly defined child rows visible - */ + * Make newly defined child rows visible + */ show(): Api; } interface RowMethodsModel { /** - * Select a row found by a row selector - * - * @param rowSelector Row selector. - * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. - */ + * Select a row found by a row selector + * + * @param rowSelector Row selector. + * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. + */ (rowSelector: any, modifier?: ObjectSelectorModifier): RowMethods; /** - * Add a new row to the table using the given data - * - * @param data Data to use for the new row. This may be an array, object or Javascript object instance, but must be in the same format as the other data in the table - */ - add(data: any[] | Object): Api; + * Add a new row to the table using the given data + * + * @param data Data to use for the new row. This may be an array, object or Javascript object instance, but must be in the same format as the other data in the table + */ + add(data: any[] | object): Api; } interface RowMethods extends CoreMethods, CommonRowMethod { /** - * Order Methods / Object - */ + * Order Methods / object + */ child: RowChildMethodModel; /** - * Get the data for the selected row - */ - data(): any[] | Object; + * Get the data for the selected row + */ + data(): any[] | object; /** - * Set the data for the selected row - * - * @param d Data to use for the row. - */ - data(d: any[] | Object): Api; + * Set the data for the selected row + * + * @param d Data to use for the row. + */ + data(d: any[] | object): Api; /** - - * Get the id of the selected row. Since: 1.10.8 - * - * @param hash true - Append a hash (#) to the start of the row id. This can be useful for then using the id as a selector - * false - Do not modify the id value. - * @returns Row id. If the row does not have an id available 'undefined' will be returned. - */ + * Get the id of the selected row. Since: 1.10.8 + * + * @param hash true - Append a hash (#) to the start of the row id. This can be useful for then using the id as a selector + * false - Do not modify the id value. + * @returns Row id. If the row does not have an id available 'undefined' will be returned. + */ id(hash?: boolean): string; /** - * Get the row index of the row column. - */ + * Get the row index of the row column. + */ index(): number; /** - * Obtain the tr node for the selected row - */ + * Obtain the tr node for the selected row + */ node(): Node; /** - * Delete the selected row from the DataTable. - */ + * Delete the selected row from the DataTable. + */ remove(): Node; } interface RowsMethodsModel { /** - * Select all rows - * - * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. - */ + * Select all rows + * + * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. + */ (modifier?: ObjectSelectorModifier): RowsMethods; /** - * Select rows found by a row selector - * - * @param cellSelector Row selector. - * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. - */ + * Select rows found by a row selector + * + * @param cellSelector Row selector. + * @param Option used to specify how the cells should be ordered, and if paging or filtering in the table should be taken into account. + */ (rowSelector: any, modifier?: ObjectSelectorModifier): RowsMethods; /** - * Add new rows to the table using the data given - * - * @param data Array of data elements, with each one describing a new row to be added to the table - */ + * Add new rows to the table using the data given + * + * @param data Array of data elements, with each one describing a new row to be added to the table + */ add(data: any[]): Api; } interface RowsMethods extends CoreMethods, CommonRowMethod { /** - * Get the data for the rows from the selector - */ - data(): Api; + * Get / Set the data for the selected row + * + * @param d Data to use for the row. + */ + data(d?: any[] | object): Api; /** - * Set the data for the selected row - * - * @param d Data to use for the row. - */ - data(d: any[] | Object): Api; - - /** - * Iterate over each selected row, with the function context set to be the row in question. Since: DataTables 1.10.6 - * - * @param fn Function to execute for every row selected. - */ + * Iterate over each selected row, with the function context set to be the row in question. Since: DataTables 1.10.6 + * + * @param fn Function to execute for every row selected. + */ every(fn: (rowIdx: number, tableLoop: number, rowLoop: number) => void): Api; /** - * Get the ids of the selected rows. Since: 1.10.8 - * - * @param hash true - Append a hash (#) to the start of each row id. This can be useful for then using the ids as selectors - * false - Do not modify the id value. - * @returns Api instance with the selected rows in its result set. If a row does not have an id available 'undefined' will be returned as the value. - */ + * Get the ids of the selected rows. Since: 1.10.8 + * + * @param hash true - Append a hash (#) to the start of each row id. This can be useful for then using the ids as selectors + * false - Do not modify the id value. + * @returns Api instance with the selected rows in its result set. If a row does not have an id available 'undefined' will be returned as the value. + */ ids(hash?: boolean): Api; /** - * Get the row indexes of the selected rows. - */ + * Get the row indexes of the selected rows. + */ indexes(): Api; /** - * Obtain the tr nodes for the selected rows - */ + * Obtain the tr nodes for the selected rows + */ nodes(): Api; /** - * Delete the selected rows from the DataTable. - */ + * Delete the selected rows from the DataTable. + */ remove(): Api; } //#endregion "row-methods" @@ -1015,55 +1010,55 @@ declare namespace DataTables { interface TableMethods extends CoreMethods { /** - * Get the tfoot node for the table in the API's context - */ + * Get the tfoot node for the table in the API's context + */ footer(): Node; /** - * Get the thead node for the table in the API's context - */ + * Get the thead node for the table in the API's context + */ header(): Node; /** - * Get the tbody node for the table in the API's context - */ + * Get the tbody node for the table in the API's context + */ body(): Node; /** - * Get the div container node for the table in the API's context - */ + * Get the div container node for the table in the API's context + */ container(): Node; /** - * Get the table node for the table in the API's context - */ + * Get the table node for the table in the API's context + */ node(): Node; } interface TablesMethods extends CoreMethods { /** - * Get the tfoot nodes for the tables in the API's context - */ + * Get the tfoot nodes for the tables in the API's context + */ footer(): Api; /** - * Get the thead nodes for the tables in the API's context - */ + * Get the thead nodes for the tables in the API's context + */ header(): Api; /** - * Get the tbody nodes for the tables in the API's context - */ + * Get the tbody nodes for the tables in the API's context + */ body(): Api; /** - * Get the div container nodes for the tables in the API's context - */ + * Get the div container nodes for the tables in the API's context + */ containers(): Api; /** - * Get the table nodes for the tables in the API's context - */ + * Get the table nodes for the tables in the API's context + */ nodes(): Api; } //#endregion "table-methods" @@ -1072,142 +1067,165 @@ declare namespace DataTables { //#region "Static-Methods" - export interface StaticFunctions { + interface StaticFunctions { /** - * Check is a table node is a DataTable or not - * - * @param table Selector string for table - */ + * Returns JQuery object + * + * Usage: + * $( selector ).dataTable(); + */ + (): JQueryDataTables; + + /** + * Check is a table node is a DataTable or not + * + * Usage: + * $.fn.dataTable.isDataTable("selector"); + * @param table Selector string for table + */ isDataTable(table: string): boolean; /** - * Get all DataTable tables that have been initialised - optionally you can select to get only currently visible tables and / or retrieve the tables as API instances. - * - * @param visible As a boolean value this options is used to indicate if you want all tables on the page should be returned (false), or visible tables only (true). - * Since 1.10.8 this option can also be given as an object. - */ - tables(visible?: boolean | ObjectTablesStatic): DataTables.Api[] | DataTables.Api; + * Get all DataTable tables that have been initialised - optionally you can select to get only currently visible tables and / or retrieve the tables as API instances. + * + * @param visible As a boolean value this options is used to indicate if you want all tables on the page should be returned (false), or visible tables only (true). + * Since 1.10.8 this option can also be given as an object. + */ + tables(visible?: boolean | objectTablesStatic): Api[] | Api; /** - * Version number compatibility check function - * - * @param version Version string - */ + * Version number compatibility check function + * + * Usage: + * $.fn.dataTable.versionCheck("1.10.0"); + * @param version Version string + */ versionCheck(version: string): boolean; /** - * Utils - */ + * Utils + */ util: StaticUtilFunctions; /** - * Check is a table node is a DataTable or not - * - * @param table Selector string for table - */ - Api(selector: string | Node | Node[] | JQuery): DataTables.Api; + * Get DataTable API instance + * + * @param table Selector string for table + */ + Api: new (selector: string | Node | Node[] | JQuery) => Api; + + /** + * Default Settings + */ + defaults: Settings; + + /** + * Default Settings + */ + ext: ExtSettings; } - export interface StaticUtilFunctions { + interface StaticUtilFunctions { /** - * Escape special characters in a regular expression string. Since: 1.10.4 - * - * @param str String to escape - */ + * Escape special characters in a regular expression string. Since: 1.10.4 + * + * @param str String to escape + */ escapeRegex(str: string): string; /** - * Throttle the calls to a method to reduce call frequency. Since: 1.10.3 - * - * @param fn Function - * @param period ms - */ - throttle(fn: Function, period?: number): Function; + * Throttle the calls to a method to reduce call frequency. Since: 1.10.3 + * + * @param fn Function + * @param period ms + */ + throttle(fn: FunctionThrottle, period?: number): (() => void); } - interface ObjectTablesStatic { + type FunctionThrottle = (data: any) => void; + + interface objectTablesStatic { /** - * Get only visible tables (true) or all tables regardless of visibility (false). - */ - visible: boolean + * Get only visible tables (true) or all tables regardless of visibility (false). + */ + visible: boolean; /** - * Return a DataTables API instance for the selected tables (true) or an array (false). - */ - api: boolean + * Return a DataTables API instance for the selected tables (true) or an array (false). + */ + api: boolean; } //#endregion "Static-Methods" //#region "Settings" - export interface Settings { - + interface Settings { //#region "Features" /** - * Feature control DataTables' smart column width handling. Since: 1.10 - */ + * Feature control DataTables' smart column width handling. Since: 1.10 + */ autoWidth?: boolean; /** - * Feature control deferred rendering for additional speed of initialisation. Since: 1.10 - */ + * Feature control deferred rendering for additional speed of initialisation. Since: 1.10 + */ deferRender?: boolean; /** - * Feature control table information display field. Since: 1.10 - */ + * Feature control table information display field. Since: 1.10 + */ info?: boolean; /** - * Use markup and classes for the table to be themed by jQuery UI ThemeRoller. Since: 1.10 - */ + * Use markup and classes for the table to be themed by jQuery UI ThemeRoller. Since: 1.10 + */ jQueryUI?: boolean; /** - * Feature control the end user's ability to change the paging display length of the table. Since: 1.10 - */ + * Feature control the end user's ability to change the paging display length of the table. Since: 1.10 + */ lengthChange?: boolean; /** - * Feature control ordering (sorting) abilities in DataTables. Since: 1.10 - */ + * Feature control ordering (sorting) abilities in DataTables. Since: 1.10 + */ ordering?: boolean; /** - * Enable or disable table pagination. Since: 1.10 - */ + * Enable or disable table pagination. Since: 1.10 + */ paging?: boolean; /** - * Feature control the processing indicator. Since: 1.10 - */ + * Feature control the processing indicator. Since: 1.10 + */ processing?: boolean; /** - * Horizontal scrolling. Since: 1.10 - */ + * Horizontal scrolling. Since: 1.10 + */ scrollX?: boolean; /** - * Vertical scrolling. Since: 1.10 Exp: "200px" - */ + * Vertical scrolling. Since: 1.10 Exp: "200px" + */ scrollY?: string; /** - * Feature control search (filtering) abilities Since: 1.10 - */ + * Feature control search (filtering) abilities Since: 1.10 + */ searching?: boolean; /** - * Feature control DataTables' server-side processing mode. Since: 1.10 - */ + * Feature control DataTables' server-side processing mode. Since: 1.10 + */ serverSide?: boolean; /** - * State saving - restore table state on page reload. Since: 1.10 - */ + * State saving - restore table state on page reload. Since: 1.10 + */ stateSave?: boolean; //#endregion "Features" @@ -1215,142 +1233,142 @@ declare namespace DataTables { //#region "Data" /** - * Load data for the table's content from an Ajax source. Since: 1.10 - */ + * Load data for the table's content from an Ajax source. Since: 1.10 + */ ajax?: string | AjaxSettings | FunctionAjax; /** - * Data to use as the display data for the table. Since: 1.10 - */ - data?: Object; + * Data to use as the display data for the table. Since: 1.10 + */ + data?: object; //#endregion "Data" //#region "Options" /** - * Data to use as the display data for the table. Since: 1.10 - */ + * Data to use as the display data for the table. Since: 1.10 + */ columns?: ColumnSettings[]; /** - * Assign a column definition to one or more columns.. Since: 1.10 - */ + * Assign a column definition to one or more columns.. Since: 1.10 + */ columnDefs?: ColumnDefsSettings[]; /** - * Delay the loading of server-side data until second draw - */ + * Delay the loading of server-side data until second draw + */ deferLoading?: number | number[]; /** - * Destroy any existing table matching the selector and replace with the new options. Since: 1.10 - */ + * Destroy any existing table matching the selector and replace with the new options. Since: 1.10 + */ destroy?: boolean; /** - * Initial paging start point. Since: 1.10 - */ + * Initial paging start point. Since: 1.10 + */ displayStart?: number; /** - * Define the table control elements to appear on the page and in what order. Since: 1.10 - */ + * Define the table control elements to appear on the page and in what order. Since: 1.10 + */ dom?: string; /** - * Change the options in the page length select list. Since: 1.10 - */ - lengthMenu?: (number | string)[] | (number | string)[][]; + * Change the options in the page length select list. Since: 1.10 + */ + lengthMenu?: Array<(number | string)> | Array>; /** - * Control which cell the order event handler will be applied to in a column. Since: 1.10 - */ + * Control which cell the order event handler will be applied to in a column. Since: 1.10 + */ orderCellsTop?: boolean; /** - * Highlight the columns being ordered in the table's body. Since: 1.10 - */ + * Highlight the columns being ordered in the table's body. Since: 1.10 + */ orderClasses?: boolean; /** - * Initial order (sort) to apply to the table. Since: 1.10 - */ - order?: (string | number)[] | (string | number)[][]; + * Initial order (sort) to apply to the table. Since: 1.10 + */ + order?: Array<(number | string)> | Array>; /** - * Ordering to always be applied to the table. Since: 1.10 - */ - orderFixed?: (string | number)[] | (string | number)[][] | Object; + * Ordering to always be applied to the table. Since: 1.10 + */ + orderFixed?: Array<(number | string)> | Array> | object; /** - * Multiple column ordering ability control. Since: 1.10 - */ + * Multiple column ordering ability control. Since: 1.10 + */ orderMulti?: boolean; /** - * Change the initial page length (number of rows per page). Since: 1.10 - */ + * Change the initial page length (number of rows per page). Since: 1.10 + */ pageLength?: number; /** - * Pagination button display options. Basic Types: numbers (1.10.8) simple, simple_numbers, full, full_numbers - */ + * Pagination button display options. Basic Types: numbers (1.10.8) simple, simple_numbers, full, full_numbers + */ pagingType?: string; /** - * Retrieve an existing DataTables instance. Since: 1.10 - */ - retrieve?: boolean + * Retrieve an existing DataTables instance. Since: 1.10 + */ + retrieve?: boolean; /** - * Display component renderer types. Since: 1.10 - */ + * Display component renderer types. Since: 1.10 + */ renderer?: string | RendererSettings; /** - * Data property name that DataTables will use to set element DOM IDs. Since: 1.10.8 - */ + * Data property name that DataTables will use to set element DOM IDs. Since: 1.10.8 + */ rowId?: string; /** - * Allow the table to reduce in height when a limited number of rows are shown. Since: 1.10 - */ + * Allow the table to reduce in height when a limited number of rows are shown. Since: 1.10 + */ scrollCollapse?: boolean; /** - * Set an initial filter in DataTables and / or filtering options. Since: 1.10 - */ + * Set an initial filter in DataTables and / or filtering options. Since: 1.10 + */ search?: SearchSettings | boolean; /** - * Set placeholder attribute for input type="text" tag elements. Since: 1.10 - */ + * Set placeholder attribute for input type="text" tag elements. Since: 1.10 + */ searchPlaceholder?: SearchSettings; /** - * Define an initial search for individual columns. Since: 1.10 - */ + * Define an initial search for individual columns. Since: 1.10 + */ searchCols?: SearchSettings[]; /** - * Set a throttle frequency for searching. Since: 1.10 - */ + * Set a throttle frequency for searching. Since: 1.10 + */ searchDelay?: number; /** - * Saved state validity duration. Since: 1.10 - */ + * Saved state validity duration. Since: 1.10 + */ stateDuration?: number; /** - * Set the zebra stripe class names for the rows in the table. Since: 1.10 - */ + * Set the zebra stripe class names for the rows in the table. Since: 1.10 + */ stripeClasses?: string[]; /** - * Tab index control for keyboard navigation. Since: 1.10 - */ + * Tab index control for keyboard navigation. Since: 1.10 + */ tabIndex?: number; //#endregion "Options" @@ -1358,73 +1376,73 @@ declare namespace DataTables { //#region "Callbacks" /** - * Callback for whenever a TR element is created for the table's body. Since: 1.10 - */ + * Callback for whenever a TR element is created for the table's body. Since: 1.10 + */ createdRow?: FunctionCreateRow; /** - * Function that is called every time DataTables performs a draw. Since: 1.10 - */ + * Function that is called every time DataTables performs a draw. Since: 1.10 + */ drawCallback?: FunctionDrawCallback; /** - * Footer display callback function. Since: 1.10 - */ + * Footer display callback function. Since: 1.10 + */ footerCallback?: FunctionFooterCallback; /** - * Number formatting callback function. Since: 1.10 - */ + * Number formatting callback function. Since: 1.10 + */ formatNumber?: FunctionFormatNumber; /** - * Header display callback function. Since: 1.10 - */ + * Header display callback function. Since: 1.10 + */ headerCallback?: FunctionHeaderCallback; /** - * Table summary information display callback. Since: 1.10 - */ + * Table summary information display callback. Since: 1.10 + */ infoCallback?: FunctionInfoCallback; /** - * Initialisation complete callback. Since: 1.10 - */ + * Initialisation complete callback. Since: 1.10 + */ initComplete?: FunctionInitComplete; /** - * Pre-draw callback. Since: 1.10 - */ + * Pre-draw callback. Since: 1.10 + */ preDrawCallback?: FunctionPreDrawCallback; /** - * Row draw callback.. Since: 1.10 - */ + * Row draw callback.. Since: 1.10 + */ rowCallback?: FunctionRowCallback; /** - * Callback that defines where and how a saved state should be loaded. Since: 1.10 - */ + * Callback that defines where and how a saved state should be loaded. Since: 1.10 + */ stateLoadCallback?: FunctionStateLoadCallback; /** - * State loaded callback. Since: 1.10 - */ + * State loaded callback. Since: 1.10 + */ stateLoaded?: FunctionStateLoaded; /** - * State loaded - data manipulation callback. Since: 1.10 - */ + * State loaded - data manipulation callback. Since: 1.10 + */ stateLoadParams?: FunctionStateLoadParams; /** - * Callback that defines how the table state is stored and where. Since: 1.10 - */ + * Callback that defines how the table state is stored and where. Since: 1.10 + */ stateSaveCallback?: FunctionStateSaveCallback; /** - * State save - data manipulation callback. Since: 1.10 - */ + * State save - data manipulation callback. Since: 1.10 + */ stateSaveParams?: FunctionStateSaveParams; //#endregion "Callbacks" @@ -1438,7 +1456,7 @@ declare namespace DataTables { //#region "ajax-settings" - export interface AjaxDataRequest { + interface AjaxDataRequest { draw: number; start: number; length: number; @@ -1448,17 +1466,17 @@ declare namespace DataTables { search: AjaxDataRequestSearch; } - export interface AjaxDataRequestSearch { + interface AjaxDataRequestSearch { value: string; regex: boolean; } - export interface AjaxDataRequestOrder { + interface AjaxDataRequestOrder { column: number; dir: string; } - export interface AjaxDataRequestColumn { + interface AjaxDataRequestColumn { data: string | number; name: string; searchable: boolean; @@ -1466,7 +1484,7 @@ declare namespace DataTables { search: AjaxDataRequestSearch; } - export interface AjaxData { + interface AjaxData { draw?: number; recordsTotal?: number; recordsFiltered?: number; @@ -1476,126 +1494,116 @@ declare namespace DataTables { interface AjaxSettings extends JQueryAjaxSettings { /** - * Add or modify data submitted to the server upon an Ajax request. Since: 1.10 - */ - data?: Object | FunctionAjaxData; + * Add or modify data submitted to the server upon an Ajax request. Since: 1.10 + */ + data?: object | FunctionAjaxData; /** - * Data property or manipulation method for table data. Since: 1.10 - */ - dataSrc?: string | Function; + * Data property or manipulation method for table data. Since: 1.10 + */ + dataSrc?: string | ((data: any) => any[]); } - interface FunctionAjax { - (data: Object, callback: Function, settings: SettingsLegacy): void; - } + type FunctionAjax = (data: object, callback: ((data: any) => void), settings: SettingsLegacy) => void; - interface FunctionAjaxData { - /* - * @param data Data that DataTables has constructed for the request. - * @param settings DataTables settings object. Since 1.10.6 - */ - (data: Object, settings: Settings): string | Object; - } + type FunctionAjaxData = (data: object, settings: Settings) => string | object; //#endregion "ajax-settings" //#region "colunm-settings" - export interface ColumnSettings { + interface ColumnSettings { /** - * Cell type to be created for a column. th/td Since: 1.10 - */ + * Cell type to be created for a column. th/td Since: 1.10 + */ cellType?: string; /** - * Class to assign to each cell in the column. Since: 1.10 - */ + * Class to assign to each cell in the column. Since: 1.10 + */ className?: string; /** - * Add padding to the text content used when calculating the optimal with for a table. Since: 1.10 - */ + * Add padding to the text content used when calculating the optimal with for a table. Since: 1.10 + */ contentPadding?: string; /** - * Cell created callback to allow DOM manipulation. Since: 1.10 - */ + * Cell created callback to allow DOM manipulation. Since: 1.10 + */ createdCell?: FunctionColumnCreatedCell; /** - * Class to assign to each cell in the column. Since: 1.10 - */ + * Class to assign to each cell in the column. Since: 1.10 + */ data?: number | string | ObjectColumnData | FunctionColumnData; /** - * Set default, static, content for a column. Since: 1.10 - */ + * Set default, static, content for a column. Since: 1.10 + */ defaultContent?: string; /** - * Set a descriptive name for a column. Since: 1.10 - */ + * Set a descriptive name for a column. Since: 1.10 + */ name?: string; /** - * Enable or disable ordering on this column. Since: 1.10 - */ + * Enable or disable ordering on this column. Since: 1.10 + */ orderable?: boolean; /** - * Define multiple column ordering as the default order for a column. Since: 1.10 - */ + * Define multiple column ordering as the default order for a column. Since: 1.10 + */ orderData?: number | number[]; /** - * Live DOM sorting type assignment. Since: 1.10 - */ + * Live DOM sorting type assignment. Since: 1.10 + */ orderDataType?: string; /** - * Order direction application sequence. Since: 1.10 - */ + * Order direction application sequence. Since: 1.10 + */ orderSequence?: string[]; /** - * Render (process) the data for use in the table. Since: 1.10 - */ - render?: number | string | ObjectColumnRender | FunctionColumnRender; + * Render (process) the data for use in the table. Since: 1.10 + */ + render?: number | string | ObjectColumnData | FunctionColumnRender; /** - * Enable or disable filtering on the data in this column. Since: 1.10 - */ + * Enable or disable filtering on the data in this column. Since: 1.10 + */ searchable?: boolean; /** - * Set the column title. Since: 1.10 - */ + * Set the column title. Since: 1.10 + */ title?: string; /** - * Set the column type - used for filtering and sorting string processing. Since: 1.10 - */ + * Set the column type - used for filtering and sorting string processing. Since: 1.10 + */ type?: string; /** - * Enable or disable the display of this column. Since: 1.10 - */ + * Enable or disable the display of this column. Since: 1.10 + */ visible?: boolean; /** - * Column width assignment. Since: 1.10 - */ + * Column width assignment. Since: 1.10 + */ width?: string; } interface ColumnDefsSettings extends ColumnSettings { - targets: string | number | (number | string)[] + targets: string | number | Array<(number | string)>; } - interface FunctionColumnCreatedCell { - (cell: Node, cellData: any, rowData: any, row: number, col: number): void; - } + type FunctionColumnCreatedCell = (cell: Node, cellData: any, rowData: any, row: number, col: number) => void; interface FunctionColumnData { (row: any, t: 'set', s: any, meta: CellMetaSettings): void; @@ -1610,52 +1618,47 @@ declare namespace DataTables { sort?: string; } - interface ObjectColumnRender extends ObjectColumnData { - } - - interface FunctionColumnRender { - (data: any, type: 'filter' | 'display' | 'type' | 'sort' | undefined | any, row: any, meta: CellMetaSettings): any; - } + type FunctionColumnRender = (data: any, type: any, row: any, meta: CellMetaSettings) => any; interface CellMetaSettings { row: number; col: number; - settings: DataTables.Settings; + settings: Settings; } //#endregion "colunm-settings" //#region "other-settings" - export interface RendererSettings { + interface RendererSettings { header?: string; pageButton?: string; } - export interface SearchSettings { + interface SearchSettings { /** - * Control case-sensitive filtering option. Since: 1.10 - */ + * Control case-sensitive filtering option. Since: 1.10 + */ caseInsensitive?: boolean; /** - * Enable / disable escaping of regular expression characters in the search term. Since: 1.10 - */ + * Enable / disable escaping of regular expression characters in the search term. Since: 1.10 + */ regex?: boolean; /** - * Enable / disable DataTables' smart filtering. Since: 1.10 - */ + * Enable / disable DataTables' smart filtering. Since: 1.10 + */ smart?: boolean; /** - * Set an initial filtering condition on the table. Since: 1.10 - */ + * Set an initial filtering condition on the table. Since: 1.10 + */ search?: string; /** - * Set a placeholder attribute for input type="text" tag elements. Since: 1.10.1 - */ + * Set a placeholder attribute for input type="text" tag elements. Since: 1.10.1 + */ searchPlaceholder?: string; } @@ -1663,61 +1666,33 @@ declare namespace DataTables { //#region "callback-functions" - interface FunctionCreateRow { - (row: Node, data: any[] | Object, dataIndex: number): void; - } + type FunctionCreateRow = (row: Node, data: any[] | object, dataIndex: number) => void; - interface FunctionDrawCallback { - (settings: SettingsLegacy): void; - } + type FunctionDrawCallback = (settings: SettingsLegacy) => void; - interface FunctionFooterCallback { - (tfoot: Node, data: any[], start: number, end: number, display: any[]): void; - } + type FunctionFooterCallback = (tfoot: Node, data: any[], start: number, end: number, display: any[]) => void; - interface FunctionFormatNumber { - (formatNumber: number): void; - } + type FunctionFormatNumber = (formatNumber: number) => void; - interface FunctionHeaderCallback { - (thead: Node, data: any[], start: number, end: number, display: any[]): void; - } + type FunctionHeaderCallback = (thead: Node, data: any[], start: number, end: number, display: any[]) => void; - interface FunctionInfoCallback { - (settings: SettingsLegacy, start: number, end: number, mnax: number, total: number, pre: string): void; - } + type FunctionInfoCallback = (settings: SettingsLegacy, start: number, end: number, mnax: number, total: number, pre: string) => void; - interface FunctionInitComplete { - (settings: SettingsLegacy, json: Object): void; - } + type FunctionInitComplete = (settings: SettingsLegacy, json: object) => void; - interface FunctionPreDrawCallback { - (settings: SettingsLegacy): void; - } + type FunctionPreDrawCallback = (settings: SettingsLegacy) => void; - interface FunctionRowCallback { - (row: Node, data: any[] | Object, index: number): void; - } + type FunctionRowCallback = (row: Node, data: any[] | object, index: number) => void; - interface FunctionStateLoadCallback { - (settings: SettingsLegacy): void; - } + type FunctionStateLoadCallback = (settings: SettingsLegacy) => void; - interface FunctionStateLoaded { - (settings: SettingsLegacy, data: Object): void; - } + type FunctionStateLoaded = (settings: SettingsLegacy, data: object) => void; - interface FunctionStateLoadParams { - (settings: SettingsLegacy, data: Object): void; - } + type FunctionStateLoadParams = (settings: SettingsLegacy, data: object) => void; - interface FunctionStateSaveCallback { - (settings: SettingsLegacy, data: Object): void; - } + type FunctionStateSaveCallback = (settings: SettingsLegacy, data: object) => void; - interface FunctionStateSaveParams { - (settings: SettingsLegacy, data: Object): void; - } + type FunctionStateSaveParams = (settings: SettingsLegacy, data: object) => void; //#endregion "callback-functions" @@ -1764,7 +1739,7 @@ declare namespace DataTables { [index: string]: Node; } - export interface SettingsLegacy { + interface SettingsLegacy { ajax: any; oApi: any; oFeatures: FeaturesLegacy; @@ -1838,25 +1813,25 @@ declare namespace DataTables { bSortCellsTop: boolean; oInit: any; aoDestroyCallback: any[]; - fnRecordsTotal: () => number; - fnRecordsDisplay: () => number; - fnDisplayEnd: () => number; + fnRecordsTotal(): number; + fnRecordsDisplay(): number; + fnDisplayEnd(): number; oInstance: any; sInstance: string; iTabIndex: number; nScrollHead: Node; nScrollFoot: Node; - rowIdFn: (mSource: string | number | Function) => Function; + rowIdFn(mSource: string | number | (() => void)): (() => void); } - export interface BrowserLegacy { - barWidth: number, - bBounding: boolean, - bScrollbarLeft: boolean, - bScrollOversize: boolean + interface BrowserLegacy { + barWidth: number; + bBounding: boolean; + bScrollbarLeft: boolean; + bScrollOversize: boolean; } - export interface FeaturesLegacy { + interface FeaturesLegacy { bAutoWidth: boolean; bDeferRender: boolean; bFilter: boolean; @@ -1870,7 +1845,7 @@ declare namespace DataTables { bStateSave: boolean; } - export interface ScrollingLegacy { + interface ScrollingLegacy { bAutoCss: boolean; bCollapse: boolean; bInfinite: boolean; @@ -1880,7 +1855,7 @@ declare namespace DataTables { sY: string; } - export interface RowLegacy { + interface RowLegacy { nTr: Node; _aData: any; _aSortData: any[]; @@ -1888,7 +1863,7 @@ declare namespace DataTables { _sRowStripe: string; } - export interface ColumnLegacy { + interface ColumnLegacy { aDataSort: any; asSorting: string[]; bSearchable: boolean; @@ -1896,8 +1871,8 @@ declare namespace DataTables { bVisible: boolean; _bAutoType: boolean; fnCreatedCell: FunctionColumnCreatedCell; - fnGetData: (data: any, specific: string) => any; - fnSetData: (data: any, value: any) => void; + fnGetData(data: any, specific: string): any; + fnSetData(data: any, value: any): void; mData: any; mRender: any; nTh: Node; @@ -1915,11 +1890,9 @@ declare namespace DataTables { sWidthOrig: string; } - export interface CookieCallbackLegacy { - (name: string, data: any, expires: string, path: string, cookie: string): void; - } + type CookieCallbackLegacy = (name: string, data: any, expires: string, path: string, cookie: string) => void; - export interface LanguageLegacy { + interface LanguageLegacy { oAria?: LanguageAriaLegacy; oPaginate?: LanguagePaginateLegacy; sEmptyTable?: string; @@ -1936,12 +1909,12 @@ declare namespace DataTables { sZeroRecords?: string; } - export interface LanguageAriaLegacy { + interface LanguageAriaLegacy { sSortAscending?: string; sSortDescending?: string; } - export interface LanguagePaginateLegacy { + interface LanguagePaginateLegacy { sFirst?: string; sLast?: string; sNext?: string; @@ -1949,4 +1922,213 @@ declare namespace DataTables { } //#endregion "SettingsLegacy" + //#region "ext internal" + + interface ExtSettings { + aTypes: any[]; + afnFiltering: any[]; + afnSortData: object; + aoFeatures: any[]; + builder: string; + classes: ExtClassesSettings; + errMode: string; + feature: any[]; + fnVersionCheck(version: string): string; + iApiIndex: number; + internal: object; + legacy: object; + oApi: object; + oJUIClasses: object; + oPagination: object; + oSort: object; + oStdClasses: ExtClassesSettings; + ofnSearch: object; + order: object; + pager: object; + renderer: object; + sVersion: string; + search: any[]; + selector: object; + type: object; + } + + interface ExtClassesSettings { + /** + * Default Value: + * dataTable + */ + sTable?: string; + + /** + * Default Value: + * no-footer + */ + sNoFooter?: string; + + /** + * Default Value: + * paginate_button + */ + sPageButton?: string; + + /** + * Default Value: + * current + */ + sPageButtonActive?: string; + + /** + * Default Value: + * disabled + */ + sPageButtonDisabled?: string; + + /** + * Default Value: + * odd + */ + sStripeOdd?: string; + + /** + * Default Value: + * even + */ + sStripeEven?: string; + + /** + * Default Value: + * dataTables_empty + */ + sRowEmpty?: string; + + /** + * Default Value: + * dataTables_wrapper + */ + sWrapper?: string; + + /** + * Default Value: + * dataTables_filter + */ + sFilter?: string; + + /** + * Default Value: + * dataTables_info + */ + sInfo?: string; + + /** + * Default Value: + * dataTables_paginate paging_ + */ + sPaging?: string; + + /** + * Default Value: + * dataTables_length + */ + sLength?: string; + + /** + * Default Value: + * dataTables_processing + */ + sProcessing?: string; + + /** + * Default Value: + * sorting_asc + */ + sSortAsc?: string; + + /** + * Default Value: + * sorting_desc + */ + sSortDesc?: string; + + /** + * Default Value: + * sorting + */ + sSortable?: string; + + /** + * Default Value: + * sorting_asc_disabled + */ + sSortableAsc?: string; + + /** + * Default Value: + * sorting_desc_disabled + */ + sSortableDesc?: string; + + /** + * Default Value: + * sorting_disabled + */ + sSortableNone?: string; + + /** + * Default Value: + * sorting_ + */ + sSortColumn?: string; + + sFilterInput?: string; + sLengthSelect?: string; + + /** + * Default Value: + * dataTables_scroll + */ + sScrollWrapper?: string; + + /** + * Default Value: + * dataTables_scrollHead + */ + sScrollHead?: string; + + /** + * Default Value: + * dataTables_scrollHeadInner + */ + sScrollHeadInner?: string; + + /** + * Default Value: + * dataTables_scrollBody + */ + sScrollBody?: string; + + /** + * Default Value: + * dataTables_scrollFoot + */ + sScrollFoot?: string; + + /** + * Default Value: + * dataTables_scrollFootInner + */ + sScrollFootInner?: string; + + sHeaderTH?: string; + sFooterTH?: string; + sSortJUIAsc?: string; + sSortJUIDesc?: string; + sSortJUI?: string; + sSortJUIAscAllowed?: string; + sSortJUIDescAllowed?: string; + sSortJUIWrapper?: string; + sSortIcon?: string; + sJUIHeader?: string; + sJUIFooter?: string; + } + //#endregion "ext internal" } diff --git a/types/datatables.net/tslint.json b/types/datatables.net/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/datatables.net/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/date-arithmetic/date-arithmetic-tests.ts b/types/date-arithmetic/date-arithmetic-tests.ts new file mode 100644 index 0000000000..509551dd92 --- /dev/null +++ b/types/date-arithmetic/date-arithmetic-tests.ts @@ -0,0 +1,21 @@ +import dateArithmetic = require('dateArithmetic'); + +dateArithmetic.add(new Date(2010, 7, 23), 2, 'second'); +dateArithmetic.add(new Date(2010, 7, 23), 2, 'minutes'); +dateArithmetic.add(new Date(2010, 7, 23), 2, 'hours'); +dateArithmetic.add(new Date(2010, 7, 23), 2, 'day'); +dateArithmetic.add(new Date(2010, 7, 23), 2, 'week'); +dateArithmetic.add(new Date(2010, 7, 23), 2, 'month'); +dateArithmetic.add(new Date(2010, 7, 23), 2, 'year'); +dateArithmetic.add(new Date(2010, 7, 23), 2, 'decade'); +dateArithmetic.add(new Date(2010, 7, 23), 2, 'century'); + +dateArithmetic.subtract(new Date(2010, 7, 30), 1, 'second'); +dateArithmetic.subtract(new Date(2010, 7, 29), 2, 'minutes'); +dateArithmetic.subtract(new Date(2010, 7, 28), 3, 'hours'); +dateArithmetic.subtract(new Date(2010, 7, 27), 4, 'day'); +dateArithmetic.subtract(new Date(2010, 7, 26), 5, 'week'); +dateArithmetic.subtract(new Date(2010, 7, 24), 6, 'month'); +dateArithmetic.subtract(new Date(2010, 7, 23), 7, 'year'); +dateArithmetic.subtract(new Date(2010, 7, 22), 8, 'decade'); +dateArithmetic.subtract(new Date(2010, 7, 21), 9, 'century'); diff --git a/types/date-arithmetic/index.d.ts b/types/date-arithmetic/index.d.ts new file mode 100644 index 0000000000..ad669fd523 --- /dev/null +++ b/types/date-arithmetic/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for date-arithmetic v3.1.0 +// Project: https://github.com/jquense/date-math +// Definitions by: Sergii Paryzhskyi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +type Unit = 'second' | 'minutes' | 'hours' | 'day' | 'week' | 'month' | 'year' | 'decade' | 'century'; + +/** dateArithmetic Public Instance Methods */ +interface dateArithmeticStatic { + /** Add specified amount of units to a provided date and return new date as a result */ + add(date: Date, num: number, unit: Unit): Date; + + /** Subtract specified amount of units from a provided date and return new date as a result */ + subtract(date: Date, num: number, unit: Unit): Date; +} + +declare module 'dateArithmetic' { + const dateArithmetic: dateArithmeticStatic; + export = dateArithmetic; +} diff --git a/types/mqtt/tsconfig.json b/types/date-arithmetic/tsconfig.json similarity index 92% rename from types/mqtt/tsconfig.json rename to types/date-arithmetic/tsconfig.json index 7149db58c4..d8942e343c 100644 --- a/types/mqtt/tsconfig.json +++ b/types/date-arithmetic/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "mqtt-tests.ts" + "date-arithmetic-tests.ts" ] } \ No newline at end of file diff --git a/types/date-arithmetic/tslint.json b/types/date-arithmetic/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/date-arithmetic/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/date.format.js/tslint.json b/types/date.format.js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/date.format.js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/dateformat/tslint.json b/types/dateformat/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/dateformat/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/datejs/tslint.json b/types/datejs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/datejs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/daterangepicker/index.d.ts b/types/daterangepicker/index.d.ts index f01ffd59a3..4fddcc4fbd 100644 --- a/types/daterangepicker/index.d.ts +++ b/types/daterangepicker/index.d.ts @@ -25,6 +25,7 @@ declare namespace daterangepicker { startDate: moment.Moment; endDate: moment.Moment; + container: JQuery; setStartDate(date: Date | moment.Moment | string): void; setEndDate(date: Date | moment.Moment | string): void; diff --git a/types/daterangepicker/package.json b/types/daterangepicker/package.json index fce08a048d..19e5fb0d14 100644 --- a/types/daterangepicker/package.json +++ b/types/daterangepicker/package.json @@ -3,4 +3,4 @@ "dependencies": { "moment": ">=2.14.0" } -} \ No newline at end of file +} diff --git a/types/daterangepicker/tslint.json b/types/daterangepicker/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/daterangepicker/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/db-migrate-base/tslint.json b/types/db-migrate-base/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/db-migrate-base/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/db-migrate-pg/tslint.json b/types/db-migrate-pg/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/db-migrate-pg/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/db.js/tslint.json b/types/db.js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/db.js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/dc/tslint.json b/types/dc/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/dc/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/debug/tslint.json b/types/debug/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/debug/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/decimal.js/tslint.json b/types/decimal.js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/decimal.js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/decompress/decompress-tests.ts b/types/decompress/decompress-tests.ts new file mode 100644 index 0000000000..3df7df0219 --- /dev/null +++ b/types/decompress/decompress-tests.ts @@ -0,0 +1,21 @@ +import decompress = require('decompress'); +import * as path from "path"; + +decompress('unicorn.zip', 'dist').then(files => { + console.log('done!'); +}); + +decompress('unicorn.zip', 'dist', { + filter: file => path.extname(file.path) !== '.exe' +}).then(files => { + console.log('done!'); +}); + +decompress('unicorn.zip', 'dist', { + map: file => { + file.path = `unicorn-${file.path}`; + return file; + } +}).then(files => { + console.log('done!'); +}); diff --git a/types/decompress/index.d.ts b/types/decompress/index.d.ts new file mode 100644 index 0000000000..c2211b3434 --- /dev/null +++ b/types/decompress/index.d.ts @@ -0,0 +1,39 @@ +// Type definitions for decompress 4.2 +// Project: https://github.com/kevva/decompress#readme +// Definitions by: York Yao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export = decompress; + +declare function decompress(input: string | Buffer, output: string, opts?: Options): Promise; + +interface File { + data: Buffer; + mode: number; + mtime: string; + path: string; + type: string; +} + +interface Options { + /** + * Filter out files before extracting + */ + filter?(file: File): boolean; + /** + * Map files before extracting + */ + map?(file: File): File; + /** + * Array of plugins to use. + * Default: [decompressTar(), decompressTarbz2(), decompressTargz(), decompressUnzip()] + */ + plugins?: any[]; + /** + * Remove leading directory components from extracted files. + * Default: 0 + */ + strip?: number; +} diff --git a/types/decompress/tsconfig.json b/types/decompress/tsconfig.json new file mode 100644 index 0000000000..33c7a8c5e8 --- /dev/null +++ b/types/decompress/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", + "decompress-tests.ts" + ] +} diff --git a/types/decompress/tslint.json b/types/decompress/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/decompress/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/decorum/tslint.json b/types/decorum/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/decorum/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/deep-assign/tslint.json b/types/deep-assign/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/deep-assign/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/deep-diff/tslint.json b/types/deep-diff/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/deep-diff/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/deep-extend/tslint.json b/types/deep-extend/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/deep-extend/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/deepmerge/index.d.ts b/types/deepmerge/index.d.ts index 797e52c8a5..05f5c96d2e 100644 --- a/types/deepmerge/index.d.ts +++ b/types/deepmerge/index.d.ts @@ -18,3 +18,10 @@ declare namespace deepmerge { function all(objects: Array>, options?: Options): T; } + +declare global { + interface Window { + deepmerge(x: Partial, y: Partial, options?: deepmerge.Options): T; + deepmerge(x: T1, y: T2, options?: deepmerge.Options): T1 & T2; + } +} diff --git a/types/defaults/tslint.json b/types/defaults/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/defaults/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/deku/tslint.json b/types/deku/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/deku/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/delay/index.d.ts b/types/delay/index.d.ts index f84c7ab5e4..0ec894f1e1 100644 --- a/types/delay/index.d.ts +++ b/types/delay/index.d.ts @@ -22,9 +22,9 @@ declare namespace delay { type PDelayedPassThroughThunk = ((value: TValue) => DelayedPromiseLike) & DelayedPromiseLike; interface DelayedPromiseLike { - then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, - onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; - catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | null, + onrejected?: ((reason: any) => TResult2 | PromiseLike) | null): Promise; + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | null): Promise; cancel(): void; } } diff --git a/types/denodeify/tslint.json b/types/denodeify/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/denodeify/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/deoxxa-content-type/tslint.json b/types/deoxxa-content-type/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/deoxxa-content-type/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/deployjava/tslint.json b/types/deployjava/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/deployjava/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/detect-browser/detect-browser-tests.ts b/types/detect-browser/detect-browser-tests.ts index 336da5150a..48abb964f8 100644 --- a/types/detect-browser/detect-browser-tests.ts +++ b/types/detect-browser/detect-browser-tests.ts @@ -1,5 +1,7 @@ +import { detect } from 'detect-browser'; +const browser = detect(); -import detectBrowser = require("detect-browser"); - -const n: string = detectBrowser.name; -const v: string = detectBrowser.version; +if (browser) { + const name: string = browser.name; + const version: string = browser.version; +} diff --git a/types/detect-browser/index.d.ts b/types/detect-browser/index.d.ts index 57ed80c411..351067ff59 100644 --- a/types/detect-browser/index.d.ts +++ b/types/detect-browser/index.d.ts @@ -1,14 +1,27 @@ -// Type definitions for detect-browser v1.6.2 +// Type definitions for detect-browser 2.0 // Project: https://github.com/DamonOehlman/detect-browser // Definitions by: Rogier Schouten // Definitions: https://github.com/borisyankov/DefinitelyTyped -/** - * Browser name - */ -export const name: "edge" | "yandexbrowser" | "chrome" | "crios" | "firefox" | "opera" | "ie" | "bb10" | "android" | "ios" | "safari"; +export type BrowserName = + "android" | + "bb10" | + "chrome" | + "crios" | + "edge" | + "firefox" | + "fxios" | + "ie" | + "ios" | + "kakaotalk" | + "opera" | + "phantomjs" | + "safari" | + "vivaldi" | + "yandexbrowser"; -/** - * Browser version - */ -export const version: string; +export function detect(): null | { + name: BrowserName | "node"; + version: string; + os: string; +}; diff --git a/types/detect-browser/tsconfig.json b/types/detect-browser/tsconfig.json index 076582077e..b1319407fc 100644 --- a/types/detect-browser/tsconfig.json +++ b/types/detect-browser/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/detect-browser/tslint.json b/types/detect-browser/tslint.json new file mode 100644 index 0000000000..dc8ddaa586 --- /dev/null +++ b/types/detect-browser/tslint.json @@ -0,0 +1,10 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "indent": [ + true, + "spaces", + 4 + ] + } +} diff --git a/types/devexpress-web/tslint.json b/types/devexpress-web/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/devexpress-web/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/devexpress-web/v161/tslint.json b/types/devexpress-web/v161/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/devexpress-web/v161/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/devexpress-web/v162/tslint.json b/types/devexpress-web/v162/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/devexpress-web/v162/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/devtools-detect/tslint.json b/types/devtools-detect/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/devtools-detect/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/df-visible/tslint.json b/types/df-visible/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/df-visible/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/dhtmlxgantt/tslint.json b/types/dhtmlxgantt/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/dhtmlxgantt/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/dhtmlxscheduler/index.d.ts b/types/dhtmlxscheduler/index.d.ts index 96c9670a4d..007a049623 100644 --- a/types/dhtmlxscheduler/index.d.ts +++ b/types/dhtmlxscheduler/index.d.ts @@ -1212,6 +1212,14 @@ interface SchedulerStatic { * @param config the configuration object of the timespan to mark/block */ addMarkedTimespan(config: any): number; + + /** + * adds a new keyboard shortcut + * @param shortcut the key name or the name of keys combination for a shortcut (shortcut syntax) + * @param handler the handler of the shortcut call + * @param scope the name of the context element to attach the handler function to (list of scopes) + */ + addShortcut(shortcut: string, handler: () => void, scope?: any): void; /** * adds a section to the currently active view (if the opened view isn't Timeline in the 'Tree' mode - the method will be ignored) @@ -1558,6 +1566,13 @@ interface SchedulerStatic { * @param type ('json', 'xml', 'ical') the data type. The default value - 'xml' */ parse(data: any, type?: string): void; + + /** + * removes a keyboard shortcut + * @param shortcut the key name or the name of keys combination for a shortcut (shortcut syntax) + * @param scope the element to which the shortcut is attached (list of scopes) + */ + removeShortcut(shortcut: string, scope: any): void; /** * creates a mini calendar diff --git a/types/dhtmlxscheduler/tslint.json b/types/dhtmlxscheduler/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/dhtmlxscheduler/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/di-lite/tslint.json b/types/di-lite/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/di-lite/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/diff-match-patch/diff-match-patch-tests.ts b/types/diff-match-patch/diff-match-patch-tests.ts index 9226d7be4a..0f2af4451a 100644 --- a/types/diff-match-patch/diff-match-patch-tests.ts +++ b/types/diff-match-patch/diff-match-patch-tests.ts @@ -1,31 +1,261 @@ +import * as DiffMatchPatch from 'diff-match-patch'; -import DiffMatchPatch = require("diff-match-patch"); +function testDiffMainEach() { + const oldValue = "hello world, how are you?"; + const newValue = "hello again world. how have you been?"; -var oldValue = "hello world, how are you?"; -var newValue = "hello again world. how have you been?"; + const diffEngine = new DiffMatchPatch.diff_match_patch(); + const diffs = diffEngine.diff_main(oldValue, newValue); + diffEngine.diff_cleanupSemantic(diffs); -var diffEngine = new DiffMatchPatch.diff_match_patch(); -var diffs = diffEngine.diff_main(oldValue, newValue); -diffEngine.diff_cleanupSemantic(diffs); + let changes = ""; + let pattern = ""; -var changes = ""; -var pattern = ""; + diffs.forEach((diff) => { + const operation = diff[0]; // Operation (insert, delete, equal) + const text = diff[1]; // Text of change -diffs.forEach(function(diff) { - var operation = diff[0]; // Operation (insert, delete, equal) - var text = diff[1]; // Text of change - - switch (operation) { - case DiffMatchPatch.DIFF_INSERT: - pattern += "I"; - break; - case DiffMatchPatch.DIFF_DELETE: - pattern += "D"; - break; - case DiffMatchPatch.DIFF_EQUAL: - pattern += "E"; - break; - } + switch (operation) { + case DiffMatchPatch.DIFF_INSERT: + pattern += "I"; + break; + case DiffMatchPatch.DIFF_DELETE: + pattern += "D"; + break; + case DiffMatchPatch.DIFF_EQUAL: + pattern += "E"; + break; + } - changes += text; -}); + changes += text; + }); +} + +const DIFF_DELETE: number = DiffMatchPatch.DIFF_DELETE; +const DIFF_INSERT: number = DiffMatchPatch.DIFF_INSERT; +const DIFF_EQUAL: number = DiffMatchPatch.DIFF_EQUAL; +const dmp = new DiffMatchPatch.diff_match_patch(); + +// DIFF TEST FUNCTIONS + +function testDiffCommonPrefix() { + assertEquals(0, dmp.diff_commonPrefix('abc', 'xyz')); +} + +function testDiffCommonSuffix() { + assertEquals(0, dmp.diff_commonSuffix('abc', 'xyz')); +} + +function testDiffCommonOverlap() { + assertEquals(0, dmp.diff_commonOverlap_('', 'abcd')); +} + +function testDiffHalfMatch() { + dmp.Diff_Timeout = 1; + + assertEquals(null, dmp.diff_halfMatch_('1234567890', 'abcdef')); + + assertEquivalent(['12', '90', 'a', 'z', '345678'], dmp.diff_halfMatch_('1234567890', 'a345678z')); + + assertEquivalent(['12123', '123121', 'a', 'z', '1234123451234'], dmp.diff_halfMatch_('121231234123451234123121', 'a1234123451234z')); +} + +function testDiffLinesToChars() { + assertLinesToCharsResultEquals({chars1: '\x01\x02\x01', chars2: '\x02\x01\x02', lineArray: ['', 'alpha\n', 'beta\n']}, dmp.diff_linesToChars_('alpha\nbeta\nalpha\n', 'beta\nalpha\nbeta\n')); +} + +function testDiffCharsToLines() { + const diffs: DiffMatchPatch.Diff[] = [[DIFF_EQUAL, '\x01\x02\x01'], [DIFF_INSERT, '\x02\x01\x02']]; + dmp.diff_charsToLines_(diffs, ['', 'alpha\n', 'beta\n']); + assertEquivalent([[DIFF_EQUAL, 'alpha\nbeta\nalpha\n'], [DIFF_INSERT, 'beta\nalpha\nbeta\n']], diffs); +} + +function testDiffCleanupMerge() { + const diffs: DiffMatchPatch.Diff[] = [[DIFF_EQUAL, 'a'], [DIFF_DELETE, 'b'], [DIFF_INSERT, 'c']]; + dmp.diff_cleanupMerge(diffs); + assertEquivalent([[DIFF_EQUAL, 'a'], [DIFF_DELETE, 'b'], [DIFF_INSERT, 'c']], diffs); +} + +function testDiffCleanupSemanticLossless() { + const diffs: DiffMatchPatch.Diff[] = [[DIFF_EQUAL, 'AAA\r\n\r\nBBB'], [DIFF_INSERT, '\r\nDDD\r\n\r\nBBB'], [DIFF_EQUAL, '\r\nEEE']]; + dmp.diff_cleanupSemanticLossless(diffs); + assertEquivalent([[DIFF_EQUAL, 'AAA\r\n\r\n'], [DIFF_INSERT, 'BBB\r\nDDD\r\n\r\n'], [DIFF_EQUAL, 'BBB\r\nEEE']], diffs); +} + +function testDiffCleanupSemantic() { + const diffs: DiffMatchPatch.Diff[] = [[DIFF_DELETE, 'ab'], [DIFF_INSERT, 'cd'], [DIFF_EQUAL, '12'], [DIFF_DELETE, 'e']]; + dmp.diff_cleanupSemantic(diffs); + assertEquivalent([[DIFF_DELETE, 'ab'], [DIFF_INSERT, 'cd'], [DIFF_EQUAL, '12'], [DIFF_DELETE, 'e']], diffs); +} + +function testDiffCleanupEfficiency() { + dmp.Diff_EditCost = 4; + + const diffs: DiffMatchPatch.Diff[] = [[DIFF_DELETE, 'ab'], [DIFF_INSERT, '12'], [DIFF_EQUAL, 'wxyz'], [DIFF_DELETE, 'cd'], [DIFF_INSERT, '34']]; + dmp.diff_cleanupEfficiency(diffs); + assertEquivalent([[DIFF_DELETE, 'ab'], [DIFF_INSERT, '12'], [DIFF_EQUAL, 'wxyz'], [DIFF_DELETE, 'cd'], [DIFF_INSERT, '34']], diffs); +} + +function testDiffPrettyHtml() { + const diffs: DiffMatchPatch.Diff[] = [[DIFF_EQUAL, 'a\n'], [DIFF_DELETE, 'b'], [DIFF_INSERT, 'c&d']]; + assertEquals('a¶
    <B>b</B>c&d', dmp.diff_prettyHtml(diffs)); +} + +function testDiffText() { + const diffs: DiffMatchPatch.Diff[] = [[DIFF_EQUAL, 'jump'], [DIFF_DELETE, 's'], [DIFF_INSERT, 'ed'], [DIFF_EQUAL, ' over '], [DIFF_DELETE, 'the'], [DIFF_INSERT, 'a'], [DIFF_EQUAL, ' lazy']]; + assertEquals('jumps over the lazy', dmp.diff_text1(diffs)); + + assertEquals('jumped over a lazy', dmp.diff_text2(diffs)); +} + +function testDiffDelta() { + const diffs: DiffMatchPatch.Diff[] = + [[DIFF_EQUAL, 'jump'], [DIFF_DELETE, 's'], [DIFF_INSERT, 'ed'], [DIFF_EQUAL, ' over '], [DIFF_DELETE, 'the'], [DIFF_INSERT, 'a'], [DIFF_EQUAL, ' lazy'], [DIFF_INSERT, 'old dog']]; + const text1 = dmp.diff_text1(diffs); + assertEquals('jumps over the lazy', text1); + + const delta = dmp.diff_toDelta(diffs); + assertEquals('=4\t-1\t+ed\t=6\t-3\t+a\t=5\t+old dog', delta); + + assertEquivalent(diffs, dmp.diff_fromDelta(text1, delta)); +} + +function testDiffXIndex() { + assertEquals(5, dmp.diff_xIndex([[DIFF_DELETE, 'a'], [DIFF_INSERT, '1234'], [DIFF_EQUAL, 'xyz']], 2)); +} + +function testDiffLevenshtein() { + assertEquals(4, dmp.diff_levenshtein([[DIFF_DELETE, 'abc'], [DIFF_INSERT, '1234'], [DIFF_EQUAL, 'xyz']])); +} + +function testDiffBisect() { + const a = 'cat'; + const b = 'map'; + assertEquivalent([[DIFF_DELETE, 'c'], [DIFF_INSERT, 'm'], [DIFF_EQUAL, 'a'], [DIFF_DELETE, 't'], [DIFF_INSERT, 'p']], dmp.diff_bisect_(a, b, Number.MAX_VALUE)); +} + +function testDiffMain() { + assertEquivalent([], dmp.diff_main('', '', false)); + + dmp.Diff_Timeout = 0; + // Simple cases. + assertEquivalent([[DIFF_DELETE, 'a'], [DIFF_INSERT, 'b']], dmp.diff_main('a', 'b', false)); +} + +// MATCH TEST FUNCTIONS + +function testMatchAlphabet() { + const expected: {[char: string]: number} = {}; + expected['a'] = 4; + expected['b'] = 2; + expected['c'] = 1; + assertEquivalent(expected, dmp.match_alphabet_('abc')); +} + +function testMatchBitap() { + dmp.Match_Distance = 100; + dmp.Match_Threshold = 0.5; + + assertEquals(5, dmp.match_bitap_('abcdefghijk', 'fgh', 5)); +} + +function testMatchMain() { + assertEquals(0, dmp.match_main('abcdef', 'abcdef', 1000)); +} + +// PATCH TEST FUNCTIONS + +function testPatchObj() { + // Patch Object. + const p = new DiffMatchPatch.patch_obj(); + assertEquals(null, p.start1); + assertEquals(null, p.start2); + + p.start1 = 20; + p.start2 = 21; + p.length1 = 18; + p.length2 = 17; + p.diffs = [[DIFF_EQUAL, 'jump'], [DIFF_DELETE, 's'], [DIFF_INSERT, 'ed'], [DIFF_EQUAL, ' over '], [DIFF_DELETE, 'the'], [DIFF_INSERT, 'a'], [DIFF_EQUAL, '\nlaz']]; + const strp = p.toString(); + assertEquals('@@ -21,18 +22,17 @@\n jump\n-s\n+ed\n over \n-the\n+a\n %0Alaz\n', strp); +} + +function testPatchFromText() { + const strp = '@@ -21,18 +22,17 @@\n jump\n-s\n+ed\n over \n-the\n+a\n %0Alaz\n'; + assertEquals(strp, dmp.patch_fromText(strp)[0].toString()); +} + +function testPatchToText() { + const strp = '@@ -21,18 +22,17 @@\n jump\n-s\n+ed\n over \n-the\n+a\n laz\n'; + const p = dmp.patch_fromText(strp); + assertEquals(strp, dmp.patch_toText(p)); +} + +function testPatchAddContext() { + dmp.Patch_Margin = 4; + const p = dmp.patch_fromText('@@ -21,4 +21,10 @@\n-jump\n+somersault\n')[0]; + dmp.patch_addContext_(p, 'The quick brown fox jumps over the lazy dog.'); + assertEquals('@@ -17,12 +17,18 @@\n fox \n-jump\n+somersault\n s ov\n', p.toString()); +} + +function testPatchMake() { + const text1 = 'The quick brown fox jumps over the lazy dog.'; + const text2 = 'That quick brown fox jumped over a lazy dog.'; + let expectedPatch = '@@ -1,8 +1,7 @@\n Th\n-at\n+e\n qui\n@@ -21,17 +21,18 @@\n jump\n-ed\n+s\n over \n-a\n+the\n laz\n'; + let patches = dmp.patch_make(text2, text1); + assertEquals(expectedPatch, dmp.patch_toText(patches)); + + // Method 1 + expectedPatch = '@@ -1,11 +1,12 @@\n Th\n-e\n+at\n quick b\n@@ -22,18 +22,17 @@\n jump\n-s\n+ed\n over \n-the\n+a\n laz\n'; + patches = dmp.patch_make(text1, text2); + assertEquals(expectedPatch, dmp.patch_toText(patches)); + + // Method 2 + const diffs = dmp.diff_main(text1, text2, false); + patches = dmp.patch_make(diffs); + assertEquals(expectedPatch, dmp.patch_toText(patches)); + + // Method 3 + patches = dmp.patch_make(text1, diffs); + assertEquals(expectedPatch, dmp.patch_toText(patches)); + + // Method 4 + patches = dmp.patch_make(text1, text2, diffs); + assertEquals(expectedPatch, dmp.patch_toText(patches)); +} + +function testPatchSplitMax() { + const patches = dmp.patch_make('abcdefghijklmnopqrstuvwxyz01234567890', 'XabXcdXefXghXijXklXmnXopXqrXstXuvXwxXyzX01X23X45X67X89X0'); + dmp.patch_splitMax(patches); + assertEquals( + [ + '@@ -1,32 +1,46 @@\n', + '+X\n ab\n+X\n cd\n+X\n ef\n+X\n gh\n+X\n ij\n+X\n kl\n+X\n mn\n+X\n op\n+X\n qr\n+X\n st\n+X\nuv\n+X\n wx\n+X\n yz\n+X\n 012345\n', + '@@ -25,13 +39,18 @@', + '\n zX01\n+X\n 23\n+X\n 45\n+X\n 67\n+X\n 89\n+X\n 0\n' + ].join(''), + dmp.patch_toText(patches)); +} + +function testPatchAddPadding() { + const patches = dmp.patch_make('', 'test'); + assertEquals('@@ -0,0 +1,4 @@\n+test\n', dmp.patch_toText(patches)); + dmp.patch_addPadding(patches); + assertEquals('@@ -1,8 +1,12 @@\n %01%02%03%04\n+test\n %01%02%03%04\n', dmp.patch_toText(patches)); +} + +function testPatchApply() { + dmp.Match_Distance = 1000; + dmp.Match_Threshold = 0.5; + dmp.Patch_DeleteThreshold = 0.5; + const patches = dmp.patch_make('The quick brown fox jumps over the lazy dog.', 'That quick brown fox jumped over a lazy dog.'); + const results = dmp.patch_apply(patches, 'The quick brown fox jumps over the lazy dog.'); + assertEquivalent(['That quick brown fox jumped over a lazy dog.', [true, true]], results); +} + +declare function assertEquals(expected: T, actual: T): void; + +declare function assertEquivalent(expected: T[], actual: T[]): void; +declare function assertEquivalent(expected: T, actual: T): void; + +declare function assertLinesToCharsResultEquals(expected: {chars1: string, chars2: string, lineArray: string[]}, actual: {chars1: string, chars2: string, lineArray: string[]}): void; diff --git a/types/diff-match-patch/index.d.ts b/types/diff-match-patch/index.d.ts index cfaeace764..9d27016691 100644 --- a/types/diff-match-patch/index.d.ts +++ b/types/diff-match-patch/index.d.ts @@ -1,22 +1,19 @@ -// Type definitions for diff-match-patch v1.0.0 +// Type definitions for diff-match-patch 1.0 // Project: https://www.npmjs.com/package/diff-match-patch // Definitions by: Asana // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +export type Diff = [number, string]; -type Diff = [number, string]; - -export declare class Patch { +export class patch_obj { diffs: Diff[]; - start1: number; - start2: number; + start1: number | null; + start2: number | null; length1: number; length2: number; } -export declare class diff_match_patch { - static new(): diff_match_patch; - +export class diff_match_patch { Diff_Timeout: number; Diff_EditCost: number; Match_Threshold: number; @@ -26,8 +23,13 @@ export declare class diff_match_patch { Match_MaxBits: number; diff_main(text1: string, text2: string, opt_checklines?: boolean, opt_deadline?: number): Diff[]; + diff_bisect_(text1: string, text2: string, deadline: number): Diff[]; + diff_linesToChars_(text1: string, text2: string): { chars1: string; chars2: string; lineArray: string[]; }; + diff_charsToLines_(diffs: Diff[], lineArray: string[]): void; diff_commonPrefix(text1: string, text2: string): number; diff_commonSuffix(text1: string, text2: string): number; + diff_commonOverlap_(text1: string, text2: string): number; + diff_halfMatch_(text1: string, text2: string): string[]; diff_cleanupSemantic(diffs: Diff[]): void; diff_cleanupSemanticLossless(diffs: Diff[]): void; diff_cleanupEfficiency(diffs: Diff[]): void; @@ -40,13 +42,22 @@ export declare class diff_match_patch { diff_toDelta(diffs: Diff[]): string; diff_fromDelta(text1: string, delta: string): Diff[]; - patch_make(text1: any, text2?: string): Patch[]; - patch_deepCopy(patches: Patch[]): Patch[]; - patch_apply(patches: Patch[], text: string): [string, boolean[]]; - patch_fromText(text: string): Patch[]; - patch_toText(patches: Patch[]): string; + match_main(text: string, pattern: string, loc: number): number; + match_bitap_(text: string, pattern: string, loc: number): number; + match_alphabet_(pattern: string): {[char: string]: number}; + + patch_addContext_(patch: patch_obj, text: string): void; + patch_make(a: string, opt_b: string | Diff[]): patch_obj[]; + patch_make(a: Diff[]): patch_obj[]; + patch_make(a: string, opt_b: string, opt_c: Diff[]): patch_obj[]; + patch_deepCopy(patches: patch_obj[]): patch_obj[]; + patch_apply(patches: patch_obj[], text: string): [string, boolean[]]; + patch_addPadding(patches: patch_obj[]): string; + patch_splitMax(patches: patch_obj[]): void; + patch_fromText(text: string): patch_obj[]; + patch_toText(patches: patch_obj[]): string; } -export declare var DIFF_DELETE: number; -export declare var DIFF_INSERT: number; -export declare var DIFF_EQUAL: number; +export const DIFF_DELETE: number; +export const DIFF_INSERT: number; +export const DIFF_EQUAL: number; diff --git a/types/diff-match-patch/tslint.json b/types/diff-match-patch/tslint.json new file mode 100644 index 0000000000..65c83fb1e3 --- /dev/null +++ b/types/diff-match-patch/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "dt-header": false + } +} diff --git a/types/diff2html/tslint.json b/types/diff2html/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/diff2html/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/disposable-email-domains/tslint.json b/types/disposable-email-domains/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/disposable-email-domains/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/doccookies/tslint.json b/types/doccookies/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/doccookies/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/dock-spawn/tslint.json b/types/dock-spawn/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/dock-spawn/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/docopt/tslint.json b/types/docopt/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/docopt/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/doctrine/tslint.json b/types/doctrine/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/doctrine/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/documentdb-server/tslint.json b/types/documentdb-server/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/documentdb-server/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/documentdb-session/index.d.ts b/types/documentdb-session/index.d.ts index 69914bdc6c..ed64df8921 100644 --- a/types/documentdb-session/index.d.ts +++ b/types/documentdb-session/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/dwhieb/documentdb-session#readme // Definitions by: Daniel Rosenwasser // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 import session = require("express-session"); diff --git a/types/documentdb/index.d.ts b/types/documentdb/index.d.ts index 140470fbda..73ec95787c 100644 --- a/types/documentdb/index.d.ts +++ b/types/documentdb/index.d.ts @@ -553,6 +553,7 @@ export class HashPartitionResolver implements PartitionResolver { * * @deprecated */ +// tslint:disable-next-line no-unnecessary-class export class Range { /** * DEPRECATED @@ -619,7 +620,8 @@ export class DocumentClient { */ constructor(urlConnection: string, auth: AuthOptions, connectionPolicy?: ConnectionPolicy, consistencyLevel?: ConsistencyLevel); - /** Create an attachment for the document object. + /** + * Create an attachment for the document object. *

    * Each document may contain zero or more attachments. Attachments can be of any MIME type - text, image, binary data.
    * These are stored externally in Azure Blob storage. Attachments are automatically deleted when the parent document is deleted. @@ -642,7 +644,8 @@ export class DocumentClient { createAttachmentAndUploadMedia(documentLink: string, readableStream: NodeJS.ReadableStream, options: MediaOptions, callback: RequestCallback): void; createAttachmentAndUploadMedia(documentLink: string, readableStream: NodeJS.ReadableStream, callback: RequestCallback): void; - /** Send a request for creating a database. + /** + * Send a request for creating a database. * A database manages users, permissions and a set of collections. * Each Azure DocumentDB Database Account is able to support multiple independent named databases, with the database being the logical container for data. * Each Database consists of one or more collections, each of which in turn contain one or more documents. Since databases are an an administrative @@ -757,7 +760,8 @@ export class DocumentClient { executeStoredProcedure(procedureLink: string, params: any[], options: RequestOptions, callback: RequestCallback): void; executeStoredProcedure(procedureLink: string, paramsOrOptions: any[] | RequestOptions, callback: RequestCallback): void; - /** Lists all databases that satisfy a query. + /** + * Lists all databases that satisfy a query. * @param query - A SQL query string. * @param [options] - The feed options. * @returns - An instance of QueryIterator to handle reading feed. @@ -802,10 +806,10 @@ export class DocumentClient { /** * Query the triggers for the collection. - * @param {string} collectionLink - The self-link of the collection. - * @param {SqlQuerySpec | string} query - A SQL query. - * @param {FeedOptions} [options] - Represents the feed options. - * @returns {QueryIterator} - An instance of queryIterator to handle reading feed. + * @param collectionLink - The self-link of the collection. + * @param query - A SQL query. + * @param [options] - Represents the feed options. + * @returns - An instance of queryIterator to handle reading feed. */ queryTriggers(collectionLink: string, query: DocumentQuery, options?: FeedOptions): QueryIterator; @@ -940,10 +944,10 @@ export class DocumentClient { /** * Replace the document object. - * @param {string} documentLink - The self-link of the document. - * @param {object} document - Represent the new document body. - * @param {RequestOptions} [options] - The request options. - * @param {RequestCallback} callback - The callback for the request. + * @param documentLink - The self-link of the document. + * @param document - Represent the new document body. + * @param [options] - The request options. + * @param callback - The callback for the request. */ replaceDocument(documentLink: string, document: NewDocument, options: RequestOptions, callback: RequestCallback): void; replaceDocument(documentLink: string, document: NewDocument, callback: RequestCallback): void; @@ -1340,107 +1344,107 @@ export class DocumentClient { getWriteEndpoint(callback: RequestCallback): void; } -export class UriFactory { +export namespace UriFactory { /** * Given a database id, this creates a database link. - * @param {string} databaseId -The database id - * @returns {string} -A database link in the format of dbs/{0} with {0} being a Uri escaped version of the databaseId + * @param databaseId -The database id + * @returns -A database link in the format of dbs/{0} with {0} being a Uri escaped version of the databaseId * @description Would be used when creating or deleting a DocumentCollection or a User in Azure DocumentDB database service */ - static createDatabaseUri(databaseId: string): string; + function createDatabaseUri(databaseId: string): string; /** * Given a database and collection id, this creates a collection link. - * @param {string} databaseId -The database id - * @param {string} collectionId -The collection id - * @returns {string} A collection link in the format of dbs/{0}/colls/{1} with {0} being a Uri escaped version of the databaseId and {1} being collectionId + * @param databaseId -The database id + * @param collectionId -The collection id + * @returns A collection link in the format of dbs/{0}/colls/{1} with {0} being a Uri escaped version of the databaseId and {1} being collectionId * @description Would be used when updating or deleting a DocumentCollection, creating a Document, a StoredProcedure, a * Trigger, a UserDefinedFunction, or when executing a query with CreateDocumentQuery in Azure DocumentDB database service. */ - static createDocumentCollectionUri(databaseId: string, collectionId: string): string; + function createDocumentCollectionUri(databaseId: string, collectionId: string): string; /** * Given a database and collection id, this creates a collection link. - * @param {string} databaseId -The database id - * @param {string} collectionId -The collection id - * @param {string} documentId -The document id - * @returns {string} -A document link in the format of dbs/{0}/colls/{1}/docs/{2} with {0} + * @param databaseId -The database id + * @param collectionId -The collection id + * @param documentId -The document id + * @returns -A document link in the format of dbs/{0}/colls/{1}/docs/{2} with {0} * being a Uri escaped version of the databaseId, {1} being collectionId and {2} being the documentId * @description Would be used when creating an Attachment, or when replacing or deleting a Document in Azure DocumentDB database service */ - static createDocumentUri(databaseId: string, collectionId: string, documentId: string): string; + function createDocumentUri(databaseId: string, collectionId: string, documentId: string): string; /** * Given a database, collection and document id, this creates a document link. - * @param {string} databaseId -The database Id - * @param {string} userId -The user Id - * @param {string} permissionId - The permissionId - * @returns {string} A permission link in the format of dbs/{0}/users/{1}/permissions/{2} with {0} being a Uri escaped version of the databaseId, {1} being userId and {2} being permissionId + * @param databaseId -The database Id + * @param userId -The user Id + * @param permissionId - The permissionId + * @returns A permission link in the format of dbs/{0}/users/{1}/permissions/{2} with {0} being a Uri escaped version of the databaseId, {1} being userId and {2} being permissionId * @description Would be used when replacing or deleting a Permission in Azure DocumentDB database service. */ - static createPermissionUri(databaseId: string, userId: string, permissionId: string): string; + function createPermissionUri(databaseId: string, userId: string, permissionId: string): string; /** * Given a database, collection and stored proc id, this creates a stored proc link. - * @param {string} databaseId -The database Id - * @param {string} collectionId -The collection Id - * @param {string} storedProcedureId -The stored procedure Id - * @returns {string} -A stored procedure link in the format of dbs/{0}/colls/{1}/sprocs/{2} + * @param databaseId -The database Id + * @param collectionId -The collection Id + * @param storedProcedureId -The stored procedure Id + * @returns -A stored procedure link in the format of dbs/{0}/colls/{1}/sprocs/{2} * with {0} being a Uri escaped version of the databaseId, * {1} being collectionId and {2} being the storedProcedureId * @description Would be used when replacing, executing, or deleting a StoredProcedure in Azure DocumentDB database service. */ - static createStoredProcedureUri(databaseId: string, collectionId: string, storedProcedureId: string): string; + function createStoredProcedureUri(databaseId: string, collectionId: string, storedProcedureId: string): string; /** * @summary Given a database, collection and trigger id, this creates a trigger link. - * @param {string} databaseId -The database Id - * @param {string} collectionId -The collection Id - * @param {string} triggerId -The trigger Id - * @returns {string} -A trigger link in the format of dbs/{0}/colls/{1}/triggers/{2} + * @param databaseId -The database Id + * @param collectionId -The collection Id + * @param triggerId -The trigger Id + * @returns -A trigger link in the format of dbs/{0}/colls/{1}/triggers/{2} * with {0} being a Uri escaped version of the databaseId, * {1} being collectionId and {2} being the triggerId * @description Would be used when replacing, executing, or deleting a Trigger in Azure DocumentDB database service */ - static createTriggerUri(databaseId: string, collectionId: string, triggerId: string): string; + function createTriggerUri(databaseId: string, collectionId: string, triggerId: string): string; /** * @summary Given a database, collection and udf id, this creates a udf link. - * @param {string} databaseId -The database Id - * @param {string} collectionId -The collection Id - * @param {string} udfId -The User Defined Function Id - * @returns {string} -A udf link in the format of dbs/{0}/colls/{1}/udfs/{2} with {0} being a Uri escaped version of the databaseId, {1} being collectionId and {2} being the udfId + * @param databaseId -The database Id + * @param collectionId -The collection Id + * @param udfId -The User Defined Function Id + * @returns -A udf link in the format of dbs/{0}/colls/{1}/udfs/{2} with {0} being a Uri escaped version of the databaseId, {1} being collectionId and {2} being the udfId * @description Would be used when replacing, executing, or deleting a UserDefinedFunction in Azure DocumentDB database service */ - static createUserDefinedFunctionUri(databaseId: string, collectionId: string, udfId: string): string; + function createUserDefinedFunctionUri(databaseId: string, collectionId: string, udfId: string): string; /** * @summary - * @param {string} databaseId -The database Id - * @param {string} collectionId -The collection Id - * @param {string} conflictId -The conflict Id - * @returns {string} -A conflict link in the format of dbs/{0}/colls/{1}/conflicts/{2} + * @param databaseId -The database Id + * @param collectionId -The collection Id + * @param conflictId -The conflict Id + * @returns -A conflict link in the format of dbs/{0}/colls/{1}/conflicts/{2} * with {0} being a Uri escaped version of the databaseId, {1} being collectionId and {2} being the conflictId * @description Would be used when creating a Conflict in Azure DocumentDB database service. */ - static createConflictUri(databaseId: string, collectionId: string, conflictId: string): string; + function createConflictUri(databaseId: string, collectionId: string, conflictId: string): string; /** * @summary Given a database, collection and conflict id, this creates a conflict link. - * @param {string} databaseId -The database Id - * @param {string} collectionId -The collection Id - * @param {string} documentId -The document Id\ - * @param {string} attachmentId -The attachment Id - * @returns {string} -A conflict link in the format of dbs/{0}/colls/{1}/conflicts/{2} with {0} being a Uri escaped version of the databaseId, + * @param databaseId -The database Id + * @param collectionId -The collection Id + * @param documentId -The document Id\ + * @param attachmentId -The attachment Id + * @returns -A conflict link in the format of dbs/{0}/colls/{1}/conflicts/{2} with {0} being a Uri escaped version of the databaseId, * {1} being collectionId and {2} being the conflictId * @description Would be used when creating a Conflict in Azure DocumentDB database service. */ - static createAttachmentUri(databaseId: string, collectionId: string, documentId: string, attachmentId: string): string; + function createAttachmentUri(databaseId: string, collectionId: string, documentId: string, attachmentId: string): string; /** * @summary Given a database and collection, this creates a partition key ranges link in the Azure DocumentDB database service. - * @param {string} databaseId -The database Id - * @param {string} collectionId -The collection Id - * @returns {string} -A partition key ranges link in the format of dbs/{0}/colls/{1}/pkranges with {0} being a Uri escaped version of the databaseId and {1} being collectionId + * @param databaseId -The database Id + * @param collectionId -The collection Id + * @returns -A partition key ranges link in the format of dbs/{0}/colls/{1}/pkranges with {0} being a Uri escaped version of the databaseId and {1} being collectionId */ - static createPartitionKeyRangesUri(databaseId: string, collectionId: string): string; + function createPartitionKeyRangesUri(databaseId: string, collectionId: string): string; } export type MediaReadMode = 'Buffered' | 'Streamed'; diff --git a/types/dojo/dijit.d.ts b/types/dojo/dijit.d.ts index 3c2d892471..b22742b85d 100644 --- a/types/dojo/dijit.d.ts +++ b/types/dojo/dijit.d.ts @@ -29946,7 +29946,7 @@ declare module dijit { * * @param aroundNode */ - hide(aroundNode: any): any; + static hide(aroundNode: any): any; /** * Return true if this widget can currently be focused * and false if not @@ -30107,7 +30107,7 @@ declare module dijit { * @param rtl OptionalCorresponds to WidgetBase.dir attribute, where false means "ltr" and truemeans "rtl"; specifies GUI direction, not text direction. * @param textDir OptionalCorresponds to WidgetBase.textdir attribute; specifies direction of text. */ - show(innerHTML: String, aroundNode: Object, position: String[], rtl: boolean, textDir: String): any; + static show(innerHTML: String, aroundNode: Object, position?: String[], rtl?: boolean, textDir?: String): any; /** * */ @@ -106941,4 +106941,4 @@ declare module "dijit/ConfirmDialog" { declare module "dijit/_ConfirmDialogMixin" { var exp: typeof dijit._ConfirmDialogMixin; export=exp; -} \ No newline at end of file +} diff --git a/types/dojo/dojox.charting.d.ts b/types/dojo/dojox.charting.d.ts index 0f69eee3d4..d3336effd1 100644 --- a/types/dojo/dojox.charting.d.ts +++ b/types/dojo/dojox.charting.d.ts @@ -1,6 +1,7 @@ // Type definitions for Dojo v1.9 // Project: http://dojotoolkit.org // Definitions by: Michael Van Sickle +// Don Waldo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -13132,326 +13133,326 @@ declare namespace dojox { } declare module "dojox/charting/Chart3D" { - var exp: dojox.charting.Chart3D + import exp = dojox.charting.Chart3D export=exp; } declare module "dojox/charting/Chart2D" { - var exp: dojox.charting.Chart2D + import exp = dojox.charting.Chart2D export=exp; } declare module "dojox/charting/DataSeries" { - var exp: dojox.charting.DataSeries + import exp = dojox.charting.DataSeries export=exp; } declare module "dojox/charting/Chart" { - var exp: dojox.charting.Chart + import exp = dojox.charting.Chart export=exp; } declare module "dojox/charting/DataChart" { - var exp: dojox.charting.DataChart + import exp = dojox.charting.DataChart export=exp; } declare module "dojox/charting/Element" { - var exp: dojox.charting.Element + import exp = dojox.charting.Element export=exp; } declare module "dojox/charting/Series" { - var exp: dojox.charting.Series + import exp = dojox.charting.Series export=exp; } declare module "dojox/charting/StoreSeries" { - var exp: dojox.charting.StoreSeries + import exp = dojox.charting.StoreSeries export=exp; } declare module "dojox/charting/SimpleTheme" { - var exp: dojox.charting.SimpleTheme + import exp = dojox.charting.SimpleTheme export=exp; } declare module "dojox/charting/SimpleTheme.defaultMarkers" { - var exp: dojox.charting.SimpleTheme.defaultMarkers + import exp = dojox.charting.SimpleTheme.defaultMarkers export=exp; } declare module "dojox/charting/SimpleTheme.defaultTheme" { - var exp: dojox.charting.SimpleTheme.defaultTheme + import exp = dojox.charting.SimpleTheme.defaultTheme export=exp; } declare module "dojox/charting/Theme" { - var exp: dojox.charting.Theme + import exp = dojox.charting.Theme export=exp; } declare module "dojox/charting/Theme.defaultMarkers" { - var exp: dojox.charting.Theme.defaultMarkers + import exp = dojox.charting.Theme.defaultMarkers export=exp; } declare module "dojox/charting/Theme.defaultTheme" { - var exp: dojox.charting.Theme.defaultTheme + import exp = dojox.charting.Theme.defaultTheme export=exp; } declare module "dojox/charting/action2d/Base" { - var exp: dojox.charting.action2d.Base + import exp = dojox.charting.action2d.Base export=exp; } declare module "dojox/charting/action2d/ChartAction" { - var exp: dojox.charting.action2d.ChartAction + import exp = dojox.charting.action2d.ChartAction export=exp; } declare module "dojox/charting/action2d/_IndicatorElement" { - var exp: dojox.charting.action2d._IndicatorElement + import exp = dojox.charting.action2d._IndicatorElement export=exp; } declare module "dojox/charting/action2d/Highlight" { - var exp: dojox.charting.action2d.Highlight + import exp = dojox.charting.action2d.Highlight export=exp; } declare module "dojox/charting/action2d/Magnify" { - var exp: dojox.charting.action2d.Magnify + import exp = dojox.charting.action2d.Magnify export=exp; } declare module "dojox/charting/action2d/MouseZoomAndPan" { - var exp: dojox.charting.action2d.MouseZoomAndPan + import exp = dojox.charting.action2d.MouseZoomAndPan export=exp; } declare module "dojox/charting/action2d/MouseIndicator" { - var exp: dojox.charting.action2d.MouseIndicator + import exp = dojox.charting.action2d.MouseIndicator export=exp; } declare module "dojox/charting/action2d/MoveSlice" { - var exp: dojox.charting.action2d.MoveSlice + import exp = dojox.charting.action2d.MoveSlice export=exp; } declare module "dojox/charting/action2d/PlotAction" { - var exp: dojox.charting.action2d.PlotAction + import exp = dojox.charting.action2d.PlotAction export=exp; } declare module "dojox/charting/action2d/Tooltip" { - var exp: dojox.charting.action2d.Tooltip + import exp = dojox.charting.action2d.Tooltip export=exp; } declare module "dojox/charting/action2d/Shake" { - var exp: dojox.charting.action2d.Shake + import exp = dojox.charting.action2d.Shake export=exp; } declare module "dojox/charting/action2d/TouchZoomAndPan" { - var exp: dojox.charting.action2d.TouchZoomAndPan + import exp = dojox.charting.action2d.TouchZoomAndPan export=exp; } declare module "dojox/charting/action2d/TouchIndicator" { - var exp: dojox.charting.action2d.TouchIndicator + import exp = dojox.charting.action2d.TouchIndicator export=exp; } declare module "dojox/charting/axis2d/common" { - var exp: dojox.charting.axis2d.common + import exp = dojox.charting.axis2d.common export=exp; } declare module "dojox/charting/axis2d/common.createText" { - var exp: dojox.charting.axis2d.common.createText + import exp = dojox.charting.axis2d.common.createText export=exp; } declare module "dojox/charting/axis2d/Base" { - var exp: dojox.charting.axis2d.Base + import exp = dojox.charting.axis2d.Base export=exp; } declare module "dojox/charting/axis2d/Invisible" { - var exp: dojox.charting.axis2d.Invisible + import exp = dojox.charting.axis2d.Invisible export=exp; } declare module "dojox/charting/axis2d/Default" { - var exp: dojox.charting.axis2d.Default + import exp = dojox.charting.axis2d.Default export=exp; } declare module "dojox/charting/bidi/_bidiutils" { - var exp: dojox.charting.bidi._bidiutils + import exp = dojox.charting.bidi._bidiutils export=exp; } declare module "dojox/charting/bidi/Chart" { - var exp: dojox.charting.bidi.Chart + import exp = dojox.charting.bidi.Chart export=exp; } declare module "dojox/charting/bidi/Chart3D" { - var exp: dojox.charting.bidi.Chart3D + import exp = dojox.charting.bidi.Chart3D export=exp; } declare module "dojox/charting/bidi/action2d/Tooltip" { - var exp: dojox.charting.bidi.action2d.Tooltip + import exp = dojox.charting.bidi.action2d.Tooltip export=exp; } declare module "dojox/charting/bidi/action2d/ZoomAndPan" { - var exp: dojox.charting.bidi.action2d.ZoomAndPan + import exp = dojox.charting.bidi.action2d.ZoomAndPan export=exp; } declare module "dojox/charting/bidi/axis2d/Default" { - var exp: dojox.charting.bidi.axis2d.Default + import exp = dojox.charting.bidi.axis2d.Default export=exp; } declare module "dojox/charting/bidi/widget/Chart" { - var exp: dojox.charting.bidi.widget.Chart + import exp = dojox.charting.bidi.widget.Chart export=exp; } declare module "dojox/charting/bidi/widget/Legend" { - var exp: dojox.charting.bidi.widget.Legend + import exp = dojox.charting.bidi.widget.Legend export=exp; } declare module "dojox/charting/plot2d/common" { - var exp: dojox.charting.plot2d.common + import exp = dojox.charting.plot2d.common export=exp; } declare module "dojox/charting/plot2d/common.defaultStats" { - var exp: dojox.charting.plot2d.common.defaultStats + import exp = dojox.charting.plot2d.common.defaultStats export=exp; } declare module "dojox/charting/plot2d/commonStacked" { - var exp: dojox.charting.plot2d.commonStacked + import exp = dojox.charting.plot2d.commonStacked export=exp; } declare module "dojox/charting/plot2d/_PlotEvents" { - var exp: dojox.charting.plot2d._PlotEvents + import exp = dojox.charting.plot2d._PlotEvents export=exp; } declare module "dojox/charting/plot2d/Areas" { - var exp: dojox.charting.plot2d.Areas + import exp = dojox.charting.plot2d.Areas export=exp; } declare module "dojox/charting/plot2d/Bars" { - var exp: dojox.charting.plot2d.Bars + import exp = dojox.charting.plot2d.Bars export=exp; } declare module "dojox/charting/plot2d/Base" { - var exp: dojox.charting.plot2d.Base + import exp = dojox.charting.plot2d.Base export=exp; } declare module "dojox/charting/plot2d/Bubble" { - var exp: dojox.charting.plot2d.Bubble + import exp = dojox.charting.plot2d.Bubble export=exp; } declare module "dojox/charting/plot2d/CartesianBase" { - var exp: dojox.charting.plot2d.CartesianBase + import exp = dojox.charting.plot2d.CartesianBase export=exp; } declare module "dojox/charting/plot2d/Candlesticks" { - var exp: dojox.charting.plot2d.Candlesticks + import exp = dojox.charting.plot2d.Candlesticks export=exp; } declare module "dojox/charting/plot2d/ClusteredBars" { - var exp: dojox.charting.plot2d.ClusteredBars + import exp = dojox.charting.plot2d.ClusteredBars export=exp; } declare module "dojox/charting/plot2d/ClusteredColumns" { - var exp: dojox.charting.plot2d.ClusteredColumns + import exp = dojox.charting.plot2d.ClusteredColumns export=exp; } declare module "dojox/charting/plot2d/Columns" { - var exp: dojox.charting.plot2d.Columns + import exp = dojox.charting.plot2d.Columns export=exp; } declare module "dojox/charting/plot2d/Grid" { - var exp: dojox.charting.plot2d.Grid + import exp = dojox.charting.plot2d.Grid export=exp; } declare module "dojox/charting/plot2d/Default" { - var exp: dojox.charting.plot2d.Default + import exp = dojox.charting.plot2d.Default export=exp; } declare module "dojox/charting/plot2d/Indicator" { - var exp: dojox.charting.plot2d.Indicator + import exp = dojox.charting.plot2d.Indicator export=exp; } declare module "dojox/charting/plot2d/Lines" { - var exp: dojox.charting.plot2d.Lines + import exp = dojox.charting.plot2d.Lines export=exp; } declare module "dojox/charting/plot2d/Markers" { - var exp: dojox.charting.plot2d.Markers + import exp = dojox.charting.plot2d.Markers export=exp; } declare module "dojox/charting/plot2d/Pie" { - var exp: dojox.charting.plot2d.Pie + import exp = dojox.charting.plot2d.Pie export=exp; } declare module "dojox/charting/plot2d/MarkersOnly" { - var exp: dojox.charting.plot2d.MarkersOnly + import exp = dojox.charting.plot2d.MarkersOnly export=exp; } declare module "dojox/charting/plot2d/OHLC" { - var exp: dojox.charting.plot2d.OHLC + import exp = dojox.charting.plot2d.OHLC export=exp; } declare module "dojox/charting/plot2d/Scatter" { - var exp: dojox.charting.plot2d.Scatter + import exp = dojox.charting.plot2d.Scatter export=exp; } declare module "dojox/charting/plot2d/Stacked" { - var exp: dojox.charting.plot2d.Stacked + import exp = dojox.charting.plot2d.Stacked export=exp; } declare module "dojox/charting/plot2d/Spider" { - var exp: dojox.charting.plot2d.Spider + import exp = dojox.charting.plot2d.Spider export=exp; } declare module "dojox/charting/plot2d/StackedAreas" { - var exp: dojox.charting.plot2d.StackedAreas + import exp = dojox.charting.plot2d.StackedAreas export=exp; } declare module "dojox/charting/plot2d/StackedBars" { - var exp: dojox.charting.plot2d.StackedBars + import exp = dojox.charting.plot2d.StackedBars export=exp; } declare module "dojox/charting/plot2d/StackedColumns" { - var exp: dojox.charting.plot2d.StackedColumns + import exp = dojox.charting.plot2d.StackedColumns export=exp; } declare module "dojox/charting/plot2d/StackedLines" { - var exp: dojox.charting.plot2d.StackedLines + import exp = dojox.charting.plot2d.StackedLines export=exp; } declare module "dojox/charting/plot3d/Bars" { - var exp: dojox.charting.plot3d.Bars + import exp = dojox.charting.plot3d.Bars export=exp; } declare module "dojox/charting/plot3d/Base" { - var exp: dojox.charting.plot3d.Base + import exp = dojox.charting.plot3d.Base export=exp; } declare module "dojox/charting/plot3d/Cylinders" { - var exp: dojox.charting.plot3d.Cylinders + import exp = dojox.charting.plot3d.Cylinders export=exp; } declare module "dojox/charting/scaler/common" { - var exp: dojox.charting.scaler.common + import exp = dojox.charting.scaler.common export=exp; } declare module "dojox/charting/scaler/primitive" { - var exp: dojox.charting.scaler.primitive + import exp = dojox.charting.scaler.primitive export=exp; } declare module "dojox/charting/scaler/linear" { - var exp: dojox.charting.scaler.linear + import exp = dojox.charting.scaler.linear export=exp; } declare module "dojox/charting/themes/common" { - var exp: dojox.charting.themes.common + import exp = dojox.charting.themes.common export=exp; } declare module "dojox/charting/themes/gradientGenerator" { - var exp: dojox.charting.themes.gradientGenerator + import exp = dojox.charting.themes.gradientGenerator export=exp; } declare module "dojox/charting/themes/PlotKit/base" { - var exp: dojox.charting.themes.PlotKit.base + import exp = dojox.charting.themes.PlotKit.base export=exp; } declare module "dojox/charting/widget/Chart2D" { - var exp: dojox.charting.widget.Chart2D + import exp = dojox.charting.widget.Chart2D export=exp; } declare module "dojox/charting/widget/Chart" { - var exp: dojox.charting.widget.Chart + import exp = dojox.charting.widget.Chart export=exp; } declare module "dojox/charting/widget/Legend" { - var exp: dojox.charting.widget.Legend + import exp = dojox.charting.widget.Legend export=exp; } declare module "dojox/charting/widget/SelectableLegend" { - var exp: dojox.charting.widget.SelectableLegend + import exp = dojox.charting.widget.SelectableLegend export=exp; } diff --git a/types/dojo/tsconfig.json b/types/dojo/tsconfig.json index 983ded2a9c..140f764554 100644 --- a/types/dojo/tsconfig.json +++ b/types/dojo/tsconfig.json @@ -83,4 +83,5 @@ "dojox.widget.d.ts", "dojox.xml.d.ts" ] -} \ No newline at end of file +} + diff --git a/types/dojo/tslint.json b/types/dojo/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/dojo/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/dom-inputevent/index.d.ts b/types/dom-inputevent/index.d.ts index df1cce5ec4..0d2111a0e0 100644 --- a/types/dom-inputevent/index.d.ts +++ b/types/dom-inputevent/index.d.ts @@ -7,11 +7,11 @@ interface InputEventInit extends UIEventInit { data?: string; isComposing: boolean; } -interface InputEvent extends UIEvent { + +// tslint:disable-next-line no-empty-interface +interface InputEvent extends UIEvent {} +declare class InputEvent { + constructor(typeArg: 'input' | 'beforeinput', inputEventInit?: InputEventInit); readonly data: string; readonly isComposing: boolean; } - -declare class InputEvent { - constructor(typeArg: 'input' | 'beforeinput', inputEventInit?: InputEventInit); -} diff --git a/types/dom4/tslint.json b/types/dom4/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/dom4/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/domo/tslint.json b/types/domo/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/domo/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/dompurify/tslint.json b/types/dompurify/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/dompurify/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/domready/tslint.json b/types/domready/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/domready/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/domurl/tslint.json b/types/domurl/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/domurl/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/donna/tslint.json b/types/donna/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/donna/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/dot-object/tslint.json b/types/dot-object/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/dot-object/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/dotdir-regex/dotdir-regex-tests.ts b/types/dotdir-regex/dotdir-regex-tests.ts new file mode 100644 index 0000000000..ff40d153f8 --- /dev/null +++ b/types/dotdir-regex/dotdir-regex-tests.ts @@ -0,0 +1,4 @@ +import dotdir = require('dotdir-regex'); + +// $ExpectType RegExp +dotdir(); diff --git a/types/dotdir-regex/index.d.ts b/types/dotdir-regex/index.d.ts new file mode 100644 index 0000000000..59b68ae322 --- /dev/null +++ b/types/dotdir-regex/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for dotdir-regex 1.0 +// Project: https://github.com/regexhq/dotdir-regex +// Definitions by: mrmlnc +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function dotdirRegex(): RegExp; + +export = dotdirRegex; diff --git a/types/dotdir-regex/tsconfig.json b/types/dotdir-regex/tsconfig.json new file mode 100644 index 0000000000..48f516abd8 --- /dev/null +++ b/types/dotdir-regex/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", + "dotdir-regex-tests.ts" + ] +} diff --git a/types/dotdir-regex/tslint.json b/types/dotdir-regex/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/dotdir-regex/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/dotdotdot/tslint.json b/types/dotdotdot/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/dotdotdot/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/dotenv-safe/index.d.ts b/types/dotenv-safe/index.d.ts index a435f36fe7..2c696ae1b5 100644 --- a/types/dotenv-safe/index.d.ts +++ b/types/dotenv-safe/index.d.ts @@ -21,20 +21,28 @@ export interface MissingEnvVarsError extends Error { /** * Loads environment variables file into 'process.env'. * - * @param {object} options - * @param {string} [options.sample=".env.example"] Path to example environment file. - * @param {string} [options.path=".env"] Path to environment file. - * @param {string} [options.encoding="utf8"] Encoding of your file containing environment variables. - * @param {boolean} [options.allowEmptyValues=false] Enabling this option will not throw an error after loading. - * * @throws MissingEnvVarsError - * - * @return env.DotenvResult */ export function load(options?: { path?: string, + /** + * Path to example environment file. + * @default ".env.example" + */ sample?: string, + /** + * Path to environment file. + * @default ".env" + */ silent?: boolean, + /** + * Encoding of your file containing environment variables. + * @default "utf8" + */ encoding?: string, + /** + * Enabling this option will not throw an error after loading. + * @default false + */ allowEmptyValues?: boolean, }): env.DotenvResult diff --git a/types/dotenv/index.d.ts b/types/dotenv/index.d.ts index e29c04e8d7..831790138c 100644 --- a/types/dotenv/index.d.ts +++ b/types/dotenv/index.d.ts @@ -13,7 +13,6 @@ export function parse(src: string | Buffer): {[name: string]: string}; /** * Loads `.env` into `process.env`. * - * @param options * @return Object Object with either * - "parsed" containing the parsed keys and values or * - "error" containing an Error object diff --git a/types/dotenv/v2/index.d.ts b/types/dotenv/v2/index.d.ts index e3c26eb2c6..276052e481 100644 --- a/types/dotenv/v2/index.d.ts +++ b/types/dotenv/v2/index.d.ts @@ -13,7 +13,6 @@ export function parse(src: string | Buffer): {[name: string]: string}; /** * Loads `.env` into `process.env`. * - * @param options * @return Object Object with the parsed keys and values, e.g., 'KEY=value' becomes { KEY: 'value' } */ export function config(options?: DotenvOptions): {[name: string]: string} | false; diff --git a/types/dotfile-regex/dotfile-regex-tests.ts b/types/dotfile-regex/dotfile-regex-tests.ts new file mode 100644 index 0000000000..f6bad1d84b --- /dev/null +++ b/types/dotfile-regex/dotfile-regex-tests.ts @@ -0,0 +1,4 @@ +import dotfile = require('dotfile-regex'); + +// $ExpectType RegExp +dotfile(); diff --git a/types/dotfile-regex/index.d.ts b/types/dotfile-regex/index.d.ts new file mode 100644 index 0000000000..3a96f4fbad --- /dev/null +++ b/types/dotfile-regex/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for dotfile-regex 1.0 +// Project: https://github.com/regexhq/dotfile-regex +// Definitions by: mrmlnc +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function dotfileRegex(): RegExp; + +export = dotfileRegex; diff --git a/types/dotfile-regex/tsconfig.json b/types/dotfile-regex/tsconfig.json new file mode 100644 index 0000000000..899be54b3b --- /dev/null +++ b/types/dotfile-regex/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", + "dotfile-regex-tests.ts" + ] +} diff --git a/types/dotfile-regex/tslint.json b/types/dotfile-regex/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/dotfile-regex/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/doublearray/tslint.json b/types/doublearray/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/doublearray/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/doubleclick-gpt/tslint.json b/types/doubleclick-gpt/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/doubleclick-gpt/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/draft-js/draft-js-tests.tsx b/types/draft-js/draft-js-tests.tsx index dae23b90ef..63821eda98 100644 --- a/types/draft-js/draft-js-tests.tsx +++ b/types/draft-js/draft-js-tests.tsx @@ -12,7 +12,17 @@ import { SelectionState, getDefaultKeyBinding, ContentState, - convertFromHTML + RawDraftInlineStyleRange, + RawDraftEntityRange, + RawDraftEntity, + RawDraftContentBlock, + RawDraftContentState, + DraftBlockType, + DraftInlineStyleType, + DraftEntityMutability, + DraftEntityType, + convertFromHTML, + convertToRaw } from 'draft-js'; const SPLIT_HEADER_BLOCK = 'split-header-block'; @@ -30,7 +40,7 @@ type SyntheticKeyboardEvent = React.KeyboardEvent<{}>; class RichEditorExample extends React.Component<{}, { editorState: EditorState }> { constructor() { - super(); + super({}); const sampleMarkup = 'Bold text, Italic text

    ' + @@ -182,9 +192,17 @@ function getBlockStyle(block: ContentBlock) { } } -class StyleButton extends React.Component<{key: string, active: boolean, label: string, onToggle: (blockType: string) => void, style: string}> { - constructor() { - super(); +interface Props { + key: string + active: boolean + label: string + onToggle: (blockType: string) => void + style: string +} + +class StyleButton extends React.Component { + constructor(props: Props) { + super(props); } onToggle: (event: Event) => void = (event: Event) => { @@ -266,7 +284,7 @@ var INLINE_STYLES = [ const InlineStyleControls = (props: {editorState: EditorState, onToggle: (blockType: string) => void}) => { var currentStyle = props.editorState.getCurrentInlineStyle(); - return ( + return (

    {INLINE_STYLES.map(type => , document.getElementById('target') ); + +const editorState = EditorState.createEmpty(); +const contentState = editorState.getCurrentContent(); +const rawContentState: RawDraftContentState = convertToRaw(contentState); + +rawContentState.blocks.forEach((block: RawDraftContentBlock) => { + block.entityRanges.forEach((entityRange: RawDraftEntityRange) => { + const { key, offset, length } = entityRange; + const entity: RawDraftEntity = rawContentState.entityMap[key]; + const entityType: DraftEntityType = entity.type; + const entityMutability: DraftEntityMutability = entity.mutability; + console.log(entityType, entityMutability, offset, length); + }); + + block.inlineStyleRanges.forEach((inlineStyleRange: RawDraftInlineStyleRange) => { + const { offset, length } = inlineStyleRange + const inlineStyle: DraftInlineStyleType = inlineStyleRange.style; + console.log(inlineStyle, offset, length); + }); +}); diff --git a/types/draft-js/index.d.ts b/types/draft-js/index.d.ts index a559b7ebc0..3eaa05aa30 100644 --- a/types/draft-js/index.d.ts +++ b/types/draft-js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Draft.js v0.10.1 +// Type definitions for Draft.js v0.10.4 // Project: https://facebook.github.io/draft-js/ // Definitions by: Dmitry Rogozhny // Eelco Lempsink @@ -111,11 +111,11 @@ declare namespace Draft { ariaActiveDescendantID?: string; ariaAutoComplete?: string; + ariaControls?: string; ariaDescribedBy?: string; ariaExpanded?: boolean; - ariaHasPopup?: boolean; ariaLabel?: string; - ariaOwneeID?: string; + ariaMultiline?: boolean; webDriverTestID?: string; @@ -156,6 +156,8 @@ declare namespace Draft { onTab?(e: SyntheticKeyboardEvent): void, onUpArrow?(e: SyntheticKeyboardEvent): void, onDownArrow?(e: SyntheticKeyboardEvent): void, + onRightArrow?(e: SyntheticKeyboardEvent): void, + onLeftArrow?(e: SyntheticKeyboardEvent): void, onBlur?(e: SyntheticEvent): void, onFocus?(e: SyntheticEvent): void, @@ -260,9 +262,10 @@ declare namespace Draft { * or block types. */ "bold" | - "italic" | - "underline" | "code" | + "italic" | + "strikethrough" | + "underline" | /** * Split a block in two. @@ -320,6 +323,66 @@ declare namespace Draft { * to indicate whether an event was handled or not. */ type DraftHandleValue = "handled" | "not-handled"; + + /** + * A type that defines if an fragment shall be inserted before or after + * another fragment or if the selected fragment shall be replaced + */ + type DraftInsertionType = "replace" | "before" | "after"; + + /** + * Valid inline styles. + */ + type DraftInlineStyleType = ( + "BOLD" | + "CODE" | + "ITALIC" | + "STRIKETHROUGH" | + "UNDERLINE" + ) + + /** + * Default entity types. + */ + type ComposedEntityType = ( + "LINK" | + "TOKEN" | + "PHOTO" | + "IMAGE" + ) + + /** + * Possible entity types. + */ + type DraftEntityType = string | ComposedEntityType; + + /** + * Possible "mutability" options for an entity. This refers to the behavior + * that should occur when inserting or removing characters in a text range + * with an entity applied to it. + * + * `MUTABLE`: + * The text range can be modified freely. Generally used in cases where + * the text content and the entity do not necessarily have a direct + * relationship. For instance, the text and URI for a link may be completely + * different. The user is allowed to edit the text as needed, and the entity + * is preserved and applied to any characters added within the range. + * + * `IMMUTABLE`: + * Not to be confused with immutable data structures used to represent the + * state of the editor. Immutable entity ranges cannot be modified in any + * way. Adding characters within the range will remove the entity from the + * entire range. Deleting characters will delete the entire range. Example: + * Facebook Page mentions. + * + * `SEGMENTED`: + * Segmented entities allow the removal of partial ranges of text, as + * separated by a delimiter. Adding characters wihin the range will remove + * the entity from the entire range. Deleting characters within a segmented + * entity will delete only the segments affected by the deletion. Example: + * Facebook User mentions. + */ + type DraftEntityMutability = "MUTABLE" | "IMMUTABLE" | "SEGMENTED"; } namespace Decorators { @@ -400,14 +463,24 @@ declare namespace Draft { } namespace Encoding { + import DraftInlineStyleType = Draft.Model.Constants.DraftInlineStyleType; + import DraftBlockType = Draft.Model.Constants.DraftBlockType; + import DraftEntityMutability = Draft.Model.Constants.DraftEntityMutability; + import DraftEntityType = Draft.Model.Constants.DraftEntityType; + import ContentBlock = Draft.Model.ImmutableData.ContentBlock; import ContentState = Draft.Model.ImmutableData.ContentState; import DraftBlockRenderMap = Draft.Component.Base.DraftBlockRenderMap; - import DraftBlockType = Draft.Model.Constants.DraftBlockType; - import DraftEntityType = Draft.Model.Entity.DraftEntityType; - import DraftEntityMutability = Draft.Model.Entity.DraftEntityMutability; + /** + * A plain object representation of an inline style range. + */ + interface RawDraftInlineStyleRange { + style: DraftInlineStyleType; + offset: number; + length: number; + } /** * A plain object representation of an entity attribution. @@ -415,21 +488,12 @@ declare namespace Draft { * The `key` value corresponds to the key of the entity in the `entityMap` of * a `ComposedText` object, not for use with `DraftEntity.get()`. */ - interface EntityRange { + interface RawDraftEntityRange { key: number, offset: number, length: number, } - /** - * A plain object representation of an inline style range. - */ - interface InlineStyleRange { - style: string; - offset: number; - length: number; - } - /** * A plain object representation of an EntityInstance. */ @@ -448,8 +512,8 @@ declare namespace Draft { type: DraftBlockType; text: string; depth: number; - inlineStyleRanges: Array; - entityRanges: Array; + inlineStyleRanges: Array; + entityRanges: Array; data?: Object; } @@ -473,36 +537,8 @@ declare namespace Draft { } namespace Entity { - type ComposedEntityType = "LINK" | "TOKEN" | "PHOTO"; - type DraftEntityType = string | ComposedEntityType; - - /** - * An enum representing the possible "mutability" options for an entity. - * This refers to the behavior that should occur when inserting or removing - * characters in a text range with an entity applied to it. - * - * `MUTABLE`: - * The text range can be modified freely. Generally used in cases where - * the text content and the entity do not necessarily have a direct - * relationship. For instance, the text and URI for a link may be completely - * different. The user is allowed to edit the text as needed, and the entity - * is preserved and applied to any characters added within the range. - * - * `IMMUTABLE`: - * Not to be confused with immutable data structures used to represent the - * state of the editor. Immutable entity ranges cannot be modified in any - * way. Adding characters within the range will remove the entity from the - * entire range. Deleting characters will delete the entire range. Example: - * Facebook Page mentions. - * - * `SEGMENTED`: - * Segmented entities allow the removal of partial ranges of text, as - * separated by a delimiter. Adding characters wihin the range will remove - * the entity from the entire range. Deleting characters within a segmented - * entity will delete only the segments affected by the deletion. Example: - * Facebook User mentions. - */ - type DraftEntityMutability = "MUTABLE" | "IMMUTABLE" | "SEGMENTED"; + import DraftEntityMutability = Draft.Model.Constants.DraftEntityMutability; + import DraftEntityType = Draft.Model.Constants.DraftEntityType; /** * A "document entity" is an object containing metadata associated with a @@ -571,10 +607,10 @@ declare namespace Draft { namespace ImmutableData { import DraftBlockType = Draft.Model.Constants.DraftBlockType; - import DraftDecoratorType = Draft.Model.Decorators.DraftDecoratorType; + import DraftEntityMutability = Draft.Model.Constants.DraftEntityMutability; + import DraftEntityType = Draft.Model.Constants.DraftEntityType; - import DraftEntityType = Draft.Model.Entity.DraftEntityType; - import DraftEntityMutability = Draft.Model.Entity.DraftEntityMutability; + import DraftDecoratorType = Draft.Model.Decorators.DraftDecoratorType; type DraftInlineStyle = Immutable.OrderedSet; type BlockMap = Immutable.OrderedMap; @@ -828,6 +864,7 @@ declare namespace Draft { class AtomicBlockUtils { static insertAtomicBlock(editorState: EditorState, entityKey: string, character: string): EditorState; + static moveAtomicBlock(editorState: EditorState, atomicBlock: ContentBlock, targetRange: SelectionState, insertionMode?: DraftInsertionType): EditorState; } /** @@ -929,6 +966,10 @@ import RichUtils = Draft.Model.Modifier.RichTextEditorUtil; import DefaultDraftBlockRenderMap = Draft.Model.ImmutableData.DefaultDraftBlockRenderMap; import DefaultDraftInlineStyle = Draft.Model.ImmutableData.DefaultDraftInlineStyle; +import RawDraftInlineStyleRange = Draft.Model.Encoding.RawDraftInlineStyleRange; +import RawDraftEntityRange = Draft.Model.Encoding.RawDraftEntityRange; +import RawDraftEntity = Draft.Model.Encoding.RawDraftEntity; +import RawDraftContentBlock = Draft.Model.Encoding.RawDraftContentBlock; import RawDraftContentState = Draft.Model.Encoding.RawDraftContentState; import convertFromRaw = Draft.Model.Encoding.convertFromRawToDraftState; import convertToRaw = Draft.Model.Encoding.convertFromDraftStateToRaw; @@ -941,8 +982,12 @@ import getVisibleSelectionRect = Draft.Component.Selection.getVisibleSelectionRe import DraftEditorCommand = Draft.Model.Constants.DraftEditorCommand; import DraftDragType = Draft.Model.Constants.DraftDragType; import DraftBlockType = Draft.Model.Constants.DraftBlockType; +import DraftInlineStyleType = Draft.Model.Constants.DraftInlineStyleType; +import DraftEntityMutability = Draft.Model.Constants.DraftEntityMutability; +import DraftEntityType = Draft.Model.Constants.DraftEntityType; import DraftRemovalDirection = Draft.Model.Constants.DraftRemovalDirection; import DraftHandleValue = Draft.Model.Constants.DraftHandleValue; +import DraftInsertionType = Draft.Model.Constants.DraftInsertionType; export { Editor, @@ -969,6 +1014,10 @@ export { DefaultDraftBlockRenderMap, DefaultDraftInlineStyle, + RawDraftInlineStyleRange, + RawDraftEntityRange, + RawDraftEntity, + RawDraftContentBlock, RawDraftContentState, convertFromRaw, convertToRaw, @@ -981,6 +1030,10 @@ export { DraftEditorCommand, DraftDragType, DraftBlockType, + DraftInlineStyleType, + DraftEntityType, + DraftEntityMutability, DraftRemovalDirection, - DraftHandleValue + DraftHandleValue, + DraftInsertionType, }; diff --git a/types/draft-js/package.json b/types/draft-js/package.json index 9b1e26b353..d657a0de12 100644 --- a/types/draft-js/package.json +++ b/types/draft-js/package.json @@ -3,4 +3,4 @@ "dependencies": { "immutable": "^3.8.1" } -} \ No newline at end of file +} diff --git a/types/draft-js/tslint.json b/types/draft-js/tslint.json new file mode 100644 index 0000000000..e3610fefae --- /dev/null +++ b/types/draft-js/tslint.json @@ -0,0 +1,80 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "use-default-type-parameter": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/dragula/tslint.json b/types/dragula/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/dragula/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/dropboxjs/tslint.json b/types/dropboxjs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/dropboxjs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/dropzone/dropzone-tests.ts b/types/dropzone/dropzone-tests.ts index 53cedba333..4abc3a6223 100644 --- a/types/dropzone/dropzone-tests.ts +++ b/types/dropzone/dropzone-tests.ts @@ -56,6 +56,7 @@ const dropzoneWithOptions = new Dropzone(".test", { dictRemoveFile: "", dictRemoveFileConfirmation: "", dictMaxFilesExceeded: "", + dictFileSizeUnits: { tb: "", gb: "", mb: "", kb: "", b: "" }, accept: (file: Dropzone.DropzoneFile, done: (error?: string | Error) => void) => { if (file.accepted) { diff --git a/types/dropzone/index.d.ts b/types/dropzone/index.d.ts index f809f84227..0295afbed2 100644 --- a/types/dropzone/index.d.ts +++ b/types/dropzone/index.d.ts @@ -26,6 +26,14 @@ declare namespace Dropzone { accepted: boolean; xhr?: XMLHttpRequest; } + + export interface DropzoneDictFileSizeUnits { + tb?: string; + gb?: string; + mb?: string; + kb?: string; + b?: string; + } export interface DropzoneOptions { url?: string; @@ -72,6 +80,7 @@ declare namespace Dropzone { dictRemoveFile?: string; dictRemoveFileConfirmation?: string; dictMaxFilesExceeded?: string; + dictFileSizeUnits?: DropzoneDictFileSizeUnits; accept?(file: DropzoneFile, done: (error?: string | Error) => void): void; init?(): void; diff --git a/types/dropzone/tslint.json b/types/dropzone/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/dropzone/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/dropzone/v4/tslint.json b/types/dropzone/v4/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/dropzone/v4/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/dsv/tslint.json b/types/dsv/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/dsv/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/dts-bundle/tslint.json b/types/dts-bundle/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/dts-bundle/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/dts-generator/index.d.ts b/types/dts-generator/index.d.ts index 9de25e1f91..5ef99eb2b0 100644 --- a/types/dts-generator/index.d.ts +++ b/types/dts-generator/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/SitePen/dts-generator#readme // Definitions by: Matt Traynham // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.3 import ts = require('typescript'); import Bluebird = require('bluebird'); diff --git a/types/dts-generator/package.json b/types/dts-generator/package.json new file mode 100644 index 0000000000..2195330f38 --- /dev/null +++ b/types/dts-generator/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "typescript": "*" + } +} diff --git a/types/duplexer3/duplexer3-tests.ts b/types/duplexer3/duplexer3-tests.ts index 557437597c..c540828d5d 100644 --- a/types/duplexer3/duplexer3-tests.ts +++ b/types/duplexer3/duplexer3-tests.ts @@ -6,7 +6,7 @@ const readable = new stream.Readable({objectMode: true}); writable._write = (input, encoding, done) => { if (readable.push(input)) { - return done(); + done(); } else { readable.once('drain', <(...args: any[]) => void> done); } diff --git a/types/durandal/tslint.json b/types/durandal/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/durandal/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/durandal/v1/tslint.json b/types/durandal/v1/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/durandal/v1/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/dustjs-linkedin/tslint.json b/types/dustjs-linkedin/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/dustjs-linkedin/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/dw-bxslider-4/tslint.json b/types/dw-bxslider-4/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/dw-bxslider-4/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/dwt/index.d.ts b/types/dwt/index.d.ts index cad6825c27..d72fab058f 100644 --- a/types/dwt/index.d.ts +++ b/types/dwt/index.d.ts @@ -21,9 +21,11 @@ declare namespace Dynamsoft { namespace WebTwainEnv { function GetWebTwain (cid: string): WebTwain; - function RegisterEvent(event: string, fn: () => void): void; + function RegisterEvent(event: string, fn: (...args: any[]) => void): void; function Load(): void; + function Unload(): void; let AutoLoad: boolean; + let Containers: Container[]; } } @@ -1253,6 +1255,12 @@ declare enum EnumDWT_MouseShape { Zoom = 3 } +interface Container { + ContainerId: string; + Width: string | number; + Height: string | number; +} + /** * @class */ diff --git a/types/dwt/tslint.json b/types/dwt/tslint.json index acce7c8a0b..cb4a75513c 100644 --- a/types/dwt/tslint.json +++ b/types/dwt/tslint.json @@ -1,7 +1,10 @@ { "extends": "dtslint/dt.json", "rules": { + "jsdoc-format": false, "max-line-length": [false], + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, "no-trailing-whitespace": false, "space-before-function-paren": false, "only-arrow-functions": [false] diff --git a/types/dwt/v12/tslint.json b/types/dwt/v12/tslint.json index acce7c8a0b..cb4a75513c 100644 --- a/types/dwt/v12/tslint.json +++ b/types/dwt/v12/tslint.json @@ -1,7 +1,10 @@ { "extends": "dtslint/dt.json", "rules": { + "jsdoc-format": false, "max-line-length": [false], + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, "no-trailing-whitespace": false, "space-before-function-paren": false, "only-arrow-functions": [false] diff --git a/types/dygraphs/index.d.ts b/types/dygraphs/index.d.ts index c8617b18fc..6e45d5ccd7 100644 --- a/types/dygraphs/index.d.ts +++ b/types/dygraphs/index.d.ts @@ -526,6 +526,12 @@ declare namespace dygraphs { */ highlightSeriesBackgroundAlpha?: number; + /** + * Sets the background color used to fade out the series in conjunction with 'highlightSeriesBackgroundAlpha'. + * Default: rgb(255, 255, 255) + */ + highlightSeriesBackgroundColor?: string; + /** * When set, the options from this object are applied to the timeseries closest to the mouse * pointer for interactive highlighting. See also 'highlightCallback'. Example: diff --git a/types/dygraphs/tslint.json b/types/dygraphs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/dygraphs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/dymo-label-framework/tslint.json b/types/dymo-label-framework/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/dymo-label-framework/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/dynatable/tslint.json b/types/dynatable/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/dynatable/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/dynogels/dynogels-tests.ts b/types/dynogels/dynogels-tests.ts new file mode 100644 index 0000000000..ca16707256 --- /dev/null +++ b/types/dynogels/dynogels-tests.ts @@ -0,0 +1,795 @@ +import dynogels = require("dynogels"); +import { DynamoDB } from "aws-sdk"; +import * as Joi from "joi"; + +// AWS Configs +dynogels.AWS.config.loadFromPath('credentials.json'); +dynogels.AWS.config.update({ region: "REGION" }); + +// Define a Model +const Account = dynogels.define('Account', { + hashKey: 'email', + + // add the timestamp attributes (updatedAt, createdAt) + timestamps: true, + + schema: { + email: Joi.string().email(), + name: Joi.string(), + age: Joi.number(), + roles: dynogels.types.stringSet(), + settings: { + nickname: Joi.string(), + acceptedTerms: Joi.boolean().default(false), + test: { + evan: Joi.string() + } + } + } +}); + +const BlogPost = dynogels.define('BlogPost', { + hashKey: 'email', + rangeKey: 'title', + schema: { + email: Joi.string().email(), + title: Joi.string(), + content: Joi.binary(), + tags: dynogels.types.stringSet(), + } +}); + +const BlogPost1 = dynogels.define('BlogPost', { + hashKey: 'email', + rangeKey: 'title', + schema: { + email: Joi.string().email(), + title: Joi.string() + }, + validation: { + // allow properties not defined in the schema + allowUnknown: true + } +}); + +// Create Tables +dynogels.createTables((err) => { }); + +dynogels.createTables({ + BlogPost: { readCapacity: 5, writeCapacity: 10 }, + Account: { + readCapacity: 20, + writeCapacity: 4, + streamSpecification: { + streamEnabled: true, + streamViewType: 'NEW_IMAGE' + } + } +}, (err) => { }); + +dynogels.createTables({ + $dynogels: { pollingInterval: 100 } +}, (err) => { }); + +// Delete Table +BlogPost.deleteTable((err) => { }); + +// UUID +const Tweet = dynogels.define('Tweet', { + hashKey: 'TweetID', + timestamps: true, + schema: { + TweetID: dynogels.types.uuid(), + content: Joi.string(), + } +}); + +// Configuration +const Account1 = dynogels.define('Account', { + hashKey: 'email', + + // add the timestamp attributes (updatedAt, createdAt) + timestamps: true, + + schema: { + email: Joi.string().email(), + } +}); + +const Account2 = dynogels.define('Account', { + hashKey: 'email', + + // enable timestamps support + timestamps: true, + + // I don't want createdAt + createdAt: false, + + // I want updatedAt to actually be called updateTimestamp + updatedAt: 'updateTimestamp', + + schema: { + email: Joi.string().email(), + } +}); + +const Event = dynogels.define('Event', { + hashKey: 'name', + schema: { + name: Joi.string(), + total: Joi.number() + }, + + tableName: 'deviceEvents' +}); + +const Event1 = dynogels.define('Event', { + hashKey: 'name', + schema: { + name: Joi.string(), + total: Joi.number() + }, + + // store monthly event data + tableName: () => { + const d = new Date(); + return ['events', d.getFullYear(), d.getMonth() + 1].join('_'); + } +}); + +Account.config({ tableName: 'AccountsTable' }); + +const dynamodb = new DynamoDB(); +Account.config({ dynamodb }); + +// or globally use custom DynamoDB instance +// all defined models will now use this driver +dynogels.dynamoDriver(dynamodb); + +// Saving Models To DynamoDB +Account.create({ email: 'foo@example.com', name: 'Foo Bar', age: 21 }, (err, acc) => { + acc.get('email'); +}); + +const acc = new Account({ email: 'test@example.com', name: 'Test Example' }); +acc.save((err) => { + acc.get('email'); +}); + +BlogPost.create({ + email: 'werner@example.com', + title: 'Expanding the Cloud', + content: 'Today, we are excited to announce the limited preview...' +}, (err, post) => { }); + +const item1 = { email: 'foo1@example.com', name: 'Foo 1', age: 10 }; +const item2 = { email: 'foo2@example.com', name: 'Foo 2', age: 20 }; +const item3 = { email: 'foo3@example.com', name: 'Foo 3', age: 30 }; + +Account.create([item1, item2, item3], (err, accounts) => { }); + +const params: dynogels.CreateItemOptions = {}; + +params.ConditionExpression = '#i <> :x'; +params.ExpressionAttributeNames = { '#i': 'id' }; +params.ExpressionAttributeValues = { ':x': 123 }; + +Account.create({ id: 123, name: 'Kurt Warner' }, params, (error, acc) => { }); + +// setting overwrite to false will generate +// the same Condition Expression as in the previous example +Account.create({ id: 123, name: 'Kurt Warner' }, { overwrite: false }, (error, acc) => { }); + +// Updating +Account.update({ email: 'foo@example.com', name: 'Bar Tester' }, (err, acc) => { }); + +Account.update({ email: 'foo@example.com', name: 'Bar Tester' }, { ReturnValues: 'ALL_OLD' }, (err, acc) => { }); + +// Only update the account if the current age of the account is 22 +Account.update({ email: 'foo@example.com', name: 'Bar Tester' }, { expected: { age: 22 } }, (err, acc) => { }); + +// setting an attribute to null will delete the attribute from DynamoDB +Account.update({ email: 'foo@example.com', age: null }, (err, acc) => { }); + +Account.update( + { email: 'foo@example.com', name: 'FooBar Testers' }, + { expected: { email: { Exists: true } } }, + (err, acc) => { } +); + +Account.update( + { email: 'baz@example.com', name: 'Bar Tester' }, + { expected: { email: { Exists: true } } }, + (err, acc) => { } +); + +Account.update({ email: 'foo@example.com', age: { $add: 1 } }, (err, acc) => { }); + +BlogPost.update({ + email: 'werner@example.com', + title: 'Expanding the Cloud', + tags: { $add: 'cloud' } +}, (err, post) => { }); + +BlogPost.update({ + email: 'werner@example.com', + title: 'Expanding the Cloud', + tags: { $add: ['cloud', 'dynamodb'] } +}, (err, post) => { }); + +BlogPost.update({ + email: 'werner@example.com', + title: 'Expanding the Cloud', + tags: { $del: 'cloud' } +}, (err, post) => { }); + +BlogPost.update({ + email: 'werner@example.com', + title: 'Expanding the Cloud', + tags: { $del: ['aws', 'node'] } +}, (err, post) => { }); + +const params1: dynogels.UpdateItemOptions = {}; +params1.UpdateExpression = 'SET #year = #year + :inc, #dir.titles = list_append(#dir.titles, :title), #act[0].firstName = :firstName ADD tags :tag'; +params1.ConditionExpression = '#year = :current'; +params1.ExpressionAttributeNames = { + '#year': 'releaseYear', + '#dir': 'director', + '#act': 'actors' +}; + +params1.ExpressionAttributeValues = { + ':inc': 1, + ':current': 2001, + ':title': ['The Man'], + ':firstName': 'Rob', + ':tag': dynogels.Set(['Sports', 'Horror'], 'S') +}; + +BlogPost.update({ title: 'Movie 0', description: 'This is a description' }, params1, (err, mov) => { }); + +// Deleting +Account.destroy('foo@example.com', (err) => { }); + +// Destroy model using hash and range key +BlogPost.destroy('foo@example.com', 'Hello World!', (err) => { }); + +BlogPost.destroy({ email: 'foo@example.com', title: 'Another Post' }, (err) => { }); + +Account.destroy('foo@example.com', { ReturnValues: 'ALL_OLD' }, (err, acc) => { }); + +Account.destroy('foo@example.com', { expected: { age: 22 } }, (err) => { }); + +const params2: dynogels.DestroyItemOptions = {}; +params2.ConditionExpression = '#v = :x'; +params2.ExpressionAttributeNames = { '#v': 'version' }; +params2.ExpressionAttributeValues = { ':x': '2' }; + +Account.destroy({ id: 123 }, params2, (err, acc) => { }); + +// Loading Models from DynamoDB +Account.get('test@example.com', (err, acc) => { + console.log('got account', acc.get('email')); +}); + +Account.get('test@example.com', { ConsistentRead: true }, (err, acc) => { }); + +Account.get('test@example.com', { ConsistentRead: true, AttributesToGet: ['name', 'age'] }, (err, acc) => { }); + +BlogPost.get('werner@example.com', 'dynamodb-keeps-getting-better-and-cheaper', (err, post) => { }); + +BlogPost.get({ email: 'werner@example.com', title: 'Expanding the Cloud' }, (err, post) => { }); + +BlogPost.get({ id: '123456789' }, { ProjectionExpression: 'email, age, settings.nickname' }, (err, acc) => { }); + +// Query + +const callback = () => { }; +// query for blog posts by werner@example.com +BlogPost + .query('werner@example.com') + .exec(callback); + +// same as above, but load all results +BlogPost + .query('werner@example.com') + .loadAll() + .exec(callback); + +// only load the first 5 posts by werner +BlogPost + .query('werner@example.com') + .limit(5) + .exec(callback); + +// query for posts by werner where the tile begins with 'Expanding' +BlogPost + .query('werner@example.com') + .where('title').beginsWith('Expanding') + .exec(callback); + +// return only the count of documents that begin with the title Expanding +BlogPost + .query('werner@example.com') + .where('title').beginsWith('Expanding') + .select('COUNT') + .exec(callback); + +// query the first 10 posts by werner@example.com but only return +// the title and content from posts where the title starts with 'Expanding' +// WARNING: See notes below on the implementation of limit in DynamoDB +BlogPost + .query('werner@example.com') + .where('title').beginsWith('Expanding') + .attributes(['title', 'content']) + .limit(10) + .exec(callback); + +// sorting by title ascending +BlogPost + .query('werner@example.com') + .ascending() + .exec(callback); + +// sorting by title descending +BlogPost + .query('werner@example.com') + .descending() + .exec(callback); + +// All query options are chainable +BlogPost + .query('werner@example.com') + .where('title').gt('Expanding') + .attributes(['title', 'content']) + .limit(10) + .ascending() + .loadAll() + .exec(callback); + +// Traversing Map Data Types +Account + .query('werner@example.com') + .filter('settings.acceptedTerms').equals(true) + .exec(callback); + +BlogPost + .query('werner@example.com') + .where('title').equals('Expanding') + .exec(); + +// less than equals +BlogPost + .query('werner@example.com') + .where('title').lte('Expanding') + .exec(); + +// less than +BlogPost + .query('werner@example.com') + .where('title').lt('Expanding') + .exec(); + +// greater than +BlogPost + .query('werner@example.com') + .where('title').gt('Expanding') + .exec(); + +// greater than equals +BlogPost + .query('werner@example.com') + .where('title').gte('Expanding') + .exec(); + +// attribute doesn't exist +BlogPost + .query('werner@example.com') + .where('title').null() + .exec(); + +// attribute exists +BlogPost + .query('werner@example.com') + .where('title').exists() + .exec(); + +BlogPost + .query('werner@example.com') + .where('title').beginsWith('Expanding') + .exec(); + +BlogPost + .query('werner@example.com') + .where('title').between('foo@example.com', 'test@example.com') + .exec(); + +BlogPost + .query('werner@example.com') + .where('title').equals('Expanding') + .filter('tags').contains('cloud') + .exec(); + +BlogPost + .query('werner@example.com') + .filterExpression('#title < :t') + .expressionAttributeValues({ ':t': 'Expanding' }) + .expressionAttributeNames({ '#title': 'title' }) + .projectionExpression('#title, tag') + .exec(); + +const GameScore = dynogels.define('GameScore', { + hashKey: 'userId', + rangeKey: 'gameTitle', + schema: { + userId: Joi.string(), + gameTitle: Joi.string(), + topScore: Joi.number(), + topScoreDateTime: Joi.date(), + wins: Joi.number(), + losses: Joi.number() + }, + indexes: [{ + hashKey: 'gameTitle', rangeKey: 'topScore', name: 'GameTitleIndex', type: 'global' + }] +}); + +GameScore + .query('Galaxy Invaders') + .usingIndex('GameTitleIndex') + .descending() + .exec(callback); + +const GameScore1 = dynogels.define('GameScore', { + hashKey: 'userId', + rangeKey: 'gameTitle', + schema: { + userId: Joi.string(), + gameTitle: Joi.string(), + topScore: Joi.number(), + topScoreDateTime: Joi.date(), + wins: Joi.number(), + losses: Joi.number() + }, + indexes: [{ + hashKey: 'gameTitle', + rangeKey: 'topScore', + name: 'GameTitleIndex', + type: 'global', + projection: { NonKeyAttributes: ['wins'], ProjectionType: 'INCLUDE' } // optional, defaults to ALL + }] +}); + +GameScore + .query('Galaxy Invaders') + .usingIndex('GameTitleIndex') + .where('topScore').gt(1000) + .descending() + .exec((err, data) => { }); + +const BlogPost5 = dynogels.define('Account', { + hashKey: 'email', + rangeKey: 'title', + schema: { + email: Joi.string().email(), + title: Joi.string(), + content: Joi.binary(), + PublishedDateTime: Joi.date() + }, + + indexes: [{ + hashKey: 'email', rangeKey: 'PublishedDateTime', type: 'local', name: 'PublishedIndex' + }] +}); + +BlogPost + .query('werner@example.com') + .usingIndex('PublishedIndex') + .descending() + .exec(callback); + +BlogPost + .query('werner@example.com') + .usingIndex('PublishedIndex') + .ascending() + .exec(callback); + +BlogPost + .query('werner@example.com') + .usingIndex('PublishedIndex') + .descending() + .loadAll() + .exec(callback); + +// scan all accounts, returning the first page or results +Account.scan().exec(callback); + +// scan all accounts, this time loading all results +// note this will potentially make several calls to DynamoDB +// in order to load all results +Account + .scan() + .loadAll() + .exec(callback); + +// Load 20 accounts +Account + .scan() + .limit(20) + .exec(); + +// Load All accounts, 20 at a time per request +Account + .scan() + .limit(20) + .loadAll() + .exec(); + +// Load accounts which match a filter +// only return email and created attributes +// and return back the consumed capacity the request took +Account + .scan() + .where('email').gte('f@example.com') + .attributes(['email', 'created']) + .returnConsumedCapacity() + .exec(); + +// Load All accounts, if settings.acceptedTerms is true +Account + .scan() + .where('settings.acceptedTerms').equals(true) + .exec(); + +// Returns number of matching accounts, rather than the matching accounts themselves +Account + .scan() + .where('age').gte(21) + .select('COUNT') + .exec(); + +// Start scan using start key +Account + .scan() + .where('age').notNull() + .startKey('foo@example.com') + .exec(); + +// equals +Account + .scan() + .where('name').equals('Werner') + .exec(); + +// not equals +Account + .scan() + .where('name').ne('Werner') + .exec(); + +// less than equals +Account + .scan() + .where('name').lte('Werner') + .exec(); + +// less than +Account + .scan() + .where('name').lt('Werner') + .exec(); + +// greater than equals +Account + .scan() + .where('name').gte('Werner') + .exec(); + +// greater than +Account + .scan() + .where('name').gt('Werner') + .exec(); + +// name attribute doesn't exist +Account + .scan() + .where('name').null() + .exec(); + +// name attribute exists +Account + .scan() + .where('name').notNull() + .exec(); + +// contains +Account + .scan() + .where('name').contains('ner') + .exec(); + +// not contains +Account + .scan() + .where('name').notContains('ner') + .exec(); + +// in +Account + .scan() + .where('name').in(['foo@example.com', 'bar@example.com']) + .exec(); + +// begins with +Account + .scan() + .where('name').beginsWith('Werner') + .exec(); + +// between +Account + .scan() + .where('name').between('Bar', 'Foo') + .exec(); + +// multiple filters +Account + .scan() + .where('name').equals('Werner') + .where('age').notNull() + .exec(); + +Account.scan() + .filterExpression('#age BETWEEN :low AND :high AND begins_with(#email, :e)') + .expressionAttributeValues({ ':low': 18, ':high': 22, ':e': 'test1' }) + .expressionAttributeNames({ '#age': 'age', '#email': 'email' }) + .projectionExpression('#age, #email') + .exec(); + +const totalSegments = 8; + +Account.parallelScan(totalSegments) + .where('age').gte(18) + .attributes('age') + .exec(callback); + +// Load All accounts +Account + .parallelScan(totalSegments) + .exec(); + +Account.getItems(['foo@example.com', 'bar@example.com', 'test@example.com'], (err, accounts) => { + console.log(`loaded ${accounts.length} accounts`); // prints loaded 3 accounts +}); + +// Get both accounts, using a consistent read +Account.getItems(['foo@example.com', 'bar@example.com'], { ConsistentRead: true }, (err, accounts) => { + console.log(`loaded ${accounts.length} accounts`); // prints loaded 2 accounts +}); + +// Streaming API + +const stream = Account.parallelScan(4).exec(); + +stream.on('readable', () => { + console.log('single parallel scan response', stream.read()); +}); + +stream.on('end', () => { + console.log('Parallel scan of accounts finished'); +}); + +const querystream = BlogPost.query('werner@dynogels.com').loadAll().exec(); + +querystream.on('readable', () => { + console.log('single query response', stream.read()); +}); + +querystream.on('end', () => { + console.log('query for blog posts finished'); +}); + +// Dynamic Table Names + +const Event2 = dynogels.define('Event', { + hashKey: 'name', + schema: { + name: Joi.string(), + total: Joi.number() + }, + + // store monthly event data + tableName: () => { + const d = new Date(); + return ['events', d.getFullYear(), d.getMonth() + 1].join('_'); + } +}); + +// Logging + +const accountLogger = { + info: (...args: any[]) => { }, + warn: (...args: any[]) => { } +}; + +dynogels.log = accountLogger; + +const Account3 = dynogels.define('Account', { + hashKey: 'email', + log: accountLogger +}); // INFO level on account table + +const Account4 = dynogels.define('Account', { + hashKey: 'email', + + // add the timestamp attributes (updatedAt, createdAt) + timestamps: true, + + schema: { + email: Joi.string().email(), + name: Joi.string().required(), + age: Joi.number(), + } +}); + +Account.create({ email: 'test@example.com', name: 'Test Account' }, (err, acc) => { + console.log('created account at', acc.get('created')); // prints created Date + + acc.set({ age: 22 }); + + acc.update((err) => { + console.log('updated account age'); + }); +}); + +// For models with range keys you must pass in objects of hash and range key attributes +const postKey1 = { email: 'test@example.com', title: 'Hello World!' }; +const postKey2 = { email: 'test@example.com', title: 'Another Post' }; + +BlogPost.getItems([postKey1, postKey2], (err, posts) => { + console.log('loaded posts'); +}); + +dynogels.log.info("test", "123", {}); +dynogels.log.warn("test", "123", {}); + +// Lifecycle hooks +Account.before('create', (data, next) => { + if (!data.name) { + data.name = 'Foo Bar'; + } + + next(null, data); +}); + +Account.before('update', (data, next) => { + data.age = 45; + next(null, data); +}); + +Account.after('create', item => { + console.log('Account created', item.get()); +}); + +Account.after('update', item => { + console.log('Account updated', item.get()); +}); + +Account.after('destroy', item => { + console.log('Account destroyed', item.get()); +}); + +dynogels.createTables(err => { + if (err) { + process.exit(1); + } + + Account.create({ email: 'test11@example.com' }, (err, acc) => { + acc.set({ age: 25 }); + + acc.update(() => { + acc.destroy({ ReturnValues: 'ALL_OLD' }); + }); + }); +}); diff --git a/types/dynogels/index.d.ts b/types/dynogels/index.d.ts new file mode 100644 index 0000000000..2e4c5acbf4 --- /dev/null +++ b/types/dynogels/index.d.ts @@ -0,0 +1,263 @@ +// Type definitions for dynogels 8.0 +// Project: https://github.com/clarkie/dynogels#readme +// Definitions by: Spartan Labs +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// + +export import AWS = require("aws-sdk"); +import * as joi from "joi"; +import stream = require("stream"); + +// Dynogels Data Members +export let log: Log; +export let models: { [key: string]: Model }; +export let types: { + stringSet(): joi.AnySchema; + numberSet(): joi.AnySchema; + binarySet(): joi.AnySchema; + uuid(): joi.AnySchema; + timeUUID(): joi.AnySchema; +}; + +export interface Log { + info(...args: any[]): void; + warn(...args: any[]): void; +} + +// Dynogels global functions +export function dynamoDriver(dynamoDB: AWS.DynamoDB): AWS.DynamoDB; +export function reset(): void; +export function define(modelName: string, config: ModelConfiguration): Model; +export function createTables(callback: (err: string) => void): void; +export function createTables(options: { [key: string]: CreateTablesOptions } | DynogelsGlobalOptions, callback: (err: string) => void): void; +export function Set(...args: any[]): any; + +export interface DynogelsGlobalOptions { + $dynogels: { + pollingInterval: number; + }; +} + +export interface CreateTablesOptions { + readCapacity?: number; + writeCapacity?: number; + streamSpecification?: { + streamEnabled: boolean; + streamViewType: string; + }; +} + +export type LifeCycleAction = "create" | "update" | "destroy"; + +// Dynogels Model +export interface Model { + new(attrs: { [key: string]: any }): Item; + + get(hashKey: any, rangeKey: any, options: GetItemOptions, callback: DynogelsItemCallback): void; + get(haskKey: any, options: GetItemOptions, callback: DynogelsItemCallback): void; + get(hashKey: any, callback: DynogelsItemCallback): void; + get(hashKey: any, rangeKey: any, callback: DynogelsItemCallback): void; + create(item: any, options: CreateItemOptions, callback: DynogelsItemCallback): void; + create(item: any, callback: DynogelsItemCallback): void; + update(item: any, options: UpdateItemOptions, callback: DynogelsItemCallback): void; + update(item: any, callback: DynogelsItemCallback): void; + destroy(hashKey: any, rangeKey: any, options: DestroyItemOptions, callback: DynogelsItemCallback): void; + destroy(haskKey: any, options: DestroyItemOptions, callback: DynogelsItemCallback): void; + destroy(hashKey: any, callback: DynogelsItemCallback): void; + destroy(hashKey: any, rangeKey: any, callback: DynogelsItemCallback): void; + destroy(item: any, options: DestroyItemOptions, callback: DynogelsItemCallback): void; + destroy(item: any, callback: DynogelsItemCallback): void; + query(hashKey: any): Query; + scan(): Scan; + parallelScan(totalSegments: number): Scan; + getItems(items: string[] | Array<{ [key: string]: string }>, callback: (err: Error, items: any[]) => void): void; + getItems(items: string[] | Array<{ [key: string]: string }>, options: GetItemOptions, callback: (err: Error, items: any[]) => void): void; + batchGetItems(items: string[] | Array<{ [key: string]: string }>, callback: (err: Error, items: any[]) => void): void; + batchGetItems(items: string[] | Array<{ [key: string]: string }>, options: GetItemOptions, callback: (err: Error, items: any[]) => void): void; + createTable(options: { [key: string]: CreateTablesOptions } | DynogelsGlobalOptions, callback: (err: Error, data: AWS.DynamoDB.CreateTableOutput) => void): void; + createTable(callback: (err: Error, data: AWS.DynamoDB.CreateTableOutput) => void): void; + updateTable(throughput: Throughput, callback: (err: Error, data: AWS.DynamoDB.UpdateTableOutput) => void): void; + updateTable(callback: (err: Error, data: AWS.DynamoDB.UpdateTableOutput) => void): void; + describeTable(callback: (err: Error, data: AWS.DynamoDB.DescribeTableOutput) => void): void; + deleteTable(callback: (err: Error) => void): void; + tableName(): string; + + after(action: LifeCycleAction, listner: (item: Item) => void): void; + before(action: LifeCycleAction, listner: (data: any, next: (err: Error | null, data: any) => void) => void): void; + config(config: ModelConfig): { name: string }; +} + +export type DynogelsItemCallback = (err: Error, data: Item) => void; + +export interface Throughput { + readCapacity: number; + writeCapacity: number; +} + +export interface CreateItemOptions { + expected?: { [key: string]: any }; + overwrite?: boolean; + + Expected?: AWS.DynamoDB.ExpectedAttributeMap; + ReturnValues?: AWS.DynamoDB.ReturnValue; + ReturnConsumedCapacity?: AWS.DynamoDB.ReturnConsumedCapacity; + ReturnItemCollectionMetrics?: AWS.DynamoDB.ReturnItemCollectionMetrics; + ConditionalOperator?: AWS.DynamoDB.ConditionalOperator; + ConditionExpression?: AWS.DynamoDB.ConditionExpression; + ExpressionAttributeNames?: AWS.DynamoDB.ExpressionAttributeNameMap; + ExpressionAttributeValues?: { [key: string]: any }; +} + +export interface UpdateItemOptions { + expected?: { [key: string]: any }; + + AttributeUpdates?: AWS.DynamoDB.AttributeUpdates; + Expected?: AWS.DynamoDB.ExpectedAttributeMap; + ConditionalOperator?: AWS.DynamoDB.ConditionalOperator; + ReturnValues?: AWS.DynamoDB.ReturnValue; + ReturnConsumedCapacity?: AWS.DynamoDB.ReturnConsumedCapacity; + ReturnItemCollectionMetrics?: AWS.DynamoDB.ReturnItemCollectionMetrics; + UpdateExpression?: AWS.DynamoDB.UpdateExpression; + ConditionExpression?: AWS.DynamoDB.ConditionExpression; + ExpressionAttributeNames?: AWS.DynamoDB.ExpressionAttributeNameMap; + ExpressionAttributeValues?: { [key: string]: any }; +} + +export interface DestroyItemOptions { + Expected?: AWS.DynamoDB.ExpectedAttributeMap; + ConditionalOperator?: AWS.DynamoDB.ConditionalOperator; + ReturnValues?: AWS.DynamoDB.ReturnValue; + ReturnConsumedCapacity?: AWS.DynamoDB.ReturnConsumedCapacity; + ReturnItemCollectionMetrics?: AWS.DynamoDB.ReturnItemCollectionMetrics; + ConditionExpression?: AWS.DynamoDB.ConditionExpression; + ExpressionAttributeNames?: AWS.DynamoDB.ExpressionAttributeNameMap; + ExpressionAttributeValues?: { [key: string]: any }; +} + +export interface GetItemOptions { + AttributesToGet?: AWS.DynamoDB.AttributeNameList; + ConsistentRead?: AWS.DynamoDB.ConsistentRead; + ReturnConsumedCapacity?: AWS.DynamoDB.ReturnConsumedCapacity; + ProjectionExpression?: AWS.DynamoDB.ProjectionExpression; + ExpressionAttributeNames?: AWS.DynamoDB.ExpressionAttributeNameMap; +} + +export interface ModelConfig { + tableName?: string; + docClient?: any; + dynamodb?: AWS.DynamoDB; +} + +// Dynogels Item +export interface Item { + get(key?: string): { [key: string]: any }; + set(params: {}): Item; + save(callback?: DynogelsItemCallback): void; + update(options: UpdateItemOptions, callback?: DynogelsItemCallback): void; + update(callback?: DynogelsItemCallback): void; + destroy(options: DestroyItemOptions, callback?: DynogelsItemCallback): void; + destroy(callback?: DynogelsItemCallback): void; + toJSON(): any; + toPlainObject(): any; +} + +export interface BaseChain { + equals(value: any): T; + eq(value: any): T; + lte(value: any): T; + lt(value: any): T; + gte(value: any): T; + gt(value: any): T; + null(): T; + exists(): T; + beginsWith(value: any): T; + between(value1: any, value2: any): T; +} + +export interface ExtendedChain extends BaseChain { + contains(value: any): T; + notContains(value: any): T; + in(values: any[]): T; + ne(value: any): T; +} + +export type QueryWhereChain = BaseChain; +export type QueryFilterChain = ExtendedChain; + +// Dynogels Query +export interface Query { + limit(number: number): Query; + filterExpression(expression: any): Query; + expressionAttributeNames(data: any): Query; + expressionAttributeValues(data: any): Query; + projectionExpression(data: any): Query; + usingIndex(name: string): Query; + consistentRead(read: boolean): Query; + addKeyCondition(condition: any): Query; + addFilterCondition(condition: any): Query; + startKey(hashKey: any, rangeKey: any): Query; + attributes(attrs: any): Query; + ascending(): Query; + descending(): Query; + select(value: any): Query; + returnConsumedCapacity(value: any): Query; + loadAll(): Query; + where(keyName: string): QueryWhereChain; + filter(keyName: string): QueryFilterChain; + exec(): stream.Readable; + exec(callback: (err: Error, data: any) => void): void; +} + +export interface ScanWhereChain extends ExtendedChain { + notNull(): Scan; +} + +// Dynogels Scan +export interface Scan { + limit(number: number): Scan; + addFilterCondition(condition: any): Scan; + startKey(hashKey: any, rangeKey?: any): Scan; + attributes(attrs: any): Scan; + select(value: any): Scan; + returnConsumedCapacity(): Scan; + segments(segment: any, totalSegments: number): Scan; + where(keyName: string): ScanWhereChain; + filterExpression(expression: any): Scan; + expressionAttributeNames(data: any): Scan; + expressionAttributeValues(data: any): Scan; + projectionExpression(data: any): Scan; + exec(): stream.Readable; + exec(callback: (err: Error, data: any) => void): void; + loadAll(): Scan; +} + +export type tableResolve = () => string; + +export interface SchemaType { + [key: string]: joi.AnySchema | SchemaType; +} + +export interface ModelConfiguration { + hashKey: string; + rangeKey?: string; + timestamps?: boolean; + createdAt?: boolean; + updatedAt?: string; + schema?: SchemaType; + validation?: joi.ValidationOptions; + tableName?: string | tableResolve; + indexes?: any[]; + log?: Log; +} + +export interface Document { + [key: string]: any; +} + +export interface DocumentCollection { + Items: Document[]; + Count: number; + ScannedCount: number; +} diff --git a/types/dynogels/package.json b/types/dynogels/package.json new file mode 100644 index 0000000000..28676516a3 --- /dev/null +++ b/types/dynogels/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "aws-sdk": "^2.58.0" + } +} \ No newline at end of file diff --git a/types/dynogels/tsconfig.json b/types/dynogels/tsconfig.json new file mode 100644 index 0000000000..40297f0a43 --- /dev/null +++ b/types/dynogels/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "strictFunctionTypes": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "dynogels-tests.ts" + ] +} \ No newline at end of file diff --git a/types/dynogels/tslint.json b/types/dynogels/tslint.json new file mode 100644 index 0000000000..c7d87e32cc --- /dev/null +++ b/types/dynogels/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "unified-signatures": false + } +} \ No newline at end of file diff --git a/types/each/tslint.json b/types/each/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/each/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/easeljs/index.d.ts b/types/easeljs/index.d.ts index d47f631728..462c9f04cf 100644 --- a/types/easeljs/index.d.ts +++ b/types/easeljs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for EaselJS 0.8.0 +// Type definitions for EaselJS 1.0.0 // Project: http://www.createjs.com/#!/EaselJS // Definitions by: Pedro Ferreira , Chris Smith // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -53,6 +53,22 @@ declare namespace createjs { clone(): Bitmap; } + export class BitmapCache { + constructor(); + + // properties + cacheID: number; + + // methods + static getFilterBounds(target: DisplayObject, output?: Rectangle): Rectangle; + toString(): string; + define(target: DisplayObject, x: number, y: number, width: number, height: number, scale?: number): void; + update(compositeOperation?: string): void; + release(): void; + getCacheDataURL(): string; + draw(ctx: CanvasRenderingContext2D): boolean; + } + export class ScaleBitmap extends DisplayObject { constructor(imageOrUrl: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | Object | string, scale9Grid: Rectangle); @@ -211,6 +227,7 @@ declare namespace createjs { // properties alpha: number; + bitmapCache: BitmapCache; cacheCanvas: HTMLCanvasElement | Object; cacheID: number; compositeOperation: string; @@ -924,6 +941,60 @@ declare namespace createjs { } + interface IStageGLOptions { + preserveBuffer?: boolean; + antialias?: boolean; + transparent?: boolean; + premultiply?: boolean; + autoPurge?: number; + } + + export class StageGL extends Stage { + constructor(canvas: HTMLCanvasElement | string | Object, options?: IStageGLOptions); + + // properties + static VERTEX_PROPERTY_COUNT: number; + static INDICIES_PER_CARD: number; + static DEFAULT_MAX_BATCH_SIZE: number; + static WEBGL_MAX_INDEX_NUM: number; + static UV_RECT: number; + static COVER_VERT: Float32Array; + static COVER_UV: Float32Array; + static COVER_UV_FLIP: Float32Array; + static REGULAR_VARYING_HEADER: string; + static REGULAR_VERTEX_HEADER: string; + static REGULAR_FRAGMENT_HEADER: string; + static REGULAR_VERTEX_BODY: string; + static REGULAR_FRAGMENT_BODY: string; + static REGULAR_FRAG_COLOR_NORMAL: string; + static REGULAR_FRAG_COLOR_PREMULTIPLY: string; + static PARTICLE_VERTEX_BODY: string; + static PARTICLE_FRAGMENT_BODY: string; + static COVER_VARYING_HEADER: string; + static COVER_VERTEX_HEADER: string; + static COVER_FRAGMENT_HEADER: string; + static COVER_VERTEX_BODY: string; + static COVER_FRAGMENT_BODY: string; + isWebGL: boolean; + autoPurge: number; + vocalDebug: boolean; + + // methods + static buildUVRects(spritesheet: SpriteSheet, target?: number, onlyTarget?: boolean): Object; + static isWebGLActive(ctx: CanvasRenderingContext2D): boolean; + cacheDraw(target: DisplayObject, filters: Filter[], manager: BitmapCache): boolean; + getBaseTexture(w?: number, h?: number): WebGLTexture | null; + getFilterShader(filter: Filter | Object): WebGLProgram; + getRenderBufferTexture (w: number, h: number): WebGLTexture; + getTargetRenderTexture (target: DisplayObject, w: number, h: number): Object; + protectTextureSlot(id: number, lock?: boolean): void; + purgeTextures(count?: number): void; + releaseTexture(item: DisplayObject | WebGLTexture | HTMLImageElement | HTMLCanvasElement): void; + setTextureParams(gl: WebGLRenderingContext, isPOT?: boolean): void; + updateSimultaneousTextureCount(count?: number): void; + updateViewport(width: number, height: number): void; + } + export class Text extends DisplayObject { constructor(text?: string, font?: string, color?: string); diff --git a/types/easeljs/tslint.json b/types/easeljs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/easeljs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/easy-api-request/index.d.ts b/types/easy-api-request/index.d.ts index cc3fc85810..e306a0a2b2 100644 --- a/types/easy-api-request/index.d.ts +++ b/types/easy-api-request/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/DeadAlready/easy-api-request // Definitions by: Karl Düüna // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.3 /// diff --git a/types/easy-api-request/tslint.json b/types/easy-api-request/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/easy-api-request/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/easy-jsend/index.d.ts b/types/easy-jsend/index.d.ts index 6cf9f48d03..c0280736e9 100644 --- a/types/easy-jsend/index.d.ts +++ b/types/easy-jsend/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/DeadAlready/easy-jsend // Definitions by: Karl Düüna // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 diff --git a/types/easy-jsend/tslint.json b/types/easy-jsend/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/easy-jsend/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/easy-session/index.d.ts b/types/easy-session/index.d.ts index 904b74d23f..30df43458c 100644 --- a/types/easy-session/index.d.ts +++ b/types/easy-session/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/DeadAlready/node-easy-session // Definitions by: Karl Düüna // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 /// diff --git a/types/easy-session/tslint.json b/types/easy-session/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/easy-session/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/easy-table/tslint.json b/types/easy-table/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/easy-table/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/easy-x-headers/index.d.ts b/types/easy-x-headers/index.d.ts index 35ede3ef2e..1dffb8adc8 100644 --- a/types/easy-x-headers/index.d.ts +++ b/types/easy-x-headers/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/DeadAlready/easy-x-headers // Definitions by: Karl Düüna // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /// diff --git a/types/easy-x-headers/tslint.json b/types/easy-x-headers/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/easy-x-headers/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/easy-xapi-supertest/index.d.ts b/types/easy-xapi-supertest/index.d.ts index f67dc4345b..6f8b6764fd 100644 --- a/types/easy-xapi-supertest/index.d.ts +++ b/types/easy-xapi-supertest/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/DeadAlready/easy-x-headers // Definitions by: Karl Düüna // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 diff --git a/types/easy-xapi-supertest/tslint.json b/types/easy-xapi-supertest/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/easy-xapi-supertest/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/easy-xapi-utils/index.d.ts b/types/easy-xapi-utils/index.d.ts index 5085af7551..c845b17a58 100644 --- a/types/easy-xapi-utils/index.d.ts +++ b/types/easy-xapi-utils/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/DeadAlready/easy-xapi-utils // Definitions by: Karl Düüna // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.2 /// /// diff --git a/types/easy-xapi-utils/tslint.json b/types/easy-xapi-utils/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/easy-xapi-utils/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/easy-xapi/index.d.ts b/types/easy-xapi/index.d.ts index aa7316288b..5d3cdb2eb1 100644 --- a/types/easy-xapi/index.d.ts +++ b/types/easy-xapi/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/DeadAlready/easy-xapi // Definitions by: Karl Düüna // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.2 /// /// diff --git a/types/easy-xapi/tslint.json b/types/easy-xapi/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/easy-xapi/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/easystarjs/tslint.json b/types/easystarjs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/easystarjs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/echarts/index.d.ts b/types/echarts/index.d.ts index bcae4299d3..0ea8aa0c6a 100644 --- a/types/echarts/index.d.ts +++ b/types/echarts/index.d.ts @@ -4,77 +4,91 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace echarts { - function init(dom:HTMLDivElement|HTMLCanvasElement, theme?:Object|string, opts?:{ + function init(dom: HTMLDivElement | HTMLCanvasElement, theme?: Object | string, opts?: { devicePixelRatio?: number renderer?: string - }):ECharts; + }): ECharts; const graphic: { clipPointsByRect(points: number[][], rect: ERectangle): number[][]; clipRectByRect(targetRect: ERectangle, rect: ERectangle): ERectangle; + LinearGradient: { new (x: number, y: number, x2: number, y2: number, colorStops: Array, globalCoord?: boolean): LinearGradient } + + }; + + + function connect(group: string | Array): void; + + function disConnect(group: string): void; + + function dispose(target: ECharts | HTMLDivElement | HTMLCanvasElement): void; + + function getInstanceByDom(target: HTMLDivElement | HTMLCanvasElement): void; + + function registerMap(mapName: string, geoJson: Object, specialAreas?: Object): void; + + function registerTheme(themeName: string, theme: Object): void; + + interface LinearGradient { + colorStops: Array; + global: boolean; + type: string; + x: number + x2: number + y: number + y2: number } - - function connect(group:string|Array):void; - function disConnect(group:string):void; - - function dispose(target:ECharts|HTMLDivElement|HTMLCanvasElement):void; - - function getInstanceByDom(target:HTMLDivElement|HTMLCanvasElement):void; - - function registerMap(mapName:string, geoJson:Object, specialAreas?:Object):void; - - function registerTheme(themeName:string, theme:Object):void; interface ECharts { - group:string; + group: string; - setOption(option:EChartOption, notMerge?:boolean, notRefreshImmediately?:boolean):void + setOption(option: EChartOption, notMerge?: boolean, notRefreshImmediately?: boolean): void - getWidth():number + getWidth(): number - getHeight():number + getHeight(): number - getDom():HTMLCanvasElement|HTMLDivElement + getDom(): HTMLCanvasElement | HTMLDivElement - getOption():Object + getOption(): Object - resize():void + resize(): void - dispatchAction(payload:Object):void + dispatchAction(payload: Object): void - on(eventName:string, handler:Function, context?:Object):void + on(eventName: string, handler: Function, context?: Object): void - off(eventName:string, handler?:Function):void + off(eventName: string, handler?: Function): void - showLoading(type?:string, opts?:Object):void + showLoading(type?: string, opts?: Object): void - hideLoading():void + hideLoading(): void - getDataURL(opts:{ + getDataURL(opts: { // 导出的格式,可选 png, jpeg type?: string, // 导出的图片分辨率比例,默认为 1。 pixelRatio?: number, // 导出的图片背景色,默认使用 option 里的 backgroundColor backgroundColor?: string - }):string + }): string - getConnectedDataURL(opts:{ + getConnectedDataURL(opts: { // 导出的格式,可选 png, jpeg type: string, // 导出的图片分辨率比例,默认为 1。 pixelRatio: number, // 导出的图片背景色,默认使用 option 里的 backgroundColor backgroundColor: string - }):string + }): string - clear():void + clear(): void - isDisposed():boolean + isDisposed(): boolean + + dispose(): void - dispose():void - // 转换逻辑点到像素 convertToPixel(finder: { seriesIndex?: number, @@ -92,8 +106,8 @@ declare namespace echarts { gridIndex?: number, gridId?: string gridName?: string - } | string, value: string|Array): string|Array - + } | string, value: string | Array): string | Array + convertFromPixel(finder: { seriesIndex?: number, seriesId?: string, @@ -110,7 +124,7 @@ declare namespace echarts { gridIndex?: number, gridId?: string gridName?: string - } | string, value: Array|string): Array|string + } | string, value: Array | string): Array | string } interface ERectangle { @@ -177,6 +191,6 @@ declare namespace echarts { } } -declare module "echarts" { +declare module 'echarts' { export = echarts; } diff --git a/types/echarts/tslint.json b/types/echarts/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/echarts/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/ed25519/ed25519-tests.ts b/types/ed25519/ed25519-tests.ts new file mode 100644 index 0000000000..b8bbcb5d31 --- /dev/null +++ b/types/ed25519/ed25519-tests.ts @@ -0,0 +1,15 @@ +import * as crypto from 'crypto'; +import * as ed25519 from 'ed25519'; + +function signAndValidatePlaintext() { + const seed: Buffer = crypto.randomBytes(32); + const keyPair: ed25519.CurveKeyPair = ed25519.MakeKeypair(seed); + + const plaintext = Buffer.from('plaintext'); + const signature: Buffer = ed25519.Sign(plaintext, keyPair.privateKey); + + const matches: boolean = ed25519.Verify(plaintext, signature, keyPair.publicKey); + if (!matches) { + throw new Error("Sign and verify should work for the same plaintext"); + } +} diff --git a/types/ed25519/index.d.ts b/types/ed25519/index.d.ts new file mode 100644 index 0000000000..bc280afe0c --- /dev/null +++ b/types/ed25519/index.d.ts @@ -0,0 +1,46 @@ +// Type definitions for ed25519 0.0 +// Project: https://github.com/dazoe/ed25519 +// Definitions by: Erik Mavrinac +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// Main site: https://ed25519.cr.yp.to/ +// Manually generated and maintained because the package is a +// veneer on an underlying C library; auto-generation won't work. +// The JavaScript-C interface is well described at +// https://github.com/dazoe/ed25519/blob/master/src/ed25519.cc + +/// + +/** The key material returned from a call to MakeKeypair(). */ +export interface CurveKeyPair { + /** + * A Buffer containing the public portion of the Curve25519 key. + */ + publicKey: Buffer; + + /** + * A Buffer containing the private, secret portion of the Curve25519 key. + */ + privateKey: Buffer; +} + +/** + * Uses the crytpographically strong random seed to generate a + * Curve25519 key pair. + * @return The public and private key pair. + */ +export function MakeKeypair(seed: Buffer): CurveKeyPair; + +/** + * Signs a plaintext message buffer using the private key generated using + * MakeKeypair(). + * @return The signature calculated on the plaintext. + */ +export function Sign(message: Buffer, privateKeyOrKeyPair: Buffer | CurveKeyPair): Buffer; + +/** + * Verifies a signature for a message buffer using a + * public key generated using MakeKeypair(). + * @return True if the signature validates correctly, false otherwise. + */ +export function Verify(message: Buffer, signature: Buffer, publicKey: Buffer): boolean; diff --git a/types/ed25519/tsconfig.json b/types/ed25519/tsconfig.json new file mode 100644 index 0000000000..98fa33a4b1 --- /dev/null +++ b/types/ed25519/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", + "ed25519-tests.ts" + ] +} diff --git a/types/ed25519/tslint.json b/types/ed25519/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/ed25519/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/egg-mock/index.d.ts b/types/egg-mock/index.d.ts index 9ccf6989dd..7308d52184 100644 --- a/types/egg-mock/index.d.ts +++ b/types/egg-mock/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/eggjs/egg-mock // Definitions by: Eward Song // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import { Application, Context } from 'egg'; diff --git a/types/egg.js/tslint.json b/types/egg.js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/egg.js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/egg/index.d.ts b/types/egg/index.d.ts index abf8d5db38..fe0539e4c1 100644 --- a/types/egg/index.d.ts +++ b/types/egg/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/eggjs/egg // Definitions by: Eward Song // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 import * as accepts from 'accepts'; import * as KoaApplication from 'koa'; @@ -51,14 +51,12 @@ interface Request extends KoaApplication.Request { // tslint:disable-line * 2. response type is set to json * 3. detect by request accept header * - * @member {Boolean} Request#acceptJSON * @since 1.0.0 */ acceptJSON: boolean; /** * Request remote IPv4 address - * @member {String} Request#ip * @example * ```js * this.request.ip @@ -72,7 +70,6 @@ interface Request extends KoaApplication.Request { // tslint:disable-line * Get all pass through ip addresses from the request. * Enable only on `app.config.proxy = true` * - * @member {Array} Request#ips * @example * ```js * this.request.ips @@ -85,7 +82,6 @@ interface Request extends KoaApplication.Request { // tslint:disable-line /** * get params pass by querystring, all value are Array type. {@link Request#query} - * @member {Array} Request#queries * @example * ```js * GET http://127.0.0.1:7001?a=b&a=c&o[foo]=bar&b[]=1&b[]=2&e=val @@ -103,7 +99,6 @@ interface Request extends KoaApplication.Request { // tslint:disable-line /** * get params pass by querystring, all value are String type. - * @member {Object} Request#query * @example * ```js * GET http://127.0.0.1:7001?name=Foo&age=20&age=21 @@ -132,7 +127,6 @@ interface Response extends KoaApplication.Response { // tslint:disable-line * instead of show current 500 status page. * And access log should save 500 not 302, * then the `realStatus` can help us find out the real status code. - * @member {Number} Context#realStatus */ realStatus: number; } @@ -140,19 +134,19 @@ interface Response extends KoaApplication.Response { // tslint:disable-line interface ContextView { // tslint:disable-line /** * Render a file by view engine - * @param {String} name - the file path based on root - * @param {Object} [locals] - data used by template - * @param {Object} [options] - view options, you can use `options.viewEngine` to specify view engine - * @return {Promise} result - return a promise with a render result + * @param name - the file path based on root + * @param [locals] - data used by template + * @param [options] - view options, you can use `options.viewEngine` to specify view engine + * @return result - return a promise with a render result */ render(name: string, locals: any, options?: any): Promise; /** * Render a template string by view engine - * @param {String} tpl - template string - * @param {Object} [locals] - data used by template - * @param {Object} [options] - view options, you can use `options.viewEngine` to specify view engine - * @return {Promise} result - return a promise with a render result + * @param tpl - template string + * @param [locals] - data used by template + * @param [options] - view options, you can use `options.viewEngine` to specify view engine + * @return result - return a promise with a render result */ renderString(name: string, locals: any, options?: any): Promise; } @@ -162,60 +156,79 @@ export type LoggerLevel = 'DEBUG' | 'INFO' | 'WARN' | 'ERROR' | 'NONE'; export interface EggAppConfig { workerStartTimeout: number; baseDir: string; - /** - * The option of `bodyParser` middleware - * - * @member Config#bodyParser - * @property {Boolean} enable - enable bodyParser or not, default to true - * @property {String | RegExp | Function | Array} ignore - won't parse request body when url path hit ignore pattern, can not set `ignore` when `match` presented - * @property {String | RegExp | Function | Array} match - will parse request body only when url path hit match pattern - * @property {String} encoding - body encoding config, default utf8 - * @property {String} formLimit - form body size limit, default 100kb - * @property {String} jsonLimit - json body size limit, default 100kb - * @property {Boolean} strict - json body strict mode, if set strict value true, then only receive object and array json body - * @property {Number} queryString.arrayLimit - from item array length limit, default 100 - * @property {Number} queryString.depth - json value deep lenght, default 5 - * @property {Number} queryString.parameterLimit - paramter number limit ,default 1000 - */ bodyParser: { + /** + * enable bodyParser or not + * @default true + */ enable: boolean; + /** + * body encoding config + * @default utf8 + */ encoding: string; + /** + * form body size limit + * @default 100kb + */ formLimit: string; + /** + * json body size limit + * @default 100kb + */ jsonLimit: string; + /** json body strict mode, if set strict value true, then only receive object and array json body */ strict: true; queryString: { + /** + * from item array length limit + * @default 100 + */ arrayLimit: number; + /** + * json value deep lenght + * @default 5 + */ depth: number; + /** + * paramter number limit + * @default 1000 + */ parameterLimit: number; }; }; - /** - * logger options - * @member Config#logger - * @property {String} dir - directory of log files - * @property {String} encoding - log file encloding, defaults to utf8 - * @property {String} level - default log level, could be: DEBUG, INFO, WARN, ERROR or NONE, defaults to INFO in production - * @property {String} consoleLevel - log level of stdout, defaults to INFO in local serverEnv, defaults to WARN in unittest, defaults to NONE elsewise - * @property {Boolean} outputJSON - log as JSON or not, defaults to false - * @property {Boolean} buffer - if enabled, flush logs to disk at a certain frequency to improve performance, defaults to true - * @property {String} errorLogName - file name of errorLogger - * @property {String} coreLogName - file name of coreLogger - * @property {String} agentLogName - file name of agent worker log - * @property {Object} coreLogger - custom config of coreLogger - */ logger: { + /** directory of log files */ dir: string; + /** + * log file encloding + * @default utf8 + */ encoding: string; env: string; + /** + * default log level, could be: DEBUG, INFO, WARN, ERROR or NONE + * @default INFO in production + */ level: LoggerLevel; + /** + * log level of stdout + * @default INFO in local serverEnv, WARN in unittest, NONE elsewise + */ consoleLevel: LoggerLevel; + /** log as JSON or not, defaults to false */ outputJSON: boolean; + /** if enabled, flush logs to disk at a certain frequency to improve performance, defaults to true */ buffer: boolean; appLogName: string; + /** file name of coreLogger */ coreLogName: string; + /** file name of agent worker log */ agentLogName: string; + /** file name of errorLogger */ errorLogName: string; + /** custom config of coreLogger */ coreLogger: any; }; @@ -292,18 +305,20 @@ export interface EggAppConfig { */ ipHeaders: string; - /** - * jsonp options - * @member Config#jsonp - * @property {String} callback - jsonp callback method key, default to `_callback` - * @property {Number} limit - callback method name's max length, default to `50` - * @property {Boolean} csrf - enable csrf check or not. default to false - * @property {String|RegExp|Array} whiteList - referrer white list - */ jsonp: { + /** + * callback method name's max length + * @default 50 + */ limit: number; + /** + * jsonp callback method key + * @default `_callback` + */ callback: string; + /** enable csrf check or not. default to false */ csrf: boolean; + /** referrer white list */ whiteList: string | RegExp | Array; }; @@ -356,8 +371,8 @@ export interface Router extends KoaRouter { resources(name: string, prefix: string, middleware: any): Router; /** - * @param {String} name - Router name - * @param {Object} params - more parameters + * @param name - Router name + * @param params - more parameters * @example * ```js * router.url('edit_post', { id: 1, name: 'foo', page: 2 }) @@ -365,7 +380,7 @@ export interface Router extends KoaRouter { * router.url('posts', { name: 'foo&1', page: 2 }) * => /posts?name=foo%261&page=2 * ``` - * @return {String} url by path name and query params. + * @return url by path name and query params. * @since 1.0.0 */ url(name: string, params: any): any; @@ -410,7 +425,6 @@ declare interface EggApplication extends KoaApplication { // tslint:disable-line /** * Logger for Application, wrapping app.coreLogger with context infomation * - * @member {ContextLogger} Context#logger * @since 1.0.0 * @example * ```js @@ -462,7 +476,7 @@ declare interface EggApplication extends KoaApplication { // tslint:disable-line * * If error is thrown when it's closing, the promise will reject. * It will also reject after following call. - * @return {Promise} promise + * @return promise * @since 1.0.0 */ close(): Promise; @@ -605,7 +619,6 @@ export interface Context extends KoaApplication.Context { * 设置返回资源对象 * set the ctx.body.data value * - * @member {Object} Context#data= * @example * ```js * ctx.data = { @@ -677,7 +690,6 @@ export interface Context extends KoaApplication.Context { * * `ctx.locals` has cache, it only merges `app.locals` once in one request. * - * @member {Object} Context#locals */ locals: any; @@ -689,7 +701,6 @@ export interface Context extends KoaApplication.Context { /** * Logger for Application, wrapping app.coreLogger with context infomation * - * @member {ContextLogger} Context#logger * @since 1.0.0 * @example * ```js @@ -718,19 +729,19 @@ export interface Context extends KoaApplication.Context { /** * Render a file by view engine - * @param {String} name - the file path based on root - * @param {Object} [locals] - data used by template - * @param {Object} [options] - view options, you can use `options.viewEngine` to specify view engine - * @return {Promise} result - return a promise with a render result + * @param name - the file path based on root + * @param [locals] - data used by template + * @param [options] - view options, you can use `options.viewEngine` to specify view engine + * @return result - return a promise with a render result */ render(name: string, locals: any, options?: any): Promise; /** * Render a template string by view engine - * @param {String} tpl - template string - * @param {Object} [locals] - data used by template - * @param {Object} [options] - view options, you can use `options.viewEngine` to specify view engine - * @return {Promise} result - return a promise with a render result + * @param tpl - template string + * @param [locals] - data used by template + * @param [options] - view options, you can use `options.viewEngine` to specify view engine + * @return result - return a promise with a render result */ renderString(name: string, locals: any, options?: any): Promise; @@ -745,8 +756,7 @@ export interface Context extends KoaApplication.Context { * // get other fields * console.log(stream.fields); * ``` - * @method Context#getFileStream - * @return {ReadStream} stream + * @return stream * @since 1.0.0 */ getFileStream(): Promise; diff --git a/types/ej.web.all/ej.web.all-tests.ts b/types/ej.web.all/ej.web.all-tests.ts index d1d67be14c..9a1b418da0 100644 --- a/types/ej.web.all/ej.web.all-tests.ts +++ b/types/ej.web.all/ej.web.all-tests.ts @@ -1,4 +1,6 @@ /* tslint:disable */ +/* tslint:disable */ + module AccordionComponent { $(function () { @@ -76,6 +78,35 @@ module Bulletgraphcomponent { $(function () { var bulletsample = new ej.datavisualization.BulletGraph($("#BulletGraph"), { isResponsive: true, + load: function () { + var sender = $("#BulletGraph").data("ejBulletGraph"); + var bulletTheme = window.themeStyle + window.themeColor + window.themeVarient; + if (bulletTheme) { + switch (bulletTheme) { + case "flatdark": + case "flatazuredark": + case "flatlimedark": + case "flatsaffrondark": + case "gradientdark": + case "gradientazuredark": + case "gradientlimedark": + case "gradientsaffrondark": + case "flathigh-contrast-01dark": + case "flathigh-contrast-02dark": + theme = "flatdark"; + break; + case "flatoffice-365light": + case "flatmateriallight": + theme = "material"; + break; + default: + theme = "flatlight"; + break; + } + sender.model.theme = theme; + } + + }, tooltipSettings: { visible: true }, quantitativeScaleSettings: { featureMeasures: [{ @@ -232,10 +263,50 @@ module ChartComponent { model.primaryYAxis.labelIntersectAction = "rotate45"; model.primaryYAxis.edgeLabelPlacement = "hide"; } + var theme = window.themeStyle + window.themeColor + window.themeVarient; + if (theme) { + switch (theme) { + case "flatdark": + case "flatazuredark": + case "flatlimedark": + case "flatsaffrondark": + theme = "flatdark"; + break; + case "gradientlight": + case "gradientazurelight": + case "gradientlimelight": + case "gradientsaffronlight": + theme = "gradientlight"; + break; + case "gradientdark": + case "gradientazuredark": + case "gradientlimedark": + case "gradientsaffrondark": + theme = "gradientdark"; + break; + case "flatbootstraplight": + theme = "bootstrap"; + break; + case "flathigh-contrast-01dark": + case "flathigh-contrast-02dark": + theme = "high-contrast-01"; + break; + case "flatmateriallight": + case "flatoffice-365light": + theme = "material"; + break; + + default: + theme = "flatlight"; + break; + } + sender.model.theme = theme; + } }, title: { text: 'Efficiency of oil-fired power production' }, size: { height: "600" }, - legend: { visible: true} + legend: { visible: true}, + load:"loadTheme" }); }); } @@ -307,6 +378,28 @@ module ColorPickerComponent { } + + +module ComboBoxComponent{ + var BikeList = [ + { empid: "bk1", text: "Apache RTR" }, { empid: "bk2", text: "CBR 150-R" }, { empid: "bk3", text: "CBZ Xtreme" }, + { empid: "bk4", text: "Discover" }, { empid: "bk5", text: "Dazzler" }, { empid: "bk6", text: "Flame" }, + { empid: "bk7", text: "Fazzer" }, { empid: "bk8", text: "FZ-S" }, { empid: "bk9", text: "Pulsar" }, + { empid: "bk10", text: "Shine" }, { empid: "bk11", text: "R15" }, { empid: "bk12", text: "Unicorn" } + ]; + $(function () { + var comboboxInstance =new ej.ComboBox($("#selectCar"), { + width: "100%", + placeholder: "Select a Bike", + fields: { text: "text", value: "empid" }, + dataSource: BikeList, + autofill: true + }); + }); +} + + + module DatePickerComponent { @@ -1065,7 +1158,8 @@ module PivotChartOlap { size: { height: "460px", width: "100%" }, primaryXAxis: { title: { text: "Date - Fiscal" }, labelRotation: 0 }, primaryYAxis: { title: { text: "Internet Sales Amount" } }, - legend: { visible: true, rowCount: 2 } + legend: { visible: true, rowCount: 2 }, + load:"loadTheme" }); }); } @@ -1139,7 +1233,8 @@ module PivotChartRelational { }, size: { height: "460px", width: "100%" }, primaryYAxis: { title: { text: "Amount" } }, - legend: { visible: true } + legend: { visible: true }, + load:"loadTheme" }); }); } @@ -1650,7 +1745,67 @@ module rangecomponent { fill: '#69D2E7' } ]; - } + }, + loaded: function () { + var sender = $("#RangeNavigator").data("ejRangeNavigator"); + var theme = window.themeStyle + window.themeColor + window.themeVarient; + if (theme) { + switch (theme) { + case "flatazurelight": + theme = "azurelight"; + break; + case "flatlimelight": + theme = "limelight"; + break; + case "flatsaffronlight": + theme = "saffronlight"; + break; + case "gradientazurelight": + theme = "gradientazure"; + break; + case "gradientlimelight": + theme = "gradientlime"; + break; + case "gradientsaffronlight": + theme = "gradientsaffron"; + break; + case "flatazuredark": + theme = "azuredark"; + break; + case "flatlimedark": + theme = "limedark"; + break; + case "flatsaffrondark": + theme = "saffrondark"; + break; + case "gradientazuredark": + theme = "gradientazuredark"; + break; + case "gradientlimedark": + theme = "gradientlimedark"; + break; + case "gradientsaffrondark": + theme = "gradientsaffrondark"; + break; + case "flathigh-contrast-01dark": + theme = "highcontrast01"; + break; + case "flathigh-contrast-02dark": + theme = "highcontrast02"; + break; + case "flatmateriallight": + theme = "material"; + break; + case "flatoffice-365light": + theme = "office"; + break; + default: + theme = "flatlight"; + break; + } + sender.model.theme = theme; + } + } }); }); @@ -2621,7 +2776,9 @@ module ScrollerComponent { }); $(window).bind('resize', function () { scrollerSample.refresh(); - }); }); + }); + + }); } @@ -2893,9 +3050,20 @@ module sunburstcomponent { enableAnimation:false, size:{height:"600"}, innerRadius:0.2, + load: function () { + var sender = $("#Sunburst").data("ejSunburstChart"); + var SunBurstTheme = window.themeStyle + window.themeColor + window.themeVarient; + SunBurstTheme = SunBurstTheme.toString(); + if (SunBurstTheme.indexOf("dark") > -1 || SunBurstTheme.indexOf("contrast") > -1) + SunBurstTheme = "flatdark"; + else + SunBurstTheme = "flatlight"; + sender.model.theme = SunBurstTheme; + }, title:{text:"Employees Count"}, zoomSettings:{enable:false}, - legend:{visible:true,position:'top'} + legend:{visible:true,position:'top'}, + load:"loadTheme" }); }); } diff --git a/types/ej.web.all/index.d.ts b/types/ej.web.all/index.d.ts index e9f83b680c..ae1948ba86 100644 --- a/types/ej.web.all/index.d.ts +++ b/types/ej.web.all/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ej.web.all 15.3 +// Type definitions for ej.web.all 15.4 // Project: http://help.syncfusion.com/js/typescript // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -6,9 +6,10 @@ /// + /*! * filename: ej.web.all.d.ts -* version : 15.3.0.33 +* version : 15.4.0.17 * Copyright Syncfusion Inc. 2001 - 2017. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing @@ -54,7 +55,7 @@ declare namespace ej { function getNameSpace(className: string): string; function getOffset(ele: string): any; function getRenderMode(): string; - function getScrollableParents(element: any): void; + function getScrollableParents(element: any): JQuery; function getTheme(): string; function getZindexPartial(element: any, popupEle: string): number; function hasRenderMode(element: string): void; @@ -5131,6 +5132,10 @@ declare namespace ej { */ beforeUpload?(e: BeforeUploadEventArgs): void; + /** Fires before opening the upload dialog. + */ + beforeUploadDialogOpen?(e: BeforeUploadDialogOpenEventArgs): void; + /** Fires when FileExplorer control was created */ create?(e: CreateEventArgs): void; @@ -5355,6 +5360,21 @@ declare namespace ej { type?: string; } + export interface BeforeUploadDialogOpenEventArgs { + + /** returns Selected FileList objects + */ + files?: any; + + /** returns the FileExplorer model + */ + model?: any; + + /** returns the name of the event. + */ + type?: string; + } + export interface CreateEventArgs { /** Set to true when the event has to be canceled, else false. @@ -16921,6 +16941,11 @@ declare namespace ej { */ readOnly?: boolean; + /** Shows/Hides the increment and decrement buttons of the slider. + * @Default {false} + */ + showButtons?: boolean; + /** Specifies the rounded corner behavior for slider. * @Default {false} */ @@ -32630,17 +32655,13 @@ declare namespace ej { export interface ActionBeginEventArgs { - /** Returns the current date value. - */ - currentDate?: any; - /** Returns the cancel option value. */ cancel?: boolean; - /** Returns the current view value. + /** Returns the data about the view change action. */ - currentView?: string; + data?: any; /** Returns the Schedule model. */ @@ -32650,21 +32671,17 @@ declare namespace ej { */ requestType?: string; - /** Returns the target of the click. - */ - target?: any; - /** Returns the name of the event. */ type?: string; - /** Returns the save appointment value. + /** Returns the name of the CRUD action performed. */ - data?: any; + currentAction?: string; - /** Returns the id of delete appointment. + /** Returns the GUid of appointment. */ - id?: number; + id?: string; } export interface ActionCompleteEventArgs { @@ -32689,6 +32706,10 @@ declare namespace ej { */ type?: string; + /** Returns the name of the CRUD action performed. + */ + currentAction?: string; + /** Returns the appointment data dropped. */ appointment?: any; @@ -32719,13 +32740,17 @@ declare namespace ej { export interface BeforeAppointmentRemoveEventArgs { + /** Returns the deleted appointment object. + */ + appointment?: any; + /** Returns the cancel option value. */ cancel?: boolean; - /** Returns the deleted appointment object. + /** Returns the name of the CRUD action performed. */ - appointment?: any; + currentAction?: string; /** Returns the Schedule model. */ @@ -32746,10 +32771,18 @@ declare namespace ej { */ cancel?: boolean; + /** Returns the name of the CRUD action performed. + */ + currentAction?: string; + /** Returns the Schedule model. */ model?: ej.Schedule.Model; + /** Returns the name of the Scheduler event. + */ + requestType?: string; + /** Returns the name of the Scheduler event. */ type?: string; @@ -32881,14 +32914,14 @@ declare namespace ej { export interface CellClickEventArgs { - /** Returns the object of cellClick event. - */ - object?: any; - /** Returns the cancel option value. */ cancel?: boolean; + /** Returns the index of the cell. + */ + cellIndex?: number; + /** Returns the end time of the clicked cell. */ endTime?: any; @@ -32897,6 +32930,14 @@ declare namespace ej { */ model?: ej.Schedule.Model; + /** Returns day, date and time information. + */ + quickString?: string; + + /** Returns the object of the resource. + */ + resources?: any; + /** Returns the start time of the clicked cell. */ startTime?: any; @@ -32912,10 +32953,6 @@ declare namespace ej { export interface CellDoubleClickEventArgs { - /** Returns the object of cellDoubleClick event. - */ - object?: any; - /** Returns the cancel option value. */ cancel?: boolean; @@ -32928,6 +32965,10 @@ declare namespace ej { */ model?: ej.Schedule.Model; + /** Returns the object of the resource. + */ + resources?: any; + /** Returns the start time of the double clicked cell. */ startTime?: any; @@ -32943,26 +32984,30 @@ declare namespace ej { export interface CellHoverEventArgs { - /** Returns the object of cellHover event. - */ - object?: any; - /** Returns the cancel option value. */ cancel?: boolean; /** Returns the index of the hovered cell. */ - cellIndex?: any; + cellIndex?: number; - /** Returns the current date of the hovered cell. + /** Returns the end time of the clicked cell. */ - currentDate?: any; + endTime?: any; /** Returns the Schedule model. */ model?: ej.Schedule.Model; + /** Returns the object of the resource. + */ + resources?: any; + + /** Returns the start time of the clicked cell. + */ + startTime?: any; + /** Returns the target of the clicked cell. */ target?: any; @@ -33004,10 +33049,6 @@ declare namespace ej { export interface DragEventArgs { - /** Returns the object of dragOver event. - */ - object?: any; - /** Returns the cancel option value. */ cancel?: boolean; @@ -33023,13 +33064,17 @@ declare namespace ej { /** Returns the name of the event. */ type?: string; + + /** Returns the default dragging interval range in minutes + */ + interval?: number; } export interface DragStartEventArgs { - /** Returns the object of dragStart event. + /** Returns the dragged appointment. */ - object?: any; + appointment?: any; /** Returns the cancel option value. */ @@ -33050,10 +33095,6 @@ declare namespace ej { export interface DragStopEventArgs { - /** Returns the object of dragDrop event. - */ - object?: any; - /** Returns the dropped appointment object. */ appointment?: any; @@ -33073,10 +33114,6 @@ declare namespace ej { export interface MenuItemClickEventArgs { - /** Returns the object of menuItemClick event. - */ - object?: any; - /** Returns the cancel option value. */ cancel?: boolean; @@ -33089,6 +33126,10 @@ declare namespace ej { */ model?: ej.Schedule.Model; + /** Returns the right clicked cell details. + */ + targetInfo?: any; + /** Returns the name of the event. */ type?: string; @@ -33120,6 +33161,10 @@ declare namespace ej { */ target?: any; + /** Returns the name of the Scheduler event. + */ + requestType?: string; + /** Returns the name of the event. */ type?: string; @@ -33193,10 +33238,6 @@ declare namespace ej { export interface ResizeEventArgs { - /** Returns the object of resizing event. - */ - object?: any; - /** Returns the cancel option value. */ cancel?: boolean; @@ -33205,6 +33246,10 @@ declare namespace ej { */ element?: any; + /** Returns the default appointment resizing range . + */ + interval?: number; + /** Returns the Schedule model. */ model?: ej.Schedule.Model; @@ -33216,9 +33261,9 @@ declare namespace ej { export interface ResizeStartEventArgs { - /** Returns the object of resizeStart event. + /** Returns the object of the resized appointment. */ - object?: any; + appointment?: any; /** Returns the cancel option value. */ @@ -33239,10 +33284,6 @@ declare namespace ej { export interface ResizeStopEventArgs { - /** Returns the object of resizeStop event. - */ - object?: any; - /** Returns the resized appointment value. */ appointment?: any; @@ -33266,14 +33307,14 @@ declare namespace ej { export interface OverflowButtonClickEventArgs { - /** Returns the object consisting of start time, end time and resource value of the underlying cell on which the clicked overflow button is present. - */ - object?: any; - /** Returns the cancel option value. */ cancel?: boolean; + /** Returns the icon rendered cell information. + */ + Datas?: any; + /** Returns the object of menu item event. */ events?: any; @@ -33289,17 +33330,17 @@ declare namespace ej { export interface OverflowButtonHoverEventArgs { - /** Returns the object consisting of start time, end time and resource value of the underlying cell on which the overflow button is currently hovered. - */ - object?: any; - /** Returns the cancel option value. */ cancel?: boolean; + /** Returns the icon rendered cell information. + */ + datas?: any; + /** Returns the object of menu item event. */ - events?: any; + event?: any; /** Returns the Schedule model. */ @@ -33343,6 +33384,10 @@ declare namespace ej { */ model?: ej.Schedule.Model; + /** Returns the name of the Scheduler event. + */ + requestType?: string; + /** Returns the name of the Scheduler event. */ type?: string; @@ -33358,10 +33403,18 @@ declare namespace ej { */ cancel?: boolean; + /** Returns the name of the CRUD action performed. + */ + currentAction?: string; + /** Returns the Schedule model. */ model?: ej.Schedule.Model; + /** Returns the name of the Scheduler event. + */ + requestType?: string; + /** Returns the name of the Scheduler event. */ type?: string; @@ -33377,10 +33430,18 @@ declare namespace ej { */ appointment?: any; + /** Returns the name of the CRDU action performed. + */ + currentAction?: string; + /** Returns the Schedule model. */ model?: ej.Schedule.Model; + /** Returns the name of the Scheduler event. + */ + requestType?: string; + /** Returns the name of the Scheduler event. */ type?: string; @@ -34190,6 +34251,11 @@ declare namespace ej { */ enablePredecessorValidation?: boolean; + /** Enables or disables serial number column for Gantt. When enabled, the records will be number sequenced. + * @Default {false} + */ + enableSerialNumber?: boolean; + /** Specifies the baseline background color in Gantt * @Default {#fba41c} */ @@ -34271,6 +34337,10 @@ declare namespace ej { */ editDialogFields?: EditDialogField[]; + /** Options for filtering and customizing filter actions. + */ + filterSettings?: FilterSettings; + /** Enables or disables the responsiveness of Gantt * @Default {false} */ @@ -34655,6 +34725,32 @@ declare namespace ej { */ workWeek?: any[]; + /** Specifies the view type for a project in the Gantt. + * @Default {ej.Gantt.ViewType.ProjectView} + */ + viewType?: ej.Gantt.ViewType|string; + + /** Specifies the data collection for grouping the resources in resource allocation view in Gantt. + * @Default {[]} + */ + groupCollection?: any[]; + + /** Default Value + */ + resourceCollectionMapping?: string; + + /** Default Value + */ + taskCollectionMapping?: string; + + /** Default Value + */ + groupIdMapping?: string; + + /** Default Value + */ + groupNameMapping?: string; + /** Triggered for every Gantt action before its starts. */ actionBegin?(e: ActionBeginEventArgs): void; @@ -35479,6 +35575,33 @@ declare namespace ej { editType?: string; } + export interface FilterSettingsFilteredColumn { + + /** Specifies the value to be filtered in Gantt. + */ + value?: string; + + /** Specifies the field where filtering has to be performed. + */ + field?: string; + + /** Specifies the predicate(and/or) value to perform filtering. + */ + predicate?: string; + + /** Specifies the filter condition to filtered column. See operator + */ + operator?: string; + } + + export interface FilterSettings { + + /** Specifies the column collection for filtering the Gantt content on initial load + * @Default {[]} + */ + filteredColumns?: FilterSettingsFilteredColumn[]; + } + export interface SplitterSettings { /** Specifies position of the splitter in Gantt , splitter can be placed either based on percentage values or pixel values. @@ -35867,6 +35990,16 @@ declare namespace ej { TimeScale24Hours } + + enum ViewType { + + ///Displays the project in task view in Gantt. + ProjectView, + + ///Displays the project in resource allocation view in Gantt. + ResourceView + } + } class ReportViewer extends ej.Widget { @@ -36620,6 +36753,141 @@ declare namespace ej { * @returns {void} */ reorderColumn(fieldName: string, targetIndex: string): void; + + /** To get the updated data source of TreeGrid. + * @returns {any[]} + */ + getUpdatedRecords(): any[]; + + /** Sends request to navigate to a specific page in TreeGrid. + * @param {number} Pass the page index to perform paging at specified page index. + * @returns {void} + */ + gotoPage(PageIndex: number): void; + + /** To change the checkbox selection to any column. + * @param {string} Pass the column field name to check box selection to that column. + * @returns {void} + */ + updateCheckboxColumn(fieldName: string): void; + + /** Gets the selected cell(s) element details in TreeGrid. + * @returns {any[]} + */ + getSelectedCells(): any[]; + + /** Sets the minimum responsive width for TreeGrid. + * @param {string} Pass the minimum responsive width, above which the TreeGrid needs to work in responsive mode. + * @returns {void} + */ + updateResponsiveMinWidth(width: string): void; + + /** To open the dialog to add new record/row in TreeGrid. + * @returns {void} + */ + showAddDialog(): void; + + /** To open the dialog to edit a row/record in TreeGrid. + * @param {number} Pass the index of row to be edit. + * @returns {void} + */ + showEditDialog(Index: number): void; + + /** Sets the scroll left and scroll top offsets of TreeGrid. + * @param {string} Pass a value to set left position of horizontal scroll bar. + * @param {string} Pass a value to set top position of vertical scroll bar. + * @returns {void} + */ + scrollOffset(Left: string, Top: string): void; + + /** Gets the scroll top offset of TreeGrid. + * @returns {number} + */ + getScrollTopOffset(): number; + + /** Gets the scroll left offset of TreeGrid. + * @returns {number} + */ + getScrollLeftOffset(): number; + + /** Sets the scroll top offset of TreeGrid to 0. + * @returns {void} + */ + scrollToTop(): void; + + /** Sets the scroll top offset of TreeGrid to maximum value. + * @returns {void} + */ + scrollToBottom(): void; + + /** To expand and collapse an item in TreeGrid using item’s index. + * @param {number} Pass the row index of row to expand/collapse. + * @returns {void} + */ + expandCollapseRow(Index: number): void; + + /** To expand all the root level nodes in TreeGrid. + * @returns {void} + */ + expandAll(): void; + + /** Show/Hide the detail row of a specific record. + * @param {number} Pass the row index of record to show/hide the detail row. + * @returns {void} + */ + showHideDetailsRow(rowIndex: number): void; + + /** Sends filtering request to filter a column in TreeGrid. + * @param {string} Pass the field name of the column. + * @param {string} string/integer/dateTime operator. + * @param {string} Pass the value to be filtered in a column. + * @param {string} Pass the predicate as and/or. + * @param {boolean} Optional pass the match case value as true/false. + * @param {any} Optional actualFilterValue denote the filter object of current filtered columns. + * @returns {void} + */ + filterColumn(fieldName: string, filterOperator: string, filterValue: string, predicate: string, matchcase: boolean, actualFilterValue: any): void; + + /** To change the index of the tree column in TreeGrid. + * @param {number} Pass the column index to make the column as treeColumnIndex. + * @returns {void} + */ + columnIndex(Index: number): void; + + /** To clear the sorting from sorted columns in TreeGrid. + * @returns {void} + */ + clearSorting(): void; + + /** Gets the column index of specific column with data source field. + * @param {string} Pass the column field name to get its index. + * @returns {number} + */ + getColumnIndexByField(fieldName: string): number; + + /** Gets the column field name using column header text. + * @param {string} Pass the column header text to get its field name. + * @returns {string} + */ + getFieldNameByHeaderText(headerText: string): string; + + /** Gets the column object of specific column. + * @param {string} Pass the column header text to get details of that column. + * @returns {any} + */ + getColumnByHeaderText(headerText: string): any; + + /** Clears the filter applied to a specific column. + * @param {string} Pass the column field name to clear filtering done in that column. + * @returns {void} + */ + clearFilter(fieldName: string): void; + + /** Gets the column object of specific column. + * @param {string} Pass the column field name to get details of that column. + * @returns {any} + */ + getColumnByField(fieldName: string): any; } export namespace TreeGrid { @@ -36851,6 +37119,16 @@ declare namespace ej { */ detailsRowHeight?: number; + /** Gets or sets a value that indicates stacked header should be shown on TreeGrid layout when the property “stackedHeaderRows” is set. + * @Default {false} + */ + showStackedHeader?: boolean; + + /** Gets or sets an object that indicates to managing the collection of stacked header rows for the treegrid. + * @Default {[]} + */ + stackedHeaderRows?: StackedHeaderRow[]; + /** Specifies the visibility of summary row * @Default {false} */ @@ -38263,6 +38541,42 @@ declare namespace ej { enableSelectAll?: boolean; } + export interface StackedHeaderRowsStackedHeaderColumn { + + /** Gets or sets a value that indicates the header text for the particular stacked header column. + * @Default {null} + */ + column?: any; + + /** Gets or sets a value that indicates class to the corresponding stackedHeaderColumn. + * @Default {null} + */ + cssClass?: string; + + /** Gets or sets a value that indicates the header text for the particular stacked header column. + * @Default {null} + */ + headerText?: string; + + /** Gets or sets a value that indicates the text alignment of the corresponding headerText. + * @Default {ej.TextAlign.Left} + */ + textAlign?: string; + + /** Sets the template for tooltip for the Grid stackedHeaderColumns. + * @Default {null} + */ + tooltip?: string; + } + + export interface StackedHeaderRow { + + /** Gets or sets a value that indicates whether to add stacked header columns into the stacked header rows + * @Default {[]} + */ + stackedHeaderColumns?: StackedHeaderRowsStackedHeaderColumn[]; + } + export interface SummaryRowsSummaryColumn { /** Specifies the summary type to perform calculations in a corresponding summary column. See summaryType. @@ -39019,63 +39333,79 @@ declare namespace ej { export interface AjaxCompleteEventArgs { - /** returns true if the event should be canceled; otherwise, false. + /** Set this option to true to cancel the event. */ cancel?: boolean; - /** returns the name of the event. + /** Instance of the navigation drawer model object. + */ + model?: ej.NavigationDrawer.Model; + + /** Name of the event. */ type?: string; - /** returns the model value of the control. + /** URL of the content. */ - model?: ej.NavigationDrawer.Model; + URL?: string; + + /** Response content. + */ + data?: string; } export interface AjaxErrorEventArgs { - /** returns true if the event should be canceled; otherwise, false. + /** Set this option to true to cancel the event. */ cancel?: boolean; - /** returns the name of the event. - */ - type?: string; - - /** returns the model value of the control. + /** Instance of the navigation drawer model object. */ model?: ej.NavigationDrawer.Model; - /** returns the error thrown in the AJAX post. + /** Name of the event. */ - errorThrown?: any; + type?: string; - /** returns the status. + /** URL of the content. */ - textStatus?: any; + URL?: string; + + /** Error page content. + */ + responseText?: string; + + /** Error code. + */ + status?: number; + + /** The corresponding error description. + */ + statusText?: string; } export interface AjaxSuccessEventArgs { - /** returns true if the event should be canceled; otherwise, false. + /** Set this option to true to cancel the event. */ cancel?: boolean; - /** returns the name of the event. - */ - type?: string; - - /** returns the model value of the control. + /** Instance of the navigation drawer model object. */ model?: ej.NavigationDrawer.Model; - /** returns the AJAX current content. + /** Name of the event. */ - content?: string; + type?: string; - /** returns the current URL of the AJAX post. + /** URL of the content. */ URL?: string; + + /** Response content. + */ + data?: string; } export interface BeforeCloseEventArgs { @@ -45056,6 +45386,12 @@ declare namespace ej { */ enableAsync?: boolean; + /** Sets the data type for the ajax call used within the SpellCheck control, denoting the type of data that are expected to be retrieved from the server. The applicable values are + * json and jsonp. + * @Default {jsonp} + */ + ajaxDataType?: string; + /** Triggers on the success of AJAX call request. */ actionSuccess?(e: ActionSuccessEventArgs): void; @@ -45789,209 +46125,283 @@ declare namespace ej.datavisualization { destroy(): void; /** To export Image + * @param {number} for the Image + * @param {number} for the Image * @returns {void} */ - exportImage(): void; + exportImage(fileName: number, fileType: number): void; /** To get Bar Distance From Scale in number + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge * @returns {any} */ - getBarDistanceFromScale(): any; + getBarDistanceFromScale(scaleIndex: number, pointerIndex: number): any; /** To get Bar Pointer Value in number + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge * @returns {any} */ - getBarPointerValue(): any; + getBarPointerValue(scaleIndex: number, pointerIndex: number): any; /** To get Bar Width in number + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge * @returns {any} */ - getBarWidth(): any; + getBarWidth(scaleIndex: number, pointerIndex: number): any; /** To get CustomLabel Angle in number + * @param {number} scaleIndex value for the Gauge + * @param {number} customLabelIndex value for the Gauge * @returns {any} */ - getCustomLabelAngle(): any; + getCustomLabelAngle(scaleIndex: number, customLabelIndex: number): any; /** To get CustomLabel Value in string + * @param {number} scaleIndex value for the Gauge + * @param {number} customLabelIndex value for the Gauge * @returns {any} */ - getCustomLabelValue(): any; + getCustomLabelValue(scaleIndex: number, customLabelIndex: number): any; /** To get Label Angle in number + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge * @returns {any} */ - getLabelAngle(): any; + getLabelAngle(scaleIndex: number, labelIndex: number): any; /** To get LabelPlacement in number + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge * @returns {any} */ - getLabelPlacement(): any; + getLabelPlacement(scaleIndex: number, labelIndex: number): any; /** To get LabelStyle in number + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge * @returns {any} */ - getLabelStyle(): any; + getLabelStyle(scaleIndex: number, labelIndex: number): any; /** To get Label XDistance From Scale in number + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge * @returns {any} */ - getLabelXDistanceFromScale(): any; + getLabelXDistanceFromScale(scaleIndex: number, labelIndex: number): any; /** To get PointerValue in number + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge * @returns {any} */ - getLabelYDistanceFromScale(): any; + getLabelYDistanceFromScale(scaleIndex: number, labelIndex: number): any; /** To get Major Interval Value in number + * @param {number} scaleIndex value for the Gauge * @returns {any} */ - getMajorIntervalValue(): any; + getMajorIntervalValue(scaleIndex: number): any; /** To get MarkerStyle in number + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge * @returns {any} */ - getMarkerStyle(): any; + getMarkerStyle(scaleIndex: number, pointerIndex: number): any; /** To get Maximum Value in number + * @param {number} scaleIndex value for the Gauge * @returns {any} */ - getMaximumValue(): any; + getMaximumValue(scaleIndex: number): any; /** To get PointerValue in number + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge * @returns {any} */ - getMinimumValue(): any; + getMinimumValue(scaleIndex: number, pointerIndex: number): any; /** To get Minor Interval Value in number + * @param {number} scaleIndex value for the Gauge * @returns {any} */ - getMinorIntervalValue(): any; + getMinorIntervalValue(scaleIndex: number): any; /** To get Pointer Distance From Scale in number + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge * @returns {any} */ - getPointerDistanceFromScale(): any; + getPointerDistanceFromScale(scaleIndex: number, pointerIndex: number): any; /** To get PointerHeight in number + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge * @returns {any} */ - getPointerHeight(): any; + getPointerHeight(scaleIndex: number, pointerIndex: number): any; /** To get Pointer Placement in String + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge * @returns {any} */ - getPointerPlacement(): any; + getPointerPlacement(scaleIndex: number, pointerIndex: number): any; /** To get PointerValue in number + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge * @returns {any} */ - getPointerValue(): any; + getPointerValue(scaleIndex: number, pointerIndex: number): any; /** To get PointerWidth in number + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge * @returns {any} */ - getPointerWidth(): any; + getPointerWidth(scaleIndex: number, pointerIndex: number): any; /** To get Range Border Width in number + * @param {number} scaleIndex value for the Gauge + * @param {number} rangeIndex value for the Gauge * @returns {any} */ - getRangeBorderWidth(): any; + getRangeBorderWidth(scaleIndex: number, rangeIndex: number): any; /** To get Range Distance From Scale in number + * @param {number} scaleIndex value for the Gauge + * @param {number} rangeIndex value for the Gauge * @returns {any} */ - getRangeDistanceFromScale(): any; + getRangeDistanceFromScale(scaleIndex: number, rangeIndex: number): any; /** To get Range End Value in number + * @param {number} scaleIndex value for the Gauge + * @param {number} rangeIndex value for the Gauge * @returns {any} */ - getRangeEndValue(): any; + getRangeEndValue(scaleIndex: number, rangeIndex: number): any; /** To get Range End Width in number + * @param {number} scaleIndex value for the Gauge + * @param {number} rangeIndex value for the Gauge * @returns {any} */ - getRangeEndWidth(): any; + getRangeEndWidth(scaleIndex: number, rangeIndex: number): any; /** To get Range Position in number + * @param {number} scaleIndex value for the Gauge + * @param {number} rangeIndex value for the Gauge * @returns {any} */ - getRangePosition(): any; + getRangePosition(scaleIndex: number, rangeIndex: number): any; /** To get Range Start Value in number + * @param {number} scaleIndex value for the Gauge + * @param {number} rangeIndex value for the Gauge * @returns {any} */ - getRangeStartValue(): any; + getRangeStartValue(scaleIndex: number, rangeIndex: number): any; /** To get Range Start Width in number + * @param {number} scaleIndex value for the Gauge + * @param {number} rangeIndex value for the Gauge * @returns {any} */ - getRangeStartWidth(): any; + getRangeStartWidth(scaleIndex: number, rangeIndex: number): any; /** To get ScaleBarLength in number + * @param {number} scaleIndex value for the Gauge * @returns {any} */ - getScaleBarLength(): any; + getScaleBarLength(scaleIndex: number): any; /** To get Scale Bar Size in number + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge * @returns {any} */ - getScaleBarSize(): any; + getScaleBarSize(scaleIndex: number, pointerIndex: number): any; /** To get Scale Border Width in number + * @param {number} scaleIndex value for the Gauge * @returns {any} */ - getScaleBorderWidth(): any; + getScaleBorderWidth(scaleIndex: number): any; /** To get Scale Direction in number + * @param {number} scaleIndex value for the Gauge * @returns {any} */ - getScaleDirection(): any; + getScaleDirection(scaleIndex: number): any; /** To get Scale Location in object + * @param {number} scaleIndex value for the Gauge * @returns {any} */ - getScaleLocation(): any; + getScaleLocation(scaleIndex: number): any; /** To get Scale Style in string + * @param {number} scaleIndex value for the Gauge * @returns {any} */ - getScaleStyle(): any; + getScaleStyle(scaleIndex: number): any; /** To get Tick Angle in number + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge * @returns {any} */ - getTickAngle(): any; + getTickAngle(scaleIndex: number, tickIndex: number): any; /** To get Tick Height in number + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge * @returns {any} */ - getTickHeight(): any; + getTickHeight(scaleIndex: number, tickIndex: number): any; /** To get getTickPlacement in number + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge * @returns {any} */ - getTickPlacement(): any; + getTickPlacement(scaleIndex: number, tickIndex: number): any; /** To get Tick Style in string + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge * @returns {any} */ - getTickStyle(): any; + getTickStyle(scaleIndex: number, tickIndex: number): any; /** To get Tick Width in number + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge * @returns {any} */ - getTickWidth(): any; + getTickWidth(scaleIndex: number, tickIndex: number): any; /** To get get Tick XDistance From Scale in number + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge * @returns {any} */ - getTickXDistanceFromScale(): any; + getTickXDistanceFromScale(scaleIndex: number, tickIndex: number): any; /** To get Tick YDistance From Scale in number + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge * @returns {any} */ - getTickYDistanceFromScale(): any; + getTickYDistanceFromScale(scaleIndex: number, tickIndex: number): any; /** Specifies the scales. * @returns {void} @@ -45999,204 +46409,314 @@ declare namespace ej.datavisualization { scales(): void; /** To set setBarDistanceFromScale + * @param {number} scaleIndex,value for the Gauge + * @param {number} pointerIndex value for the Gauge + * @param {number} Bar DistanceFromScale value for Gauge * @returns {void} */ - setBarDistanceFromScale(): void; + setBarDistanceFromScale(scaleIndex: number, pointerIndex: number, value: number): void; /** To set setBarPointerValue + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge + * @param {number} Bar Pointer Value for Gauge * @returns {void} */ - setBarPointerValue(): void; + setBarPointerValue(scaleIndex: number, pointerIndex: number, value: number): void; /** To set setBarWidth + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge + * @param {number} Bar Width for Gauge * @returns {void} */ - setBarWidth(): void; + setBarWidth(scaleIndex: number, pointerIndex: number, value: number): void; /** To set setCustomLabelAngle + * @param {number} scaleIndex value for the Gauge + * @param {number} customLabelIndex value for the Gauge + * @param {number} Custom Label Angle for Gauge * @returns {void} */ - setCustomLabelAngle(): void; + setCustomLabelAngle(scaleIndex: number, customLabelIndex: number, value: number): void; /** To set setCustomLabelValue + * @param {number} scaleIndex value for the Gauge + * @param {number} customLabelIndex value for the Gauge + * @param {number} CustomLabel value for Gauge * @returns {void} */ - setCustomLabelValue(): void; + setCustomLabelValue(scaleIndex: number, customLabelIndex: number, value: number): void; /** To set setLabelAngle + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge + * @param {number} Label Angle for Gauge * @returns {void} */ - setLabelAngle(): void; + setLabelAngle(scaleIndex: number, labelIndex: number, angle: number): void; /** To set setLabelPlacement + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge + * @param {number} Label Placement for Gauge * @returns {void} */ - setLabelPlacement(): void; + setLabelPlacement(scaleIndex: number, labelIndex: number, value: number): void; /** To set setLabelStyle + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge + * @param {string} Label Style for Gauge * @returns {void} */ - setLabelStyle(): void; + setLabelStyle(scaleIndex: number, labelIndex: number, value: string): void; /** To set setLabelXDistanceFromScale + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge + * @param {number} Label XDistance From Scale for Gauge * @returns {void} */ - setLabelXDistanceFromScale(): void; + setLabelXDistanceFromScale(scaleIndex: number, labelIndex: number, value: number): void; /** To set setLabelYDistanceFromScale + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge + * @param {number} Label YDistance From Scale for Gauge * @returns {void} */ - setLabelYDistanceFromScale(): void; + setLabelYDistanceFromScale(scaleIndex: number, labelIndex: number, value: number): void; /** To set setMajorIntervalValue + * @param {number} scaleIndex value for the Gauge + * @param {number} Major Interval Value for Gauge * @returns {void} */ - setMajorIntervalValue(): void; + setMajorIntervalValue(scaleIndex: number, value: number): void; /** To set setMarkerStyle + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge + * @param {string} marker Style for Gauge * @returns {void} */ - setMarkerStyle(): void; + setMarkerStyle(scaleIndex: number, pointerIndex: number, value: string): void; /** To set setMaximumValue + * @param {number} scaleIndex value for the Gauge + * @param {number} MaximumValue for Gauge * @returns {void} */ - setMaximumValue(): void; + setMaximumValue(scaleIndex: number, value: number): void; /** To set setMinimumValue + * @param {number} scaleIndex value for the Gauge + * @param {number} MinimumValue for Gauge * @returns {void} */ - setMinimumValue(): void; + setMinimumValue(scaleIndex: number, value: number): void; /** To set setMinorIntervalValue + * @param {number} scaleIndex value for the Gauge + * @param {number} Minor Interval Value for Gauge * @returns {void} */ - setMinorIntervalValue(): void; + setMinorIntervalValue(scaleIndex: number, value: number): void; /** To set setPointerDistanceFromScale + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge + * @param {number} for Gauge * @returns {void} */ - setPointerDistanceFromScale(): void; + setPointerDistanceFromScale(scaleIndex: number, pointerIndex: number, value: number): void; /** To set PointerHeight + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge + * @param {number} for Gauge * @returns {void} */ - setPointerHeight(): void; + setPointerHeight(scaleIndex: number, pointerIndex: number, height: number): void; /** To set setPointerPlacement + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge + * @param {number} pointer placement for Gauge * @returns {void} */ - setPointerPlacement(): void; + setPointerPlacement(scaleIndex: number, pointerIndex: number, value: number): void; /** To set PointerValue + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge + * @param {number} Pointer value for Gauge * @returns {void} */ - setPointerValue(): void; + setPointerValue(scaleIndex: number, pointerIndex: number, value: number): void; /** To set PointerWidth + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge + * @param {number} Pointer width for Gauge * @returns {void} */ - setPointerWidth(): void; + setPointerWidth(scaleIndex: number, pointerIndex: number, width: number): void; /** To set setRangeBorderWidth + * @param {number} scaleIndex value for the Gauge + * @param {number} rangeIndex value for the Gauge + * @param {number} Range Border Width for Gauge * @returns {void} */ - setRangeBorderWidth(): void; + setRangeBorderWidth(scaleIndex: number, rangeIndex: number, value: number): void; /** To set setRangeDistanceFromScale + * @param {number} scaleIndex value for the Gauge + * @param {number} rangeIndex value for the Gauge + * @param {number} Range Distance FromScale for Gauge * @returns {void} */ - setRangeDistanceFromScale(): void; + setRangeDistanceFromScale(scaleIndex: number, rangeIndex: number, value: number): void; /** To set setRangeEndValue + * @param {number} scaleIndex value for the Gauge + * @param {number} rangeIndex value for the Gauge + * @param {number} Range end value for Gauge * @returns {void} */ - setRangeEndValue(): void; + setRangeEndValue(scaleIndex: number, rangeIndex: number, value: number): void; /** To set setRangeEndWidth + * @param {number} scaleIndex value for the Gauge + * @param {number} rangeIndex value for the Gauge + * @param {number} Range End Width for Gauge * @returns {void} */ - setRangeEndWidth(): void; + setRangeEndWidth(scaleIndex: number, rangeIndex: number, value: number): void; /** To set setRangePosition + * @param {number} scaleIndex value for the Gauge + * @param {number} rangeIndex value for the Gauge + * @param {number} Range Position for Gauge * @returns {void} */ - setRangePosition(): void; + setRangePosition(scaleIndex: number, rangeIndex: number, value: number): void; /** To set setRangeStartValue + * @param {number} scaleIndex value for the Gauge + * @param {number} rangeIndex value for the Gauge + * @param {number} range start value for Gauge * @returns {void} */ - setRangeStartValue(): void; + setRangeStartValue(scaleIndex: number, rangeIndex: number, value: number): void; /** To set setRangeStartWidth + * @param {number} scaleIndex value for the Gauge + * @param {number} rangeIndex value for the Gauge + * @param {number} Range Start Width for Gauge * @returns {void} */ - setRangeStartWidth(): void; + setRangeStartWidth(scaleIndex: number, rangeIndex: number, value: number): void; /** To set setScaleBarLength + * @param {number} scaleIndex value for the Gauge + * @param {number} Scale Bar Length for Gauge * @returns {void} */ - setScaleBarLength(): void; + setScaleBarLength(scaleIndex: number, value: number): void; /** To set setScaleBarSize + * @param {number} scaleIndex value for the Gauge + * @param {number} ScaleBarSize for Gauge * @returns {void} */ - setScaleBarSize(): void; + setScaleBarSize(scaleIndex: number, value: number): void; /** To set setScaleBorderWidth + * @param {number} scaleIndex value for the Gauge + * @param {number} Scale Border Width for Gauge * @returns {void} */ - setScaleBorderWidth(): void; + setScaleBorderWidth(scaleIndex: number, value: number): void; /** To set setScaleDirection + * @param {number} scaleIndex value for the Gauge + * @param {number} Scale Direction for Gauge * @returns {void} */ - setScaleDirection(): void; + setScaleDirection(scaleIndex: number, value: number): void; /** To set setScaleLocation + * @param {number} scaleIndex value for the Gauge + * @param {any} Scale position for Gauge * @returns {void} */ - setScaleLocation(): void; + setScaleLocation(scaleIndex: number, value: any): void; /** To set setScaleStyle + * @param {number} scaleIndex value for the Gauge + * @param {number} for Gauge * @returns {void} */ - setScaleStyle(): void; + setScaleStyle(scaleIndex: number, value: number): void; /** To set setTickAngle + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge + * @param {number} Tick Angle for Gauge * @returns {void} */ - setTickAngle(): void; + setTickAngle(scaleIndex: number, tickIndex: number, angle: number): void; /** To set setTickHeight + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge + * @param {number} Tick Height for Gauge * @returns {void} */ - setTickHeight(): void; + setTickHeight(scaleIndex: number, tickIndex: number, value: number): void; /** To set setTickPlacement + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge + * @param {number} Tick Placement for Gauge * @returns {void} */ - setTickPlacement(): void; + setTickPlacement(scaleIndex: number, tickIndex: number, value: number): void; /** To set setTickStyle + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge + * @param {string} Tick Style for Gauge * @returns {void} */ - setTickStyle(): void; + setTickStyle(scaleIndex: number, tickIndex: number, value: string): void; /** To set setTickWidth + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge + * @param {number} Tick Width for Gauge * @returns {void} */ - setTickWidth(): void; + setTickWidth(scaleIndex: number, tickIndex: number, value: number): void; /** To set setTickXDistanceFromScale + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge + * @param {number} Tick XDistance From Scale for Gauge * @returns {void} */ - setTickXDistanceFromScale(): void; + setTickXDistanceFromScale(scaleIndex: number, tickIndex: number, value: number): void; /** To set setTickYDistanceFromScale + * @param {number} scaleIndex value for the Gauge + * @param {number} value for the Gauge + * @param {number} Tick YDistance From Scale for Gauge * @returns {void} */ - setTickYDistanceFromScale(): void; + setTickYDistanceFromScale(scaleIndex: number, tickIndex: number, value: number): void; } export namespace LinearGauge { @@ -47833,419 +48353,601 @@ declare namespace ej.datavisualization { destroy(): void; /** To export Image + * @param {string} fileName for the Image + * @param {string} fileType for the Image * @returns {boolean} */ - exportImage(): boolean; + exportImage(fileName: string, fileType: string): boolean; /** To get BackNeedleLength + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge * @returns {any} */ - getBackNeedleLength(): any; + getBackNeedleLength(scaleIndex: number, pointerIndex: number): any; /** To get CustomLabelAngle + * @param {number} scaleIndex value for the Gauge + * @param {number} customLabelIndex value for the Gauge * @returns {any} */ - getCustomLabelAngle(): any; + getCustomLabelAngle(scaleIndex: number, customLabelIndex: number): any; /** To get CustomLabelValue + * @param {number} scaleIndex value for the Gauge + * @param {number} customLabelIndex value for the Gauge * @returns {any} */ - getCustomLabelValue(): any; + getCustomLabelValue(scaleIndex: number, customLabelIndex: number): any; /** To get LabelAngle + * @param {number} scaleIndex value for the Gauge + * @param {number} labelIndex value for the Gauge * @returns {any} */ - getLabelAngle(): any; + getLabelAngle(scaleIndex: number, labelIndex: number): any; /** To get LabelDistanceFromScale + * @param {number} scaleIndex value for the Gauge + * @param {number} labelIndex value for the Gauge * @returns {any} */ - getLabelDistanceFromScale(): any; + getLabelDistanceFromScale(scaleIndex: number, labelIndex: number): any; /** To get LabelPlacement + * @param {number} scaleIndex value for the Gauge + * @param {number} labelIndex value for the Gauge * @returns {any} */ - getLabelPlacement(): any; + getLabelPlacement(scaleIndex: number, labelIndex: number): any; /** To get LabelStyle + * @param {number} scaleIndex value for the Gauge + * @param {number} labelIndex value for the Gauge * @returns {any} */ - getLabelStyle(): any; + getLabelStyle(scaleIndex: number, labelIndex: number): any; /** To get MajorIntervalValue + * @param {number} scaleIndex value for the Gauge * @returns {any} */ - getMajorIntervalValue(): any; + getMajorIntervalValue(scaleIndex: number): any; /** To get MarkerDistanceFromScale + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge * @returns {any} */ - getMarkerDistanceFromScale(): any; + getMarkerDistanceFromScale(scaleIndex: number, pointerIndex: number): any; /** To get MarkerStyle + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge * @returns {any} */ - getMarkerStyle(): any; + getMarkerStyle(scaleIndex: number, pointerIndex: number): any; /** To get MaximumValue + * @param {number} scaleIndex value for the Gauge * @returns {any} */ - getMaximumValue(): any; + getMaximumValue(scaleIndex: number): any; /** To get MinimumValue + * @param {number} scaleIndex value for the Gauge * @returns {any} */ - getMinimumValue(): any; + getMinimumValue(scaleIndex: number): any; /** To get MinorIntervalValue + * @param {number} scaleIndex value for the Gauge * @returns {any} */ - getMinorIntervalValue(): any; + getMinorIntervalValue(scaleIndex: number): any; /** To get NeedleStyle + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge * @returns {any} */ - getNeedleStyle(): any; + getNeedleStyle(scaleIndex: number, pointerIndex: number): any; /** To get PointerCapBorderWidth + * @param {number} scaleIndex value for the Gauge * @returns {any} */ - getPointerCapBorderWidth(): any; + getPointerCapBorderWidth(scaleIndex: number): any; /** To get PointerCapRadius + * @param {number} scaleIndex value for the Gauge * @returns {any} */ - getPointerCapRadius(): any; + getPointerCapRadius(scaleIndex: number): any; /** To get PointerLength + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge * @returns {any} */ - getPointerLength(): any; + getPointerLength(scaleIndex: number, pointerIndex: number): any; /** To get PointerNeedleType + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge * @returns {any} */ - getPointerNeedleType(): any; + getPointerNeedleType(scaleIndex: number, pointerIndex: number): any; /** To get PointerPlacement + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge * @returns {any} */ - getPointerPlacement(): any; + getPointerPlacement(scaleIndex: number, pointerIndex: number): any; /** To get PointerValue + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge * @returns {any} */ - getPointerValue(): any; + getPointerValue(scaleIndex: number, pointerIndex: number): any; /** To get PointerWidth + * @param {number} scaleIndex value for the Gauge + * @param {number} pointerIndex value for the Gauge * @returns {any} */ - getPointerWidth(): any; + getPointerWidth(scaleIndex: number, pointerIndex: number): any; /** To get RangeBorderWidth + * @param {number} scaleIndex value for the Gauge + * @param {number} rangeIndex value for the Gauge * @returns {any} */ - getRangeBorderWidth(): any; + getRangeBorderWidth(scaleIndex: number, rangeIndex: number): any; /** To get RangeDistanceFromScale + * @param {number} scaleIndex value for the Gauge + * @param {number} rangeIndex value for the Gauge * @returns {any} */ - getRangeDistanceFromScale(): any; + getRangeDistanceFromScale(scaleIndex: number, rangeIndex: number): any; /** To get RangeEndValue + * @param {number} scaleIndex value for the Gauge + * @param {number} rangeIndex value for the Gauge * @returns {any} */ - getRangeEndValue(): any; + getRangeEndValue(scaleIndex: number, rangeIndex: number): any; /** To get RangePosition + * @param {number} scaleIndex value for the Gauge + * @param {number} rangeIndex value for the Gauge * @returns {any} */ - getRangePosition(): any; + getRangePosition(scaleIndex: number, rangeIndex: number): any; /** To get RangeSize + * @param {number} scaleIndex value for the Gauge + * @param {number} rangeIndex value for the Gauge * @returns {any} */ - getRangeSize(): any; + getRangeSize(scaleIndex: number, rangeIndex: number): any; /** To get RangeStartValue + * @param {number} scaleIndex value for the Gauge + * @param {number} rangeIndex value for the Gauge * @returns {any} */ - getRangeStartValue(): any; + getRangeStartValue(scaleIndex: number, rangeIndex: number): any; /** To get ScaleBarSize + * @param {number} scaleIndex value for the Gauge * @returns {any} */ - getScaleBarSize(): any; + getScaleBarSize(scaleIndex: number): any; /** To get ScaleBorderWidth + * @param {number} scaleIndex value for the Gauge * @returns {any} */ - getScaleBorderWidth(): any; + getScaleBorderWidth(scaleIndex: number): any; /** To get ScaleDirection + * @param {number} scaleIndex value for the Gauge * @returns {any} */ - getScaleDirection(): any; + getScaleDirection(scaleIndex: number): any; /** To get ScaleRadius + * @param {number} scaleIndex value for the Gauge * @returns {any} */ - getScaleRadius(): any; + getScaleRadius(scaleIndex: number): any; /** To get StartAngle + * @param {number} scaleIndex value for the Gauge * @returns {any} */ - getStartAngle(): any; + getStartAngle(scaleIndex: number): any; /** To get SubGaugeLocation + * @param {number} scaleIndex value for the Gauge + * @param {number} GaugeIndex value for the Gauge * @returns {any} */ - getSubGaugeLocation(): any; + getSubGaugeLocation(scaleIndex: number, GaugeIndex: number): any; /** To get SweepAngle + * @param {number} scaleIndex value for the Gauge * @returns {any} */ - getSweepAngle(): any; + getSweepAngle(scaleIndex: number): any; /** To get TickAngle + * @param {number} scaleIndex value for the Gauge + * @param {number} tickIndex value for the Gauge * @returns {any} */ - getTickAngle(): any; + getTickAngle(scaleIndex: number, tickIndex: number): any; /** To get TickDistanceFromScale + * @param {number} scaleIndex value for the Gauge + * @param {number} tickIndex value for the Gauge * @returns {any} */ - getTickDistanceFromScale(): any; + getTickDistanceFromScale(scaleIndex: number, tickIndex: number): any; /** To get TickHeight + * @param {number} scaleIndex value for the Gauge + * @param {number} labelIndex value for the Gauge * @returns {any} */ - getTickHeight(): any; + getTickHeight(scaleIndex: number, labelIndex: number): any; /** To get TickPlacement + * @param {number} scaleIndex value for the Gauge + * @param {number} tickIndex value for the Gauge * @returns {any} */ - getTickPlacement(): any; + getTickPlacement(scaleIndex: number, tickIndex: number): any; /** To get TickStyle + * @param {number} scaleIndex value for the Gauge + * @param {number} tickIndex value for the Gauge * @returns {any} */ - getTickStyle(): any; + getTickStyle(scaleIndex: number, tickIndex: number): any; /** To get TickWidth + * @param {number} scaleIndex value for the Gauge + * @param {number} tickIndex value for the Gauge * @returns {any} */ - getTickWidth(): any; + getTickWidth(scaleIndex: number, tickIndex: number): any; /** To set includeFirstValue + * @param {number} scaleIndex value for the gauge + * @param {number} labelIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - includeFirstValue(): void; + includeFirstValue(scaleIndex: number, labelIndex: number, value: number): void; /** Switching the redraw option for the gauge + * @param {string} redraw value for the gauge * @returns {void} */ - redraw(): void; + redraw(value: string): void; /** To set BackNeedleLength + * @param {number} scaleIndex value for the gauge + * @param {number} pointerIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setBackNeedleLength(): void; + setBackNeedleLength(scaleIndex: number, pointerIndex: number, value: number): void; /** To set CustomLabelAngle + * @param {number} scaleIndex value for the gauge + * @param {number} customLabelIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setCustomLabelAngle(): void; + setCustomLabelAngle(scaleIndex: number, customLabelIndex: number, value: number): void; /** To set CustomLabelValue + * @param {number} scaleIndex value for the gauge + * @param {number} customLabelIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setCustomLabelValue(): void; + setCustomLabelValue(scaleIndex: number, customLabelIndex: number, value: number): void; /** To set LabelAngle + * @param {number} scaleIndex value for the gauge + * @param {number} labelIndex value for the gauge + * @param {number} angle value for the gauge * @returns {void} */ - setLabelAngle(): void; + setLabelAngle(scaleIndex: number, labelIndex: number, angle: number): void; /** To set LabelDistanceFromScale + * @param {number} scaleIndex value for the gauge + * @param {number} labelIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setLabelDistanceFromScale(): void; + setLabelDistanceFromScale(scaleIndex: number, labelIndex: number, value: number): void; /** To set LabelPlacement + * @param {number} scaleIndex value for the gauge + * @param {number} labelIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setLabelPlacement(): void; + setLabelPlacement(scaleIndex: number, labelIndex: number, value: number): void; /** To set LabelStyle + * @param {number} scaleIndex value for the gauge + * @param {number} labelIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setLabelStyle(): void; + setLabelStyle(scaleIndex: number, labelIndex: number, value: number): void; /** To set MajorIntervalValue + * @param {number} scaleIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setMajorIntervalValue(): void; + setMajorIntervalValue(scaleIndex: number, value: number): void; /** To set MarkerDistanceFromScale + * @param {number} scaleIndex value for the gauge + * @param {number} pointerIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setMarkerDistanceFromScale(): void; + setMarkerDistanceFromScale(scaleIndex: number, pointerIndex: number, value: number): void; /** To set MarkerStyle + * @param {number} scaleIndex value for the gauge + * @param {number} pointerIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setMarkerStyle(): void; + setMarkerStyle(scaleIndex: number, pointerIndex: number, value: number): void; /** To set MaximumValue + * @param {number} scaleIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setMaximumValue(): void; + setMaximumValue(scaleIndex: number, value: number): void; /** To set MinimumValue + * @param {number} scaleIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setMinimumValue(): void; + setMinimumValue(scaleIndex: number, value: number): void; /** To set MinorIntervalValue + * @param {number} scaleIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setMinorIntervalValue(): void; + setMinorIntervalValue(scaleIndex: number, value: number): void; /** To set NeedleStyle + * @param {number} scaleIndex value for the gauge + * @param {number} pointerIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setNeedleStyle(): void; + setNeedleStyle(scaleIndex: number, pointerIndex: number, value: number): void; /** To set PointerCapBorderWidth + * @param {number} scaleIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setPointerCapBorderWidth(): void; + setPointerCapBorderWidth(scaleIndex: number, value: number): void; /** To set PointerCapRadius + * @param {number} scaleIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setPointerCapRadius(): void; + setPointerCapRadius(scaleIndex: number, value: number): void; /** To set PointerLength + * @param {number} scaleIndex value for the gauge + * @param {number} pointerIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setPointerLength(): void; + setPointerLength(scaleIndex: number, pointerIndex: number, value: number): void; /** To set PointerNeedleType + * @param {number} scaleIndex value for the gauge + * @param {number} pointerIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setPointerNeedleType(): void; + setPointerNeedleType(scaleIndex: number, pointerIndex: number, value: number): void; /** To set PointerPlacement + * @param {number} scaleIndex value for the gauge + * @param {number} pointerIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setPointerPlacement(): void; + setPointerPlacement(scaleIndex: number, pointerIndex: number, value: number): void; /** To set PointerValue + * @param {number} scaleIndex value for the gauge + * @param {number} pointerIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setPointerValue(): void; + setPointerValue(scaleIndex: number, pointerIndex: number, value: number): void; /** To set PointerWidth + * @param {number} scaleIndex value for the gauge + * @param {number} pointerIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setPointerWidth(): void; + setPointerWidth(scaleIndex: number, pointerIndex: number, value: number): void; /** To set RangeBorderWidth + * @param {number} scaleIndex value for the gauge + * @param {number} rangeIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setRangeBorderWidth(): void; + setRangeBorderWidth(scaleIndex: number, rangeIndex: number, value: number): void; /** To set RangeDistanceFromScale + * @param {number} scaleIndex value for the gauge + * @param {number} rangeIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setRangeDistanceFromScale(): void; + setRangeDistanceFromScale(scaleIndex: number, rangeIndex: number, value: number): void; /** To set RangeEndValue + * @param {number} scaleIndex value for the gauge + * @param {number} rangeIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setRangeEndValue(): void; + setRangeEndValue(scaleIndex: number, rangeIndex: number, value: number): void; /** To set RangePosition + * @param {number} scaleIndex value for the gauge + * @param {number} rangeIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setRangePosition(): void; + setRangePosition(scaleIndex: number, rangeIndex: number, value: number): void; /** To set RangeSize + * @param {number} scaleIndex value for the gauge + * @param {number} rangeIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setRangeSize(): void; + setRangeSize(scaleIndex: number, rangeIndex: number, value: number): void; /** To set RangeStartValue + * @param {number} scaleIndex value for the gauge + * @param {number} rangeIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setRangeStartValue(): void; + setRangeStartValue(scaleIndex: number, rangeIndex: number, value: number): void; /** To set ScaleBarSize + * @param {number} scaleIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setScaleBarSize(): void; + setScaleBarSize(scaleIndex: number, value: number): void; /** To set ScaleBorderWidth + * @param {number} scaleIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setScaleBorderWidth(): void; + setScaleBorderWidth(scaleIndex: number, value: number): void; /** To set ScaleDirection + * @param {number} scaleIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setScaleDirection(): void; + setScaleDirection(scaleIndex: number, value: number): void; /** To set ScaleRadius + * @param {number} scaleIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setScaleRadius(): void; + setScaleRadius(scaleIndex: number, value: number): void; /** To set StartAngle + * @param {number} scaleIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setStartAngle(): void; + setStartAngle(scaleIndex: number, value: number): void; /** To set SubGaugeLocation + * @param {number} scaleIndex value for the gauge + * @param {number} GaugeIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setSubGaugeLocation(): void; + setSubGaugeLocation(scaleIndex: number, GaugeIndex: number, value: number): void; /** To set SweepAngle + * @param {number} scaleIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setSweepAngle(): void; + setSweepAngle(scaleIndex: number, value: number): void; /** To set TickAngle + * @param {number} scaleIndex value for the gauge + * @param {number} tickIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setTickAngle(): void; + setTickAngle(scaleIndex: number, tickIndex: number, value: number): void; /** To set TickDistanceFromScale + * @param {number} scaleIndex value for the gauge + * @param {number} tickIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setTickDistanceFromScale(): void; + setTickDistanceFromScale(scaleIndex: number, tickIndex: number, value: number): void; /** To set TickHeight + * @param {number} scaleIndex value for the gauge + * @param {number} tickIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setTickHeight(): void; + setTickHeight(scaleIndex: number, tickIndex: number, value: number): void; /** To set TickPlacement + * @param {number} scaleIndex value for the gauge + * @param {number} tickIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setTickPlacement(): void; + setTickPlacement(scaleIndex: number, tickIndex: number, value: number): void; /** To set TickStyle + * @param {number} scaleIndex value for the gauge + * @param {number} tickIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setTickStyle(): void; + setTickStyle(scaleIndex: number, tickIndex: number, value: number): void; /** To set TickWidth + * @param {number} scaleIndex value for the gauge + * @param {number} tickIndex value for the gauge + * @param {number} value for the gauge * @returns {void} */ - setTickWidth(): void; + setTickWidth(scaleIndex: number, tickIndex: number, value: number): void; } export namespace CircularGauge { @@ -50694,7 +51396,7 @@ declare namespace ej.datavisualization { /** Options to customize the left, right, top and bottom margins of chart area. */ - Margin?: any; + margin?: Margin; /** Perspective angle of the 3D view. Chart appears closer when perspective angle is decreased, and distant when perspective angle is increased.This property is applicable only when * 3D view is enabled @@ -52245,6 +52947,11 @@ declare namespace ej.datavisualization { */ enableContrastColor?: boolean; + /** Displays the partially visible labels inside the chart Area + * @Default {false} + */ + showEdgeLabels?: boolean; + /** Options for customizing the border of the data label. */ border?: CommonSeriesOptionsMarkerDataLabelBorder; @@ -53790,6 +54497,29 @@ declare namespace ej.datavisualization { toggleSeriesVisibility?: boolean; } + export interface Margin { + + /** Spacing for the left margin of chart area. Setting positive value decreases the width of the chart area from left side. + * @Default {10} + */ + left?: number; + + /** Spacing for the right margin of chart area. Setting positive value decreases the width of the chart area from right side. + * @Default {10} + */ + right?: number; + + /** Spacing for the top margin of chart area. Setting positive value decreases the height of the chart area from the top. + * @Default {10} + */ + top?: number; + + /** Spacing for the bottom margin of the chart area. Setting positive value decreases the height of the chart area from the bottom. + * @Default {10} + */ + bottom?: number; + } + export interface PrimaryXAxisAlternateGridBandEven { /** Fill color for the even grid bands. @@ -56217,6 +56947,11 @@ declare namespace ej.datavisualization { */ enableContrastColor?: boolean; + /** Displays the partially visible data labels inside the chart Area. + * @Default {false} + */ + showEdgeLabels?: boolean; + /** Options for customizing the border of the data label. */ border?: SeriesMarkerDataLabelBorder; @@ -59604,14 +60339,18 @@ declare namespace ej.datavisualization { redraw(): void; /** To set the value for comparative measure in bullet graph. + * @param {number} value for the graph + * @param {number} value for the graph * @returns {void} */ - setComparativeMeasureSymbol(): void; + setComparativeMeasureSymbol(index: number, measure: number): void; /** To set the value for feature measure bar. + * @param {number} value for the graph + * @param {number} value for the graph * @returns {void} */ - setFeatureMeasureBarValue(): void; + setFeatureMeasureBarValue(index: number, measure: number): void; } export namespace BulletGraph { @@ -62830,6 +63569,13 @@ declare namespace ej.datavisualization { */ exportDiagram(options?: Diagram.Options): string; + /** The exportImage method is used to export the image passed through argument with different image format and exporting options as like exportDiagram method. + * @param {string} pass the base64String image to be exported. + * @param {Diagram.Options} options to export the desired region of diagram to the desired formats. + * @returns {string} + */ + exportImage(image: string, options?: Diagram.Options): string; + /** Read a node/connector object by its name * @param {string} name of the node/connector that is to be identified * @returns {any} @@ -62844,6 +63590,18 @@ declare namespace ej.datavisualization { */ fitToPage(mode?: ej.datavisualization.Diagram.FitMode, region?: ej.datavisualization.Diagram.Region, margin?: any): void; + /** Get the diagram DOM element as a string along with dependent stylesheets. + * @param {any[]} If its specified, will get the diagram DOM element along with specified stylesheet references. Please note that you have to define absolute path for local CSS file. + * If not specified, will get the diagram content along with all stylesheets loaded in the document. + * @returns {void} + */ + getDiagramContent(styleSheets?: any[]): void; + + /** Get the bounds of the diagram. + * @returns {void} + */ + getDiagramBounds(): void; + /** Group the selected nodes and connectors * @returns {void} */ @@ -62888,9 +63646,17 @@ declare namespace ej.datavisualization { paste(object?: any, rename?: boolean): void; /** Print the diagram as image + * @param {Diagram.Options} options to print the desired region of diagram and print the diagram in multiple pages. * @returns {void} */ - print(): void; + print(options?: Diagram.Options): void; + + /** The printImage method is used to print the image passed through argument with desired region and multiple pages as like print method. + * @param {string} pass the base64String image to be printed. + * @param {Diagram.Options} options to export the desired region of diagram to the desired formats. + * @returns {string} + */ + printImage(image: string, options?: Diagram.Options): string; /** Restore the last action that was reverted * @returns {void} @@ -63098,6 +63864,119 @@ declare namespace ej.datavisualization { /** to resize the diagram content to fill its allocated space. */ stretch?: ej.datavisualization.Diagram.Stretch; + + /** to export the diagram into multiple pages + */ + multiplePage?: boolean; + + /** to set the page width of the diagram while exporting the diagram into multiple pages. + */ + pageWidth?: number; + + /** to set the page height of the diagram while exporting the diagram into multiple pages. + */ + pageHeight?: number; + + /** to sets the orientation of the page. + */ + pageOrientation?: ej.datavisualization.Diagram.PageOrientations; + } + + export interface Options { + + /** name of the file to be downloaded. + */ + fileName?: string; + + /** format of the exported file/data. + */ + format?: ej.datavisualization.Diagram.FileFormats; + + /** to set the region of the diagram to be exported. + */ + region?: ej.datavisualization.Diagram.Region; + + /** to export any custom region of diagram. + */ + bounds?: any; + + /** to set margin to the exported data. + */ + margin?: any; + + /** to export the diagram into multiple pages + */ + multiplePage?: boolean; + + /** to set the page width of the diagram while exporting the diagram into multiple pages. + */ + pageWidth?: number; + + /** to set the page height of the diagram while exporting the diagram into multiple pages. + */ + pageHeight?: number; + + /** to sets the orientation of the page. + */ + pageOrientation?: ej.datavisualization.Diagram.PageOrientations; + } + + export interface Options { + + /** to set the region of the diagram to be printed. + */ + region?: ej.datavisualization.Diagram.Region; + + /** to print any custom region of diagram. + */ + bounds?: any; + + /** to resize the diagram content to fill its allocated space and printed. + */ + stretch?: ej.datavisualization.Diagram.Stretch; + + /** to print the diagram into multiple pages + */ + multiplePage?: boolean; + + /** to set the page width of the diagram while printing the diagram into multiple pages. + */ + pageWidth?: number; + + /** to set the page height of the diagram while printing the diagram into multiple pages. + */ + pageHeight?: number; + + /** to sets the orientation of the page. + */ + pageOrientation?: ej.datavisualization.Diagram.PageOrientations; + } + + export interface Options { + + /** to set the region of the diagram to be printed. + */ + region?: ej.datavisualization.Diagram.Region; + + /** to print any custom region of diagram. + */ + bounds?: any; + + /** to export the diagram into multiple pages + */ + multiplePage?: boolean; + + /** to set the page width of the diagram while printing the diagram into multiple pages. + */ + pageWidth?: number; + + /** to set the page height of the diagram while printing the diagram into multiple pages. + */ + pageHeight?: number; + + /** to sets the orientation of the page. + */ + pageOrientation?: ej.datavisualization.Diagram.PageOrientations; } export interface Zoom { @@ -63228,6 +64107,10 @@ declare namespace ej.datavisualization { */ showTooltip?: boolean; + /** Defines diagram serialization properties that would defines how the serialization content would be. + */ + serializationSettings?: SerializationSettings; + /** Defines the properties of the both the horizontal and vertical gauge to measure the diagram area. */ rulerSettings?: RulerSettings; @@ -63375,6 +64258,10 @@ declare namespace ej.datavisualization { /** Triggered when the diagram is rendered completely. */ create?(e: CreateEventArgs): void; + + /** Used to decide on the action on Diagramming elements at runtime. + */ + setTool?(e: SetToolEventArgs): void; } export interface AutoScrollChangeEventArgs { @@ -64144,6 +65031,17 @@ declare namespace ej.datavisualization { diagramId?: string; } + export interface SetToolEventArgs { + + /** Returns the port when mouse move over on it + */ + source?: any; + + /** Defines the tool to be activated. + */ + action?: ej.datavisualization.Diagram.ActiveTool; + } + export interface BackgroundImage { /** Defines how to align the background image over the diagram area. @@ -64266,6 +65164,11 @@ declare namespace ej.datavisualization { */ boundaryConstraints?: boolean; + /** Enables or disables the default behaviors of the label. + * @Default {ej.datavisualization.Diagram.LabelConstraints.None} + */ + constraints?: ej.datavisualization.Diagram.LabelConstraints|string; + /** Sets the fill color of the text area * @Default {transparent} */ @@ -64286,6 +65189,11 @@ declare namespace ej.datavisualization { */ fontSize?: number; + /** Sets the height of the label(the maximum value of label height and the connector height will be considered as label height) + * @Default {0} + */ + height?: number; + /** Sets the horizontal alignment of the label. * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Center} */ @@ -65068,6 +65976,21 @@ declare namespace ej.datavisualization { * @Default {30} */ root?: string; + + /** Defines how long edges should be, ideally. This will be the resting length for the springs. + * @Default {100} + */ + springLength?: number; + + /** Defines how long edges should be, ideally. This will be the resting length for the springs. + * @Default {0.442} + */ + springFactor?: number; + + /** Defines how long edges should be, ideally. This will be the resting length for the springs. + * @Default {1000} + */ + maxIteration?: number; } export interface NodesAnnotation { @@ -65291,11 +66214,6 @@ declare namespace ej.datavisualization { */ stops?: any[]; - /** Defines the type of gradient - * @Default {linear} - */ - type?: string; - /** Defines the left most position(relative to node) of the rectangular region that needs to be painted * @Default {0} */ @@ -65319,11 +66237,6 @@ declare namespace ej.datavisualization { export interface NodesGradientRadialGradient { - /** Defines the type of gradient - * @Default {radial} - */ - type?: string; - /** Defines the position of the outermost circle * @Default {0} */ @@ -65438,6 +66351,11 @@ declare namespace ej.datavisualization { */ borderWidth?: number; + /** Enables or disables the default behaviors of the label. + * @Default {ej.datavisualization.Diagram.LabelConstraints.None} + */ + constraints?: ej.datavisualization.Diagram.LabelConstraints|string; + /** Sets the fill color of the text area * @Default {transparent} */ @@ -65458,6 +66376,11 @@ declare namespace ej.datavisualization { */ fontSize?: number; + /** Sets the height of the label(the maximum value of label height and the node height will be considered as label height) + * @Default {0} + */ + height?: number; + /** Sets the horizontal alignment of the label. * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Center} */ @@ -65733,6 +66656,10 @@ declare namespace ej.datavisualization { * @Default {ej.datavisualization.Diagram.PortVisibility.Default} */ visibility?: ej.datavisualization.Diagram.PortVisibility|string; + + /** Sets the name of the node which contains this port. + */ + parent?: string; } export interface NodesShadow { @@ -65753,6 +66680,38 @@ declare namespace ej.datavisualization { opacity?: number; } + export interface NodesSubProcessEvent { + + /** Sets the type of the event by which the sub-process will be triggered + * @Default {ej.datavisualization.Diagram.BPMNEvents.Start} + */ + event?: ej.datavisualization.Diagram.BPMNEvents|string; + + /** Sets the fraction/ratio(relative to parent) that defines the position of the event shape + * @Default {ej.datavisualization.Diagram.Point(0.5, 0.5)} + */ + offset?: any; + + /** Sets the name of the BPMN event shape. + */ + name?: string; + + /** Defines the type of the event trigger + * @Default {ej.datavisualization.Diagram.BPMNTriggers.Message} + */ + trigger?: ej.datavisualization.Diagram.BPMNTriggers|string; + + /** An array of objects where each object represents a port + * @Default {[]} + */ + ports?: any[]; + + /** A collection of objects where each object represents a label + * @Default {[]} + */ + labels?: any[]; + } + export interface NodesSubProcess { /** Defines whether the BPMN sub process is without any prescribed order or not @@ -65782,7 +66741,7 @@ declare namespace ej.datavisualization { /** Defines the collection of events that need to be appended with BPMN Sub-Process */ - events?: any[]; + events?: NodesSubProcessEvent[]; /** Defines the loop type of a sub process. * @Default {ej.datavisualization.Diagram.BPMNLoops.None} @@ -65826,6 +66785,10 @@ declare namespace ej.datavisualization { * @Default {ej.datavisualization.Diagram.BPMNTasks.None} */ type?: ej.datavisualization.Diagram.BPMNTasks|string; + + /** Defines the collection of events that need to be appended with BPMN tasks + */ + events?: any[]; } export interface Node { @@ -66299,6 +67262,16 @@ declare namespace ej.datavisualization { export interface SelectedItemsUserHandle { + /** Sets the horizontal alignment of the user handle + * @Default {ej.datavisualization.Diagram.HorizontalAlignment.Center} + */ + horizontalAlignment?: ej.datavisualization.Diagram.HorizontalAlignment|string; + + /** To set the margin of the user handle + * @Default {ej.datavisualization.Diagram.Margin()} + */ + margin?: any; + /** Defines the name of the user handle */ name?: string; @@ -66318,6 +67291,11 @@ declare namespace ej.datavisualization { */ enableMultiSelection?: boolean; + /** Sets the fraction/ratio(relative to node) that defines the position of the user handle + * @Default {ej.datavisualization.Diagram.point(0.5, 1)} + */ + offset?: any; + /** Sets the stroke color of the user handle * @Default {transparent} */ @@ -66341,6 +67319,11 @@ declare namespace ej.datavisualization { */ tool?: any; + /** Sets the vertical alignment of the user handle + * @Default {ej.datavisualization.Diagram.VerticalAlignment.Center} + */ + verticalAlignment?: ej.datavisualization.Diagram.VerticalAlignment|string; + /** Defines the visibility of the user handle * @Default {true} */ @@ -66400,6 +67383,14 @@ declare namespace ej.datavisualization { width?: number; } + export interface SerializationSettings { + + /** defines whether the default diagram properties can be serialized or not. + * @Default {false} + */ + preventDefaultValues?: boolean; + } + export interface RulerSettingsHorizontalRuler { /** Defines the number of intervals to be present on the each segment of the horizontal ruler. @@ -66776,6 +67767,8 @@ declare namespace ej.datavisualization { InheritCrispEdges, //Enables the contrast between clean edges of connector over rendering speed and geometric precision DragLimit, + //Enables or disables bridging over a connector, if bridging constraints disabled.. + BridgeObstacle, //Enables connector to be selected and dragged. Interaction, //Enables all constraints @@ -66802,6 +67795,22 @@ declare namespace ej.datavisualization { After, } } + namespace Diagram { + enum LabelConstraints { + //Disable all label Constraints + None, + //Enables label to be selected + Selectable, + //Enables label to be Dragged + Draggable, + //Enables label to be Resized + Resizable, + //Enables label to be Rotated + Rotatable, + //Enables all label constraints + All, + } + } namespace Diagram { enum LabelRelativeMode { //Sets the relativeMode as SegmentPath @@ -67645,6 +68654,16 @@ declare namespace ej.datavisualization { ZoomOut, } } + namespace Diagram { + enum ActiveTool { + //Set the default Tool + None, + //Activate the port tool to drag when the mouse is moved over the port + Drag, + //Activate the draw tool to draw when the mouse is moved over the port + Draw, + } + } class HeatMap extends ej.Widget { static fn: HeatMap; diff --git a/types/ej.web.all/tslint.json b/types/ej.web.all/tslint.json index d396efe0bf..36e60efe0b 100644 --- a/types/ej.web.all/tslint.json +++ b/types/ej.web.all/tslint.json @@ -3,10 +3,13 @@ "rules": { // All are TODOs "comment-format": false, + "jsdoc-format": false, "no-consecutive-blank-lines": false, "no-mergeable-namespace": false, "no-padding": false, "no-any-union": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, "no-unnecessary-generics": false, "no-unnecessary-qualifier": false, "strict-export-declare-modifiers": false diff --git a/types/ejs-locals/index.d.ts b/types/ejs-locals/index.d.ts index 6398ee199f..5ddb36fea3 100644 --- a/types/ejs-locals/index.d.ts +++ b/types/ejs-locals/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/randometc/ejs-locals // Definitions by: jt000 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 diff --git a/types/ejs-locals/tslint.json b/types/ejs-locals/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/ejs-locals/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/ejs/tslint.json b/types/ejs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/ejs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/ejson/tslint.json b/types/ejson/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/ejson/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/elastic.js/tslint.json b/types/elastic.js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/elastic.js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/elasticsearch/tslint.json b/types/elasticsearch/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/elasticsearch/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/electron-debug/tslint.json b/types/electron-debug/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/electron-debug/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/electron-devtools-installer/tslint.json b/types/electron-devtools-installer/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/electron-devtools-installer/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/electron-json-storage/electron-json-storage-tests.ts b/types/electron-json-storage/electron-json-storage-tests.ts index 07d8461bed..2429f6a95f 100644 --- a/types/electron-json-storage/electron-json-storage-tests.ts +++ b/types/electron-json-storage/electron-json-storage-tests.ts @@ -2,8 +2,9 @@ import electron = require('electron'); import storage = require('electron-json-storage'); const DATA_PATH = '~/Downloads'; +const NEW_DATA_PATH = `${DATA_PATH}/new-data-path`; -console.log(storage.DEFAULT_DATA_PATH.length); +console.log(storage.getDefaultDataPath().length); storage.setDataPath(DATA_PATH); console.log(DATA_PATH.length); @@ -12,31 +13,59 @@ console.log(storage.getDataPath().length); storage.set('foo', { foo: 'bar' }, (err: any) => { }); storage.set('bar', { foo: 'bar' }, (err: any) => { }); +storage.set('baz', { foo: 'bar' }, {dataPath: NEW_DATA_PATH}, (err: any) => { }); storage.get('foo', (err: any, data: object) => { console.log(JSON.stringify(data)); }); +storage.get('baz', {dataPath: NEW_DATA_PATH}, (err: any, data: object) => { + console.log(JSON.stringify(data)); +}); + storage.getMany(['foo', 'bar'], (err: any, data: object) => { console.log(JSON.stringify(data)); }); +storage.getMany(['baz'], {dataPath: NEW_DATA_PATH}, (err: any, data: object) => { + console.log(JSON.stringify(data)); +}); storage.getAll((err: any, data: object) => { console.log(JSON.stringify(data)); }); +storage.getAll({dataPath: NEW_DATA_PATH}, (err: any, data: object) => { + console.log(JSON.stringify(data)); +}); + storage.has('foo', (err: any, hasKey: boolean) => { console.log("hasKey?: %s", hasKey); }); +storage.has('baz', {dataPath: NEW_DATA_PATH}, (err: any, hasKey: boolean) => { + console.log("hasKey?: %s", hasKey); +}); + storage.keys((err: any, keys: string[]) => { console.log(keys); }); +storage.keys({dataPath: NEW_DATA_PATH}, (err: any, keys: string[]) => { + console.log(keys); +}); + storage.remove("foo", (err: any) => { console.log(err); }); +storage.remove("baz", {dataPath: NEW_DATA_PATH}, (err: any) => { + console.log(err); +}); + storage.clear((err: any) => { console.log(err); }); + +storage.clear({dataPath: NEW_DATA_PATH}, (err: any) => { + console.log(err); +}); diff --git a/types/electron-json-storage/index.d.ts b/types/electron-json-storage/index.d.ts index cafa6c4171..75d6cf3983 100644 --- a/types/electron-json-storage/index.d.ts +++ b/types/electron-json-storage/index.d.ts @@ -1,18 +1,28 @@ -// Type definitions for electron-json-storage 3.1 +// Type definitions for electron-json-storage 4.0 // Project: https://github.com/electron-userland/electron-json-storage // Definitions by: Sam Saint-Pettersen , -// nrlquaker +// nrlquaker , +// John Woodruff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -export const DEFAULT_DATA_PATH: string; -export function setDataPath(directory: string): void; +export interface DataOptions { dataPath: string; } +export function getDefaultDataPath(): string; +export function setDataPath(directory?: string): void; export function getDataPath(): string; export function get(key: string, callback: (error: any, data: object) => void): void; +export function get(key: string, options: DataOptions, callback: (error: any, data: object) => void): void; export function getMany(keys: ReadonlyArray, callback: (error: any, data: object) => void): void; +export function getMany(keys: ReadonlyArray, options: DataOptions, callback: (error: any, data: object) => void): void; export function getAll(callback: (error: any, data: object) => void): void; +export function getAll(options: DataOptions, callback: (error: any, data: object) => void): void; export function set(key: string, json: object, callback: (error: any) => void): void; +export function set(key: string, json: object, options: DataOptions, callback: (error: any) => void): void; export function has(key: string, callback: (error: any, hasKey: boolean) => void): void; +export function has(key: string, options: DataOptions, callback: (error: any, hasKey: boolean) => void): void; export function keys(callback: (error: any, keys: string[]) => void): void; +export function keys(options: DataOptions, callback: (error: any, keys: string[]) => void): void; export function remove(key: string, callback: (error: any) => void): void; +export function remove(key: string, options: DataOptions, callback: (error: any) => void): void; export function clear(callback: (error: any) => void): void; +export function clear(options: DataOptions, callback: (error: any) => void): void; diff --git a/types/electron-notifications/package.json b/types/electron-notifications/package.json index 73c77d2608..880e1b40f6 100644 --- a/types/electron-notifications/package.json +++ b/types/electron-notifications/package.json @@ -3,4 +3,4 @@ "dependencies": { "electron": "^1.7.5" } -} \ No newline at end of file +} diff --git a/types/electron-notifications/tslint.json b/types/electron-notifications/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/electron-notifications/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/electron-notify/package.json b/types/electron-notify/package.json index 73c77d2608..880e1b40f6 100644 --- a/types/electron-notify/package.json +++ b/types/electron-notify/package.json @@ -3,4 +3,4 @@ "dependencies": { "electron": "^1.7.5" } -} \ No newline at end of file +} diff --git a/types/electron-notify/tslint.json b/types/electron-notify/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/electron-notify/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/electron-settings/electron-settings-tests.ts b/types/electron-settings/electron-settings-tests.ts index a1fad17f10..0ff969eb42 100644 --- a/types/electron-settings/electron-settings-tests.ts +++ b/types/electron-settings/electron-settings-tests.ts @@ -12,6 +12,7 @@ settings.setAll({foo: {bar: 'test'}}, {prettify: true}); // $ExpectType Settings settings.get('foo.bar'); // $ExpectType JsonValue settings.get('foo.bar', 'test'); // $ExpectType JsonValue +settings.get('foo.bar', 'test', {prettify: true}); // $ExpectType JsonValue settings.getAll(); // $ExpectType JsonValue @@ -24,3 +25,6 @@ settings.deleteAll({prettify: true}); // $ExpectType Settings settings.watch('foo.bar', () => {}); // $ExpectType SettingsObserver settings.file(); // $ExpectType string + +settings.setPath('~/Documents'); // $ExpectType Settings +settings.clearPath(); // $ExpectType Settings diff --git a/types/electron-settings/index.d.ts b/types/electron-settings/index.d.ts index 21bc1fb446..8ee10bf1f7 100644 --- a/types/electron-settings/index.d.ts +++ b/types/electron-settings/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for electron-settings 3.0 +// Type definitions for electron-settings 3.1 // Project: https://github.com/nathanbuchar/electron-settings#readme -// Definitions by: Ian Copp +// Definitions by: Ian Copp , +// nrlquaker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -56,7 +57,7 @@ interface Settings extends NodeJS.EventEmitter { * exist. * @see #getAll */ - get(keyPath: string, defaultValue?: any): JsonValue; + get(keyPath: string, defaultValue?: any, options?: SettingsOptions): JsonValue; /** * Returns all settings. @@ -109,6 +110,25 @@ interface Settings extends NodeJS.EventEmitter { * cause unintended consequences. */ file(): string; + + /** + * Sets a custom settings file path. By default, the settings file is + * stored in your app's user data directory in a file called Settings, + * but this method allows you to change this. + * + * Note: This method should be used cautiously, as it may have unintended + * consequences. In general, this method should only be used for + * debug purposes, and not in production apps. + * @param filePath An absolute path to the settings file where the + * user data will be saved. + */ + setPath(filePath: string): Settings; + + /** + * Clears the custom settings file path, if it exists. + * @see #setPath + */ + clearPath(): Settings; } interface SettingsObserver { diff --git a/types/electron-settings/v2/index.d.ts b/types/electron-settings/v2/index.d.ts index a869fd52b8..2f767358e5 100644 --- a/types/electron-settings/v2/index.d.ts +++ b/types/electron-settings/v2/index.d.ts @@ -73,7 +73,6 @@ declare class Settings extends EventEmitter { * * @param keyPath The path to the key whose value we wish to set. This key need not already exist. * @param value The value to set the key at the chosen key path to. This must be a data type supported by JSON: object, array, string, number, boolean, or null. - * @param options * @throws if key path is not a string. * @throws if options is not an object. * @see setSync @@ -91,7 +90,6 @@ declare class Settings extends EventEmitter { * Deletes the key and value at the chosen key path. * * @param keyPath The path to the key we wish to unset. - * @param options * @throws if keyPath is not a string. * @throws if options is not an object. * @see deleteSync diff --git a/types/electron-window-state/package.json b/types/electron-window-state/package.json index 73c77d2608..880e1b40f6 100644 --- a/types/electron-window-state/package.json +++ b/types/electron-window-state/package.json @@ -3,4 +3,4 @@ "dependencies": { "electron": "^1.7.5" } -} \ No newline at end of file +} diff --git a/types/electron-window-state/tslint.json b/types/electron-window-state/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/electron-window-state/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/element-resize-event/tslint.json b/types/element-resize-event/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/element-resize-event/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/elm/tslint.json b/types/elm/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/elm/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/email-addresses/tslint.json b/types/email-addresses/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/email-addresses/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/email-templates/email-templates-tests.ts b/types/email-templates/email-templates-tests.ts index 3c4493402c..a3311d6e81 100644 --- a/types/email-templates/email-templates-tests.ts +++ b/types/email-templates/email-templates-tests.ts @@ -1,29 +1,14 @@ import EmailTemplates = require('email-templates'); -const EmailTemplate = EmailTemplates.EmailTemplate; -const template = new EmailTemplate("./"); -const templateWithOptions = new EmailTemplate('./', {disableJuice: true, sassOptions: {}, juiceOptions: {}}); -const users = [ - { - email: 'pappa.pizza@spaghetti.com', - name: { - first: 'Pappa', - last: 'Pizza' - } +const email = new EmailTemplates({ + message: { + from: 'Test@tesitng.com' }, - { - email: 'mister.geppetto@spaghetti.com', - name: { - first: 'Mister', - last: 'Geppetto' - } - } -]; + transport: { + jsonTransport: true + }} +); -const templates = users.map((user) => { - return template.render(user) - .then((results) => { - const {html, subject, text} = results; - return html; - }); -}); +email.juiceResources('

    bob

    '); +email.render('mars/html.pug', {name: 'elon'}); +email.send({template: 'mars', message: {to: 'elon@spacex.com'}, locals: {name: 'Elon'}}); diff --git a/types/email-templates/index.d.ts b/types/email-templates/index.d.ts index d76c23aed3..12dceb181d 100644 --- a/types/email-templates/index.d.ts +++ b/types/email-templates/index.d.ts @@ -1,152 +1,104 @@ -// Type definitions for node-email-templates 2.6 +// Type definitions for node-email-templates 3.1 // Project: https://github.com/niftylettuce/node-email-templates // Definitions by: Cyril Schumacher // Matus Gura +// Jacob Copeland // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/** - * @summary Interface for result of email template. - * @interface - */ -interface EmailTemplateResults { +interface EmailConfig { /** - * @summary HTML result. - * @type {string} + * The message */ - html: string; - + message: any; /** - * @summary Text result. - * @type {string} + * The nodemailer Transport created via nodemailer.createTransport */ - text: string; - + transport: any; /** - * @summary Subject result. - * @type {string} + * The email template directory and engine information */ - subject: string; + views?: any; + /** + * Do you really want to send, false for test or development + */ + send?: boolean; + /** + * Preview the email + */ + preview?: boolean; + /** + * Set to object to configure and Enable + */ + i18n?: any; + /** + * Pass a custom render function if necessary + */ + render?: { view: string, locals: any }; + /** + * + */ + htmlToText?: any; + /** + * + */ + juice?: boolean; + /** + * + */ + juiceResources?: any; } -/** - * @summary Callback signature. - */ -type EmailTemplateCallback = (err: any, results: EmailTemplateResults) => void; - -/** - * @summary Interface for email-template options - * @interface - */ -interface EmailTemplateOptions { - disableJuice?: boolean; - juiceOptions?: any; - sassOptions?: any; -} - -declare module "email-templates" { +interface EmailOptions { /** - * @summary Email template class. - * @class + * The template name */ - class EmailTemplate { - /** - * @summary Constructor. - * @param {string} templateDir The template directory. - */ - constructor(templateDir: string, options?: EmailTemplateOptions); - - /** - * @summary Render a single template. - * @param locals The template variables. - * @param locale The language code. - */ - render(locals: any, locale?: string): Promise; - - /** - * @summary Render a single template. - * @param callback The callback function. - */ - render(callback: EmailTemplateCallback): void; - - /** - * @summary Render a single template. - * @param locals The template variables. - * @param callback The callback function. - */ - render(locals: any, callback: EmailTemplateCallback): void; - - /** - * @summary Render a single template. - * @param locals The template variables. - * @param locale The language code. - * @param callback The callback function. - */ - render(locals: any, locale: string, callback: EmailTemplateCallback): void; - - /** - * @summary Render text - * @param locals The template variables. - * @param locale The language code. - */ - renderText(locals: any, locale?: string): Promise; - - /** - * @summary Render text - * @param locals The template variables. - * @param callback The language code. - */ - renderText(locals: any, callback: EmailTemplateCallback): void; - - /** - * @summary Render text - * @param locals The template variables. - * @param locale The language code. - * @param callback The language code. - */ - renderText(locals: any, locale: string, callback: EmailTemplateCallback): void; - - /** - * @summary Render subject - * @param locals The template variables. - * @param locale The language code. - */ - renderSubject(locals: any, locale?: string): Promise; - - /** - * @summary Render subject - * @param locals The template variables. - * @param callback The language code. - */ - renderSubject(locals: any, callback: EmailTemplateCallback): void; - - /** - * @summary Render subject - * @param locals The template variables. - * @param locale The language code. - * @param callback The language code. - */ - renderSubject(locals: any, locale: string, callback: EmailTemplateCallback): void; - - /** - * @summary Render HTML - * @param locals The template variables. - * @param locale The language code. - */ - renderHtml(locals: any, locale?: string): Promise; - - /** - * @summary Render HTML - * @param locals The template variables. - * @param callback The language code. - */ - renderHtml(locals: any, callback: EmailTemplateCallback): void; - - /** - * @summary Render HTML - * @param locals The template variables. - * @param locale The language code. - * @param callback The language code. - */ - renderHtml(locals: any, locale: string, callback: EmailTemplateCallback): void; - } + template: string; + /** + * Nodemailer Message + */ + message: any; + /** + * The Template Variables + */ + locals: any; } + +declare class EmailTemplate { + constructor(config: EmailConfig); + /** + * shorthand use of `juiceResources` with the config + * mainly for custom renders like from a database). + */ + juiceResources(html: string): Promise ; + /** + * + * @param view The Html pug to render + * @param locals The template Variables + */ + render(view: string, locals: any): Promise; + /** + * Send the Email + */ + send(options: EmailOptions): any; +} + +declare namespace EmailTemplate { + /** + * shorthand use of `juiceResources` with the config + * mainly for custom renders like from a database). + */ + function juiceResources(html: string): Promise ; + + /** + * + * @param view The Html pug to render + * @param locals The template Variables + */ + function render(view: string, locals: any): Promise; + + /** + * Send the Email + */ + function send(options: EmailOptions): any; +} +export = EmailTemplate; diff --git a/types/email-templates/tslint.json b/types/email-templates/tslint.json index d04b04bc22..d88586e5bd 100644 --- a/types/email-templates/tslint.json +++ b/types/email-templates/tslint.json @@ -1,7 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "no-declare-current-package": false, - "no-single-declare-module": false - } + "extends": "dtslint/dt.json" } diff --git a/types/email-validator/tslint.json b/types/email-validator/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/email-validator/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/ember-testing-helpers/ember-testing-helpers-tests.ts b/types/ember-testing-helpers/ember-testing-helpers-tests.ts index 3691e3ede0..01ee44b338 100644 --- a/types/ember-testing-helpers/ember-testing-helpers-tests.ts +++ b/types/ember-testing-helpers/ember-testing-helpers-tests.ts @@ -1,12 +1,12 @@ -import RSVP = require('rsvp'); +import RSVP from 'rsvp'; function testAndThen() { - const result: RSVP.Promise = andThen(() => 'some string'); + const result: RSVP.Promise = andThen(() => 'some string'); result.then(s => s.length); } function testClick() { - const result: RSVP.Promise = click('someString'); + const result: RSVP.Promise = click('someString'); result.then(() => {}); } @@ -29,7 +29,7 @@ function testFillIn() { const textResult = fillIn('.foo', 'waffles'); textResult.then(() => true); const contextResult = fillIn('.bar', {}, 'pancakes'); - contextResult.catch(reason => false); + contextResult.catch((reason: any) => false); } function testFind() { diff --git a/types/ember-testing-helpers/index.d.ts b/types/ember-testing-helpers/index.d.ts index 33231a0b65..8bbbcc09f7 100644 --- a/types/ember-testing-helpers/index.d.ts +++ b/types/ember-testing-helpers/index.d.ts @@ -1,8 +1,8 @@ // Type definitions for ember-testing/lib/helpers // Project: https://github.com/emberjs/ember.js/tree/master/packages/ember-testing/lib/helpers -// Definitions by: Chris Krycho +// Definitions by: Chris Krycho // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.4 // Note that these are distributed separately because they represent a discrete // set of functionality, and as globally-injected items (as of Ember 2.13), are @@ -10,14 +10,14 @@ /// -import RSVP = require('rsvp'); +import RSVP from 'rsvp'; type KeyEventType = 'keydown' | 'keyup' | 'keypress'; -type WaitResult = RSVP.Promise; +type WaitResult = RSVP.Promise; declare global { // https://github.com/emberjs/ember.js/blob/master/packages/ember-testing/lib/helpers/and_then.js - function andThen(callback: (...args: any[]) => T): RSVP.Promise; + function andThen(callback: (...args: any[]) => T): RSVP.Promise; // https://github.com/emberjs/ember.js/blob/master/packages/ember-testing/lib/helpers/click.js function click(selector: string, context?: Object): WaitResult; @@ -45,7 +45,7 @@ declare global { function keyEvent(selector: string, type: KeyEventType, keyCode: number): WaitResult; // https://github.com/emberjs/ember.js/blob/master/packages/ember-testing/lib/helpers/pause_test.js - function pauseTest(): RSVP.Promise<{}, never>; + function pauseTest(): RSVP.Promise<{}>; function resumeTest(): void; // https://github.com/emberjs/ember.js/blob/master/packages/ember-testing/lib/helpers/trigger_event.js diff --git a/types/ember-testing-helpers/tsconfig.json b/types/ember-testing-helpers/tsconfig.json index 725957a948..622d4d1584 100644 --- a/types/ember-testing-helpers/tsconfig.json +++ b/types/ember-testing-helpers/tsconfig.json @@ -10,9 +10,7 @@ "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": [ - "../" - ], + "typeRoots": ["../"], "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/ember-testing-helpers/tslint.json b/types/ember-testing-helpers/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/ember-testing-helpers/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts old mode 100644 new mode 100755 index 60b2f28f70..adef4e70c2 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -1,2543 +1,3639 @@ -// Type definitions for Ember.js 2.7 +// Type definitions for Ember.js 2.8 // Project: http://emberjs.com/ // Definitions by: Jed Mao // bttf +// Derek Wickern +// Chris Krycho +// Theron Cross // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 /// /// -// Capitalization is intentional: this makes it much easier to re-export RSVP on -// the Ember namespace. -import Rsvp = require('rsvp'); +declare module 'ember' { + // Capitalization is intentional: this makes it much easier to re-export RSVP on + // the Ember namespace. + import Rsvp from 'rsvp'; + import { TemplateFactory } from 'htmlbars-inline-precompile'; -declare namespace EmberStates { - interface Transition { - targetName: string; - urlMethod: string; - intent: any; - params: {} | any; - pivotHandler: any; - resolveIndex: number; - handlerInfos: any; - resolvedModels: {} | any; - isActive: boolean; - state: any; - queryParams: {} | any; - queryParamsOnly: boolean; + // Get an alias to the global Array type to use in inner scope below. + type GlobalArray = T[]; - isTransition: boolean; + /** + * Deconstructs computed properties into the types which would be returned by `.get()`. + */ + type ComputedProperties = { [K in keyof T]: Ember.ComputedProperty | T[K] }; - /** - The Transition's internal promise. Calling `.then` on this property - is that same as calling `.then` on the Transition object itself, but - this property is exposed for when you want to pass around a - Transition's promise, but not the Transition object itself, since - Transition object can be externally `abort`ed, while the promise - cannot. - */ - promise: Rsvp.Promise; + /** + * Check that any arguments to `create()` match the type's properties. + * + * Accept any additional properties and add merge them into the instance. + */ + type EmberInstanceArguments = Partial & { + [key: string]: any; + }; - /** - Custom state can be stored on a Transition's `data` object. - This can be useful for decorating a Transition within an earlier - hook and shared with a later hook. Properties set on `data` will - be copied to new transitions generated by calling `retry` on this - transition. - */ - data: any; - - /** - A standard promise hook that resolves if the transition - succeeds and rejects if it fails/redirects/aborts. - - Forwards to the internal `promise` property which you can - use in situations where you want to pass around a thennable, - but not the Transition itself. - - @arg {Function} onFulfilled - @arg {Function} onRejected - @arg {String} label optional string for labeling the promise. Useful for tooling. - @return {Promise} - */ - then(onFulfilled: Function, onRejected?: Function, label?: string): Rsvp.Promise; - - /** - Forwards to the internal `promise` property which you can - use in situations where you want to pass around a thennable, - but not the Transition itself. - - @method catch - @arg {Function} onRejection - @arg {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - */ - catch(onRejection: Function, label?: string): Rsvp.Promise; - - /** - Forwards to the internal `promise` property which you can - use in situations where you want to pass around a thennable, - but not the Transition itself. - - @method finally - @arg {Function} callback - @arg {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} - */ - finally(callback: Function, label?: string): Rsvp.Promise; - - /** - Aborts the Transition. Note you can also implicitly abort a transition - by initiating another transition while a previous one is underway. - */ - abort(): EmberStates.Transition; - normalize(manager: Ember.StateManager, contexts: any[]): void; - - /** - Retries a previously-aborted transition (making sure to abort the - transition if it's still active). Returns a new transition that - represents the new attempt to transition. - */ - retry(): EmberStates.Transition; - - /** - Sets the URL-changing method to be employed at the end of a - successful transition. By default, a new Transition will just - use `updateURL`, but passing 'replace' to this method will - cause the URL to update using 'replaceWith' instead. Omitting - a parameter will disable the URL change, allowing for transitions - that don't update the URL at completion (this is also used for - handleURL, since the URL has already changed before the - transition took place). - - @arg {String} method the type of URL-changing method to use - at the end of a transition. Accepted values are 'replace', - falsy values, or any other non-falsy value (which is - interpreted as an updateURL transition). - - @return {Transition} this transition - */ - method(method: string): EmberStates.Transition; - - /** - Fires an event on the current list of resolved/resolving - handlers within this transition. Useful for firing events - on route hierarchies that haven't fully been entered yet. - - Note: This method is also aliased as `send` - - @arg {Boolean} [ignoreFailure=false] a boolean specifying whether unhandled events throw an error - @arg {String} name the name of the event to fire - */ - trigger(ignoreFailure: boolean, eventName: string): void; - /** - Fires an event on the current list of resolved/resolving - handlers within this transition. Useful for firing events - on route hierarchies that haven't fully been entered yet. - - Note: This method is also aliased as `send` - - @arg {String} name the name of the event to fire - */ - trigger(eventName: string): void; - - /** - Transitions are aborted and their promises rejected - when redirects occur; this method returns a promise - that will follow any redirects that occur and fulfill - with the value fulfilled by any redirecting transitions - that occur. - - @return {Promise} a promise that fulfills with the same - value that the final redirecting transition fulfills with - */ - followRedirects(): Rsvp.Promise; + /** + * Accept any additional properties and add merge them into the prototype. + */ + interface EmberClassArguments { + [key: string]: any; } -} -// Get an alias to the global Array type to use in inner scope below. -type GlobalArray = T[]; + /** + * Map type `T` to a plain object hash with the identity mapping. + * + * Discards any additional object identity like the ability to `new()` up the class. + * The `new()` capability is added back later by merging `EmberClassConstructor` + * + * Implementation is carefully chosen for the reasons described in + * https://github.com/typed-ember/ember-typings/pull/29 + */ + type Objectify = Readonly; -declare namespace EmberTesting { - namespace Test { - class Adapter { - asyncEnd(): void; - asyncStart(): void; - exception(error: string): void; + type Fix = { [K in keyof T]: T[K] }; + + /** + * Ember.Object.extend(...) accepts any number of mixins or literals. + */ + type MixinOrLiteral = Ember.Mixin | T; + + /** + * Used to infer the type of ember classes of type `T`. + * + * Generally you would use `EmberClass.create()` instead of `new EmberClass()`. + * + * The no-arg constructor is required by the typescript compiler. + * The multi-arg constructor is included for better ergonomics. + * + * Implementation is carefully chosen for the reasons described in + * https://github.com/typed-ember/ember-typings/pull/29 + */ + type EmberClassConstructor = (new () => T) & (new (...args: any[]) => T); + + type ComputedPropertyGetterFunction = (this: any, key: string) => T; + + interface ComputedPropertyGet { + get(this: any, key: string): T; + } + + interface ComputedPropertySet { + set(this: any, key: string, value: T): T; + } + + type ComputedPropertyCallback = + | ComputedPropertyGetterFunction + | ComputedPropertyGet + | ComputedPropertySet + | (ComputedPropertyGet & ComputedPropertySet); + + interface ActionsHash { + [index: string]: (...params: any[]) => any; + } + + interface EmberRunTimer { + __ember_run_timer_brand__: any; + } + + type RunMethod = ((this: Target, ...args: any[]) => Ret) | keyof Target; + type EmberRunQueues = + | 'sync' + | 'actions' + | 'routerTransitions' + | 'render' + | 'afterRender' + | 'destroy'; + + type ObserverMethod = + | (keyof Target) + | ((this: Target, sender: Sender, key: keyof Sender, value: any, rev: number) => void); + + interface RenderOptions { + into?: string; + controller?: string; + model?: any; + outlet?: string; + view?: string; + } + + interface RouteQueryParam { + refreshModel?: boolean; + replace?: boolean; + as?: string; + } + + interface EventDispatcherEvents { + touchstart?: string | null; + touchmove?: string | null; + touchend?: string | null; + touchcancel?: string | null; + keydown?: string | null; + keyup?: string | null; + keypress?: string | null; + mousedown?: string | null; + mouseup?: string | null; + contextmenu?: string | null; + click?: string | null; + dblclick?: string | null; + mousemove?: string | null; + focusin?: string | null; + focusout?: string | null; + mouseenter?: string | null; + mouseleave?: string | null; + submit?: string | null; + input?: string | null; + change?: string | null; + dragstart?: string | null; + drag?: string | null; + dragenter?: string | null; + dragleave?: string | null; + dragover?: string | null; + drop?: string | null; + dragend?: string | null; + [event: string]: string | null | undefined; + } + + interface ViewMixin { + /** + * A list of properties of the view to apply as attributes. If the property + * is a string value, the value of that string will be applied as the value + * for an attribute of the property's name. + */ + attributeBindings: string[]; + /** + * Returns the current DOM element for the view. + */ + element: Element; + /** + * Returns a jQuery object for this view's element. If you pass in a selector + * string, this method will return a jQuery object, using the current element + * as its buffer. + */ + $: JQueryStatic; + /** + * The HTML `id` of the view's element in the DOM. You can provide this + * value yourself but it must be unique (just as in HTML): + */ + elementId: string; + /** + * Tag name for the view's outer element. The tag name is only used when an + * element is first created. If you change the `tagName` for an element, you + * must destroy and recreate the view element. + */ + tagName: string; + /** + * Renders the view again. This will work regardless of whether the + * view is already in the DOM or not. If the view is in the DOM, the + * rendering process will be deferred to give bindings a chance + * to synchronize. + */ + rerender(): void; + /** + * Called when a view is going to insert an element into the DOM. + */ + willInsertElement(): void; + /** + * Called when the element of the view has been inserted into the DOM. + * Override this function to do any set up that requires an element + * in the document body. + */ + didInsertElement(): void; + /** + * Called when the view is about to rerender, but before anything has + * been torn down. This is a good opportunity to tear down any manual + * observers you have installed based on the DOM state + */ + willClearRender(): void; + /** + * Called when the element of the view is going to be destroyed. Override + * this function to do any teardown that requires an element, like removing + * event listeners. + */ + willDestroyElement(): void; + } + const ViewMixin: Ember.Mixin; + + /** + Ember.CoreView is an abstract class that exists to give view-like behavior to both Ember's main + view class Ember.Component and other classes that don't need the full functionality of Ember.Component. + + Unless you have specific needs for CoreView, you will use Ember.Component in your applications. + **/ + class CoreView extends Ember.Object.extend(Ember.Evented, Ember.ActionHandler) {} + interface ActionSupport { + sendAction(action: string, ...params: any[]): void; + } + const ActionSupport: Ember.Mixin; + + interface ClassNamesSupport { + /** + A list of properties of the view to apply as class names. If the property is a string value, + the value of that string will be applied as a class name. + + If the value of the property is a Boolean, the name of that property is added as a dasherized + class name. + + If you would prefer to use a custom value instead of the dasherized property name, you can + pass a binding like this: `classNameBindings: ['isUrgent:urgent']` + + This list of properties is inherited from the component's superclasses as well. + */ + classNameBindings: string[]; + /** + * Standard CSS class names to apply to the view's outer element. This + * property automatically inherits any class names defined by the view's + * superclasses as well. + */ + classNames: string[]; + } + const ClassNamesSupport: Ember.Mixin; + + interface TriggerActionOptions { + action?: string; + target?: Ember.Object; + actionContext?: Ember.Object; + } + /** + Ember.TargetActionSupport is a mixin that can be included in a class to add a triggerAction method + with semantics similar to the Handlebars {{action}} helper. In normal Ember usage, the {{action}} + helper is usually the best choice. This mixin is most often useful when you are doing more + complex event handling in Components. + **/ + interface TargetActionSupport { + triggerAction(opts: TriggerActionOptions): boolean; + } + + export namespace Ember { + interface FunctionPrototypeExtensions { + /** + * The `property` extension of Javascript's Function prototype is available + * when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is + * `true`, which is the default. + */ + property(...args: string[]): ComputedProperty; + /** + * The `observes` extension of Javascript's Function prototype is available + * when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is + * true, which is the default. + */ + observes(...args: string[]): this; + /** + * The `on` extension of Javascript's Function prototype is available + * when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is + * true, which is the default. + */ + on(...args: string[]): this; } - class QUnitAdapter extends Adapter {} - } -} - -interface Function { - observes(...args: string[]): Function; - observesBefore(...args: string[]): Function; - on(...args: string[]): Function; - property(...args: string[]): Function; -} - -interface String { - camelize(): string; - capitalize(): string; - classify(): string; - dasherize(): string; - decamelize(): string; - fmt(...args: string[]): string; - htmlSafe(): typeof Handlebars.SafeString; - loc(...args: string[]): string; - underscore(): string; - w(): string[]; -} - -interface Array { - constructor(arr: any[]): void; - activate(): void; - addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[]; - addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): any[]; - any(callback: Function, target?: any): boolean; - anyBy(key: string, value?: string): boolean; - arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - someProperty(key: string, value?: any): boolean; - clear(): any[]; - compact(): any[]; - contains(obj: any): boolean; - enumerableContentDidChange( - start: number, - removing: Ember.Enumerable | number, - adding: Ember.Enumerable | number - ): any; - enumerableContentDidChange( - removing: Ember.Enumerable | number, - adding: Ember.Enumerable | number - ): any; - enumerableContentWillChange( - removing: Ember.Enumerable | number, - adding: Ember.Enumerable | number - ): Ember.Enumerable; - every(callback: ItemIndexEnumerableCallback, target?: any): boolean; - everyBy(key: string, value?: string): boolean; - everyProperty(key: string, value?: any): boolean; - filter(callback: Function, target?: any): any[]; - filterBy(key: string, value?: string): any[]; - - /** - Returns the first item in the array for which the callback returns true. - This method works similar to the `filter()` method defined in JavaScript 1.6 - except that it will stop working on the array once a match is found. - The callback method you provide should have the following signature (all - parameters are optional): - ```javascript - function(item, index, enumerable); - ``` - - `item` is the current item in the iteration. - - `index` is the current index in the iteration. - - `enumerable` is the enumerable object itself. - It should return the `true` to include the item in the results, `false` - otherwise. - Note that in addition to a callback, you can also pass an optional target - object that will be set as `this` on the context. This is a good way - to give your iterator function access to the current object. - @function find - @arg callback The callback to execute - @arg {Object} [target] The target object to use - @return {Object} Found item or `undefined`. -*/ - find(callback: Function, target?: any): any; - findBy(key: string, value?: string): any; - forEach(callback: Function, target?: any): any; - getEach(key: string): any[]; - indexOf(object: any, startAt?: number): number; - insertAt(idx: number, object: any): any[]; - invoke(methodName: string, ...args: any[]): any[]; - lastIndexOf(object: any, startAt?: number): number; - map(callback: Function, target?: any): any[]; - mapBy(key: string): any[]; - nextObject(index: number, previousObject: any, context: any): any; - objectAt(idx: number): any; - objectsAt(...args: number[]): any[]; - popObject(): any; - pushObject(obj: any): any; - pushObjects(...args: any[]): any[]; - reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; - reject: ItemIndexEnumerableCallbackTarget; - rejectBy(key: string, value?: string): any[]; - removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[]; - removeAt(start: number, len: number): any; - removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): any[]; - replace(idx: number, amt: number, objects: any[]): void; - reverseObjects(): any[]; - setEach(key: string, value?: any): any; - setObjects(objects: any[]): any[]; - shiftObject(): any; - slice(beginIndex?: number, endIndex?: number): any[]; - some(callback: Function, target?: any): boolean; - toArray(): any[]; - uniq(): any[]; - unshiftObject(object: any): any; - unshiftObjects(objects: any[]): any[]; - without(value: any): any[]; - '[]': any[]; - '@each': Ember.EachProxy; - Boolean: boolean; - firstObject: any; - hasEnumerableObservers: boolean; - lastObject: any; - addObject(object: any): any; - addObjects(objects: Ember.Enumerable): any[]; - removeObject(object: any): any; - removeObjects(objects: Ember.Enumerable): any[]; - addObserver: ModifyObserver; - beginPropertyChanges(): any[]; - cacheFor(keyName: string): any; - decrementProperty(keyName: string, decrement?: number): number; - endPropertyChanges(): any[]; - get(keyName: string): any; - getProperties(...args: string[]): {}; - getProperties(keys: string[]): {}; - getWithDefault(keyName: string, defaultValue: any): any; - hasObserverFor(key: string): boolean; - incrementProperty(keyName: string, increment?: number): number; - notifyPropertyChange(keyName: string): any[]; - propertyDidChange(keyName: string): any[]; - propertyWillChange(keyName: string): any[]; - removeObserver(key: string, target: any, method: Function | string): Ember.Observable; - set(keyName: string, value: any): any[]; - setProperties(hash: {}): any[]; - toggleProperty(keyName: string): any; - copy(deep: boolean): any[]; - frozenCopy(): any[]; - // 1.3 - isAny(key: string, value?: string): boolean; - isEvery(key: string, value?: string): boolean; -} - -interface ApplicationCreateArguments { - customEvents?: {}; - rootElement?: string; - /** - Basic logging of successful transitions. - **/ - LOG_TRANSITIONS?: boolean; - /** - Detailed logging of all routing steps. - **/ - LOG_TRANSITIONS_INTERNAL?: boolean; -} - -type ApplicationInitializerFunction = ( - container: Ember.Container, - application: Ember.Application -) => void; - -interface ApplicationInitializerArguments { - name?: string; - initialize?: ApplicationInitializerFunction; -} - -interface CoreObjectArguments { - /** - An overridable method called when objects are instantiated. By default, does nothing unless it is - overridden during class definition. NOTE: If you do override init for a framework class like Ember.View - or Ember.ArrayController, be sure to call this._super() in your init declaration! If you don't, Ember - may not have an opportunity to do important setup work, and you'll see strange behavior in your application. - **/ - init?: Function; - /** - Override to implement teardown. - **/ - willDestroy?: Function; - - [propName: string]: any; -} - -interface EnumerableConfigurationOptions { - willChange?: boolean; - didChange?: boolean; -} - -type ItemIndexEnumerableCallbackTarget = ( - callback: ItemIndexEnumerableCallback, - target?: any -) => any[]; - -type ItemIndexEnumerableCallback = (item: any, index: number, enumerable: Ember.Enumerable) => void; - -type ReduceCallback = ( - previousValue: any, - item: any, - index: number, - enumerable: Ember.Enumerable -) => void; - -interface TransitionsHash { - contexts: any[]; - exitStates: Ember.State[]; - enterStates: Ember.State[]; - resolveState: Ember.State; -} - -interface ActionsHash { - willTransition?: Function; - error?: Function; -} - -interface DisconnectOutletOptions { - outlet?: string; - parentView?: string; -} - -interface RenderOptions { - into?: string; - controller?: string; - model?: any; - outlet?: string; - view?: string; -} - -type ModifyObserver = ( - obj: any, - path: string | null, - target: Function | any, - method?: Function | string -) => void; - -declare namespace Ember { - /** - Alias for jQuery. - **/ - // ReSharper disable once DuplicatingLocalDeclaration - const $: JQueryStatic; - /** - Creates an Ember.NativeArray from an Array like object. Does not modify the original object. - Ember.A is not needed if Ember.EXTEND_PROTOTYPES is true (the default value). However, it is - recommended that you use Ember.A when creating addons for ember or when you can not garentee - that Ember.EXTEND_PROTOTYPES will be true. - **/ - function A(arr?: any[]): NativeArray; - /** - The Ember.ActionHandler mixin implements support for moving an actions property to an _actions - property at extend time, and adding _actions to the object's mergedProperties list. - **/ - class ActionHandlerMixin { - /** - Triggers a named action on the ActionHandler - **/ - send(name: string, ...args: any[]): void; - /** - The collection of functions, keyed by name, available on this ActionHandler as action targets. - **/ - actions: ActionsHash; - } - /** - An instance of Ember.Application is the starting point for every Ember application. It helps to - instantiate, initialize and coordinate the many objects that make up your app. - **/ - class Application extends Namespace { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - /** - Call advanceReadiness after any asynchronous setup logic has completed. - Each call to deferReadiness must be matched by a call to advanceReadiness - or the application will never become ready and routing will not begin. - **/ - advanceReadiness(): void; - /** - Use this to defer readiness until some condition is true. - - This allows you to perform asynchronous setup logic and defer - booting your application until the setup has finished. - - However, if the setup requires a loading UI, it might be better - to use the router for this purpose. - */ - deferReadiness(): void; - /** - defines an injection or typeInjection - **/ - inject(factoryNameOrType: string, property: string, injectionName: string): void; - /** - This injects the test helpers into the window's scope. If a function of the - same name has already been defined it will be cached (so that it can be reset - if the helper is removed with `unregisterHelper` or `removeTestHelpers`). - Any callbacks registered with `onInjectHelpers` will be called once the - helpers have been injected. - **/ - injectTestHelpers(): void; - /** - registers a factory for later injection - @param fullName type:name (e.g., 'model:user') - @param factory (e.g., App.Person) - **/ - register(fullName: string, factory: Function, options?: {}): void; - /** - This removes all helpers that have been registered, and resets and functions - that were overridden by the helpers. - **/ - removeTestHelpers(): void; - /** - Reset the application. This is typically used only in tests. - **/ - reset(): void; - /** - This hook defers the readiness of the application, so that you can start - the app when your tests are ready to run. It also sets the router's - location to 'none', so that the window's location will not be modified - (preventing both accidental leaking of state between tests and interference - with your testing framework). - **/ - setupForTesting(): void; - /** - The DOM events for which the event dispatcher should listen. - */ - customEvents: {}; - /** - The Ember.EventDispatcher responsible for delegating events to this application's views. - **/ - eventDispatcher: EventDispatcher; - /** - Set this to provide an alternate class to Ember.DefaultResolver - **/ - resolver: DefaultResolver; - /** - The root DOM element of the Application. This can be specified as an - element or a jQuery-compatible selector string. - - This is the element that will be passed to the Application's, eventDispatcher, - which sets up the listeners for event delegation. Every view in your application - should be a child of the element you specify here. - **/ - rootElement: HTMLElement; - /** - Called when the Application has become ready. - The call will be delayed until the DOM has become ready. - **/ - ready: Function; - /** - Application's router. - **/ - Router: Router; - registry: Registry; - } - /** - This module implements Observer-friendly Array-like behavior. This mixin is picked up by the - Array class as well as other controllers, etc. that want to appear to be arrays. - **/ - class Array implements Enumerable { - addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[]; - addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - any(callback: ItemIndexEnumerableCallback, target?: any): boolean; - anyBy(key: string, value?: string): boolean; - arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - someProperty(key: string, value?: string): boolean; - compact(): any[]; - contains(obj: any): boolean; - enumerableContentDidChange( - start: number, - removing: Enumerable | number, - adding: Enumerable | number - ): any; - enumerableContentDidChange(removing: Enumerable | number, adding: Enumerable | number): any; - enumerableContentWillChange( - removing: Enumerable | number, - adding: Enumerable | number - ): Enumerable; - every(callback: ItemIndexEnumerableCallback, target?: any): boolean; - everyBy(key: string, value?: string): boolean; - everyProperty(key: string, value?: string): boolean; - filter(callback: ItemIndexEnumerableCallback, target: any): any[]; - filterBy(key: string, value?: string): any[]; - find(callback: ItemIndexEnumerableCallback, target?: any): any; - findBy(key: string, value?: string): any; - forEach(callback: ItemIndexEnumerableCallback, target?: any): any; - getEach(key: string): any[]; - indexOf(object: any, startAt: number): number; - invoke(methodName: string, ...args: any[]): any[]; - lastIndexOf(object: any, startAt: number): number; - map: ItemIndexEnumerableCallbackTarget; - mapBy(key: string): any[]; - nextObject(index: number, previousObject: any, context: any): any; - objectAt(idx: number): any; - objectsAt(...args: number[]): any[]; - reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; - reject: ItemIndexEnumerableCallbackTarget; - rejectBy(key: string, value?: string): any[]; - removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[]; - removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - setEach(key: string, value?: any): any; - slice(beginIndex?: number, endIndex?: number): any[]; - some(callback: ItemIndexEnumerableCallback, target?: any): boolean; - toArray(): any[]; - uniq(): Enumerable; - without(value: any): Enumerable; - '@each': EachProxy; - Boolean: boolean; - '[]': any[]; - firstObject: any; - hasEnumerableObservers: boolean; - lastObject: any; - length: number; - } - /** - An ArrayProxy wraps any other object that implements Ember.Array and/or Ember.MutableArray, - forwarding all requests. This makes it very useful for a number of binding use cases or other cases - where being able to swap out the underlying array is useful. - **/ - class ArrayProxy extends Object implements MutableArray { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[]; - addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - any(callback: ItemIndexEnumerableCallback, target?: any): boolean; - anyBy(key: string, value?: string): boolean; - arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - someProperty(key: string, value?: string): boolean; - clear(): any[]; - compact(): any[]; - contains(obj: any): boolean; - enumerableContentDidChange( - start: number, - removing: Enumerable | number, - adding: Enumerable | number - ): any; - enumerableContentDidChange(removing: Enumerable | number, adding: Enumerable | number): any; - enumerableContentWillChange( - removing: Enumerable | number, - adding: Enumerable | number - ): Enumerable; - every(callback: ItemIndexEnumerableCallback, target?: any): boolean; - everyBy(key: string, value?: string): boolean; - everyProperty(key: string, value?: string): boolean; - filter(callback: ItemIndexEnumerableCallback, target: any): any[]; - filterBy(key: string, value?: string): any[]; - find(callback: ItemIndexEnumerableCallback, $target: any): any; - findBy(key: string, value?: string): any; - forEach(callback: ItemIndexEnumerableCallback, target?: any): any; - getEach(key: string): any[]; - indexOf(object: any, startAt: number): number; - insertAt(idx: number, object: any): any[]; - invoke(methodName: string, ...args: any[]): any[]; - lastIndexOf(object: any, startAt: number): number; - map: ItemIndexEnumerableCallbackTarget; - mapBy(key: string): any[]; - nextObject(index: number, previousObject: any, context: any): any; - objectAt(idx: number): any; - objectAtContent(idx: number): any; - objectsAt(...args: number[]): any[]; - popObject(): any; - pushObject(obj: any): any; - pushObjects(...args: any[]): any[]; - reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; - reject: ItemIndexEnumerableCallbackTarget; - rejectBy(key: string, value?: string): any[]; - removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[]; - removeAt(start: number, len: number): any; - removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - replace(idx: number, amt: number, objects: any[]): any; - replaceContent(idx: number, amt: number, objects: any[]): void; - reverseObjects(): any[]; - setEach(key: string, value?: any): any; - setObjects(objects: any[]): any[]; - shiftObject(): any; - slice(beginIndex?: number, endIndex?: number): any[]; - some(callback: ItemIndexEnumerableCallback, target?: any): boolean; - toArray(): any[]; - uniq(): Enumerable; - unshiftObject(object: any): any; - unshiftObjects(objects: any[]): any[]; - without(value: any): Enumerable; - '[]': any[]; - '@each': EachProxy; - Boolean: boolean; - firstObject: any; - hasEnumerableObservers: boolean; - lastObject: any; - length: number; - addObject(object: any): any; - addObjects(objects: Enumerable): MutableEnumberable; - removeObject(object: any): any; - removeObjects(objects: Enumerable): MutableEnumberable; - } - const BOOTED: boolean; - /** - Connects the properties of two objects so that whenever the value of one property changes, - the other property will be changed also. - **/ - class Binding { - constructor(toPath: string, fromPath: string); - connect(obj: any): Binding; - copy(): Binding; - disconnect(): Binding; - from(path: string): Binding; - to(path: string | any[]): Binding; - toString(): string; - } - class Button extends Component implements TargetActionSupport { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - triggerAction(opts: {}): boolean; - } - /** - The internal class used to create text inputs when the {{input}} helper is used - with type of checkbox. See Handlebars.helpers.input for usage details. - **/ - class Checkbox extends Component { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - } - /** - Implements some standard methods for comparing objects. Add this mixin to any class - you create that can compare its instances. - **/ - class Comparable { - compare(a: any, b: any): number; - } - /** - A view that is completely isolated. Property access in its templates go to the view object - and actions are targeted at the view object. There is no access to the surrounding context or - outer controller; all contextual information is passed in. - **/ - class Component extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - sendAction(action: string, context: any): void; - targetObject: Controller; - } - /** - A computed property transforms an objects function into a property. - By default the function backing the computed property will only be called once and the result - will be cached. You can specify various properties that your computed property is dependent on. - This will force the cached result to be recomputed if the dependencies are modified. - **/ - class ComputedProperty { - get(keyName: string): any; - meta(meta: {}): ComputedProperty; - property(...args: string[]): ComputedProperty; - readOnly(): ComputedProperty; - set(keyName: string, newValue: any, oldValue: string): any; - // ReSharper disable UsingOfReservedWord - volatile(): ComputedProperty; - // ReSharper restore UsingOfReservedWord - } - class Container { - constructor(parent: Container); - parent: Container; - children: any[]; - owner: any; - ownerInjection(): any; - resolver: Function; - registry: Registry; - cache: {}; - typeInjections: {}; - injections: {}; - child(): Container; - set(object: {}, key: string, value: any): void; - /** - registers a factory for later injection - @param fullName type:name (e.g., 'model:user') - @param factory (e.g., App.Person) - **/ - describe(fullName: string): string; - makeToString(factory: any, fullName: string): Function; - lookup(fullName: string, options?: {}): any; - lookupFactory(fullName: string, options?: {}): any; - destroy(): void; - reset(): void; - } - class Controller extends Object implements ControllerMixin { - replaceRoute(name: string, ...args: any[]): void; - transitionToRoute(name: string, ...args: any[]): void; - controllers: {}; - model: any; - needs: string[]; - queryParams: any; - target: any; - send(name: string, ...args: any[]): void; - actions: ActionsHash; - } - /** - Additional methods for the ControllerMixin. - **/ - class ControllerMixin extends ActionHandlerMixin { - replaceRoute(name: string, ...args: any[]): void; - transitionToRoute(name: string, ...args: any[]): void; - controllers: {}; - model: any; - needs: string[]; - queryParams: any; - target: any; - } - /** - Implements some standard methods for copying an object. Add this mixin to any object you - create that can create a copy of itself. This mixin is added automatically to the built-in array. - You should generally implement the copy() method to return a copy of the receiver. - Note that frozenCopy() will only work if you also implement Ember.Freezable. - **/ - class Copyable { - copy(deep: boolean): Copyable; - frozenCopy(): Copyable; - } - class CoreObject { - /** - An overridable method called when objects are instantiated. By default, - does nothing unless it is overridden during class definition. - @method init - **/ - init(): void; + interface ArrayPrototypeExtensions extends MutableArray, Observable, Copyable {} /** - Defines the properties that will be concatenated from the superclass (instead of overridden). - @property concatenatedProperties - @type Array - @default null - **/ - concatenatedProperties: any[]; - - /** - Destroyed object property flag. If this property is true the observers and bindings were - already removed by the effect of calling the destroy() method. - @property isDestroyed - @default false - **/ - isDestroyed: boolean; - /** - Destruction scheduled flag. The destroy() method has been called. The object stays intact - until the end of the run loop at which point the isDestroyed flag is set. - @property isDestroying - @default false - **/ - isDestroying: boolean; - - /** - Destroys an object by setting the `isDestroyed` flag and removing its - metadata, which effectively destroys observers and bindings. - If you try to set a property on a destroyed object, an exception will be - raised. - Note that destruction is scheduled for the end of the run loop and does not - happen immediately. It will set an isDestroying flag immediately. - @method destroy - @return {Ember.Object} receiver - */ - destroy(): CoreObject; - - /** - Override to implement teardown. - @method willDestroy - */ - willDestroy(): void; - - /** - Returns a string representation which attempts to provide more information than Javascript's toString - typically does, in a generic way for all Ember objects (e.g., ""). - @method toString - @return {String} string representation - **/ - toString(): string; - - static isClass: boolean; - static isMethod: boolean; - - /** - Creates a new subclass. - @method extend - @static - @param {Mixin} [mixins] - One or more Mixin classes - @param {Object} [args] - Object containing values to use within the new class - **/ - static extend(args?: CoreObjectArguments): T; - static extend(mixin1: Mixin, args?: CoreObjectArguments): T; - static extend(mixin1: Mixin, mixin2: Mixin, args?: CoreObjectArguments): T; - static extend(mixin1: Mixin, mixin2: Mixin, mixin3: Mixin, args?: CoreObjectArguments): T; - static extend(mixin1: Mixin, mixin2: Mixin, mixin3: Mixin, mixin4: Mixin, args?: CoreObjectArguments): T; - static extend(mixin1: Mixin, mixin2: Mixin, mixin3: Mixin, mixin4: Mixin, mixin5: Mixin, args?: CoreObjectArguments): T; - static extend(mixin1: Mixin, mixin2: Mixin, mixin3: Mixin, mixin4: Mixin, mixin5: Mixin, mixin6: Mixin, args?: CoreObjectArguments): T; - static extend(mixin1: Mixin, mixin2: Mixin, mixin3: Mixin, mixin4: Mixin, mixin5: Mixin, mixin6: Mixin, mixin7: Mixin, args?: CoreObjectArguments): T; - - /** - Creates a new subclass. - @method extend - @param {Mixin} [mixins] - One or more Mixin classes - @param {Object} [args] - Object containing values to use within the new class - Non-static method because Ember classes aren't currently 'real' TypeScript classes. - **/ - extend(mixin1?: Mixin, mixin2?: Mixin, args?: CoreObjectArguments): T; - - /** - Equivalent to doing extend(arguments).create(). If possible use the normal create method instead. - @method createWithMixins - @static - @param [args] - **/ - static createWithMixins(args?: {}): T; - - /** - Creates an instance of the class. - @method create - @static - @param [args] - A hash containing values with which to initialize the newly instantiated object. - **/ - static create(args?: {}): T; - - /** - Augments a constructor's prototype with additional properties and functions. - To add functions and properties to the constructor itself, see reopenClass. - @method reopen - **/ - static reopen(args?: {}): T; - - /** - Augments a constructor's own properties and functions. - To add functions and properties to instances of a constructor by extending the - constructor's prototype see reopen. - @method reopenClass - **/ - static reopenClass(args?: {}): T; - - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - - /** - Returns the original hash that was passed to meta(). - @method metaForProperty - @static - @param key {String} property name - **/ - static metaForProperty(key: string): {}; - - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - - @method eachComputedProperty - @static - @param {Function} callback - @param {Object} binding - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - } - class DAG { - add(name: string): any; - map(name: string, value: any): void; - addEdge(fromName: string, toName: string): void; - topsort(fn: Function): void; - addEdges(name: string, value: any, before: any, after: any): void; - names: any[]; - vertices: {}; - } - function DEFAULT_GETTER_FUNCTION(name: string): Function; - /** - The DefaultResolver defines the default lookup rules to resolve container lookups before consulting - the container for registered items: - templates are looked up on Ember.TEMPLATES - other names are looked up on the application after converting the name. - For example, controller:post looks up App.PostController by default. - **/ - class DefaultResolver { - resolve(fullName: string): {}; - namespace: Application; - } - /** - Objects of this type can implement an interface to respond to requests to get and set. - The default implementation handles simple properties. - You generally won't need to create or subclass this directly. - **/ - class Descriptor {} - namespace ENV { - const EXTEND_PROTOTYPES: typeof Ember.EXTEND_PROTOTYPES; - const LOG_BINDINGS: boolean; - const LOG_STACKTRACE_ON_DEPRECATION: boolean; - const LOG_VERSION: boolean; - const MODEL_FACTORY_INJECTIONS: boolean; - const RAISE_ON_DEPRECATION: boolean; - } - namespace EXTEND_PROTOTYPES { - const Array: boolean; - const Function: boolean; - const String: boolean; - } - /** - This is the object instance returned when you get the @each property on an array. It uses - the unknownProperty handler to automatically create EachArray instances for property names. - **/ - class EachProxy extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - unknownProperty(keyName: string, value: any): any[]; - } - /** - This mixin defines the common interface implemented by enumerable objects in Ember. Most of these - methods follow the standard Array iteration API defined up to JavaScript 1.8 (excluding language-specific - features that cannot be emulated in older versions of JavaScript). - This mixin is applied automatically to the Array class on page load, so you can use any of these methods - on simple arrays. If Array already implements one of these methods, the mixin will not override them. - **/ - class Enumerable { - addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - any(callback: ItemIndexEnumerableCallback, target?: any): boolean; - anyBy(key: string, value?: string): boolean; - someProperty(key: string, value?: string): boolean; - compact(): any[]; - contains(obj: any): boolean; - enumerableContentDidChange( - start: number, - removing: Enumerable | number, - adding: Enumerable | number - ): any; - enumerableContentDidChange(removing: Enumerable | number, adding: Enumerable | number): any; - enumerableContentWillChange( - removing: Enumerable | number, - adding: Enumerable | number - ): Enumerable; - every(callback: ItemIndexEnumerableCallback, target?: any): boolean; - everyBy(key: string, value?: string): boolean; - everyProperty(key: string, value?: string): boolean; - filter(callback: ItemIndexEnumerableCallback, target: any): any[]; - filterBy(key: string, value?: string): any[]; - find(callback: ItemIndexEnumerableCallback, target: any): any; - findBy(key: string, value?: string): any; - forEach(callback: ItemIndexEnumerableCallback, target?: any): any; - getEach(key: string): any[]; - invoke(methodName: string, ...args: any[]): any[]; - map: ItemIndexEnumerableCallbackTarget; - mapBy(key: string): any[]; - nextObject(index: number, previousObject: any, context: any): any; - reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; - reject: ItemIndexEnumerableCallbackTarget; - rejectBy(key: string, value?: string): any[]; - removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - setEach(key: string, value?: any): any; - some(callback: ItemIndexEnumerableCallback, target?: any): boolean; - toArray(): any[]; - uniq(): Enumerable; - without(value: any): Enumerable; - '[]': any[]; - firstObject: any; - hasEnumerableObservers: boolean; - lastObject: any; - } - /** - A subclass of the JavaScript Error object for use in Ember. - **/ - // Restore this to 'typeof Error' when https://github.com/Microsoft/TypeScript/issues/983 is resolved - // ReSharper disable once DuplicatingLocalDeclaration - const Error: any; // typeof Error; - /** - Handles delegating browser events to their corresponding Ember.Views. For example, when you click on - a view, Ember.EventDispatcher ensures that that view's mouseDown method gets called. - **/ - class EventDispatcher extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - events: {}; - } - /** - This mixin allows for Ember objects to subscribe to and emit events. - You can also chain multiple event subscriptions. - **/ - class Evented { - has(name: string): boolean; - off(name: string, target: any, method: Function): Evented; - on(name: string, target: any, method: Function): Evented; - one(name: string, target: any, method: Function): Evented; - trigger(name: string, ...args: string[]): void; - } - const FROZEN_ERROR: string; - class Freezable { - freeze(): Freezable; - isFrozen: boolean; - } - const GUID_KEY: string; - namespace Handlebars { - function compile(string: string): Function; - function compile(environment: any, options?: any, context?: any, asObject?: any): any; - function precompile(string: string, options: any): void; - class Compiler {} - class JavaScriptCompiler {} - function registerPartial(name: string, str: any): void; - function K(): any; - function createFrame(objec: any): any; - function Exception(message: string): void; - class SafeString { - constructor(str: string); - static toString(): string; - } - function parse(string: string): any; - function print(ast: any): void; - const logger: typeof Ember.Logger; - function log(level: string, str: string): void; - } - class HashLocation extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - } - class HistoryLocation extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - rootURL: string; - } - const IS_BINDING: RegExp; - const inject: { - controller(name?: string): Controller; - service(name?: string): Service; - }; - class Helper extends Object { - static helper(h: (params: any, hash?: any) => any): Helper; - compute(params: any[], hash: any): any; - recompute(params: any[], hash: any): any; - } - class Instrumentation { - getProperties(obj: any, list: any[]): {}; - getProperties(obj: any, ...args: string[]): {}; - instrument(name: string, payload: any, callback: Function, binding: any): void; - reset(): void; - subscribe(pattern: string, object: any): void; - unsubscribe(subscriber: any): void; - } - const K: Function; - const LOG_BINDINGS: boolean; - const LOG_STACKTRACE_ON_DEPRECATION: boolean; - const LOG_VERSION: boolean; - class Location { - create(options?: {}): any; - registerImplementation(name: string, implementation: any): void; - } - const Logger: { - assert(param: any): void; - debug(...args: any[]): void; - error(...args: any[]): void; - info(...args: any[]): void; - log(...args: any[]): void; - warn(...args: any[]): void; - }; - function MANDATORY_SETTER_FUNCTION(value: string): void; - const META_KEY: string; - class Map { - copy(): Map; - static create(): Map; - forEach(callback: Function, self: any): void; - get(key: any): any; - has(key: any): boolean; - set(key: any, value: any): void; - length: number; - } - class MapWithDefault extends Map { - copy(): MapWithDefault; - static create(): MapWithDefault; - } - class Mixin { - apply(obj: any): any; - /** - Creates an instance of the class. - @param arguments A hash containing values with which to initialize the newly instantiated object. - **/ - static create(...args: CoreObjectArguments[]): T; - detect(obj: any): boolean; - reopen(args?: {}): T; - } - class MutableArray implements Array, MutableEnumberable { - addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[]; - addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - any(callback: ItemIndexEnumerableCallback, target?: any): boolean; - anyBy(key: string, value?: string): boolean; - arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - someProperty(key: string, value?: string): boolean; - clear(): any[]; - compact(): any[]; - contains(obj: any): boolean; - enumerableContentDidChange( - start: number, - removing: Enumerable | number, - adding: Enumerable | number - ): any; - enumerableContentDidChange(removing: Enumerable | number, adding: Enumerable | number): any; - enumerableContentWillChange( - removing: Enumerable | number, - adding: Enumerable | number - ): Enumerable; - every(callback: ItemIndexEnumerableCallback, target?: any): boolean; - everyBy(key: string, value?: string): boolean; - everyProperty(key: string, value?: string): boolean; - filter(callback: ItemIndexEnumerableCallback, target: any): any[]; - filterBy(key: string, value?: string): any[]; - find(callback: ItemIndexEnumerableCallback, target: any): any; - findBy(key: string, value?: string): any; - forEach(callback: ItemIndexEnumerableCallback, target?: any): any; - getEach(key: string): any[]; - indexOf(object: any, startAt: number): number; - insertAt(idx: number, object: any): any[]; - invoke(methodName: string, ...args: any[]): any[]; - lastIndexOf(object: any, startAt: number): number; - map: ItemIndexEnumerableCallbackTarget; - mapBy(key: string): any[]; - nextObject(index: number, previousObject: any, context: any): any; - objectAt(idx: number): any; - objectsAt(...args: number[]): any[]; - popObject(): any; - pushObject(obj: any): any; - pushObjects(...args: any[]): any[]; - reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; - reject: ItemIndexEnumerableCallbackTarget; - rejectBy(key: string, value?: string): any[]; - removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[]; - removeAt(start: number, len: number): any; - removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - replace(idx: number, amt: number, objects: any[]): any; - reverseObjects(): any[]; - setEach(key: string, value?: any): any; - setObjects(objects: any[]): any[]; - shiftObject(): any; - slice(beginIndex?: number, endIndex?: number): any[]; - some(callback: ItemIndexEnumerableCallback, target?: any): boolean; - toArray(): any[]; - uniq(): Enumerable; - unshiftObject(object: any): any; - unshiftObjects(objects: any[]): any[]; - without(value: any): Enumerable; - '[]': any[]; - '@each': EachProxy; - Boolean: boolean; - firstObject: any; - hasEnumerableObservers: boolean; - lastObject: any; - length: number; - addObject(object: any): any; - addObjects(objects: Enumerable): MutableEnumberable; - removeObject(object: any): any; - removeObjects(objects: Enumerable): MutableEnumberable; - } - class MutableEnumberable implements Enumerable { - addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - addObject(object: any): any; - addObjects(objects: Enumerable): MutableEnumberable; - any(callback: ItemIndexEnumerableCallback, target?: any): boolean; - anyBy(key: string, value?: string): boolean; - someProperty(key: string, value?: string): boolean; - compact(): any[]; - contains(obj: any): boolean; - enumerableContentDidChange( - start: number, - removing: Enumerable | number, - adding: Enumerable | number - ): any; - enumerableContentDidChange(removing: Enumerable | number, adding: Enumerable | number): any; - enumerableContentWillChange( - removing: Enumerable | number, - adding: Enumerable | number - ): Enumerable; - every(callback: ItemIndexEnumerableCallback, target?: any): boolean; - everyBy(key: string, value?: string): boolean; - everyProperty(key: string, value?: string): boolean; - filter(callback: ItemIndexEnumerableCallback, target: any): any[]; - filterBy(key: string, value?: string): any[]; - find(callback: ItemIndexEnumerableCallback, target: any): any; - findBy(key: string, value?: string): any; - forEach(callback: ItemIndexEnumerableCallback, target?: any): any; - getEach(key: string): any[]; - invoke(methodName: string, ...args: any[]): any[]; - map: ItemIndexEnumerableCallbackTarget; - mapBy(key: string): any[]; - nextObject(index: number, previousObject: any, context: any): any; - reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; - reject: ItemIndexEnumerableCallbackTarget; - rejectBy(key: string, value?: string): any[]; - removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - removeObject(object: any): any; - removeObjects(objects: Enumerable): MutableEnumberable; - setEach(key: string, value?: any): any; - some(callback: ItemIndexEnumerableCallback, target?: any): boolean; - toArray(): any[]; - uniq(): Enumerable; - without(value: any): Enumerable; - '[]': any[]; - firstObject: any; - hasEnumerableObservers: boolean; - lastObject: any; - } - const NAME_KEY: string; - class Namespace extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - } - class NativeArray implements MutableArray, Observable, Copyable { - constructor(arr: any[]); - static activate(): void; - addArrayObserver(target: any, opts?: EnumerableConfigurationOptions): any[]; - addEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - any(callback: ItemIndexEnumerableCallback, target?: any): boolean; - anyBy(key: string, value?: string): boolean; - arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): any[]; - someProperty(key: string, value?: any): boolean; - clear(): any[]; - compact(): any[]; - contains(obj: any): boolean; - enumerableContentDidChange( - start: number, - removing: Enumerable | number, - adding: Enumerable | number - ): any; - enumerableContentDidChange(removing: Enumerable | number, adding: Enumerable | number): any; - enumerableContentWillChange( - removing: Enumerable | number, - adding: Enumerable | number - ): Enumerable; - every(callback: ItemIndexEnumerableCallback, target?: any): boolean; - everyBy(key: string, value?: string): boolean; - everyProperty(key: string, value?: any): boolean; - filter(callback: ItemIndexEnumerableCallback, target: any): any[]; - filterBy(key: string, value?: string): any[]; - find(callback: ItemIndexEnumerableCallback, target: any): any; - findBy(key: string, value?: string): any; - forEach(callback: ItemIndexEnumerableCallback, target?: any): any; - getEach(key: string): any[]; - indexOf(object: any, startAt: number): number; - insertAt(idx: number, object: any): any[]; - invoke(methodName: string, ...args: any[]): any[]; - lastIndexOf(object: any, startAt: number): number; - map: ItemIndexEnumerableCallbackTarget; - mapBy(key: string): any[]; - nextObject(index: number, previousObject: any, context: any): any; - objectAt(idx: number): any; - objectsAt(...args: number[]): any[]; - popObject(): any; - pushObject(obj: any): any; - pushObjects(...args: any[]): any[]; - reduce(callback: ReduceCallback, initialValue: any, reducerProperty: string): any; - reject: ItemIndexEnumerableCallbackTarget; - rejectBy(key: string, value?: string): any[]; - removeArrayObserver(target: any, opts: EnumerableConfigurationOptions): any[]; - removeAt(start: number, len: number): any; - removeEnumerableObserver(target: any, opts: EnumerableConfigurationOptions): Enumerable; - replace(idx: number, amt: number, objects: any[]): any; - reverseObjects(): any[]; - setEach(key: string, value?: any): any; - setObjects(objects: any[]): any[]; - shiftObject(): any; - slice(beginIndex?: number, endIndex?: number): any[]; - some(callback: ItemIndexEnumerableCallback, target?: any): boolean; - toArray(): any[]; - uniq(): Enumerable; - unshiftObject(object: any): any; - unshiftObjects(objects: any[]): any[]; - without(value: any): Enumerable; - '[]': any[]; - '@each': EachProxy; - Boolean: boolean; - firstObject: any; - hasEnumerableObservers: boolean; - lastObject: any; - length: number; - addObject(object: any): any; - addObjects(objects: Enumerable): MutableEnumberable; - removeObject(object: any): any; - removeObjects(objects: Enumerable): MutableEnumberable; - addObserver: ModifyObserver; - beginPropertyChanges(): Observable; - cacheFor(keyName: string): any; - decrementProperty(keyName: string, decrement?: number): number; - endPropertyChanges(): Observable; - get(keyName: string): any; - getProperties(...args: string[]): {}; - getProperties(keys: string[]): {}; - getWithDefault(keyName: string, defaultValue: any): any; - hasObserverFor(key: string): boolean; - incrementProperty(keyName: string, increment?: number): number; - notifyPropertyChange(keyName: string): Observable; - propertyDidChange(keyName: string): Observable; - propertyWillChange(keyName: string): Observable; - removeObserver(key: string, target: any, method: Function | string): void; - set(keyName: string, value: any): Observable; - setProperties(hash: {}): Observable; - toggleProperty(keyName: string): any; - copy(deep: boolean): Copyable; - frozenCopy(): Copyable; - } - class NoneLocation extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - } - const ORDER_DEFINITION: string[]; - class Object extends CoreObject implements Observable { - addObserver: ModifyObserver; - beginPropertyChanges(): Observable; - cacheFor(keyName: string): any; - decrementProperty(keyName: string, decrement?: number): number; - endPropertyChanges(): Observable; - - /** - * Retrieves the value of a property from the object - * @param keyName - * @returns {} + * Given a fullName return a factory manager. */ - get(keyName: string): any; + interface _ContainerProxyMixin { + /** + * Returns an object that can be used to provide an owner to a + * manually created instance. + */ + ownerInjection(): {}; + /** + * Given a fullName return a corresponding instance. + */ + lookup(fullName: string, options: {}): any; + } + const _ContainerProxyMixin: Mixin<_ContainerProxyMixin>; /** - * Retrieves the value of a property from the object - * @param keyName - * @returns {} + * RegistryProxyMixin is used to provide public access to specific + * registry functionality. */ - get(keyName: string): T; - - getProperties(...args: string[]): {}; - getProperties(keys: string[]): {}; - getWithDefault(keyName: string, defaultValue: any): any; - hasObserverFor(key: string): boolean; - incrementProperty(keyName: string, increment?: number): number; - notifyPropertyChange(keyName: string): Observable; - propertyDidChange(keyName: string): Observable; - propertyWillChange(keyName: string): Observable; - removeObserver(key: string, target: any, method: Function | string): Observable; - set(keyName: string, value: any): Observable; - setProperties(hash: {}): Observable; - toggleProperty(keyName: string): any; - } - class ObjectProxy extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - /** - The object whose properties will be forwarded. - **/ - content: Object; - } - class Observable { - addObserver: ModifyObserver; - beginPropertyChanges(): Observable; - cacheFor(keyName: string): any; - decrementProperty(keyName: string, decrement?: number): number; - endPropertyChanges(): Observable; - get(keyName: string): any; - getProperties(...args: string[]): {}; - getProperties(keys: string[]): {}; - getWithDefault(keyName: string, defaultValue: any): any; - hasObserverFor(key: string): boolean; - incrementProperty(keyName: string, increment?: number): number; - notifyPropertyChange(keyName: string): Observable; - propertyDidChange(keyName: string): Observable; - propertyWillChange(keyName: string): Observable; - removeObserver(key: string, target: {}, method: Function | string): void; - set(keyName: string, value: any): Observable; - setProperties(hash: {}): Observable; - /** - Set the value of a boolean property to the opposite of its current value. - */ - toggleProperty(keyName: string): boolean; - } - class OrderedSet { - add(obj: any): void; - clear(): void; - copy(): OrderedSet; - static create(): OrderedSet; - forEach(fn: Function, self: any): void; - has(obj: any): boolean; - isEmpty(): boolean; - toArray(): any[]; - } - class Registry { - constructor(options: any); - static set: typeof Ember.set; - } - - // FYI - RSVP source comes from https://github.com/tildeio/rsvp.js/blob/master/lib/rsvp/promise.js - const RSVP: typeof Rsvp; - - /** - The `Ember.Route` class is used to define individual routes. Refer to - the [routing guide](http://emberjs.com/guides/routing/) for documentation. - */ - class Route extends Object implements ActionHandlerMixin, Evented { - static isClass: boolean; - static isMethod: boolean; - - /** - This hook is executed when the router enters the route. It is not executed - when the model for the route changes. - @method activate - */ - activate: Function; - - /** - This hook is called after this route's model has resolved. - It follows identical async/promise semantics to `beforeModel` - but is provided the route's resolved model in addition to - the `transition`, and is therefore suited to performing - logic that can only take place after the model has already - resolved. - - Refer to documentation for `beforeModel` for a description - of transition-pausing semantics when a promise is returned - from this hook. - @method afterModel - @param {Object} resolvedModel the value returned from `model`, - or its resolved value if it was a promise - @param {Transition} transition - @return {Promise} if the value returned from this hook is - a promise, the transition will pause until the transition - resolves. Otherwise, non-promise return values are not - utilized in any way. - */ - afterModel(resolvedModel: any, transition: EmberStates.Transition): Rsvp.Promise; - - /** - This hook is the first of the route entry validation hooks - called when an attempt is made to transition into a route - or one of its children. It is called before `model` and - `afterModel`, and is appropriate for cases when: - 1) A decision can be made to redirect elsewhere without - needing to resolve the model first. - 2) Any async operations need to occur first before the - model is attempted to be resolved. - This hook is provided the current `transition` attempt - as a parameter, which can be used to `.abort()` the transition, - save it for a later `.retry()`, or retrieve values set - on it from a previous hook. You can also just call - `this.transitionTo` to another route to implicitly - abort the `transition`. - You can return a promise from this hook to pause the - transition until the promise resolves (or rejects). This could - be useful, for instance, for retrieving async code from - the server that is required to enter a route. - - @method beforeModel - @param {Transition} transition - @return {Promise} if the value returned from this hook is - a promise, the transition will pause until the transition - resolves. Otherwise, non-promise return values are not - utilized in any way. - */ - beforeModel(transition: EmberStates.Transition): Rsvp.Promise; - - /** - The controller associated with this route. - - @property controller - @type Ember.Controller - @since 1.6.0 - */ - controller: Controller; - - /** - Returns the controller for a particular route or name. - The controller instance must already have been created, either through entering the - associated route or using `generateController`. - - @method controllerFor - @param {String} name the name of the route or controller - @return {Ember.Controller} - */ - controllerFor(name: string): Controller; - - /** - The name of the controller to associate with this route. - By default, Ember will lookup a route's controller that matches the name - of the route (i.e. `App.PostController` for `App.PostRoute`). However, - if you would like to define a specific controller to use, you can do so - using this property. - This is useful in many ways, as the controller specified will be: - * passed to the `setupController` method. - * used as the controller for the view being rendered by the route. - * returned from a call to `controllerFor` for the route. - @property controllerName - @type String - @default null - @since 1.4.0 - */ - controllerName: string; - - /** - This hook is executed when the router completely exits this route. It is - not executed when the model for the route changes. - @method deactivate - */ - deactivate: Function; - - /** - Deserializes value of the query parameter based on defaultValueType - @method deserializeQueryParam - @param {Object} value - @param {String} urlKey - @param {String} defaultValueType - */ - deserializeQueryParam(value: any, urlKey: string, defaultValueType: string): any; - - /** - Disconnects a view that has been rendered into an outlet. - You may pass any or all of the following options to `disconnectOutlet`: - * `outlet`: the name of the outlet to clear (default: 'main') - * `parentView`: the name of the view containing the outlet to clear - (default: the view rendered by the parent route) - - @method disconnectOutlet - @param {Object|String} options the options hash or outlet name - */ - disconnectOutlet(options: DisconnectOutletOptions | string): void; - - /** - @method findModel - @param {String} type the model type - @param {Object} value the value passed to find - */ - findModel(type: string, value: any): any; - - /** - Generates a controller for a route. - If the optional model is passed then the controller type is determined automatically, - e.g., an ArrayController for arrays. - - @method generateController - @param {String} name the name of the controller - @param {Object} model the model to infer the type of the controller (optional) - */ - generateController(name: string, model: {}): Controller; - - /** - Perform a synchronous transition into another route without attempting - to resolve promises, update the URL, or abort any currently active - asynchronous transitions (i.e. regular transitions caused by - `transitionTo` or URL changes). - This method is handy for performing intermediate transitions on the - way to a final destination route, and is called internally by the - default implementations of the `error` and `loading` handlers. - @method intermediateTransitionTo - @param {String} name the name of the route - @param {...Object} models the model(s) to be used while transitioning - to the route. - @since 1.2.0 - */ - intermediateTransitionTo(name: string, ...models: any[]): void; - - /** - A hook you can implement to convert the URL into the model for - this route. - - @method model - @param {Object} params the parameters extracted from the URL - @param {Transition} transition - @return {Object|Promise} the model for this route. If - a promise is returned, the transition will pause until - the promise resolves, and the resolved value of the promise - will be used as the model for this route. - */ - model(params: {}, transition: EmberStates.Transition): any | Rsvp.Promise; - - /** - Returns the model of a parent (or any ancestor) route - in a route hierarchy. During a transition, all routes - must resolve a model object, and if a route - needs access to a parent route's model in order to - resolve a model (or just reuse the model from a parent), - it can call `this.modelFor(theNameOfParentRoute)` to - retrieve it. - - @method modelFor - @param {String} name the name of the route - @return {Object} the model object - */ - modelFor(name: string): {}; - - /** - Retrieves parameters, for current route using the state.params - variable and getQueryParamsFor, using the supplied routeName. - @method paramsFor - @param {String} name - */ - paramsFor(name: string): any; - - /** - Configuration hash for this route's queryParams. - @property queryParams - @for Ember.Route - @type Hash - */ - queryParams: {}; - - /** - Refresh the model on this route and any child routes, firing the - `beforeModel`, `model`, and `afterModel` hooks in a similar fashion - to how routes are entered when transitioning in from other route. - The current route params (e.g. `article_id`) will be passed in - to the respective model hooks, and if a different model is returned, - `setupController` and associated route hooks will re-fire as well. - An example usage of this method is re-querying the server for the - latest information using the same parameters as when the route - was first entered. - Note that this will cause `model` hooks to fire even on routes - that were provided a model object when the route was initially - entered. - @method refresh - @return {Transition} the transition object associated with this - attempted transition - @since 1.4.0 - */ - redirect(): EmberStates.Transition; - - /** - Refresh the model on this route and any child routes, firing the - `beforeModel`, `model`, and `afterModel` hooks in a similar fashion - to how routes are entered when transitioning in from other route. - The current route params (e.g. `article_id`) will be passed in - to the respective model hooks, and if a different model is returned, - `setupController` and associated route hooks will re-fire as well. - An example usage of this method is re-querying the server for the - latest information using the same parameters as when the route - was first entered. - Note that this will cause `model` hooks to fire even on routes - that were provided a model object when the route was initially - entered. - @method refresh - @return {Transition} the transition object associated with this - attempted transition - @since 1.4.0 - */ - refresh(): EmberStates.Transition; - - /** - `render` is used to render a template into a region of another template - (indicated by an `{{outlet}}`). `render` is used both during the entry - phase of routing (via the `renderTemplate` hook) and later in response to - user interaction. - - @method render - @param {String} name the name of the template to render - @param {Object} [options] the options - @param {String} [options.into] the template to render into, - referenced by name. Defaults to the parent template - @param {String} [options.outlet] the outlet inside `options.template` to render into. - Defaults to 'main' - @param {String|Object} [options.controller] the controller to use for this template, - referenced by name or as a controller instance. Defaults to the Route's paired controller - @param {Object} [options.model] the model object to set on `options.controller`. - Defaults to the return value of the Route's model hook - */ - render(name: string, options?: RenderOptions): void; - - /** - A hook you can use to render the template for the current route. - This method is called with the controller for the current route and the - model supplied by the `model` hook. By default, it renders the route's - template, configured with the controller for the route. - This method can be overridden to set up and render additional or - alternative templates. - - @method renderTemplate - @param {Object} controller the route's controller - @param {Object} model the route's model - */ - renderTemplate(controller: Controller, model: {}): void; - - /** - Transition into another route while replacing the current URL, if possible. - This will replace the current history entry instead of adding a new one. - Beside that, it is identical to `transitionTo` in all other respects. See - 'transitionTo' for additional information regarding multiple models. - - @method replaceWith - @param {String} name the name of the route or a URL - @param {...Object} models the model(s) or identifier(s) to be used while - transitioning to the route. - @return {Transition} the transition object associated with this - attempted transition - */ - replaceWith(name: string, ...models: any[]): void; - - /** - A hook you can use to reset controller values either when the model - changes or the route is exiting. - - @method resetController - @param {Controller} controller instance - @param {Boolean} isExiting - @param {Object} transition - @since 1.7.0 - */ - resetController(controller: Ember.Controller, isExiting: boolean, transition: any): void; - - /** - A hook you can implement to convert the route's model into parameters - for the URL. - - The default `serialize` method will insert the model's `id` into the - route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'. - If the route has multiple dynamic segments or does not contain '_id', `serialize` - will return `Ember.getProperties(model, params)` - This method is called when `transitionTo` is called with a context - in order to populate the URL. - @method serialize - @param {Object} model the route's model - @param {Array} params an Array of parameter names for the current - route (in the example, `['post_id']`. - @return {Object} the serialized parameters - */ - serialize(model: {}, params: string[]): string; - - /** - Serializes value of the query parameter based on defaultValueType - @method serializeQueryParam - @param {Object} value - @param {String} urlKey - @param {String} defaultValueType - */ - serializeQueryParam(value: any, urlKey: string, defaultValueType: string): string; - - /** - Serializes the query parameter key - @method serializeQueryParamKey - @param {String} controllerPropertyName - */ - serializeQueryParamKey(controllerPropertyName: string): string; - - /** - A hook you can use to setup the controller for the current route. - This method is called with the controller for the current route and the - model supplied by the `model` hook. - By default, the `setupController` hook sets the `model` property of - the controller to the `model`. - If you implement the `setupController` hook in your Route, it will - prevent this default behavior. If you want to preserve that behavior - when implementing your `setupController` function, make sure to call - `_super` - @method setupController - @param {Controller} controller instance - @param {Object} model - */ - setupController(controller: Controller, model: {}): void; - - /** - Store property provides a hook for data persistence libraries to inject themselves. - By default, this store property provides the exact same functionality previously - in the model hook. - Currently, the required interface is: - `store.find(modelName, findArguments)` - @method store - @param {Object} store - */ - store(store: any): any; - - /** - The name of the template to use by default when rendering this routes - template. - This is similar with `viewName`, but is useful when you just want a custom - template without a view. - - @property templateName - @type String - @default null - @since 1.4.0 - */ - templateName: string; - - /** - Transition the application into another route. The route may - be either a single route or route path - - @method transitionTo - @param {String} name the name of the route or a URL - @param {...Object} models the model(s) or identifier(s) to be used while - transitioning to the route. - @param {Object} [options] optional hash with a queryParams property - containing a mapping of query parameters - @return {Transition} the transition object associated with this - attempted transition - */ - transitionTo(name: string, ...object: any[]): EmberStates.Transition; - - /** - The name of the view to use by default when rendering this routes template. - When rendering a template, the route will, by default, determine the - template and view to use from the name of the route itself. If you need to - define a specific view, set this property. - This is useful when multiple routes would benefit from using the same view - because it doesn't require a custom `renderTemplate` method. - @property viewName - @type String - @default null - @since 1.4.0 - */ - viewName: string; - - // ActionHandlerMixin methods - - /** - Sends an action to the router, which will delegate it to the currently - active route hierarchy per the bubbling rules explained under actions - - @method send - @param {String} actionName The action to trigger - @param {*} context a context to send with the action - */ - send(name: string, ...args: any[]): void; - - /** - The collection of functions, keyed by name, available on this - `ActionHandler` as action targets. - These functions will be invoked when a matching `{{action}}` is triggered - from within a template and the application's current route is this route. - Actions can also be invoked from other parts of your application - via `ActionHandler#send`. - The `actions` hash will inherit action handlers from - the `actions` hash defined on extended parent classes - or mixins rather than just replace the entire hash. - - Within a Controller, Route, View or Component's action handler, - the value of the `this` context is the Controller, Route, View or - Component object: - - It is also possible to call `this._super.apply(this, arguments)` from within an - action handler if it overrides a handler defined on a parent - class or mixin. - - ## Bubbling - By default, an action will stop bubbling once a handler defined - on the `actions` hash handles it. To continue bubbling the action, - you must return `true` from the handler - - @property actions - @type Hash - @default null - */ - actions: ActionsHash; - - // Evented methods - - /** - Subscribes to a named event with given function. - - An optional target can be passed in as the 2nd argument that will - be set as the "this" for the callback. This is a good way to give your - function access to the object triggering the event. When the target - parameter is used the callback becomes the third argument. - - @method on - @param {String} name The name of the event - @param {Object} [target] The "this" binding for the callback - @param {Function} method The callback to execute - @return this - */ - on(name: string, target: any, method: Function): Evented; - - /** - Subscribes a function to a named event and then cancels the subscription - after the first time the event is triggered. It is good to use ``one`` when - you only care about the first time an event has taken place. - This function takes an optional 2nd argument that will become the "this" - value for the callback. If this argument is passed then the 3rd argument - becomes the function. - - @method one - @param {String} name The name of the event - @param {Object} [target] The "this" binding for the callback - @param {Function} method The callback to execute - @return this - */ - one(name: string, target: any, method: Function): Evented; - - /** - Triggers a named event for the object. Any additional arguments - will be passed as parameters to the functions that are subscribed to the - event. - - @method trigger - @param {String} name The name of the event - @param {Object...} args Optional arguments to pass on - */ - trigger(name: string, ...args: string[]): void; - - /** - Cancels subscription for given name, target, and method. - - @method off - @param {String} name The name of the event - @param {Object} target The target of the subscription - @param {Function} method The function of the subscription - @return this - */ - off(name: string, target: any, method: Function): Evented; - - /** - Checks to see if object has any subscriptions for named event. - - @method has - @param {String} name The name of the event - @return {Boolean} does the object have a subscription for event - */ - has(name: string): boolean; - } - - class Router extends Object { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - map(callback: Function): Router; - } - class RouterDSL { - resource(name: string, options?: {}, callback?: Function): void; - resource(name: string, callback: Function): void; - route(name: string, options?: {}): void; - explicitIndex: boolean; - router: Router; - options: any; - } - class Service extends CoreObject implements Observable { - /* Observable */ - addObserver: ModifyObserver; - beginPropertyChanges(): Observable; - cacheFor(keyName: string): any; - decrementProperty(keyName: string, decrement?: number): number; - endPropertyChanges(): Observable; - get(keyName: string): any; - getProperties(...args: string[]): {}; - getProperties(keys: string[]): {}; - getWithDefault(keyName: string, defaultValue: any): any; - hasObserverFor(key: string): boolean; - incrementProperty(keyName: string, increment?: number): number; - notifyPropertyChange(keyName: string): Observable; - propertyDidChange(keyName: string): Observable; - propertyWillChange(keyName: string): Observable; - removeObserver(key: string, target: {}, method: Function | string): void; - set(keyName: string, value: any): Observable; - setProperties(hash: {}): Observable; - toggleProperty(keyName: string): boolean; - /* /Observable */ - } - const STRINGS: boolean; - class State extends Object implements Evented { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - has(name: string): boolean; - off(name: string, target: any, method: Function): State; - on(name: string, target: any, method: Function): State; - one(name: string, target: any, method: Function): State; - trigger(name: string, ...args: string[]): void; - getPathsCache(stateManager: {}, path: string): {}; - init(): void; - setPathsCache(stateManager: {}, path: string, transitions: any): void; - static transitionTo(target: string): void; - hasContext: boolean; - isLeaf: boolean; - name: string; - parentState: State; - path: string; - enter: Function; - exit: Function; - setup: Function; - } - class StateManager extends State { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - contextFreeTransition(currentState: State, path: string): TransitionsHash; - enterState(transition: TransitionsHash): void; - getState(name: string): State; - getStateByPath(root: State, path: string): State; - getStateMeta(state: State, key: string): any; - getStatesInPath(root: State, path: string): State[]; - goToState(path: string, context: any): void; - send(event: string): void; - setStateMeta(state: State, key: string, value: any): any; - stateMetaFor(state: State): {}; - transitionTo(path: string, context: any): void; - triggerSetupContext(transitions: TransitionsHash): void; - unhandledEvent(manager: StateManager, event: string): any; - currentPath: string; - currentState: State; - errorOnUnhandledEvents: boolean; - transitionEvent: string; - } - namespace String { - function camelize(str: string): string; - function capitalize(str: string): string; - function classify(str: string): string; - function dasherize(str: string): string; - function decamelize(str: string): string; - function fmt(...args: string[]): string; - function htmlSafe(str: string): void; // TODO: @returns Handlebars.SafeStringStatic; - function loc(...args: string[]): string; - function underscore(str: string): string; - function w(str: string): string[]; - } - const TEMPLATES: {}; - class TargetActionSupport { - triggerAction(opts: {}): boolean; - } - namespace Test { - class Adapter extends Ember.Object { - constructor(); + interface _RegistryProxyMixin { + /** + * Given a fullName return the corresponding factory. + */ + resolveRegistration(fullName: string): Function; + /** + * Registers a factory that can be used for dependency injection (with + * `inject`) or for service lookup. Each factory is registered with + * a full name including two parts: `type:name`. + */ + register(fullName: string, factory: Function, options: {}): any; + /** + * Unregister a factory. + */ + unregister(fullName: string): any; + /** + * Check if a factory is registered. + */ + hasRegistration(fullName: string): boolean; + /** + * Register an option for a particular factory. + */ + registerOption(fullName: string, optionName: string, options: {}): any; + /** + * Return a specific registered option for a particular factory. + */ + registeredOption(fullName: string, optionName: string): {}; + /** + * Register options for a particular factory. + */ + registerOptions(fullName: string, options: {}): any; + /** + * Return registered options for a particular factory. + */ + registeredOptions(fullName: string): {}; + /** + * Allow registering options for all factories of a type. + */ + registerOptionsForType(type: string, options: {}): any; + /** + * Return the registered options for all factories of a type. + */ + registeredOptionsForType(type: string): {}; + /** + * Define a dependency injection onto a specific factory or all factories + * of a type. + */ + inject(factoryNameOrType: string, property: string, injectionName: string): any; } - class Promise extends Rsvp.Promise { - constructor(); + const _RegistryProxyMixin: Mixin<_RegistryProxyMixin>; + /** + Ember.ActionHandler is available on some familiar classes including Ember.Route, + Ember.Component, and Ember.Controller. (Internally the mixin is used by Ember.CoreView, + Ember.ControllerMixin, and Ember.Route and available to the above classes through inheritance.) + **/ + interface ActionHandler { + /** + Triggers a named action on the ActionHandler. Any parameters supplied after the actionName + string will be passed as arguments to the action target function. + + If the ActionHandler has its target property set, actions may bubble to the target. + Bubbling happens when an actionName can not be found in the ActionHandler's actions + hash or if the action target function returns true. + **/ + send(actionName: string, ...args: any[]): void; + /** + The collection of functions, keyed by name, available on this ActionHandler as action targets. + **/ + actions: ActionsHash; } - function oninjectHelpers(callback: Function): void; - function promise(resolver: (a: T) => any, label: string): Ember.Test.Promise; - function unregisterHelper(name: string): void; - function registerHelper(name: string, helperMethod: Function): void; - function registerAsyncHelper(name: string, helperMethod: Function): void; - - const adapter: Object; - const QUnitAdapter: Object; - - function registerWaiter(callback: Function): void; - function registerWaiter(context: any, callback: Function): void; - function unregisterWaiter(callback: Function): void; - function unregisterWaiter(context: any, callback: Function): void; - - function resolve(result: T): Ember.Test.Promise; - } - class TextArea extends Component implements TextSupport { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; + const ActionHandler: Ember.Mixin; /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. + An instance of Ember.Application is the starting point for every Ember application. It helps to + instantiate, initialize and coordinate the many objects that make up your app. **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - cancel(event: Function): void; - focusIn(event: Function): void; - focusOut(event: Function): void; - insertNewLine(event: Function): void; - keyPress(event: Function): void; - action: string; - bubbles: boolean; - onEvent: string; - } - class TextField extends Component implements TextSupport { - static detect(obj: any): boolean; - static detectInstance(obj: any): boolean; - /** - Iterate over each computed property for the class, passing its name and any - associated metadata (see metaForProperty) to the callback. - **/ - static eachComputedProperty(callback: Function, binding: {}): void; - /** - Returns the original hash that was passed to meta(). - @param key property name - **/ - static metaForProperty(key: string): {}; - static isClass: boolean; - static isMethod: boolean; - cancel(event: Function): void; - focusIn(event: Function): void; - focusOut(event: Function): void; - insertNewLine(event: Function): void; - keyPress(event: Function): void; - action: string; - bubbles: boolean; - onEvent: string; - pattern: string; - size: string; - type: string; - value: string; - } - class TextSupport { - cancel(event: Function): void; - focusIn(event: Function): void; - focusOut(event: Function): void; - insertNewLine(event: Function): void; - keyPress(event: Function): void; - action: string; - bubbles: boolean; - onEvent: string; - } - const VERSION: string; - class ViewTargetActionSupport extends Mixin { - target: any; - actionContext: any; - } - const ViewUtils: {}; // TODO: define interface - function addListener( - obj: any, - eventName: string, - target: Function | any, - method: Function | string, - once?: boolean - ): void; - const addObserver: ModifyObserver; - /** - Ember.alias is deprecated. Please use Ember.aliasMethod or Ember.computed.alias instead. - **/ - const alias: typeof deprecateFunc; - function aliasMethod(methodName: string): Descriptor; - function assert(desc: string, test: boolean): void; - function beginPropertyChanges(): void; - function bind(obj: any, to: string, from: string): Binding; - function cacheFor(obj: any, key: string): any; - function canInvoke(obj: any, methodName: string): boolean; - function changeProperties(callback: Function, binding?: any): void; - function compare(v: any, w: any): number; - // ReSharper disable once DuplicatingLocalDeclaration - const computed: { - (...args: any[]): ComputedProperty; - alias(dependentKey: string): ComputedProperty; - and(...args: string[]): ComputedProperty; - any(...args: string[]): ComputedProperty; - bool(dependentKey: string): ComputedProperty; - defaultTo(defaultPath: string): ComputedProperty; - empty(dependentKey: string): ComputedProperty; - equal(dependentKey: string, value: any): ComputedProperty; - filter( - dependentKey: string, - callback: (item: any, index?: number, array?: any[]) => boolean - ): ComputedProperty; - filterBy(dependentKey: string, propertyKey: string, value: any): ComputedProperty; - gt(dependentKey: string, value: number): ComputedProperty; - gte(dependentKey: string, value: number): ComputedProperty; - lt(dependentKey: string, value: number): ComputedProperty; - lte(dependentKey: string, value: number): ComputedProperty; - map(dependentKey: string, callback: (item: any, index: number) => T): ComputedProperty; - match(dependentKey: string, regexp: RegExp): ComputedProperty; - none(dependentKey: string): ComputedProperty; - not(dependentKey: string): ComputedProperty; - notEmpty(dependentKey: string): ComputedProperty; - oneWay(dependentKey: string): ComputedProperty; - or(...args: string[]): ComputedProperty; - readOnly(dependentString: string): ComputedProperty; - }; - // ReSharper restore DuplicatingLocalDeclaration - function controllerFor( - container: Container, - controllerName: string, - lookupOptions?: {} - ): Controller; - function copy(obj: any, deep: boolean): any; - /** - Creates an instance of the CoreObject class. - @param arguments A hash containing values with which to initialize the newly instantiated object. - **/ - function create(arguments?: {}): CoreObject; - function debug(message: string): void; - function defineProperty(obj: any, keyName: string, desc: {}): void; - function deprecate(message: string, test?: boolean): void; - function deprecateFunc(message: string, func: Function): Function; - function destroy(obj: any): void; - /** - Ember.empty is deprecated. Please use Ember.isEmpty instead. - **/ - // ReSharper disable once DuplicatingLocalDeclaration - const empty: typeof deprecateFunc; - function endPropertyChanges(): void; - function finishChains(obj: any): void; - function generateController( - container: Container, - controllerName: string, - context: any - ): Controller; - function generateGuid(obj: any, prefix?: string): string; - function get(obj: any, keyName: string): any; - function getProperties(obj: any, ...args: string[]): object; - function getProperties(obj: any, keys: string[]): object; - /** - getPath is deprecated since get now supports paths. - **/ - const getPath: typeof deprecateFunc; - function getWithDefault(root: string, key: string, defaultValue: any): any; - function guidFor(obj: any): string; - function handleErrors(func: Function, context: any): any; - function hasListeners(context: any, name: string): boolean; - function hasOwnProperty(prop: string): boolean; - function immediateObserver(func: Function, ...propertyNames: any[]): Function; - function inspect(obj: any): string; - function instrument(name: string, payload: any, callback: Function, binding: any): void; - function isArray(obj: any): boolean; - function isBlank(obj: any): boolean; - function isEmpty(obj: any): boolean; - function isEqual(a: any, b: any): boolean; - function isGlobalPath(path: string): boolean; - const isNamespace: boolean; - function isNone(obj: any): boolean; - function isPresent(obj: any): boolean; - function isPrototypeOf(obj: {}): boolean; - function isWatching(obj: any, key: string): boolean; - function keys(obj: any): any[]; - function listenersDiff(obj: any, eventName: string, otherActions: any[]): any[]; - function listenersFor(obj: any, eventName: string): any[]; - function listenersUnion(obj: any, eventName: string, otherActions: any[]): void; - // ReSharper disable once DuplicatingLocalDeclaration - const lookup: {}; // TODO: define interface - function makeArray(obj: any): any[]; - function merge(original: any, updates: any): any; - function meta(obj: any): {}; - function mixin(obj: any, ...args: any[]): any; - /** - Ember.none is deprecated. Please use Ember.isNone instead. - **/ - const none: typeof deprecateFunc; - function observer(...args: any[]): Function; - function observersFor(obj: any, path: string): any[]; - function onLoad(name: string, callback: Function): void; - const onError: Error; - function onerror(error: any): void; - function overrideChains(obj: any, keyName: string, m: any): boolean; - // ReSharper disable once DuplicatingLocalDeclaration - const platform: { - defineProperty: boolean; - hasPropertyAccessors: boolean; - }; - function propertyDidChange(obj: any, keyName: string): void; - function propertyIsEnumerable(prop: string): boolean; - function propertyWillChange(obj: any, keyName: string): void; - function removeChainWatcher(obj: any, keyName: string, node: any): void; - function removeListener( - obj: any, - eventName: string, - target: Function | any, - method: Function | string - ): void; - function removeObserver(obj: any, path: string, target: any, method: Function): any; - function required(): Descriptor; - function rewatch(obj: any): void; + class Application extends Namespace { + /** + Call advanceReadiness after any asynchronous setup logic has completed. + Each call to deferReadiness must be matched by a call to advanceReadiness + or the application will never become ready and routing will not begin. + **/ + advanceReadiness(): void; + /** + Use this to defer readiness until some condition is true. - type RunMethod = (...args: any[]) => T; - const run: { - (method: RunMethod | string): T; - (target: any, method: RunMethod | string): T; - begin(): void; - cancel(timer: any): void; - debounce(target: any, method: Function | string, ...args: any[]): void; - end(): void; - join(target: any, method: Function | string, ...args: any[]): any; - later(target: any, method: Function | string, ...args: any[]): string; - next(target: any, method: Function | string, ...args: any[]): number; - once(target: any, method: Function | string, ...args: any[]): number; - schedule(queue: string, target: any, method: Function | string, ...args: any[]): void; - scheduleOnce(queue: string, target: any, method: Function | string, ...args: any[]): void; - sync(): void; - throttle(target: any, method: Function | string, ...args: any[]): void; - queues: any[]; - }; - function runInDebug(fn: Function): void; - function runLoadHooks(name: string, object: any): void; - function sendEvent(obj: any, eventName: string, params?: any[], actions?: any[]): boolean; - function set(obj: any, keyName: string, value: any): any; - /** - setPath is deprecated since set now supports paths. - **/ - const setPath: typeof deprecateFunc; - function setProperties(self: any, hash: {}): any; - function subscribe(pattern: string, object: any): void; - function toLocaleString(): string; - function toString(): string; - function tryCatchFinally( - tryable: Function, - catchable: Function, - finalizer: Function, - binding?: any - ): any; - function tryInvoke(obj: any, methodName: string, args?: any[]): any; - function trySet(obj: any, path: string, value: any): void; - /** - trySetPath has been renamed to trySet. - **/ - const trySetPath: typeof deprecateFunc; - function typeOf(item: any): string; - function unwatch(obj: any, keyPath: string): void; - function unwatchKey(obj: any, keyName: string): void; - function unwatchPath(obj: any, keyPath: string): void; - // ReSharper disable once DuplicatingLocalDeclaration - const uuid: number; - function valueOf(): {}; - function warn(message: string, test?: boolean): void; - function watch(obj: any, keyPath: string): void; - function watchKey(obj: any, keyName: string): void; - function watchPath(obj: any, keyPath: string): void; - function watchedEvents(obj: {}): any[]; - function wrap(func: Function, superFunc: Function): Function; - const _ContainerProxyMixin: Mixin; - const _RegistryProxyMixin: Mixin; - function getOwner(object: any): any; - function setOwner(object: any, owner: any): void; - const testing: boolean; - const MODEL_FACTORY_INJECTIONS: boolean; - function assign(original: any, ...sources: any[]): any; + This allows you to perform asynchronous setup logic and defer + booting your application until the setup has finished. + + However, if the setup requires a loading UI, it might be better + to use the router for this purpose. + */ + deferReadiness(): void; + /** + defines an injection or typeInjection + **/ + inject(factoryNameOrType: string, property: string, injectionName: string): void; + /** + This injects the test helpers into the window's scope. If a function of the + same name has already been defined it will be cached (so that it can be reset + if the helper is removed with `unregisterHelper` or `removeTestHelpers`). + Any callbacks registered with `onInjectHelpers` will be called once the + helpers have been injected. + **/ + injectTestHelpers(): void; + /** + registers a factory for later injection + @param fullName type:name (e.g., 'model:user') + @param factory (e.g., App.Person) + **/ + register(fullName: string, factory: Function, options?: {}): void; + /** + This removes all helpers that have been registered, and resets and functions + that were overridden by the helpers. + **/ + removeTestHelpers(): void; + /** + Reset the application. This is typically used only in tests. + **/ + reset(): void; + /** + This hook defers the readiness of the application, so that you can start + the app when your tests are ready to run. It also sets the router's + location to 'none', so that the window's location will not be modified + (preventing both accidental leaking of state between tests and interference + with your testing framework). + **/ + setupForTesting(): void; + /** + The DOM events for which the event dispatcher should listen. + */ + customEvents: EventDispatcherEvents; + /** + The Ember.EventDispatcher responsible for delegating events to this application's views. + **/ + eventDispatcher: EventDispatcher; + /** + Set this to provide an alternate class to Ember.DefaultResolver + **/ + resolver: DefaultResolver; + /** + The root DOM element of the Application. This can be specified as an + element or a jQuery-compatible selector string. + + This is the element that will be passed to the Application's, eventDispatcher, + which sets up the listeners for event delegation. Every view in your application + should be a child of the element you specify here. + **/ + rootElement: HTMLElement | string; + /** + Called when the Application has become ready. + The call will be delayed until the DOM has become ready. + **/ + ready: Function; + /** + Application's router. + **/ + Router: Router; + registry: Registry; + } + /** + The `ApplicationInstance` encapsulates all of the stateful aspects of a + running `Application`. + **/ + class ApplicationInstance extends EngineInstance {} + /** + This module implements Observer-friendly Array-like behavior. This mixin is picked up by the + Array class as well as other controllers, etc. that want to appear to be arrays. + **/ + interface Array extends Enumerable { + /** + * __Required.__ You must implement this method to apply this mixin. + */ + length: number | ComputedProperty; + /** + * Returns the object at the given `index`. If the given `index` is negative + * or is greater or equal than the array length, returns `undefined`. + */ + objectAt(idx: number): T | undefined; + /** + * This returns the objects at the specified indexes, using `objectAt`. + */ + objectsAt(indexes: number[]): Ember.Array; + /** + * Returns a new array that is a slice of the receiver. This implementation + * uses the observable array methods to retrieve the objects for the new + * slice. + */ + slice(beginIndex?: number, endIndex?: number): T[]; + /** + * Returns the index of the given object's first occurrence. + * If no `startAt` argument is given, the starting location to + * search is 0. If it's negative, will count backward from + * the end of the array. Returns -1 if no match is found. + */ + indexOf(searchElement: T, fromIndex?: number): number; + /** + * Returns the index of the given object's last occurrence. + * If no `startAt` argument is given, the search starts from + * the last position. If it's negative, will count backward + * from the end of the array. Returns -1 if no match is found. + */ + lastIndexOf(searchElement: T, fromIndex?: number): number; + /** + * Adds an array observer to the receiving array. The array observer object + * normally must implement two methods: + */ + addArrayObserver(target: {}, opts: {}): this; + /** + * Removes an array observer from the object if the observer is current + * registered. Calling this method multiple times with the same object will + * have no effect. + */ + removeArrayObserver(target: {}, opts: {}): this; + /** + * Becomes true whenever the array currently has observers watching changes + * on the array. + */ + hasArrayObservers: ComputedProperty; + /** + * If you are implementing an object that supports `Ember.Array`, call this + * method just before the array content changes to notify any observers and + * invalidate any related properties. Pass the starting index of the change + * as well as a delta of the amounts to change. + */ + arrayContentWillChange(startIdx: number, removeAmt: number, addAmt: number): this; + /** + * If you are implementing an object that supports `Ember.Array`, call this + * method just after the array content changes to notify any observers and + * invalidate any related properties. Pass the starting index of the change + * as well as a delta of the amounts to change. + */ + arrayContentDidChange(startIdx: number, removeAmt: number, addAmt: number): this; + /** + * Returns a special object that can be used to observe individual properties + * on the array. Just get an equivalent property on this object and it will + * return an enumerable that maps automatically to the named key on the + * member objects. + */ + '@each': ComputedProperty; + } + // Ember.Array rather than Array because the `array-type` lint rule doesn't realize the global is shadowed + const Array: Mixin>; + + /** + An ArrayProxy wraps any other object that implements Ember.Array and/or Ember.MutableArray, + forwarding all requests. This makes it very useful for a number of binding use cases or other cases + where being able to swap out the underlying array is useful. + **/ + interface ArrayProxy extends MutableArray {} + class ArrayProxy extends Object.extend(MutableArray as {}) { + content: NativeArray; + + /** + * Should actually retrieve the object at the specified index from the + * content. You can override this method in subclasses to transform the + * content item to something new. + */ + objectAtContent(idx: number): T | undefined; + } + /** + AutoLocation will select the best location option based off browser support with the priority order: history, hash, none. + **/ + class AutoLocation extends Object {} + /** + * Connects the properties of two objects so that whenever the value of one property changes, + * the other property will be changed also. + * + * @deprecated https://emberjs.com/deprecations/v2.x#toc_ember-binding + **/ + class Binding { + constructor(toPath: string, fromPath: string); + connect(obj: any): Binding; + copy(): Binding; + disconnect(): Binding; + from(path: string): Binding; + to(path: string | string[]): Binding; + toString(): string; + } + /** + The internal class used to create text inputs when the {{input}} helper is used + with type of checkbox. See Handlebars.helpers.input for usage details. + **/ + class Checkbox extends Component {} + /** + * Implements some standard methods for comparing objects. Add this mixin to + * any class you create that can compare its instances. + */ + interface Comparable { + compare(a: any, b: any): number; + } + const Comparable: Mixin; + /** + A view that is completely isolated. Property access in its templates go to the view object + and actions are targeted at the view object. There is no access to the surrounding context or + outer controller; all contextual information is passed in. + **/ + class Component extends CoreView.extend(ViewMixin, ActionSupport, ClassNamesSupport) { + // methods + readDOMAttr(name: string): string; + // properties + /** + * The WAI-ARIA role of the control represented by this view. For example, a button may have a + * role of type 'button', or a pane may have a role of type 'alertdialog'. This property is + * used by assistive software to help visually challenged users navigate rich web applications. + */ + ariaRole: string; + /** + * The HTML id of the component's element in the DOM. You can provide this value yourself but + * it must be unique (just as in HTML): + * + * If not manually set a default value will be provided by the framework. Once rendered an + * element's elementId is considered immutable and you should never change it. If you need + * to compute a dynamic value for the elementId, you should do this when the component or + * element is being instantiated: + */ + elementId: string; + /** + * If false, the view will appear hidden in DOM. + */ + isVisible: boolean; + /** + * A component may contain a layout. A layout is a regular template but supersedes the template + * property during rendering. It is the responsibility of the layout template to retrieve the + * template property from the component (or alternatively, call Handlebars.helpers.yield, + * {{yield}}) to render it in the correct location. This is useful for a component that has a + * shared wrapper, but which delegates the rendering of the contents of the wrapper to the + * template property on a subclass. + */ + layout: TemplateFactory | string; + /** + * Enables components to take a list of parameters as arguments. + */ + static positionalParams: string[] | string; + // events + /** + * Called when the attributes passed into the component have been updated. Called both during the + * initial render of a container and during a rerender. Can be used in place of an observer; code + * placed here will be executed every time any attribute updates. + */ + didReceiveAttrs(): void; + /** + * Called after a component has been rendered, both on initial render and in subsequent rerenders. + */ + didRender(): void; + /** + * Called when the component has updated and rerendered itself. Called only during a rerender, + * not during an initial render. + */ + didUpdate(): void; + /** + * Called when the attributes passed into the component have been changed. Called only during a + * rerender, not during an initial render. + */ + didUpdateAttrs(): void; + /** + * Called before a component has been rendered, both on initial render and in subsequent rerenders. + */ + willRender(): void; + /** + * Called when the component is about to update and rerender itself. Called only during a rerender, + * not during an initial render. + */ + willUpdate(): void; + } + /** + A computed property transforms an objects function into a property. + By default the function backing the computed property will only be called once and the result + will be cached. You can specify various properties that your computed property is dependent on. + This will force the cached result to be recomputed if the dependencies are modified. + **/ + class ComputedProperty { + /** + * Call on a computed property to set it into non-cached mode. When in this + * mode the computed property will not automatically cache the return value. + */ + volatile(): this; + /** + * Call on a computed property to set it into read-only mode. When in this + * mode the computed property will throw an error when set. + */ + readOnly(): this; + /** + * Sets the dependent keys on this computed property. Pass any number of + * arguments containing key paths that this computed property depends on. + */ + property(...path: string[]): this; + /** + * In some cases, you may want to annotate computed properties with additional + * metadata about how they function or what values they operate on. For example, + * computed property functions may close over variables that are then no longer + * available for introspection. + */ + meta(meta: {}): this; + meta(): {}; + } + /** + * A container used to instantiate and cache objects. + */ + class Container { + /** + * Given a fullName, return the corresponding factory. The consumer of the factory + * is responsible for the destruction of any factory instances, as there is no + * way for the container to ensure instances are destroyed when it itself is + * destroyed. + */ + factoryFor(fullName: string, options?: {}): any; + } + /** + The ContainerDebugAdapter helps the container and resolver interface + with tools that debug Ember such as the Ember Inspector for Chrome and Firefox. + **/ + class ContainerDebugAdapter extends Object { + resolver: Resolver; + canCatalogEntriesByType(type: string): boolean; + catalogEntriesByType(type: string): any[]; + } + /** + * Additional methods for the Controller. + */ + interface ControllerMixin extends ActionHandler { + replaceRoute(name: string, ...args: any[]): void; + transitionToRoute(name: string, ...args: any[]): void; + model: any; + queryParams: string[] | Array<{ [key: string]: { type: string } }>; + target: Object; + } + const ControllerMixin: Ember.Mixin; + class Controller extends Object.extend(ControllerMixin) {} + /** + * Implements some standard methods for copying an object. Add this mixin to + * any object you create that can create a copy of itself. This mixin is + * added automatically to the built-in array. + */ + interface Copyable { + /** + * __Required.__ You must implement this method to apply this mixin. + */ + copy(deep: boolean): Copyable; + /** + * If the object implements `Ember.Freezable`, then this will return a new + * copy if the object is not frozen and the receiver if the object is frozen. + */ + frozenCopy(): Copyable; + } + const Copyable: Ember.Mixin; + class CoreObject { + _super(...args: any[]): any; + + /** + An overridable method called when objects are instantiated. By default, + does nothing unless it is overridden during class definition. + **/ + init(): void; + + /** + * Defines the properties that will be concatenated from the superclass (instead of overridden). + * @default null + */ + concatenatedProperties: any[]; + + /** + Destroyed object property flag. If this property is true the observers and bindings were + already removed by the effect of calling the destroy() method. + @default false + **/ + isDestroyed: boolean; + /** + Destruction scheduled flag. The destroy() method has been called. The object stays intact + until the end of the run loop at which point the isDestroyed flag is set. + @default false + **/ + isDestroying: boolean; + + /** + Destroys an object by setting the `isDestroyed` flag and removing its + metadata, which effectively destroys observers and bindings. + If you try to set a property on a destroyed object, an exception will be + raised. + Note that destruction is scheduled for the end of the run loop and does not + happen immediately. It will set an isDestroying flag immediately. + @return receiver + */ + destroy(): CoreObject; + + /** + Override to implement teardown. + */ + willDestroy(): void; + + /** + Returns a string representation which attempts to provide more information than Javascript's toString + typically does, in a generic way for all Ember objects (e.g., ""). + @return string representation + **/ + toString(): string; + + static create(this: EmberClassConstructor): Fix; + + static create>( + this: EmberClassConstructor>, + arg1: T1 & ThisType> + ): Fix; + + static create< + Instance, + Args, + T1 extends EmberInstanceArguments, + T2 extends EmberInstanceArguments + >( + this: EmberClassConstructor>, + arg1: T1 & ThisType>, + arg2: T2 & ThisType> + ): Fix; + + static create< + Instance, + Args, + T1 extends EmberInstanceArguments, + T2 extends EmberInstanceArguments, + T3 extends EmberInstanceArguments + >( + this: EmberClassConstructor>, + arg1: T1 & ThisType>, + arg2: T2 & ThisType>, + arg3: T3 & ThisType> + ): Fix; + + static extend( + this: Statics & EmberClassConstructor + ): Objectify & EmberClassConstructor; + + static extend( + this: Statics & EmberClassConstructor, + arg1: MixinOrLiteral & ThisType> + ): Objectify & EmberClassConstructor; + + static extend< + Statics, + Instance extends B1 & B2, + T1 extends EmberClassArguments, + B1, + T2 extends EmberClassArguments, + B2 + >( + this: Statics & EmberClassConstructor, + arg1: MixinOrLiteral & ThisType>, + arg2: MixinOrLiteral & ThisType> + ): Objectify & EmberClassConstructor; + + static extend< + Statics, + Instance extends B1 & B2 & B3, + T1 extends EmberClassArguments, + B1, + T2 extends EmberClassArguments, + B2, + T3 extends EmberClassArguments, + B3 + >( + this: Statics & EmberClassConstructor, + arg1: MixinOrLiteral & ThisType>, + arg2: MixinOrLiteral & ThisType>, + arg3: MixinOrLiteral & ThisType> + ): Objectify & EmberClassConstructor; + + static extend< + Statics, + Instance extends B1 & B2 & B3 & B4, + T1 extends EmberClassArguments, + B1, + T2 extends EmberClassArguments, + B2, + T3 extends EmberClassArguments, + B3, + T4 extends EmberClassArguments, + B4 + >( + this: Statics & EmberClassConstructor, + arg1: MixinOrLiteral & ThisType>, + arg2: MixinOrLiteral & ThisType>, + arg3: MixinOrLiteral & ThisType>, + arg4: MixinOrLiteral & ThisType> + ): Objectify & EmberClassConstructor; + + static reopen( + this: Statics & EmberClassConstructor + ): Objectify & EmberClassConstructor; + + static reopen( + this: Statics & EmberClassConstructor, + arg1: MixinOrLiteral & ThisType> + ): Objectify & EmberClassConstructor; + + static reopen< + Statics, + Instance extends B1 & B2, + T1 extends EmberClassArguments, + B1, + T2 extends EmberClassArguments, + B2 + >( + this: Statics & EmberClassConstructor, + arg1: MixinOrLiteral & ThisType>, + arg2: MixinOrLiteral & ThisType> + ): Objectify & EmberClassConstructor; + + static reopen< + Statics, + Instance extends B1 & B2 & B3, + T1 extends EmberClassArguments, + B1, + T2 extends EmberClassArguments, + B2, + T3 extends EmberClassArguments, + B3 + >( + this: Statics & EmberClassConstructor, + arg1: MixinOrLiteral & ThisType>, + arg2: MixinOrLiteral & ThisType>, + arg3: MixinOrLiteral & ThisType> + ): Objectify & EmberClassConstructor; + + static reopenClass(this: Statics): Statics; + + static reopenClass( + this: Statics, + arg1: T1 + ): Statics & T1; + + static reopenClass< + Statics, + T1 extends EmberClassArguments, + T2 extends EmberClassArguments + >(this: Statics, arg1: T1, arg2: T2): Statics & T1 & T2; + + static reopenClass< + Statics, + T1 extends EmberClassArguments, + T2 extends EmberClassArguments, + T3 extends EmberClassArguments + >(this: Statics, arg1: T1, arg2: T2, arg3: T3): Statics & T1 & T2 & T3; + + static detect( + this: Statics & EmberClassConstructor, + obj: any + ): obj is Objectify & EmberClassConstructor; + + static detectInstance( + this: EmberClassConstructor, + obj: any + ): obj is Instance; + + /** + Iterate over each computed property for the class, passing its name and any + associated metadata (see metaForProperty) to the callback. + **/ + static eachComputedProperty(callback: Function, binding: {}): void; + /** + Returns the original hash that was passed to meta(). + @param key property name + **/ + static metaForProperty(key: string): {}; + static isClass: boolean; + static isMethod: boolean; + } + /** + * The `DataAdapter` helps a data persistence library + * interface with tools that debug Ember such as Chrome and Firefox. + */ + class DataAdapter extends Object { + /** + * The container-debug-adapter which is used + * to list all models. + */ + containerDebugAdapter: any; + /** + * Ember Data > v1.0.0-beta.18 + * requires string model names to be passed + * around instead of the actual factories. + */ + acceptsModelName: any; + /** + * Specifies how records can be filtered. + * Records returned will need to have a `filterValues` + * property with a key for every name in the returned array. + */ + getFilters(): any[]; + /** + * Fetch the model types and observe them for changes. + */ + watchModelTypes(typesAdded: Function, typesUpdated: Function): Function; + /** + * Fetch the records of a given type and observe them for changes. + */ + watchRecords( + modelName: string, + recordsAdded: Function, + recordsUpdated: Function, + recordsRemoved: Function + ): Function; + } + const Debug: { + /** + * Allows for runtime registration of handler functions that override the default deprecation behavior. + * Deprecations are invoked by calls to [Ember.deprecate](http://emberjs.com/api/classes/Ember.html#method_deprecate). + * The following example demonstrates its usage by registering a handler that throws an error if the + * message contains the word "should", otherwise defers to the default handler. + */ + registerDeprecationHandler(handler: Function): any; + /** + * Allows for runtime registration of handler functions that override the default warning behavior. + * Warnings are invoked by calls made to [Ember.warn](http://emberjs.com/api/classes/Ember.html#method_warn). + * The following example demonstrates its usage by registering a handler that does nothing overriding Ember's + * default warning behavior. + */ + registerWarnHandler(handler: Function): any; + }; + /** + * The DefaultResolver defines the default lookup rules to resolve + * container lookups before consulting the container for registered + * items: + */ + class DefaultResolver extends Resolver { + /** + * This method is called via the container's resolver method. + * It parses the provided `fullName` and then looks up and + * returns the appropriate template or class. + */ + resolve(fullName: string): {}; + /** + * This will be set to the Application instance when it is + * created. + */ + namespace: Application; + } + /** + * The `Engine` class contains core functionality for both applications and + * engines. + */ + class Engine extends Namespace { + /** + * The goal of initializers should be to register dependencies and injections. + * This phase runs once. Because these initializers may load code, they are + * allowed to defer application readiness and advance it. If you need to access + * the container or store you should use an InstanceInitializer that will be run + * after all initializers and therefore after all code is loaded and the app is + * ready. + */ + initializer(initializer: {}): any; + /** + * Instance initializers run after all initializers have run. Because + * instance initializers run after the app is fully set up. We have access + * to the store, container, and other items. However, these initializers run + * after code has loaded and are not allowed to defer readiness. + */ + instanceInitializer(instanceInitializer: any): any; + /** + * Set this to provide an alternate class to `Ember.DefaultResolver` + */ + resolver: Resolver; + } + /** + * The `EngineInstance` encapsulates all of the stateful aspects of a + * running `Engine`. + */ + class EngineInstance extends Ember.Object.extend( + _RegistryProxyMixin, + _ContainerProxyMixin + ) { + /** + * Unregister a factory. + */ + unregister(fullName: string): any; + } + /** + * This mixin defines the common interface implemented by enumerable objects + * in Ember. Most of these methods follow the standard Array iteration + * API defined up to JavaScript 1.8 (excluding language-specific features that + * cannot be emulated in older versions of JavaScript). + */ + interface Enumerable { + /** + * Helper method returns the first object from a collection. This is usually + * used by bindings and other parts of the framework to extract a single + * object if the enumerable contains only one item. + */ + firstObject: ComputedProperty; + /** + * Helper method returns the last object from a collection. If your enumerable + * contains only one object, this method should always return that object. + * If your enumerable is empty, this method should return `undefined`. + */ + lastObject: ComputedProperty; + /** + * @deprecated Use `Enumerable#includes` instead. + */ + contains(obj: T): boolean; + /** + * Iterates through the enumerable, calling the passed function on each + * item. This method corresponds to the `forEach()` method defined in + * JavaScript 1.6. + */ + forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; + /** + * Alias for `mapBy` + */ + getEach(key: string): any[]; + /** + * Sets the value on the named property for each member. This is more + * ergonomic than using other methods defined on this helper. If the object + * implements Ember.Observable, the value will be changed to `set(),` otherwise + * it will be set directly. `null` objects are skipped. + */ + setEach(key: string, value: any): any; + /** + * Maps all of the items in the enumeration to another value, returning + * a new array. This method corresponds to `map()` defined in JavaScript 1.6. + */ + map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; + /** + * Similar to map, this specialized function returns the value of the named + * property on all items in the enumeration. + */ + mapBy(key: string): any[]; + /** + * Returns an array with all of the items in the enumeration that the passed + * function returns true for. This method corresponds to `filter()` defined in + * JavaScript 1.6. + */ + filter( + callbackfn: (value: T, index: number, array: T[]) => value is S, + thisArg?: any + ): S[]; + filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): T[]; + /** + * Returns an array with all of the items in the enumeration where the passed + * function returns false. This method is the inverse of filter(). + */ + reject(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): T[]; + /** + * Returns an array with just the items with the matched property. You + * can pass an optional second argument with the target value. Otherwise + * this will match any property that evaluates to `true`. + */ + filterBy(key: string, value?: any): any[]; + /** + * Returns an array with the items that do not have truthy values for + * key. You can pass an optional second argument with the target value. Otherwise + * this will match any property that evaluates to false. + */ + rejectBy(key: string, value?: string): any[]; + /** + * Returns the first item in the array for which the callback returns true. + * This method works similar to the `filter()` method defined in JavaScript 1.6 + * except that it will stop working on the array once a match is found. + */ + find( + predicate: (value: T, index: number, obj: T[]) => boolean, + thisArg?: any + ): T | undefined; + /** + * Returns the first item with a property matching the passed value. You + * can pass an optional second argument with the target value. Otherwise + * this will match any property that evaluates to `true`. + */ + findBy(key: string, value: string): T | undefined; + /** + * Returns `true` if the passed function returns true for every item in the + * enumeration. This corresponds with the `every()` method in JavaScript 1.6. + */ + every( + callbackfn: (value: T, index: number, array: T[]) => boolean, + thisArg?: any + ): boolean; + /** + * Returns `true` if the passed property resolves to the value of the second + * argument for all items in the enumerable. This method is often simpler/faster + * than using a callback. + */ + isEvery(key: string, value: boolean): boolean; + /** + * Returns `true` if the passed function returns true for any item in the + * enumeration. + */ + any(callback: (value: T, index: number, array: T[]) => boolean, target?: {}): boolean; + /** + * Returns `true` if the passed property resolves to the value of the second + * argument for any item in the enumerable. This method is often simpler/faster + * than using a callback. + */ + isAny(key: string, value?: boolean): boolean; + /** + * This will combine the values of the enumerator into a single value. It + * is a useful way to collect a summary value from an enumeration. This + * corresponds to the `reduce()` method defined in JavaScript 1.8. + */ + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + /** + * Invokes the named method on every object in the receiver that + * implements it. This method corresponds to the implementation in + * Prototype 1.6. + */ + invoke(methodName: keyof T, ...args: any[]): any[]; + /** + * Simply converts the enumerable into a genuine array. The order is not + * guaranteed. Corresponds to the method implemented by Prototype. + */ + toArray(): T[]; + /** + * Returns a copy of the array with all `null` and `undefined` elements removed. + */ + compact(): Enumerable; + /** + * Returns a new enumerable that excludes the passed value. The default + * implementation returns an array regardless of the receiver type. + * If the receiver does not contain the value it returns the original enumerable. + */ + without(value: T): Enumerable; + /** + * Returns a new enumerable that contains only unique values. The default + * implementation returns an array regardless of the receiver type. + */ + uniq(): Enumerable; + /** + * Converts the enumerable into an array and sorts by the keys + * specified in the argument. + */ + sortBy(property: string): Enumerable; + /** + * Returns a new enumerable that contains only items containing a unique property value. + * The default implementation returns an array regardless of the receiver type. + */ + uniqBy(): Enumerable; + /** + * Returns `true` if the passed object can be found in the enumerable. + */ + includes(searchElement: T, fromIndex?: number): boolean; + /** + * This is the handler for the special array content property. If you get + * this property, it will return this. If you set this property to a new + * array, it will replace the current content. + */ + '[]': ComputedProperty; + } + const Enumerable: Mixin>; + /** + A subclass of the JavaScript Error object for use in Ember. + **/ + const Error: ErrorConstructor; + /** + * `Ember.EventDispatcher` handles delegating browser events to their + * corresponding `Ember.Views.` For example, when you click on a view, + * `Ember.EventDispatcher` ensures that that view's `mouseDown` method gets + * called. + */ + class EventDispatcher extends Object { + /** + * The set of events names (and associated handler function names) to be setup + * and dispatched by the `EventDispatcher`. Modifications to this list can be done + * at setup time, generally via the `Ember.Application.customEvents` hash. + */ + events: EventDispatcherEvents; + } + /** + * This mixin allows for Ember objects to subscribe to and emit events. + */ + interface Evented { + /** + * Subscribes to a named event with given function. + */ + on( + name: string, + target: Target, + method: (this: Target, ...args: any[]) => void + ): this; + on(name: string, method: (...args: any[]) => void): this; + /** + * Subscribes a function to a named event and then cancels the subscription + * after the first time the event is triggered. It is good to use ``one`` when + * you only care about the first time an event has taken place. + */ + one( + name: string, + target: Target, + method: (this: Target, ...args: any[]) => void + ): this; + one(name: string, method: (...args: any[]) => void): this; + /** + * Triggers a named event for the object. Any additional arguments + * will be passed as parameters to the functions that are subscribed to the + * event. + */ + trigger(name: string, ...args: any[]): any; + /** + * Cancels subscription for given name, target, and method. + */ + off( + name: string, + target: Target, + method: (this: Target, ...args: any[]) => void + ): this; + off(name: string, method: (...args: any[]) => void): this; + /** + * Checks to see if object has any subscriptions for named event. + */ + has(name: string): boolean; + } + const Evented: Mixin; + /** + * The `Ember.Freezable` mixin implements some basic methods for marking an + * object as frozen. Once an object is frozen it should be read only. No changes + * may be made the internal state of the object. + * @deprecated Use `Object.freeze` instead. + */ + interface Freezable { + freeze(): Freezable; + isFrozen: boolean; + } + const Freezable: Mixin; + /** + * `Ember.HashLocation` implements the location API using the browser's + * hash. At present, it relies on a `hashchange` event existing in the + * browser. + */ + class HashLocation extends Object {} + /** + * Ember.HistoryLocation implements the location API using the browser's + * history.pushState API. + */ + class HistoryLocation extends Object {} + /** + * Ember Helpers are functions that can compute values, and are used in templates. + * For example, this code calls a helper named `format-currency`: + */ + class Helper extends Object { + /** + * In many cases, the ceremony of a full `Ember.Helper` class is not required. + * The `helper` method create pure-function helpers without instances. For + * example: + */ + static helper(helper: (params: any[], hash?: object) => any): Helper; + /** + * Override this function when writing a class-based helper. + */ + compute(params: any[], hash: object): any; + /** + * On a class-based helper, it may be useful to force a recomputation of that + * helpers value. This is akin to `rerender` on a component. + */ + recompute(): any; + } + /** + * The purpose of the Ember Instrumentation module is + * to provide efficient, general-purpose instrumentation + * for Ember. + */ + const Instrumentation: { + instrument(name: string, payload: any, callback: Function, binding: any): void; + reset(): void; + subscribe(pattern: string, object: any): void; + unsubscribe(subscriber: any): void; + }; + /** + * `Ember.LinkComponent` renders an element whose `click` event triggers a + * transition of the application's instance of `Ember.Router` to + * a supplied route by name. + */ + class LinkComponent extends Component { + /** + * Used to determine when this `LinkComponent` is active. + */ + currentWhen: any; + /** + * Sets the `title` attribute of the `LinkComponent`'s HTML element. + */ + title: string | null; + /** + * Sets the `rel` attribute of the `LinkComponent`'s HTML element. + */ + rel: string | null; + /** + * Sets the `tabindex` attribute of the `LinkComponent`'s HTML element. + */ + tabindex: string | null; + /** + * Sets the `target` attribute of the `LinkComponent`'s HTML element. + */ + target: string | null; + /** + * The CSS class to apply to `LinkComponent`'s element when its `active` + * property is `true`. + */ + activeClass: string; + /** + * Determines whether the `LinkComponent` will trigger routing via + * the `replaceWith` routing strategy. + */ + replace: boolean; + } + /** + * Ember.Location returns an instance of the correct implementation of + * the `location` API. + */ + const Location: { + /** + * This is deprecated in favor of using the container to lookup the location + * implementation as desired. + * @deprecated Use the container to lookup the location implementation that you need. + */ + create(options?: {}): any; + }; + /** + * Inside Ember-Metal, simply uses the methods from `imports.console`. + * Override this to provide more robust logging functionality. + */ + const Logger: { + /** + * If the value passed into `Ember.Logger.assert` is not truthy it will throw an error with a stack trace. + */ + assert(test: boolean, message?: string): void; + /** + * Logs the arguments to the console in blue text. + */ + debug(...args: any[]): void; + /** + * Prints the arguments to the console with an error icon, red text and a stack trace. + */ + error(...args: any[]): void; + /** + * Logs the arguments to the console. + */ + info(...args: any[]): void; + /** + * Logs the arguments to the console. + */ + log(...args: any[]): void; + /** + * Prints the arguments to the console with a warning icon. + */ + warn(...args: any[]): void; + }; + /** + * A Map stores values indexed by keys. Unlike JavaScript's + * default Objects, the keys of a Map can be any JavaScript + * object. + * @deprecated + */ + class Map { + copy(): Map; + static create(): Map; + forEach(callback: Function, self: any): void; + get(key: any): any; + has(key: any): boolean; + set(key: any, value: any): void; + length: number; + } + /** + * @deprecated + */ + class MapWithDefault extends Map { + copy(): MapWithDefault; + static create(): MapWithDefault; + } + /** + * The `Ember.Mixin` class allows you to create mixins, whose properties can be + * added to other classes. + */ + class Mixin { + /** + * Mixin needs to have *something* on its prototype, otherwise it's treated like an empty interface. + */ + private __ember_mixin__: never; + + static create( + args?: T & ThisType> + ): Mixin; + } + /** + * This mixin defines the API for modifying array-like objects. These methods + * can be applied only to a collection that keeps its items in an ordered set. + * It builds upon the Array mixin and adds methods to modify the array. + * One concrete implementations of this class include ArrayProxy. + */ + interface MutableArray extends Array, MutableEnumberable { + /** + * __Required.__ You must implement this method to apply this mixin. + */ + replace(idx: number, amt: number, objects: any[]): any; + /** + * Remove all elements from the array. This is useful if you + * want to reuse an existing array without having to recreate it. + */ + clear(): this; + /** + * This will use the primitive `replace()` method to insert an object at the + * specified index. + */ + insertAt(idx: number, object: {}): this; + /** + * Remove an object at the specified index using the `replace()` primitive + * method. You can pass either a single index, or a start and a length. + */ + removeAt(start: number, len: number): this; + /** + * Push the object onto the end of the array. Works just like `push()` but it + * is KVO-compliant. + */ + pushObject(obj: T): T; + /** + * Add the objects in the passed numerable to the end of the array. Defers + * notifying observers of the change until all objects are added. + */ + pushObjects(objects: Enumerable): this; + /** + * Pop object from array or nil if none are left. Works just like `pop()` but + * it is KVO-compliant. + */ + popObject(): T; + /** + * Shift an object from start of array or nil if none are left. Works just + * like `shift()` but it is KVO-compliant. + */ + shiftObject(): T; + /** + * Unshift an object to start of array. Works just like `unshift()` but it is + * KVO-compliant. + */ + unshiftObject(obj: T): T; + /** + * Adds the named objects to the beginning of the array. Defers notifying + * observers until all objects have been added. + */ + unshiftObjects(objects: Enumerable): this; + /** + * Reverse objects in the array. Works just like `reverse()` but it is + * KVO-compliant. + */ + reverseObjects(): this; + /** + * Replace all the receiver's content with content of the argument. + * If argument is an empty array receiver will be cleared. + */ + setObjects(objects: Ember.Array): this; + } + const MutableArray: Mixin>; + /** + * This mixin defines the API for modifying generic enumerables. These methods + * can be applied to an object regardless of whether it is ordered or + * unordered. + */ + interface MutableEnumberable extends Enumerable { + /** + * __Required.__ You must implement this method to apply this mixin. + */ + addObject(object: T): T; + /** + * Adds each object in the passed enumerable to the receiver. + */ + addObjects(objects: Enumerable): this; + /** + * __Required.__ You must implement this method to apply this mixin. + */ + removeObject(object: T): T; + /** + * Removes each object in the passed enumerable from the receiver. + */ + removeObjects(objects: Enumerable): this; + } + const MutableEnumerable: Mixin>; + /** + * A Namespace is an object usually used to contain other objects or methods + * such as an application or framework. Create a namespace anytime you want + * to define one of these new containers. + */ + class Namespace extends Object {} + /** + * The NativeArray mixin contains the properties needed to make the native + * Array support Ember.MutableArray and all of its dependent APIs. Unless you + * have `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Array` set to + * false, this will be applied automatically. Otherwise you can apply the mixin + * at anytime by calling `Ember.NativeArray.apply(Array.prototype)`. + */ + interface NativeArray extends GlobalArray, MutableArray, Observable, Copyable { + /** + * __Required.__ You must implement this method to apply this mixin. + */ + length: number; + + // NOTE: some array polyfill methods are re-declared here because their signatures + // differ between typescript versions 2.4 and 2.6. Since we need to compile against + // both, pick the more recent signature and re-declare it here as a tie-breaker. + + /** + * Returns the first item in the array for which the callback returns true. + * This method works similar to the `filter()` method defined in JavaScript 1.6 + * except that it will stop working on the array once a match is found. + */ + find( + predicate: (value: T, index: number, obj: T[]) => boolean, + thisArg?: any + ): T | undefined; + /** + * This will combine the values of the enumerator into a single value. It + * is a useful way to collect a summary value from an enumeration. This + * corresponds to the `reduce()` method defined in JavaScript 1.8. + */ + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + } + const NativeArray: Mixin>; + /** + * Ember.NoneLocation does not interact with the browser. It is useful for + * testing, or when you need to manage state with your Router, but temporarily + * don't want it to muck with the URL (for example when you embed your + * application in a larger page). + */ + class NoneLocation extends Object {} + /** + * `Ember.Object` is the main base class for all Ember objects. It is a subclass + * of `Ember.CoreObject` with the `Ember.Observable` mixin applied. For details, + * see the documentation for each of these. + */ + class Object extends CoreObject.extend(Observable) {} + /** + * `Ember.ObjectProxy` forwards all properties not defined by the proxy itself + * to a proxied `content` object. + */ + class ObjectProxy extends Object { + /** + The object whose properties will be forwarded. + **/ + content: Object; + } + /** + * This mixin provides properties and property observing functionality, core features of the Ember object model. + */ + interface Observable { + /** + * Retrieves the value of a property from the object. + */ + get(this: ComputedProperties, key: K): T[K]; + /** + * To get the values of multiple properties at once, call `getProperties` + * with a list of strings or an array: + */ + getProperties(this: ComputedProperties, list: K[]): Pick; + getProperties( + this: ComputedProperties, + ...list: K[] + ): Pick; + /** + * Sets the provided key or path to the value. + */ + set(this: ComputedProperties, key: K, value: T[K]): T[K]; + /** + * Sets a list of properties at once. These properties are set inside + * a single `beginPropertyChanges` and `endPropertyChanges` batch, so + * observers will be buffered. + */ + setProperties( + this: ComputedProperties, + hash: Pick + ): Pick; + /** + * Convenience method to call `propertyWillChange` and `propertyDidChange` in + * succession. + */ + notifyPropertyChange(keyName: string): this; + /** + * Adds an observer on a property. + */ + addObserver( + key: keyof this, + target: Target, + method: ObserverMethod + ): void; + /** + * Remove an observer you have previously registered on this object. Pass + * the same key, target, and method you passed to `addObserver()` and your + * target will no longer receive notifications. + */ + removeObserver( + key: keyof this, + target: Target, + method: ObserverMethod + ): any; + /** + * Retrieves the value of a property, or a default value in the case that the + * property returns `undefined`. + */ + getWithDefault( + this: ComputedProperties, + key: K, + defaultValue: T[K] + ): T[K]; + /** + * Set the value of a property to the current value plus some amount. + */ + incrementProperty(keyName: keyof this, increment?: number): number; + /** + * Set the value of a property to the current value minus some amount. + */ + decrementProperty(keyName: keyof this, decrement?: number): number; + /** + * Set the value of a boolean property to the opposite of its + * current value. + */ + toggleProperty(keyName: keyof this): boolean; + /** + * Returns the cached value of a computed property, if it exists. + * This allows you to inspect the value of a computed property + * without accidentally invoking it if it is intended to be + * generated lazily. + */ + cacheFor(this: ComputedProperties, key: K): T[K] | undefined; + } + const Observable: Mixin; + /** + * This class is used internally by Ember and Ember Data. + * Please do not use it at this time. We plan to clean it up + * and add many tests soon. + * @deprecated + */ + class OrderedSet { + add(obj: any): void; + clear(): void; + copy(): OrderedSet; + static create(): OrderedSet; + forEach(fn: Function, self: any): void; + has(obj: any): boolean; + isEmpty(): boolean; + toArray(): any[]; + } + /** + * A low level mixin making ObjectProxy promise-aware. + */ + interface PromiseProxyMixin extends RSVP.Promise { + /** + * If the proxied promise is rejected this will contain the reason + * provided. + */ + reason: any; + /** + * Once the proxied promise has settled this will become `false`. + */ + isPending: boolean; + /** + * Once the proxied promise has settled this will become `true`. + */ + isSettled: boolean; + /** + * Will become `true` if the proxied promise is rejected. + */ + isRejected: boolean; + /** + * Will become `true` if the proxied promise is fulfilled. + */ + isFulfilled: boolean; + /** + * The promise whose fulfillment value is being proxied by this object. + */ + promise: RSVP.Promise; + } + const PromiseProxyMixin: Mixin>; + /** + * A registry used to store factory and option information keyed + * by type. + */ + class Registry { + register( + fullName: string, + factory: EmberClassConstructor, + options?: { singleton?: boolean } + ): void; + } + class Resolver extends Ember.Object {} + /** + The `Ember.Route` class is used to define individual routes. Refer to + the [routing guide](http://emberjs.com/guides/routing/) for documentation. + */ + class Route extends Object.extend(ActionHandler, Evented) { + // methods + /** + This hook is called after this route's model has resolved. + It follows identical async/promise semantics to `beforeModel` + but is provided the route's resolved model in addition to + the `transition`, and is therefore suited to performing + logic that can only take place after the model has already + resolved. + */ + afterModel(resolvedModel: any, transition: Transition): Rsvp.Promise; + + /** + This hook is the first of the route entry validation hooks + called when an attempt is made to transition into a route + or one of its children. It is called before `model` and + `afterModel`, and is appropriate for cases when: + 1) A decision can be made to redirect elsewhere without + needing to resolve the model first. + 2) Any async operations need to occur first before the + model is attempted to be resolved. + This hook is provided the current `transition` attempt + as a parameter, which can be used to `.abort()` the transition, + save it for a later `.retry()`, or retrieve values set + on it from a previous hook. You can also just call + `this.transitionTo` to another route to implicitly + abort the `transition`. + You can return a promise from this hook to pause the + transition until the promise resolves (or rejects). This could + be useful, for instance, for retrieving async code from + the server that is required to enter a route. + */ + beforeModel(transition: Transition): Rsvp.Promise; + + /** + * Returns the controller for a particular route or name. + * The controller instance must already have been created, either through entering the + * associated route or using `generateController`. + */ + controllerFor(name: string): Controller; + + /** + * Disconnects a view that has been rendered into an outlet. + */ + disconnectOutlet(options: string | { outlet?: string; parentView?: string }): void; + + /** + * A hook you can implement to convert the URL into the model for + * this route. + */ + model(params: {}, transition: Transition): any; + + /** + * Returns the model of a parent (or any ancestor) route + * in a route hierarchy. During a transition, all routes + * must resolve a model object, and if a route + * needs access to a parent route's model in order to + * resolve a model (or just reuse the model from a parent), + * it can call `this.modelFor(theNameOfParentRoute)` to + * retrieve it. + */ + modelFor(name: string): {}; + + /** + * Retrieves parameters, for current route using the state.params + * variable and getQueryParamsFor, using the supplied routeName. + */ + paramsFor(name: string): {}; + + /** + * Refresh the model on this route and any child routes, firing the + * `beforeModel`, `model`, and `afterModel` hooks in a similar fashion + * to how routes are entered when transitioning in from other route. + * The current route params (e.g. `article_id`) will be passed in + * to the respective model hooks, and if a different model is returned, + * `setupController` and associated route hooks will re-fire as well. + * An example usage of this method is re-querying the server for the + * latest information using the same parameters as when the route + * was first entered. + * Note that this will cause `model` hooks to fire even on routes + * that were provided a model object when the route was initially + * entered. + */ + redirect(): Transition; + + /** + * Refresh the model on this route and any child routes, firing the + * `beforeModel`, `model`, and `afterModel` hooks in a similar fashion + * to how routes are entered when transitioning in from other route. + * The current route params (e.g. `article_id`) will be passed in + * to the respective model hooks, and if a different model is returned, + * `setupController` and associated route hooks will re-fire as well. + * An example usage of this method is re-querying the server for the + * latest information using the same parameters as when the route + * was first entered. + * Note that this will cause `model` hooks to fire even on routes + * that were provided a model object when the route was initially + * entered. + */ + refresh(): Transition; + + /** + * `render` is used to render a template into a region of another template + * (indicated by an `{{outlet}}`). `render` is used both during the entry + * phase of routing (via the `renderTemplate` hook) and later in response to + * user interaction. + */ + render(name: string, options?: RenderOptions): void; + + /** + * A hook you can use to render the template for the current route. + * This method is called with the controller for the current route and the + * model supplied by the `model` hook. By default, it renders the route's + * template, configured with the controller for the route. + * This method can be overridden to set up and render additional or + * alternative templates. + */ + renderTemplate(controller: Controller, model: {}): void; + + /** + * Transition into another route while replacing the current URL, if possible. + * This will replace the current history entry instead of adding a new one. + * Beside that, it is identical to `transitionTo` in all other respects. See + * 'transitionTo' for additional information regarding multiple models. + */ + replaceWith(name: string, ...args: any[]): Transition; + + /** + * A hook you can use to reset controller values either when the model + * changes or the route is exiting. + */ + resetController(controller: Controller, isExiting: boolean, transition: any): void; + + /** + * Sends an action to the router, which will delegate it to the currently active + * route hierarchy per the bubbling rules explained under actions. + */ + send(name: string, ...args: any[]): void; + + /** + * A hook you can implement to convert the route's model into parameters + * for the URL. + * + * The default `serialize` method will insert the model's `id` into the + * route's dynamic segment (in this case, `:post_id`) if the segment contains '_id'. + * If the route has multiple dynamic segments or does not contain '_id', `serialize` + * will return `Ember.getProperties(model, params)` + * This method is called when `transitionTo` is called with a context + * in order to populate the URL. + */ + serialize(model: {}, params: string[]): string; + + /** + * A hook you can use to setup the controller for the current route. + * This method is called with the controller for the current route and the + * model supplied by the `model` hook. + * By default, the `setupController` hook sets the `model` property of + * the controller to the `model`. + * If you implement the `setupController` hook in your Route, it will + * prevent this default behavior. If you want to preserve that behavior + * when implementing your `setupController` function, make sure to call + * `_super` + */ + setupController(controller: Controller, model: {}): void; + + /** + * Transition the application into another route. The route may + * be either a single route or route path + */ + transitionTo(name: string, ...object: any[]): Transition; + + /** + * The name of the view to use by default when rendering this routes template. + * When rendering a template, the route will, by default, determine the + * template and view to use from the name of the route itself. If you need to + * define a specific view, set this property. + * This is useful when multiple routes would benefit from using the same view + * because it doesn't require a custom `renderTemplate` method. + */ + transitionTo(name: string, ...object: any[]): Transition; + + // properties + /** + * The controller associated with this route. + */ + controller: Controller; + + /** + * The name of the controller to associate with this route. + * By default, Ember will lookup a route's controller that matches the name + * of the route (i.e. `App.PostController` for `App.PostRoute`). However, + * if you would like to define a specific controller to use, you can do so + * using this property. + * This is useful in many ways, as the controller specified will be: + * * p assed to the `setupController` method. + * * used as the controller for the view being rendered by the route. + * * returned from a call to `controllerFor` for the route. + */ + controllerName: string; + + /** + * Configuration hash for this route's queryParams. + */ + queryParams: { [key: string]: RouteQueryParam }; + + /** + * The name of the route, dot-delimited + */ + routeName: string; + + /** + * The name of the template to use by default when rendering this routes + * template. + * This is similar with `viewName`, but is useful when you just want a custom + * template without a view. + */ + templateName: string; + + // events + /** + * This hook is executed when the router enters the route. It is not executed + * when the model for the route changes. + */ + activate(): void; + + /** + * This hook is executed when the router completely exits this route. It is + * not executed when the model for the route changes. + */ + deactivate(): void; + + /** + * The didTransition action is fired after a transition has successfully been + * completed. This occurs after the normal model hooks (beforeModel, model, + * afterModel, setupController) have resolved. The didTransition action has + * no arguments, however, it can be useful for tracking page views or resetting + * state on the controller. + */ + didTransition(): void; + + /** + * When attempting to transition into a route, any of the hooks may return a promise + * that rejects, at which point an error action will be fired on the partially-entered + * routes, allowing for per-route error handling logic, or shared error handling logic + * defined on a parent route. + */ + error(error: any, transition: Transition): void; + + /** + * The loading action is fired on the route when a route's model hook returns a + * promise that is not already resolved. The current Transition object is the first + * parameter and the route that triggered the loading event is the second parameter. + */ + loading(transition: Transition, route: Route): void; + + /** + * The willTransition action is fired at the beginning of any attempted transition + * with a Transition object as the sole argument. This action can be used for aborting, + * redirecting, or decorating the transition from the currently active routes. + */ + willTransition(transition: Transition): void; + } + /** + * The `Ember.Router` class manages the application state and URLs. Refer to + * the [routing guide](http://emberjs.com/guides/routing/) for documentation. + */ + class Router extends Object.extend(Evented) { + /** + * The `Router.map` function allows you to define mappings from URLs to routes + * in your application. These mappings are defined within the + * supplied callback function using `this.route`. + */ + static map(callback: (this: RouterDSL) => void): void; + /** + * The `location` property determines the type of URL's that your + * application will use. + */ + location: string; + /** + * Represents the URL of the root of the application, often '/'. This prefix is + * assumed on all routes defined on this router. + */ + rootURL: string; + /** + * Handles updating the paths and notifying any listeners of the URL + * change. + */ + didTransition(): any; + /** + * Handles notifying any listeners of an impending URL + * change. + */ + willTransition(): any; + /** + * Transition the application into another route. The route may + * be either a single route or route path: + */ + transitionTo(name: string, ...models: any[]): Transition; + transitionTo(name: string, options: {}): Transition; + } + class RouterDSL { + constructor(name: string, options: object); + route(name: string, callback: (this: RouterDSL) => void): void; + route( + name: string, + options?: { path?: string; resetNamespace?: boolean }, + callback?: (this: RouterDSL) => void + ): void; + mount(name: string): void; + } + class Service extends Object {} + /** + * The internal class used to create textarea element when the `{{textarea}}` + * helper is used. + */ + class TextArea extends Component.extend(TextSupport) {} + /** + * The internal class used to create text inputs when the `{{input}}` + * helper is used with `type` of `text`. + */ + class TextField extends Component.extend(TextSupport) { + /** + * The `value` attribute of the input element. As the user inputs text, this + * property is updated live. + */ + value: string; + /** + * The `type` attribute of the input element. + */ + type: string; + /** + * The `size` of the text field in characters. + */ + size: string; + /** + * The `pattern` attribute of input element. + */ + pattern: string; + /** + * The `min` attribute of input element used with `type="number"` or `type="range"`. + */ + min: string; + /** + * The `max` attribute of input element used with `type="number"` or `type="range"`. + */ + max: string; + } + /** + * `TextSupport` is a shared mixin used by both `Ember.TextField` and + * `Ember.TextArea`. `TextSupport` adds a number of methods that allow you to + * specify a controller action to invoke when a certain event is fired on your + * text field or textarea. The specifed controller action would get the current + * value of the field passed in as the only argument unless the value of + * the field is empty. In that case, the instance of the field itself is passed + * in as the only argument. + */ + interface TextSupport extends TargetActionSupport { + cancel(event: Function): void; + focusIn(event: Function): void; + focusOut(event: Function): void; + insertNewLine(event: Function): void; + keyPress(event: Function): void; + action: string; + bubbles: boolean; + onEvent: string; + } + const TextSupport: Ember.Mixin; + interface Transition { + /** + Aborts the Transition. Note you can also implicitly abort a transition + by initiating another transition while a previous one is underway. + */ + abort(): Transition; + /** + Retries a previously-aborted transition (making sure to abort the + transition if it's still active). Returns a new transition that + represents the new attempt to transition. + */ + retry(): Transition; + } + interface ViewTargetActionSupport { + target: any; + actionContext: any; + } + const ViewTargetActionSupport: Mixin; + const ViewUtils: {}; // TODO: define interface + + // FYI - RSVP source comes from https://github.com/tildeio/rsvp.js/blob/master/lib/rsvp/promise.js + const RSVP: typeof Rsvp; + namespace RSVP { + type Promise = Rsvp.Promise; + } + + /** + * This is a container for an assortment of testing related functionality + */ + namespace Test { + /** + * `registerHelper` is used to register a test helper that will be injected + * when `App.injectTestHelpers` is called. + */ + function registerHelper( + name: string, + helperMethod: (app: Application, ...args: any[]) => any, + options?: object + ): any; + /** + * `registerAsyncHelper` is used to register an async test helper that will be injected + * when `App.injectTestHelpers` is called. + */ + function registerAsyncHelper( + name: string, + helperMethod: (app: Application, ...args: any[]) => any + ): void; + /** + * Remove a previously added helper method. + */ + function unregisterHelper(name: string): void; + /** + * Used to register callbacks to be fired whenever `App.injectTestHelpers` + * is called. + */ + function onInjectHelpers(callback: (app: Application) => void): void; + /** + * This returns a thenable tailored for testing. It catches failed + * `onSuccess` callbacks and invokes the `Ember.Test.adapter.exception` + * callback in the last chained then. + */ + function promise( + resolver: ( + resolve: (value?: T | PromiseLike) => void, + reject: (reason?: any) => void + ) => void, + label?: string + ): Ember.Test.Promise; + /** + * Replacement for `Ember.RSVP.resolve` + * The only difference is this uses + * an instance of `Ember.Test.Promise` + */ + function resolve(value?: T | PromiseLike, label?: string): Ember.Test.Promise; + function resolve(): Ember.Test.Promise; + /** + * This allows ember-testing to play nicely with other asynchronous + * events, such as an application that is waiting for a CSS3 + * transition or an IndexDB transaction. The waiter runs periodically + * after each async helper (i.e. `click`, `andThen`, `visit`, etc) has executed, + * until the returning result is truthy. After the waiters finish, the next async helper + * is executed and the process repeats. + */ + function registerWaiter(callback: () => boolean): any; + function registerWaiter( + context: Context, + callback: (this: Context) => boolean + ): any; + /** + * `unregisterWaiter` is used to unregister a callback that was + * registered with `registerWaiter`. + */ + function unregisterWaiter(callback: () => boolean): any; + function unregisterWaiter( + context: Context, + callback: (this: Context) => boolean + ): any; + /** + * Iterates through each registered test waiter, and invokes + * its callback. If any waiter returns false, this method will return + * true indicating that the waiters have not settled yet. + */ + function checkWaiters(): boolean; + /** + * Used to allow ember-testing to communicate with a specific testing + * framework. + */ + const adapter: Adapter; + /** + * The primary purpose of this class is to create hooks that can be implemented + * by an adapter for various test frameworks. + */ + class Adapter { + /** + * This callback will be called whenever an async operation is about to start. + */ + asyncStart(): any; + /** + * This callback will be called whenever an async operation has completed. + */ + asyncEnd(): any; + /** + * Override this method with your testing framework's false assertion. + * This function is called whenever an exception occurs causing the testing + * promise to fail. + */ + exception(error: string): any; + } + /** + * This class implements the methods defined by Ember.Test.Adapter for the + * QUnit testing framework. + */ + class QUnitAdapter extends Adapter {} + class Promise extends Rsvp.Promise { + constructor( + executor: ( + resolve: (value?: T | PromiseLike) => void, + reject: (reason?: any) => void + ) => void + ); + } + } + /** + * Namespace for injection helper methods. + */ + namespace inject { + /** + * Creates a property that lazily looks up another controller in the container. + * Can only be used when defining another controller. + */ + function controller(name?: string): ComputedProperty; + /** + * Creates a property that lazily looks up a service in the container. There + * are no restrictions as to what objects a service can be injected into. + */ + function service(name?: string): ComputedProperty; + } + namespace ENV { + const EXTEND_PROTOTYPES: typeof Ember.EXTEND_PROTOTYPES; + const LOG_BINDINGS: boolean; + const LOG_STACKTRACE_ON_DEPRECATION: boolean; + const LOG_VERSION: boolean; + const MODEL_FACTORY_INJECTIONS: boolean; + const RAISE_ON_DEPRECATION: boolean; + } + namespace EXTEND_PROTOTYPES { + const Array: boolean; + const Function: boolean; + const String: boolean; + } + namespace Handlebars { + function compile(string: string): Function; + function compile(environment: any, options?: any, context?: any, asObject?: any): any; + function precompile(string: string, options: any): void; + class Compiler {} + class JavaScriptCompiler {} + function registerPartial(name: string, str: any): void; + function K(): any; + function createFrame(objec: any): any; + function Exception(message: string): void; + class SafeString { + constructor(str: string); + static toString(): string; + } + function parse(string: string): any; + function print(ast: any): void; + const logger: typeof Ember.Logger; + function log(level: string, str: string): void; + } + namespace String { + function camelize(str: string): string; + function capitalize(str: string): string; + function classify(str: string): string; + function dasherize(str: string): string; + function decamelize(str: string): string; + function fmt(...args: string[]): string; + function htmlSafe(str: string): void; // TODO: @returns Handlebars.SafeStringStatic; + function isHTMLSafe(str: string): boolean; + function loc(...args: string[]): string; + function underscore(str: string): string; + function w(str: string): string[]; + } + const computed: { + (cb: ComputedPropertyCallback): ComputedProperty; + (k1: string, cb: ComputedPropertyCallback): ComputedProperty; + (k1: string, k2: string, cb: ComputedPropertyCallback): ComputedProperty; + ( + k1: string, + k2: string, + k3: string, + cb: ComputedPropertyCallback + ): ComputedProperty; + ( + k1: string, + k2: string, + k3: string, + k4: string, + cb: ComputedPropertyCallback + ): ComputedProperty; + ( + k1: string, + k2: string, + k3: string, + k4: string, + k5: string, + cb: ComputedPropertyCallback + ): ComputedProperty; + ( + k1: string, + k2: string, + k3: string, + k4: string, + k5: string, + k6: string, + cb: ComputedPropertyCallback + ): ComputedProperty; + ( + k1: string, + k2: string, + k3: string, + k4: string, + k5: string, + k6: string, + k7: string, + ...rest: any[] + ): ComputedProperty; + + /** + * A computed property that returns true if the value of the dependent + * property is null, an empty string, empty array, or empty function. + */ + empty(dependentKey: string): ComputedProperty; + /** + * A computed property that returns true if the value of the dependent + * property is NOT null, an empty string, empty array, or empty function. + */ + notEmpty(dependentKey: string): ComputedProperty; + /** + * A computed property that returns true if the value of the dependent + * property is null or undefined. This avoids errors from JSLint complaining + * about use of ==, which can be technically confusing. + */ + none(dependentKey: string): ComputedProperty; + /** + * A computed property that returns the inverse boolean value + * of the original value for the dependent property. + */ + not(dependentKey: string): ComputedProperty; + /** + * A computed property that converts the provided dependent property + * into a boolean value. + */ + bool(dependentKey: string): ComputedProperty; + /** + * A computed property which matches the original value for the + * dependent property against a given RegExp, returning `true` + * if the value matches the RegExp and `false` if it does not. + */ + match(dependentKey: string, regexp: RegExp): ComputedProperty; + /** + * A computed property that returns true if the provided dependent property + * is equal to the given value. + */ + equal(dependentKey: string, value: any): ComputedProperty; + /** + * A computed property that returns true if the provided dependent property + * is greater than the provided value. + */ + gt(dependentKey: string, value: number): ComputedProperty; + /** + * A computed property that returns true if the provided dependent property + * is greater than or equal to the provided value. + */ + gte(dependentKey: string, value: number): ComputedProperty; + /** + * A computed property that returns true if the provided dependent property + * is less than the provided value. + */ + lt(dependentKey: string, value: number): ComputedProperty; + /** + * A computed property that returns true if the provided dependent property + * is less than or equal to the provided value. + */ + lte(dependentKey: string, value: number): ComputedProperty; + /** + * A computed property that performs a logical `and` on the + * original values for the provided dependent properties. + */ + and(...dependentKeys: string[]): ComputedProperty; + /** + * A computed property which performs a logical `or` on the + * original values for the provided dependent properties. + */ + or(...dependentKeys: string[]): ComputedProperty; + /** + * Creates a new property that is an alias for another property + * on an object. Calls to `get` or `set` this property behave as + * though they were called on the original property. + */ + alias(dependentKey: string): ComputedProperty; + /** + * Where `computed.alias` aliases `get` and `set`, and allows for bidirectional + * data flow, `computed.oneWay` only provides an aliased `get`. The `set` will + * not mutate the upstream property, rather causes the current property to + * become the value set. This causes the downstream property to permanently + * diverge from the upstream property. + */ + oneWay(dependentKey: string): ComputedProperty; + /** + * This is a more semantically meaningful alias of `computed.oneWay`, + * whose name is somewhat ambiguous as to which direction the data flows. + */ + reads(dependentKey: string): ComputedProperty; + /** + * Where `computed.oneWay` provides oneWay bindings, `computed.readOnly` provides + * a readOnly one way binding. Very often when using `computed.oneWay` one does + * not also want changes to propagate back up, as they will replace the value. + */ + readOnly(dependentKey: string): ComputedProperty; + /** + * Creates a new property that is an alias for another property + * on an object. Calls to `get` or `set` this property behave as + * though they were called on the original property, but also + * print a deprecation warning. + */ + deprecatingAlias( + dependentKey: string, + options: { id: string; until: string } + ): ComputedProperty; + /** + * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options + */ + deprecatingAlias( + dependentKey: string, + options?: { id?: string; until?: string } + ): ComputedProperty; + /** + * A computed property that returns the sum of the values + * in the dependent array. + */ + sum(dependentKey: string): ComputedProperty; + /** + * A computed property that calculates the maximum value in the + * dependent array. This will return `-Infinity` when the dependent + * array is empty. + */ + max(dependentKey: string): ComputedProperty; + /** + * A computed property that calculates the minimum value in the + * dependent array. This will return `Infinity` when the dependent + * array is empty. + */ + min(dependentKey: string): ComputedProperty; + /** + * Returns an array mapped via the callback + */ + map( + dependentKey: string, + callback: (value: any, index: number, array: any[]) => U + ): ComputedProperty; + /** + * Returns an array mapped to the specified key. + */ + mapBy(dependentKey: string, propertyKey: string): ComputedProperty; + /** + * Filters the array by the callback. + */ + filter( + dependentKey: string, + callback: (value: any, index: number, array: any[]) => boolean + ): ComputedProperty; + /** + * Filters the array by the property and value + */ + filterBy( + dependentKey: string, + propertyKey: string, + value?: any + ): ComputedProperty; + /** + * A computed property which returns a new array with all the unique + * elements from one or more dependent arrays. + */ + uniq(propertyKey: string): ComputedProperty; + /** + * A computed property which returns a new array with all the unique + * elements from an array, with uniqueness determined by specific key. + */ + uniqBy(dependentKey: string, propertyKey: string): ComputedProperty; + /** + * A computed property which returns a new array with all the unique + * elements from one or more dependent arrays. + */ + union(...propertyKeys: string[]): ComputedProperty; + /** + * A computed property which returns a new array with all the elements + * two or more dependent arrays have in common. + */ + intersect(...propertyKeys: string[]): ComputedProperty; + /** + * A computed property which returns a new array with all the + * properties from the first dependent array that are not in the second + * dependent array. + */ + setDiff(setAProperty: string, setBProperty: string): ComputedProperty; + /** + * A computed property that returns the array of values + * for the provided dependent properties. + */ + collect(...dependentKeys: string[]): ComputedProperty; + /** + * A computed property which returns a new array with all the + * properties from the first dependent array sorted based on a property + * or sort function. + */ + sort( + itemsKey: string, + sortDefinition: string | ((itemA: any, itemB: any) => number) + ): ComputedProperty; + }; + const run: { + /** + * Runs the passed target and method inside of a RunLoop, ensuring any + * deferred actions including bindings and views updates are flushed at the + * end. + */ + (method: (...args: any[]) => Ret): Ret; + (target: Target, method: RunMethod): Ret; + /** + * If no run-loop is present, it creates a new one. If a run loop is + * present it will queue itself to run on the existing run-loops action + * queue. + */ + join(method: (...args: any[]) => Ret, ...args: any[]): Ret | undefined; + join( + target: Target, + method: RunMethod, + ...args: any[] + ): Ret | undefined; + /** + * Allows you to specify which context to call the specified function in while + * adding the execution of that function to the Ember run loop. This ability + * makes this method a great way to asynchronously integrate third-party libraries + * into your Ember application. + */ + bind( + target: Target, + method: RunMethod, + ...args: any[] + ): (...args: any[]) => Ret; + /** + * Begins a new RunLoop. Any deferred actions invoked after the begin will + * be buffered until you invoke a matching call to `run.end()`. This is + * a lower-level way to use a RunLoop instead of using `run()`. + */ + begin(): void; + /** + * Ends a RunLoop. This must be called sometime after you call + * `run.begin()` to flush any deferred actions. This is a lower-level way + * to use a RunLoop instead of using `run()`. + */ + end(): void; + /** + * Adds the passed target/method and any optional arguments to the named + * queue to be executed at the end of the RunLoop. If you have not already + * started a RunLoop when calling this method one will be started for you + * automatically. + */ + schedule( + queue: EmberRunQueues, + target: Target, + method: RunMethod, + ...args: any[] + ): EmberRunTimer; + schedule( + queue: EmberRunQueues, + method: (args: any[]) => any, + ...args: any[] + ): EmberRunTimer; + /** + * Invokes the passed target/method and optional arguments after a specified + * period of time. The last parameter of this method must always be a number + * of milliseconds. + */ + later(method: (...args: any[]) => any, wait: number): EmberRunTimer; + later(target: Target, method: RunMethod, wait: number): EmberRunTimer; + later( + target: Target, + method: RunMethod, + arg0: any, + wait: number + ): EmberRunTimer; + later( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + wait: number + ): EmberRunTimer; + later( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + wait: number + ): EmberRunTimer; + later( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + wait: number + ): EmberRunTimer; + later( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + arg4: any, + wait: number + ): EmberRunTimer; + later( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + arg4: any, + arg5: any, + wait: number + ): EmberRunTimer; + /** + * Schedule a function to run one time during the current RunLoop. This is equivalent + * to calling `scheduleOnce` with the "actions" queue. + */ + once(target: Target, method: RunMethod, ...args: any[]): EmberRunTimer; + /** + * Schedules a function to run one time in a given queue of the current RunLoop. + * Calling this method with the same queue/target/method combination will have + * no effect (past the initial call). + */ + scheduleOnce( + queue: EmberRunQueues, + target: Target, + method: RunMethod, + ...args: any[] + ): EmberRunTimer; + /** + * Schedules an item to run from within a separate run loop, after + * control has been returned to the system. This is equivalent to calling + * `run.later` with a wait time of 1ms. + */ + next(target: Target, method: RunMethod, ...args: any[]): EmberRunTimer; + /** + * Cancels a scheduled item. Must be a value returned by `run.later()`, + * `run.once()`, `run.scheduleOnce()`, `run.next()`, `run.debounce()`, or + * `run.throttle()`. + */ + cancel(timer: EmberRunTimer): boolean; + /** + * Delay calling the target method until the debounce period has elapsed + * with no additional debounce calls. If `debounce` is called again before + * the specified time has elapsed, the timer is reset and the entire period + * must pass again before the target method is called. + */ + debounce( + method: (...args: any[]) => any, + wait: number, + immediate?: boolean + ): EmberRunTimer; + debounce( + target: Target, + method: RunMethod, + wait: number, + immediate?: boolean + ): EmberRunTimer; + debounce( + target: Target, + method: RunMethod, + arg0: any, + wait: number, + immediate?: boolean + ): EmberRunTimer; + debounce( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + wait: number, + immediate?: boolean + ): EmberRunTimer; + debounce( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + wait: number, + immediate?: boolean + ): EmberRunTimer; + debounce( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + wait: number, + immediate?: boolean + ): EmberRunTimer; + debounce( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + arg4: any, + wait: number, + immediate?: boolean + ): EmberRunTimer; + debounce( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + arg4: any, + arg5: any, + wait: number, + immediate?: boolean + ): EmberRunTimer; + /** + * Ensure that the target method is never called more frequently than + * the specified spacing period. The target method is called immediately. + */ + throttle( + method: (...args: any[]) => any, + spacing: number, + immediate?: boolean + ): EmberRunTimer; + throttle( + target: Target, + method: RunMethod, + spacing: number, + immediate?: boolean + ): EmberRunTimer; + throttle( + target: Target, + method: RunMethod, + arg0: any, + spacing: number, + immediate?: boolean + ): EmberRunTimer; + throttle( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + spacing: number, + immediate?: boolean + ): EmberRunTimer; + throttle( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + spacing: number, + immediate?: boolean + ): EmberRunTimer; + throttle( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + spacing: number, + immediate?: boolean + ): EmberRunTimer; + throttle( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + arg4: any, + spacing: number, + immediate?: boolean + ): EmberRunTimer; + throttle( + target: Target, + method: RunMethod, + arg0: any, + arg1: any, + arg2: any, + arg3: any, + arg4: any, + arg5: any, + spacing: number, + immediate?: boolean + ): EmberRunTimer; + + queues: EmberRunQueues[]; + }; + const platform: { + defineProperty: boolean; + hasPropertyAccessors: boolean; + }; + + /** + * `getEngineParent` retrieves an engine instance's parent instance. + */ + function getEngineParent(engine: EngineInstance): EngineInstance; + /** + * Display a deprecation warning with the provided message and a stack trace + * (Chrome and Firefox only). + */ + function deprecate( + message: string, + test: boolean, + options: { id: string; until: string } + ): any; + /** + * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options + */ + function deprecate( + message: string, + test: boolean, + options?: { id?: string; until?: string } + ): any; + /** + * Define an assertion that will throw an exception if the condition is not met. + */ + function assert(desc: string, test?: boolean): void | never; + /** + * Display a debug notice. + */ + function debug(message: string): void; + /** + * NOTE: This is a low-level method used by other parts of the API. + * You almost never want to call this method directly. Instead you + * should use Ember.mixin() to define new properties. + */ + function defineProperty( + obj: object, + keyName: string, + desc?: PropertyDescriptor | ComputedProperty, + data?: any, + meta?: any + ): void; + /** + * Alias an old, deprecated method with its new counterpart. + */ + function deprecateFunc any)>( + message: string, + options: { id: string; until: string }, + func: Func + ): Func; + /** + * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options + */ + function deprecateFunc any)>( + message: string, + func: Func + ): Func; + /** + * Run a function meant for debugging. + */ + function runInDebug(func: () => void): any; + /** + * Display a warning with the provided message. + */ + function warn(message: string, test: boolean, options: { id: string }): any; + function warn(message: string, options: { id: string }): any; + /** + * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options + */ + function warn(message: string, test: boolean, options?: { id?: string }): any; + /** + * @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options + */ + function warn(message: string, options?: { id?: string }): any; + /** + * Global helper method to create a new binding. Just pass the root object + * along with a `to` and `from` path to create and connect the binding. + * @deprecated https://emberjs.com/deprecations/v2.x#toc_ember-binding + */ + function bind(obj: {}, to: string, from: string): Binding; + /** + * Returns the cached value for a property, if one exists. + * This can be useful for peeking at the value of a computed + * property that is generated lazily, without accidentally causing + * it to be created. + */ + function cacheFor( + obj: ComputedProperties, + key: K + ): T[K] | undefined; + /** + * Add an event listener + */ + function addListener( + obj: Context, + key: keyof Context, + target: Target, + method: ObserverMethod, + once?: boolean + ): void; + /** + * Remove an event listener + */ + function removeListener( + obj: Context, + key: keyof Context, + target: Target, + method: ObserverMethod + ): any; + /** + * Send an event. The execution of suspended listeners + * is skipped, and once listeners are removed. A listener without + * a target is executed on the passed object. If an array of actions + * is not passed, the actions stored on the passed object are invoked. + */ + function sendEvent(obj: any, eventName: string, params?: any[], actions?: any[]): boolean; + /** + * Define a property as a function that should be executed when + * a specified event or events are triggered. + */ + function on(eventNames: string, func: (...args: any[]) => void): (...args: any[]) => void; + /** + * To get multiple properties at once, call `Ember.getProperties` + * with an object followed by a list of strings or an array: + */ + function getProperties( + obj: ComputedProperties, + list: K[] + ): Pick; + function getProperties( + obj: ComputedProperties, + ...list: K[] + ): Pick; + /** + * A value is blank if it is empty or a whitespace string. + */ + function isBlank(obj: any): boolean; + /** + * Verifies that a value is `null` or an empty string, empty array, + * or empty function. + */ + function isEmpty(obj: any): boolean; + /** + * Returns true if the passed value is null or undefined. This avoids errors + * from JSLint complaining about use of ==, which can be technically + * confusing. + */ + function isNone(obj: any): obj is null | undefined; + /** + * A value is present if it not `isBlank`. + */ + function isPresent(obj: any): boolean; + /** + * Merge the contents of two objects together into the first object. + * @deprecated Use Object.assign + */ + function merge(original: T, updates: U): T & U; + /** + * Makes a method available via an additional name. + */ + function aliasMethod(methodName: string): ComputedProperty; + /** + * Specify a method that observes property changes. + */ + function observer(key1: string, func: (target: any, key: string) => void): void; + function observer( + key1: string, + key2: string, + func: (target: any, key: string) => void + ): void; + function observer( + key1: string, + key2: string, + key3: string, + func: (target: any, key: string) => void + ): void; + function observer( + key1: string, + key2: string, + key3: string, + key4: string, + func: (target: any, key: string) => void + ): void; + function observer( + key1: string, + key2: string, + key3: string, + key4: string, + key5: string, + func: (target: any, key: string) => void + ): void; + /** + * Adds an observer on a property. + */ + function addObserver( + obj: Context, + key: keyof Context, + target: Target, + method: ObserverMethod + ): void; + /** + * Remove an observer you have previously registered on this object. Pass + * the same key, target, and method you passed to `addObserver()` and your + * target will no longer receive notifications. + */ + function removeObserver( + obj: Context, + key: keyof Context, + target: Target, + method: ObserverMethod + ): any; + /** + * Gets the value of a property on an object. If the property is computed, + * the function will be invoked. If the property is not defined but the + * object implements the `unknownProperty` method then that will be invoked. + */ + function get(obj: ComputedProperties, key: K): T[K]; + /** + * Retrieves the value of a property from an Object, or a default value in the + * case that the property returns `undefined`. + */ + function getWithDefault( + obj: ComputedProperties, + key: K, + defaultValue: T[K] + ): T[K]; + /** + * Sets the value of a property on an object, respecting computed properties + * and notifying observers and other listeners of the change. If the + * property is not defined but the object implements the `setUnknownProperty` + * method then that will be invoked as well. + */ + function set( + obj: ComputedProperties, + key: K, + value: V + ): V; + /** + * Error-tolerant form of `Ember.set`. Will not blow up if any part of the + * chain is `undefined`, `null`, or destroyed. + */ + function trySet(root: object, path: string, value: any): any; + /** + * Set a list of properties on an object. These properties are set inside + * a single `beginPropertyChanges` and `endPropertyChanges` batch, so + * observers will be buffered. + */ + function setProperties( + obj: ComputedProperties, + hash: Pick + ): Pick; + /** + * Detects when a specific package of Ember (e.g. 'Ember.Application') + * has fully loaded and is available for extension. + */ + function onLoad(name: string, callback: Function): any; + /** + * Called when an Ember.js package (e.g Ember.Application) has finished + * loading. Triggers any callbacks registered for this event. + */ + function runLoadHooks(name: string, object?: {}): any; + /** + * Creates an `Ember.NativeArray` from an Array like object. + * Does not modify the original object's contents. Ember.A is not needed if + * `EmberENV.EXTEND_PROTOTYPES` is `true` (the default value). However, + * it is recommended that you use Ember.A when creating addons for + * ember or when you can not guarantee that `EmberENV.EXTEND_PROTOTYPES` + * will be `true`. + */ + function A(arr?: T[]): NativeArray; + /** + * Compares two javascript values and returns: + */ + function compare(v: any, w: any): number; + /** + * Creates a shallow copy of the passed object. A deep copy of the object is + * returned if the optional `deep` argument is `true`. + */ + function copy(obj: any, deep?: boolean): any; + /** + * Compares two objects, returning true if they are equal. + */ + function isEqual(a: any, b: any): boolean; + /** + * Returns true if the passed object is an array or Array-like. + */ + function isArray(obj: any): obj is ArrayLike; + /** + * Returns a consistent type for the passed object. + */ + function typeOf(item: any): string; + /** + * Copy properties from a source object to a target object. + * @deprecated Use Object.assign + */ + function assign(target: T, source: U): T & U; + function assign(target: T, source1: U, source2: V): T & U & V; + function assign(target: T, source1: U, source2: V, source3: W): T & U & V & W; + /** + * Polyfill for Object.create + * @deprecated Use Object.create + */ + function create(o: object | null): any; + /** + * Polyfill for Object.keys + * @deprecated Use Object.keys + */ + function keys(o: any): string[]; + /** + * Returns a unique id for the object. If the object does not yet have a guid, + * one will be assigned to it. You can call this on any object, + * `Ember.Object`-based or not, but be aware that it will add a `_guid` + * property. + */ + function guidFor(obj: any): string; + /** + * Convenience method to inspect an object. This method will attempt to + * convert the object into a useful string description. + */ + function inspect(obj: any): string; + /** + * Checks to see if the `methodName` exists on the `obj`, + * and if it does, invokes it with the arguments passed. + */ + function tryInvoke(obj: any, methodName: string, args?: any[]): any; + /** + * Forces the passed object to be part of an array. If the object is already + * an array, it will return the object. Otherwise, it will add the object to + * an array. If obj is `null` or `undefined`, it will return an empty array. + */ + function makeArray(obj?: T[] | T | null): T[]; + /** + * Framework objects in an Ember application (components, services, routes, etc.) + * are created via a factory and dependency injection system. Each of these + * objects is the responsibility of an "owner", which handled its + * instantiation and manages its lifetime. + */ + function getOwner(object: any): any; + /** + * `setOwner` forces a new owner on a given object instance. This is primarily + * useful in some testing cases. + */ + function setOwner(object: any, owner: any): void; + /** + * A function may be assigned to `Ember.onerror` to be called when Ember + * internals encounter an error. This is useful for specialized error handling + * and reporting code. + */ + function onerror(error: Error): void; + /** + * An empty function useful for some operations. Always returns `this`. + * @deprecated https://emberjs.com/deprecations/v2.x/#toc_code-ember-k-code + */ + function K(this: This): This; + /** + * The semantic version + */ + const VERSION: string; + /** + * Alias for jQuery + */ + const $: JQueryStatic; + /** + * This property indicates whether or not this application is currently in + * testing mode. This is set when `setupForTesting` is called on the current + * application. + */ + const testing: boolean; + + const instrument: typeof Instrumentation.instrument; + + const reset: typeof Instrumentation.reset; + + const subscribe: typeof Instrumentation.subscribe; + + const unsubscribe: typeof Instrumentation.unsubscribe; + /** + * Expands `pattern`, invoking `callback` for each expansion. + */ + function expandProperties(pattern: string, callback: (expanded: string) => void): void; + } + + export default Ember; } -export default Ember; +declare module '@ember/application' { + import Ember from 'ember'; + export default Ember.Application; + export const getOwner: typeof Ember.getOwner; + export const onLoad: typeof Ember.onLoad; + export const runLoadHooks: typeof Ember.runLoadHooks; + export const setOwner: typeof Ember.setOwner; +} + +declare module '@ember/application/deprecations' { + import Ember from 'ember'; + export const deprecate: typeof Ember.deprecate; + export const deprecateFunc: typeof Ember.deprecateFunc; +} + +declare module '@ember/application/globals-resolver' { + import Ember from 'ember'; + export default Ember.DefaultResolver; +} + +declare module '@ember/application/instance' { + import Ember from 'ember'; + export default Ember.ApplicationInstance; +} + +declare module '@ember/application/resolver' { + import Ember from 'ember'; + export default Ember.Resolver; +} + +declare module '@ember/array' { + import Ember from 'ember'; + export default Ember.Array; + export const A: typeof Ember.A; + export const isArray: typeof Ember.isArray; + export const makeArray: typeof Ember.makeArray; +} + +declare module '@ember/array/mutable' { + import Ember from 'ember'; + export default Ember.MutableArray; +} + +declare module '@ember/array/proxy' { + import Ember from 'ember'; + export default Ember.ArrayProxy; +} + +declare module '@ember/component' { + import Ember from 'ember'; + export default Ember.Component; +} + +declare module '@ember/component/checkbox' { + import Ember from 'ember'; + export default Ember.Checkbox; +} + +declare module '@ember/component/helper' { + import Ember from 'ember'; + export default Ember.Helper; + export const helper: typeof Ember.Helper.helper; +} + +declare module '@ember/component/text-area' { + import Ember from 'ember'; + export default Ember.TextArea; +} + +declare module '@ember/component/text-field' { + import Ember from 'ember'; + export default Ember.TextField; +} + +declare module '@ember/controller' { + import Ember from 'ember'; + export default Ember.Controller; + export const inject: typeof Ember.inject.controller; +} + +declare module '@ember/debug' { + import Ember from 'ember'; + export const assert: typeof Ember.assert; + export const debug: typeof Ember.debug; + export const inspect: typeof Ember.inspect; + export const registerDeprecationHandler: typeof Ember.Debug.registerDeprecationHandler; + export const registerWarnHandler: typeof Ember.Debug.registerWarnHandler; + export const runInDebug: typeof Ember.runInDebug; + export const warn: typeof Ember.warn; +} + +declare module '@ember/debug/container-debug-adapter' { + import Ember from 'ember'; + export default Ember.ContainerDebugAdapter; +} + +declare module '@ember/debug/data-adapter' { + import Ember from 'ember'; + export default Ember.DataAdapter; +} + +declare module '@ember/engine' { + import Ember from 'ember'; + export default Ember.Engine; + export const getEngineParent: typeof Ember.getEngineParent; +} + +declare module '@ember/engine/instance' { + import Ember from 'ember'; + export default Ember.EngineInstance; +} + +declare module '@ember/enumerable' { + import Ember from 'ember'; + export default Ember.Enumerable; +} + +declare module '@ember/instrumentation' { + import Ember from 'ember'; + export const instrument: typeof Ember.instrument; + export const reset: typeof Ember.reset; + export const subscribe: typeof Ember.subscribe; + export const unsubscribe: typeof Ember.unsubscribe; +} + +declare module '@ember/map' { + import Ember from 'ember'; + export default Ember.Map; +} + +declare module '@ember/map/with-default' { + import Ember from 'ember'; + export default Ember.MapWithDefault; +} + +declare module '@ember/object' { + import Ember from 'ember'; + export default Ember.Object; + export const aliasMethod: typeof Ember.aliasMethod; + export const computed: typeof Ember.computed; + export const defineProperty: typeof Ember.defineProperty; + export const get: typeof Ember.get; + export const getProperties: typeof Ember.getProperties; + export const getWithDefault: typeof Ember.getWithDefault; + export const observer: typeof Ember.observer; + export const set: typeof Ember.set; + export const setProperties: typeof Ember.setProperties; + export const trySet: typeof Ember.trySet; +} + +declare module '@ember/object/computed' { + import Ember from 'ember'; + export default Ember.ComputedProperty; + export const alias: typeof Ember.computed.alias; + export const and: typeof Ember.computed.and; + export const bool: typeof Ember.computed.bool; + export const collect: typeof Ember.computed.collect; + export const deprecatingAlias: typeof Ember.computed.deprecatingAlias; + export const empty: typeof Ember.computed.empty; + export const equal: typeof Ember.computed.equal; + export const expandProperties: typeof Ember.expandProperties; + export const filter: typeof Ember.computed.filter; + export const filterBy: typeof Ember.computed.filterBy; + export const gt: typeof Ember.computed.gt; + export const gte: typeof Ember.computed.gte; + export const intersect: typeof Ember.computed.intersect; + export const lt: typeof Ember.computed.lt; + export const lte: typeof Ember.computed.lte; + export const map: typeof Ember.computed.map; + export const mapBy: typeof Ember.computed.mapBy; + export const match: typeof Ember.computed.match; + export const max: typeof Ember.computed.max; + export const min: typeof Ember.computed.min; + export const none: typeof Ember.computed.none; + export const not: typeof Ember.computed.not; + export const notEmpty: typeof Ember.computed.notEmpty; + export const oneWay: typeof Ember.computed.oneWay; + export const or: typeof Ember.computed.or; + export const readOnly: typeof Ember.computed.readOnly; + export const reads: typeof Ember.computed.reads; + export const setDiff: typeof Ember.computed.setDiff; + export const sort: typeof Ember.computed.sort; + export const sum: typeof Ember.computed.sum; + export const union: typeof Ember.computed.union; + export const uniq: typeof Ember.computed.uniq; + export const uniqBy: typeof Ember.computed.uniqBy; +} + +declare module '@ember/object/core' { + import Ember from 'ember'; + export default Ember.CoreObject; +} + +declare module '@ember/object/evented' { + import Ember from 'ember'; + export default Ember.Evented; + export const on: typeof Ember.on; +} + +declare module '@ember/object/events' { + import Ember from 'ember'; + export const addListener: typeof Ember.addListener; + export const removeListener: typeof Ember.removeListener; + export const sendEvent: typeof Ember.sendEvent; +} + +declare module '@ember/object/internals' { + import Ember from 'ember'; + export const cacheFor: typeof Ember.cacheFor; + export const copy: typeof Ember.copy; + export const guidFor: typeof Ember.guidFor; +} + +declare module '@ember/object/mixin' { + import Ember from 'ember'; + export default Ember.Mixin; +} + +declare module '@ember/object/observable' { + import Ember from 'ember'; + export default Ember.Observable; +} + +declare module '@ember/object/observers' { + import Ember from 'ember'; + export const addObserver: typeof Ember.addObserver; + export const removeObserver: typeof Ember.removeObserver; +} + +declare module '@ember/object/promise-proxy-mixin' { + import Ember from 'ember'; + export default Ember.PromiseProxyMixin; +} + +declare module '@ember/object/proxy' { + import Ember from 'ember'; + export default Ember.ObjectProxy; +} + +declare module '@ember/polyfills' { + import Ember from 'ember'; + export const assign: typeof Ember.assign; + export const create: typeof Ember.create; + export const hasPropertyAccessors: typeof Ember.platform.hasPropertyAccessors; + export const keys: typeof Ember.keys; + export const merge: typeof Ember.merge; +} + +declare module '@ember/routing/auto-location' { + import Ember from 'ember'; + export default Ember.AutoLocation; +} + +declare module '@ember/routing/hash-location' { + import Ember from 'ember'; + export default Ember.HashLocation; +} + +declare module '@ember/routing/history-location' { + import Ember from 'ember'; + export default Ember.HistoryLocation; +} + +declare module '@ember/routing/link-component' { + import Ember from 'ember'; + export default Ember.LinkComponent; +} + +declare module '@ember/routing/location' { + import Ember from 'ember'; + export default Ember.Location; +} + +declare module '@ember/routing/none-location' { + import Ember from 'ember'; + export default Ember.NoneLocation; +} + +declare module '@ember/routing/route' { + import Ember from 'ember'; + export default Ember.Route; +} + +declare module '@ember/routing/router' { + import Ember from 'ember'; + export default Ember.Router; +} + +declare module '@ember/runloop' { + import Ember from 'ember'; + export const begin: typeof Ember.run.begin; + export const bind: typeof Ember.run.bind; + export const cancel: typeof Ember.run.cancel; + export const debounce: typeof Ember.run.debounce; + export const end: typeof Ember.run.end; + export const join: typeof Ember.run.join; + export const later: typeof Ember.run.later; + export const next: typeof Ember.run.next; + export const once: typeof Ember.run.once; + export const run: typeof Ember.run; + export const schedule: typeof Ember.run.schedule; + export const scheduleOnce: typeof Ember.run.scheduleOnce; + export const throttle: typeof Ember.run.throttle; +} + +declare module '@ember/service' { + import Ember from 'ember'; + export default Ember.Service; + export const inject: typeof Ember.inject.service; +} + +declare module '@ember/string' { + import Ember from 'ember'; + export const camelize: typeof Ember.String.camelize; + export const capitalize: typeof Ember.String.capitalize; + export const classify: typeof Ember.String.classify; + export const dasherize: typeof Ember.String.dasherize; + export const decamelize: typeof Ember.String.decamelize; + export const fmt: typeof Ember.String.fmt; + export const htmlSafe: typeof Ember.String.htmlSafe; + export const isHTMLSafe: typeof Ember.String.isHTMLSafe; + export const loc: typeof Ember.String.loc; + export const underscore: typeof Ember.String.underscore; + export const w: typeof Ember.String.w; +} + +declare module '@ember/test' { + import Ember from 'ember'; + export const registerAsyncHelper: typeof Ember.Test.registerAsyncHelper; + export const registerHelper: typeof Ember.Test.registerHelper; + export const registerWaiter: typeof Ember.Test.registerWaiter; + export const unregisterHelper: typeof Ember.Test.unregisterHelper; + export const unregisterWaiter: typeof Ember.Test.unregisterWaiter; +} + +declare module '@ember/test/adapter' { + import Ember from 'ember'; + export default Ember.Test.Adapter; +} + +declare module '@ember/utils' { + import Ember from 'ember'; + export const compare: typeof Ember.compare; + export const isBlank: typeof Ember.isBlank; + export const isEmpty: typeof Ember.isEmpty; + export const isEqual: typeof Ember.isEqual; + export const isNone: typeof Ember.isNone; + export const isPresent: typeof Ember.isPresent; + export const tryInvoke: typeof Ember.tryInvoke; + export const typeOf: typeof Ember.typeOf; +} + +declare module 'htmlbars-inline-precompile' { + interface TemplateFactory { + __htmlbars_inline_precompile_template_factory: any; + } + export default function hbs(tagged: TemplateStringsArray): TemplateFactory; +} diff --git a/types/ember/test/application.ts b/types/ember/test/application.ts new file mode 100755 index 0000000000..0589e64879 --- /dev/null +++ b/types/ember/test/application.ts @@ -0,0 +1,15 @@ +import Ember from 'ember'; +import { assertType } from "./lib/assert"; + +let App = Ember.Application.create({ + customEvents: { + paste: 'paste' + } +}); + +let App2 = Ember.Application.create({ + customEvents: { + mouseenter: null, + mouseleave: null + } +}); diff --git a/types/ember/test/array-ext.ts b/types/ember/test/array-ext.ts new file mode 100755 index 0000000000..86e84fd7c5 --- /dev/null +++ b/types/ember/test/array-ext.ts @@ -0,0 +1,18 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +declare global { + interface Array extends Ember.ArrayPrototypeExtensions {} +} + +class Person extends Ember.Object { + name: string; +} + +const person = Person.create({ name: 'Joe' }); +const array = [person]; + +assertType(array.get('length')); +assertType(array.get('firstObject')); +assertType(array.mapBy('name')); +assertType(array.map(p => p.get('name'))); diff --git a/types/ember/test/array-proxy.ts b/types/ember/test/array-proxy.ts new file mode 100644 index 0000000000..dceea7b847 --- /dev/null +++ b/types/ember/test/array-proxy.ts @@ -0,0 +1,26 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +const pets = ['dog', 'cat', 'fish']; +const proxy = Ember.ArrayProxy.create({ content: Ember.A(pets) }); + +proxy.get('firstObject'); // 'dog' +proxy.set('content', Ember.A(['amoeba', 'paramecium'])); +proxy.get('firstObject'); // 'amoeba' + +const overridden = Ember.ArrayProxy.create({ + content: Ember.A(pets), + objectAtContent(idx: number): string { + return this.get('content').objectAt(idx)!.toUpperCase(); + } +}); + +overridden.get('firstObject'); // 'DOG' + +class MyNewProxy extends Ember.ArrayProxy { + isNew = true; +} + +let x = MyNewProxy.create({ content: Ember.A([1, 2, 3]) }) as MyNewProxy; +assertType(x.get('firstObject')); +assertType(x.isNew); diff --git a/types/ember/test/array.ts b/types/ember/test/array.ts new file mode 100755 index 0000000000..5934459735 --- /dev/null +++ b/types/ember/test/array.ts @@ -0,0 +1,46 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +type Person = typeof Person.prototype; +const Person = Ember.Object.extend({ + name: '', + isHappy: false +}); + +const people = Ember.A([ + Person.create({ name: 'Yehuda', isHappy: true }), + Person.create({ name: 'Majd', isHappy: false }), +]); + +assertType(people.get('length')); +assertType(people.get('lastObject')); +assertType(people.isAny('isHappy')); +assertType(people.isAny('isHappy', false)); +assertType(people.filterBy('isHappy')); +assertType(people.get('[]')); +assertType(people.get('[]').get('firstObject')); + +assertType>(people.mapBy('isHappy')); +assertType(people.mapBy('name.length')); + +const last = people.get('lastObject'); +if (last) { + assertType(last.get('name')); +} + +const first = people.get('lastObject'); +if (first) { + assertType(first.get('isHappy')); +} + +const letters: Ember.Enumerable = Ember.A(['a', 'b', 'c']); +const codes: number[] = letters.map((item, index, enumerable) => { + assertType(item); + assertType(index); + return item.charCodeAt(0); +}); + +let value = '1,2,3'; +let filters = Ember.A(value.split(',')); +filters.push('4'); +filters.sort(); diff --git a/types/ember/test/component.ts b/types/ember/test/component.ts new file mode 100755 index 0000000000..bcc314300d --- /dev/null +++ b/types/ember/test/component.ts @@ -0,0 +1,124 @@ +import Ember from 'ember'; +import Component from '@ember/component'; +import Object, { computed } from '@ember/object'; +import hbs from 'htmlbars-inline-precompile'; +import { assertType } from "./lib/assert"; + +Component.extend({ + layout: hbs` +
    + {{yield}} +
    + `, +}); + +Component.extend({ + layout: 'my-layout', +}); + +const MyComponent = Component.extend(); +assertType(Ember.get(MyComponent, 'positionalParams')); + +const component1 = Component.extend({ + actions: { + hello(name: string) { + console.log('Hello', name); + }, + }, +}); + +Component.extend({ + name: '', + hello(name: string) { + this.set('name', name); + }, +}); + +Component.extend({ + tagName: 'em', +}); + +Component.extend({ + classNames: ['my-class', 'my-other-class'], +}); + +Component.extend({ + classNameBindings: ['propertyA', 'propertyB'], + propertyA: 'from-a', + propertyB: computed(function() { + if (!this.get('propertyA')) { + return 'from-b'; + } + }), +}); + +Component.extend({ + classNameBindings: ['hovered'], + hovered: true, +}); + +Component.extend({ + classNameBindings: ['messages.empty'], + messages: Object.create({ + empty: true, + }), +}); + +Component.extend({ + classNameBindings: ['isEnabled:enabled:disabled'], + isEnabled: true, +}); + +Component.extend({ + classNameBindings: ['isEnabled::disabled'], + isEnabled: true, +}); + +Component.extend({ + tagName: 'a', + attributeBindings: ['href'], + href: 'http://google.com', +}); + +Component.extend({ + tagName: 'a', + attributeBindings: ['url:href'], + url: 'http://google.com', +}); + +Component.extend({ + tagName: 'use', + attributeBindings: ['xlinkHref:xlink:href'], + xlinkHref: '#triangle', +}); + +Component.extend({ + tagName: 'input', + attributeBindings: ['disabled'], + disabled: false, +}); + +Component.extend({ + tagName: 'input', + attributeBindings: ['disabled'], + disabled: computed(() => { + if ('someLogic') { + return true; + } else { + return false; + } + }), +}); + +Component.extend({ + tagName: 'form', + attributeBindings: ['novalidate'], + novalidate: null, +}); + +Component.extend({ + click(event: object) { + // will be called when an instance's + // rendered element is clicked + }, +}); diff --git a/types/ember/test/computed.ts b/types/ember/test/computed.ts new file mode 100755 index 0000000000..b9bfe2ada6 --- /dev/null +++ b/types/ember/test/computed.ts @@ -0,0 +1,160 @@ +import Ember from 'ember'; +import Component from '@ember/component'; +import { or } from '@ember/object/computed'; +import { assertType } from './lib/assert'; + +const Person = Ember.Object.extend({ + firstName: '', + lastName: '', + age: 0, + + noArgs: Ember.computed(() => 'test'), + + fullName: Ember.computed('firstName', 'lastName', function() { + return `${this.get('firstName')} ${this.get('lastName')}`; + }), + + fullNameReadonly: Ember.computed('fullName', function() { + return this.get('fullName'); + }).readOnly(), + + fullNameWritable: Ember.computed('firstName', 'lastName', { + get() { + return this.get('fullName'); + }, + set(key, value) { + let [first, last] = value.split(' '); + this.set('firstName', first); + this.set('lastName', last); + return value; + } + }), + + fullNameGetOnly: Ember.computed('fullName', { + get() { + return this.get('fullName'); + } + }), + + fullNameSetOnly: Ember.computed('firstName', 'lastName', { + set(key, value) { + let [first, last] = value.split(' '); + this.set('firstName', first); + this.set('lastName', last); + return value; + } + }), + + combinators: Ember.computed(function() { + return this.get('firstName'); + }).property('firstName') + .meta({ foo: 'bar' }) + .volatile() + .readOnly() +}); + +const person = Person.create({ + firstName: 'Fred', + lastName: 'Smith', + age: 29, +}); + +assertType(person.firstName); +assertType(person.age); +assertType>(person.noArgs); +assertType>(person.fullName); +assertType>(person.fullNameReadonly); +assertType>(person.fullNameWritable); +assertType>(person.fullNameGetOnly); +assertType>(person.fullNameSetOnly); +assertType>(person.combinators); + +assertType(person.get('firstName')); +assertType(person.get('age')); +assertType(person.get('noArgs')); +assertType(person.get('fullName')); +assertType(person.get('fullNameReadonly')); +assertType(person.get('fullNameWritable')); +assertType(person.get('fullNameGetOnly')); +assertType(person.get('fullNameSetOnly')); +assertType(person.get('combinators')); + +assertType<{ firstName: string, fullName: string, age: number }>(person.getProperties('firstName', 'fullName', 'age')); + +const person2 = Person.create({ + fullName: 'Fred Smith' +}); + +assertType(person2.get('firstName')); +assertType(person2.get('fullName')); + +const person3 = Person.extend({ + firstName: 'Fred', + fullName: 'Fred Smith' +}).create(); + +assertType(person3.get('firstName')); +assertType(person3.get('fullName')); + +const person4 = Person.extend({ + firstName: Ember.computed(() => 'Fred'), + fullName: Ember.computed(() => 'Fred Smith') +}).create(); + +assertType(person4.get('firstName')); +assertType(person4.get('fullName')); + +// computed property macros +const objectWithComputedProperties = Ember.Object.extend({ + alias: Ember.computed.alias('foo'), + and: Ember.computed.and('foo', 'bar', 'baz', 'qux'), + bool: Ember.computed.bool('foo'), + collect: Ember.computed.collect('foo', 'bar', 'baz', 'qux'), + deprecatingAlias: Ember.computed.deprecatingAlias('foo', { + id: 'hamster.deprecate-banana', + until: '3.0.0' + }), + empty: Ember.computed.empty('foo'), + equalNumber: Ember.computed.equal('foo', 1), + equalString: Ember.computed.equal('foo', 'bar'), + equalObject: Ember.computed.equal('foo', {}), + filter: Ember.computed.filter('foo', (item) => item === 'bar'), + filterBy1: Ember.computed.filterBy('foo', 'bar'), + filterBy2: Ember.computed.filterBy('foo', 'bar', false), + gt: Ember.computed.gt('foo', 3), + gte: Ember.computed.gte('foo', 3), + intersect: Ember.computed.intersect('foo', 'bar', 'baz', 'qux'), + lt: Ember.computed.lt('foo', 3), + lte: Ember.computed.lte('foo', 3), + map: Ember.computed.map('foo', (item, index) => item.bar), + mapBy: Ember.computed.mapBy('foo', 'bar'), + match: Ember.computed.match('foo', /^tom.ter$/), + max: Ember.computed.max('foo'), + min: Ember.computed.min('foo'), + none: Ember.computed.none('foo'), + not: Ember.computed.not('foo'), + notEmpty: Ember.computed.notEmpty('foo'), + oneWay: Ember.computed.oneWay('foo'), + or: Ember.computed.or('foo', 'bar', 'baz', 'qux'), + readOnly: Ember.computed.readOnly('foo'), + reads: Ember.computed.reads('foo'), + setDiff: Ember.computed.setDiff('foo', 'bar'), + sort1: Ember.computed.sort('foo', 'bar'), + sort2: Ember.computed.sort('foo', (itemA, itemB) => { + if (itemA < itemB) { + return -1; + } else if (itemA > itemB) { + return 1; + } else { + return 0; + } + }), + sum: Ember.computed.sum('foo'), + union: Ember.computed.union('foo', 'bar', 'baz', 'qux'), + uniq: Ember.computed.uniq('foo'), + uniqBy: Ember.computed.uniqBy('foo', 'bar') +}); + +const component2 = Component.extend({ + isAnimal: or('isDog', 'isCat') +}); diff --git a/types/ember/test/controller.ts b/types/ember/test/controller.ts new file mode 100755 index 0000000000..02307f447c --- /dev/null +++ b/types/ember/test/controller.ts @@ -0,0 +1,11 @@ +import Controller from '@ember/controller'; + +Controller.extend ({ + queryParams: ['category'], + category: null, + isExpanded: false, + + toggleBody() { + this.toggleProperty('isExpanded'); + } +}); diff --git a/types/ember/test/create.ts b/types/ember/test/create.ts new file mode 100755 index 0000000000..6dc61b80f6 --- /dev/null +++ b/types/ember/test/create.ts @@ -0,0 +1,7 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +const obj = Ember.Object.create({ a: 1 }, { b: 2 }, { c: 3 }); +assertType(obj.a); +assertType(obj.b); +assertType(obj.c); diff --git a/types/ember/test/detect-instance.ts b/types/ember/test/detect-instance.ts new file mode 100755 index 0000000000..1b25beb244 --- /dev/null +++ b/types/ember/test/detect-instance.ts @@ -0,0 +1,20 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +const ExtendClass = Ember.Object.extend({ + foo: 'hello' +}); + +class ES6Class extends Ember.Object { + bar: string; +} + +let testObject = null; + +if (ExtendClass.detectInstance(testObject)) { + assertType(testObject.foo); +} + +if (ES6Class.detectInstance(testObject)) { + assertType(testObject.bar); +} diff --git a/types/ember/test/detect.ts b/types/ember/test/detect.ts new file mode 100755 index 0000000000..cd54880f9f --- /dev/null +++ b/types/ember/test/detect.ts @@ -0,0 +1,20 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +const ExtendClass = Ember.Object.extend({ + foo: 'hello' +}); + +class ES6Class extends Ember.Object { + bar: string; +} + +let TestClass = Ember.Object; + +if (ExtendClass.detect(TestClass)) { + assertType(TestClass.create().foo); +} + +if (ES6Class.detect(TestClass)) { + assertType(TestClass.create().bar); +} diff --git a/types/ember/ember-tests.ts b/types/ember/test/ember-tests.ts old mode 100644 new mode 100755 similarity index 68% rename from types/ember/ember-tests.ts rename to types/ember/test/ember-tests.ts index 3964d68a86..94de3bf259 --- a/types/ember/ember-tests.ts +++ b/types/ember/test/ember-tests.ts @@ -2,8 +2,7 @@ import Ember from 'ember'; let App: any; -App = Ember.Application.create(); - +App = Ember.Application.create(); App.president = Ember.Object.create({ name: 'Barack Obama', }); @@ -23,8 +22,9 @@ App.president.get('fullName'); declare class MyPerson extends Ember.Object { static createMan(): MyPerson; } +MyPerson.createMan(); -const Person1 = Ember.Object.extend({ +const Person1 = Ember.Object.extend({ say: (thing: string) => { alert(thing); }, @@ -33,7 +33,9 @@ const Person1 = Ember.Object.extend({ declare class MyPerson2 extends Ember.Object { helloWorld(): void; } -const tom = Person1.create({ +MyPerson2.create().helloWorld(); + +const tom = Person1.create({ name: 'Tom Dale', helloWorld() { this.say('Hi my name is ' + this.get('name')); @@ -41,23 +43,8 @@ const tom = Person1.create({ }); tom.helloWorld(); -Person1.reopen({ isPerson: true }); -Person1.create().get('isPerson'); - -Person1.reopenClass({ - createMan: () => { - return Person1.create({ isMan: true }); - }, -}); -// ReSharper disable once DuplicatingLocalDeclaration -Person1.createMan().get('isMan'); - -const person = Person1.create({ - firstName: 'Yehuda', - lastName: 'Katz', -}); -person.addObserver('fullName', null, () => {}); -person.set('firstName', 'Brohuda'); +const PersonReopened = Person1.reopen({ isPerson: true }); +PersonReopened.create().get('isPerson'); App.todosController = Ember.Object.create({ todos: [Ember.Object.create({ isDone: false })], @@ -105,17 +92,6 @@ App.userController = Ember.Object.create({ }), }); -Ember.Helper.helper(params => { - const cents = params[0]; - return `${cents * 0.01}`; -}); - -Ember.Helper.helper((params, hash) => { - const cents = params[0]; - const currency = hash.currency; - return `${currency}${cents * 0.01}`; -}); - Handlebars.registerHelper( 'highlight', (property: string, options: any) => @@ -124,7 +100,8 @@ Handlebars.registerHelper( const coolView = App.CoolView.create(); -const Person2 = Ember.Object.extend({ +const Person2 = Ember.Object.extend({ + name: '', sayHello() { console.log('Hello from ' + this.get('name')); }, @@ -140,24 +117,25 @@ const arr = Ember.A([Ember.Object.create(), Ember.Object.create()]); arr.setEach('name', 'unknown'); arr.getEach('name'); -const Person3 = Ember.Object.extend({ - name: null, +const Person3 = Ember.Object.extend({ + name: '', isHappy: false, }); const people2 = Ember.A([ Person3.create({ name: 'Yehuda', isHappy: true }), Person3.create({ name: 'Majd', isHappy: false }), ]); -const isHappy = (person: Ember.Object): Boolean => { +const isHappy = (person: typeof Person3.prototype): boolean => { return !!person.get('isHappy'); }; people2.every(isHappy); people2.any(isHappy); -people2.everyProperty('isHappy', true); -people2.someProperty('isHappy', true); +people2.isEvery('isHappy', true); +people2.isAny('isHappy', true); +people2.isAny('isHappy'); // Examples taken from http://emberjs.com/api/classes/Em.RSVP.Promise.html -const promise = new Ember.RSVP.Promise((resolve: Function, reject: Function) => { +const promise = new Ember.RSVP.Promise((resolve: Function, reject: Function) => { // on success resolve('ok!'); @@ -174,6 +152,9 @@ promise.then( } ); +// make sure Ember.RSVP.Promise can be reference as a type +declare function promiseReturningFunction(urn: string): Ember.RSVP.Promise; + const mix1 = Ember.Mixin.create({ foo: 1, }); @@ -182,27 +163,7 @@ const mix2 = Ember.Mixin.create({ bar: 2, }); -const mix3 = Ember.Mixin.create({ - foo: 3, -}); - -const mix4 = Ember.Mixin.create({ - bar: 4, -}); - -const mix5 = Ember.Mixin.create({ - foo: 5, -}); - -const mix6 = Ember.Mixin.create({ - bar: 6, -}); - -const mix7 = Ember.Mixin.create({ - foo: 7, -}); - -const component1 = Ember.Component.extend(mix1, mix2, mix3, mix4, mix5, mix6, mix7, { +const component1 = Ember.Component.extend(mix1, mix2, { lyft: Ember.inject.service(), cars: Ember.computed.readOnly('lyft.cars'), }); diff --git a/types/ember/test/event.ts b/types/ember/test/event.ts new file mode 100755 index 0000000000..c934072440 --- /dev/null +++ b/types/ember/test/event.ts @@ -0,0 +1,58 @@ +import Ember from 'ember'; + +function testOn() { + let Job = Ember.Object.extend({ + logCompleted: Ember.on('completed', function() { + console.log('Job completed!'); + }) + }); + + let job = Job.create(); + + Ember.sendEvent(job, 'completed'); // Logs 'Job completed!' +} + +function testEvented() { + let Person = Ember.Object.extend(Ember.Evented, { + greet() { + this.trigger('greet'); + } + }); + + let person = Person.create(); + + person.on('greet', function() { + console.log('Our person has greeted'); + }); + + person.on('greet', function() { + console.log('Our person has greeted'); + }).one('greet', function() { + console.log('Offer one-time special'); + }).off('event', {}, function() {}); + + person.greet(); +} + +function testObserver() { + Ember.Object.extend({ + valueObserver: Ember.observer('value', function() { + // Executes whenever the "value" property changes + }) + }); +} + +function testListener() { + Ember.Component.extend({ + init() { + Ember.addListener(this, 'willDestroyElement', this, 'willDestroyListener'); + Ember.addListener(this, 'willDestroyElement', this, 'willDestroyListener', true); + Ember.addListener(this, 'willDestroyElement', this, this.willDestroyListener); + Ember.addListener(this, 'willDestroyElement', this, this.willDestroyListener, true); + Ember.removeListener(this, 'willDestroyElement', this, 'willDestroyListener'); + Ember.removeListener(this, 'willDestroyElement', this, this.willDestroyListener); + }, + willDestroyListener() { + } + }); +} diff --git a/types/ember/test/extend.ts b/types/ember/test/extend.ts new file mode 100755 index 0000000000..a54f81a600 --- /dev/null +++ b/types/ember/test/extend.ts @@ -0,0 +1,61 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +const Person = Ember.Object.extend({ + firstName: '', + lastName: '', + + getFullName() { + return `${this.firstName} ${this.lastName}`; + }, + getFullName2(): string { + return `${this.get('firstName')} ${this.get('lastName')}`; + } +}); + +assertType(Person.prototype.firstName); +assertType<() => string>(Person.prototype.getFullName); + +const person = Person.create({ + firstName: 'Joe', + lastName: 'Blow', + extra: 42 +}); + +assertType(person.getFullName()); +assertType(person.extra); + +class ES6Person extends Ember.Object { + firstName: string; + lastName: string; + + get fullName() { + return `${this.firstName} ${this.lastName}`; + } + get fullName2(): string { + return `${this.get('firstName')} ${this.get('lastName')}`; + } +} + +assertType(ES6Person.prototype.firstName); +assertType(ES6Person.prototype.fullName); + +const es6Person = ES6Person.create({ + firstName: 'Joe', + lastName: 'Blow', + extra: 42 +}); + +assertType(es6Person.fullName); +assertType(es6Person.extra); + +class PersonWithStatics extends Ember.Object { + static isPerson = true; +} +const PersonWithStatics2 = PersonWithStatics.extend({}); +class PersonWithStatics3 extends PersonWithStatics {} +class PersonWithStatics4 extends PersonWithStatics2 {} +assertType(PersonWithStatics.isPerson); +assertType(PersonWithStatics2.isPerson); +assertType(PersonWithStatics3.isPerson); +assertType(PersonWithStatics4.isPerson); diff --git a/types/ember/test/function-ext.ts b/types/ember/test/function-ext.ts new file mode 100755 index 0000000000..37d831d49a --- /dev/null +++ b/types/ember/test/function-ext.ts @@ -0,0 +1,21 @@ +import Ember from 'ember'; + +declare global { + interface Function extends Ember.FunctionPrototypeExtensions {} +} + +Ember.Object.extend({ + foo: '', + + arr: function() { + return []; + }.property(), + + alias: function(this: any) { + return this.get('foo'); + }.property('foo', 'bar.@each.baz'), + + observer: function() {}.observes('foo', 'bar'), + + on: function() {}.on('foo', 'bar'), +}); diff --git a/types/ember/test/helper.ts b/types/ember/test/helper.ts new file mode 100755 index 0000000000..efe3ce33d7 --- /dev/null +++ b/types/ember/test/helper.ts @@ -0,0 +1,27 @@ +import Ember from 'ember'; + +const FormatCurrencyHelper = Ember.Helper.helper(function(params, hash: { currency: string }) { + let cents = params[0]; + let currency = hash.currency; + return `${currency}${cents * 0.01}`; +}); + +class User extends Ember.Object { + email: string; +} + +class SessionService extends Ember.Service { + currentUser: User; +} + +const CurrentUserEmailHelper = Ember.Helper.extend({ + session: Ember.inject.service() as Ember.ComputedProperty, + onNewUser: Ember.observer('session.currentUser', function(this: Ember.Helper) { + this.recompute(); + }), + compute(): string { + return this.get('session') + .get('currentUser') + .get('email'); + }, +}); diff --git a/types/ember/test/inject.ts b/types/ember/test/inject.ts new file mode 100755 index 0000000000..dd628f6d2a --- /dev/null +++ b/types/ember/test/inject.ts @@ -0,0 +1,20 @@ +import Ember from 'ember'; + +class AuthService extends Ember.Service { + isAuthenticated: boolean; +} + +class ApplicationController extends Ember.Controller { + transitionToLogin() {} +} + +class LoginRoute extends Ember.Route { + auth = Ember.inject.service('authentication') as Ember.ComputedProperty; + application = Ember.inject.controller() as Ember.ComputedProperty; + + didTransition() { + if (!this.get('auth').get('isAuthenticated')) { + this.get('application').transitionToLogin(); + } + } +} diff --git a/types/ember/test/lib/assert.ts b/types/ember/test/lib/assert.ts new file mode 100755 index 0000000000..d6748cd5bc --- /dev/null +++ b/types/ember/test/lib/assert.ts @@ -0,0 +1,5 @@ +/** Static assertion that `value` has type `T` */ +// Disable tslint here b/c the generic is used to let us do a type coercion and +// validate that coercion works for the type value "passed into" the function. +// tslint:disable-next-line:no-unnecessary-generics +export declare function assertType(value: T): void; diff --git a/types/ember/test/mixin.ts b/types/ember/test/mixin.ts new file mode 100755 index 0000000000..2c417c00da --- /dev/null +++ b/types/ember/test/mixin.ts @@ -0,0 +1,46 @@ +import Ember from 'ember'; +import { assertType } from "./lib/assert"; + +interface EditableMixin { + edit(): void; + isEditing: boolean; +} + +const EditableMixin: Ember.Mixin = Ember.Mixin.create({ + edit() { + this.get('controller'); + console.log('starting to edit'); + this.set('isEditing', true); + }, + isEditing: false +}); + +const EditableComment = Ember.Route.extend(EditableMixin, { + postId: 0, + + canEdit() { + return !this.isEditing; + }, + + tryEdit() { + if (this.canEdit()) { + this.edit(); + } + } +}); + +const comment = EditableComment.create({ + postId: 42 +}); + +comment.edit(); +comment.canEdit(); +comment.tryEdit(); +assertType(comment.isEditing); +assertType(comment.postId); + +const LiteralMixins = Ember.Object.extend({ a: 1 }, { b: 2 }, { c: 3 }); +const obj = LiteralMixins.create(); +assertType(obj.a); +assertType(obj.b); +assertType(obj.c); diff --git a/types/ember/test/object.ts b/types/ember/test/object.ts new file mode 100755 index 0000000000..cfe2c9380f --- /dev/null +++ b/types/ember/test/object.ts @@ -0,0 +1,15 @@ +import Ember from 'ember'; + +const LifetimeHooks = Ember.Object.extend({ + resource: null as {} | null, + + init() { + this._super(); + this.resource = {}; + }, + + willDestroy() { + delete this.resource; + this._super(); + } +}); diff --git a/types/ember/test/observable.ts b/types/ember/test/observable.ts new file mode 100755 index 0000000000..680b6decf7 --- /dev/null +++ b/types/ember/test/observable.ts @@ -0,0 +1,88 @@ +import Ember from 'ember'; +import { assertType } from './lib/assert'; + +class MyComponent extends Ember.Component { + foo = 'bar'; + + init() { + this._super.apply(this, arguments); + this.addObserver('foo', this, 'fooDidChange'); + this.addObserver('foo', this, this.fooDidChange); + Ember.addObserver(this, 'foo', this, 'fooDidChange'); + Ember.addObserver(this, 'foo', this, this.fooDidChange); + this.removeObserver('foo', this, 'fooDidChange'); + this.removeObserver('foo', this, this.fooDidChange); + Ember.removeObserver(this, 'foo', this, 'fooDidChange'); + Ember.removeObserver(this, 'foo', this, this.fooDidChange); + } + + fooDidChange(sender: MyComponent, key: 'foo') { + // your code + } +} + +const myComponent = MyComponent.create(); +myComponent.addObserver('foo', null, () => {}); +myComponent.set('foo', 'baz'); + +const person = Ember.Object.create({ + name: 'Fred', + age: 29, + capitalized: Ember.computed(function() { + return this.get('name').toUpperCase(); + }) +}); + +const pojo = { name: 'Fred', age: 29 }; + +function testGet() { + assertType(Ember.get(person, 'name')); + assertType(Ember.get(person, 'age')); + assertType(Ember.get(person, 'capitalized')); + assertType(person.get('name')); + assertType(person.get('age')); + assertType(person.get('capitalized')); + assertType(Ember.get(pojo, 'name')); +} + +function testGetProperties() { + assertType<{ name: string }>(Ember.getProperties(person, 'name')); + assertType<{ name: string, age: number }>(Ember.getProperties(person, 'name', 'age')); + assertType<{ name: string, age: number }>(Ember.getProperties(person, [ 'name', 'age' ])); + assertType<{ name: string, age: number, capitalized: string }>(Ember.getProperties(person, 'name', 'age', 'capitalized')); + assertType<{ name: string }>(person.getProperties('name')); + assertType<{ name: string, age: number }>(person.getProperties('name', 'age')); + assertType<{ name: string, age: number }>(person.getProperties([ 'name', 'age' ])); + assertType<{ name: string, age: number, capitalized: string }>(person.getProperties('name', 'age', 'capitalized')); + assertType<{ name: string, age: number }>(Ember.getProperties(pojo, 'name', 'age')); +} + +function testGetWithDefault() { + assertType(Ember.getWithDefault(person, 'name', 'Joe')); + assertType(Ember.getWithDefault(person, 'age', 20)); + assertType(Ember.getWithDefault(person, 'capitalized', 'JOE')); + assertType(person.getWithDefault('name', 'Joe')); + assertType(person.getWithDefault('age', 20)); + assertType(person.getWithDefault('capitalized', 'JOE')); + assertType(Ember.getWithDefault(pojo, 'name', 'JOE')); +} + +function testSet() { + assertType(Ember.set(person, 'name', 'Joe')); + assertType(Ember.set(person, 'age', 35)); + assertType(Ember.set(person, 'capitalized', 'JOE')); + assertType(person.set('name', 'Joe')); + assertType(person.set('age', 35)); + assertType(person.set('capitalized', 'JOE')); + assertType(Ember.set(pojo, 'name', 'Joe')); +} + +function testSetProperties() { + assertType<{ name: string }>(Ember.setProperties(person, { name: 'Joe' })); + assertType<{ name: string, age: number }>(Ember.setProperties(person, { name: 'Joe', age: 35 })); + assertType<{ name: string, capitalized: string }>(Ember.setProperties(person, { name: 'Joe', capitalized: 'JOE' })); + assertType<{ name: string }>(person.setProperties({ name: 'Joe' })); + assertType<{ name: string, age: number }>(person.setProperties({ name: 'Joe', age: 35 })); + assertType<{ name: string, capitalized: string }>(person.setProperties({ name: 'Joe', capitalized: 'JOE' })); + assertType<{ name: string, age: number }>(Ember.setProperties(pojo, { name: 'Joe', age: 35 })); +} diff --git a/types/ember/test/reopen.ts b/types/ember/test/reopen.ts new file mode 100755 index 0000000000..6c13ca4155 --- /dev/null +++ b/types/ember/test/reopen.ts @@ -0,0 +1,65 @@ +import Ember from 'ember'; +import { assertType } from "./lib/assert"; + +type Person = typeof Person.prototype; +const Person = Ember.Object.extend({ + name: '', + sayHello() { + alert(`Hello. My name is ${this.get('name')}`); + } +}); + +assertType(Person.reopen()); + +assertType(Person.create().name); +assertType(Person.create().sayHello()); + +const Person2 = Person.reopenClass({ + species: 'Homo sapiens', + + createPerson(name: string): Person { + return Person.create({ name }); + } +}); + +assertType(Person2.create().name); +assertType(Person2.create().sayHello()); +assertType(Person2.species); + +let tom = Person2.create({ + name: 'Tom Dale' +}); +let yehuda = Person2.createPerson('Yehuda Katz'); + +tom.sayHello(); // "Hello. My name is Tom Dale" +yehuda.sayHello(); // "Hello. My name is Yehuda Katz" +alert(Person2.species); // "Homo sapiens" + +const Person3 = Person2.reopen({ + goodbyeMessage: 'goodbye', + + sayGoodbye() { + alert(`${this.get('goodbyeMessage')}, ${this.get('name')}`); + } +}); + +const person3 = Person3.create(); +person3.get('name'); +person3.get('goodbyeMessage'); +person3.sayHello(); +person3.sayGoodbye(); + +interface AutoResizeMixin { resizable: true; } +declare const AutoResizeMixin: Ember.Mixin; + +const ResizableTextArea = Ember.TextArea.reopen(AutoResizeMixin, { + scaling: 1.0 +}); +const text = ResizableTextArea.create(); +assertType(text.resizable); +assertType(text.scaling); + +const Reopened = Ember.Object.reopenClass({ a: 1 }, { b: 2 }, { c: 3 }); +assertType(Reopened.a); +assertType(Reopened.b); +assertType(Reopened.c); diff --git a/types/ember/test/route.ts b/types/ember/test/route.ts new file mode 100755 index 0000000000..22193bd88d --- /dev/null +++ b/types/ember/test/route.ts @@ -0,0 +1,87 @@ +import Route from '@ember/routing/route'; +import Object from '@ember/object'; +import Array from '@ember/array'; +import Ember from 'ember'; // currently needed for Transition + +interface Post extends Ember.Object {} + +interface Posts extends Array {} + +Route.extend({ + beforeModel(transition: Ember.Transition) { + this.transitionTo('someOtherRoute'); + }, +}); + +Route.extend({ + afterModel(posts: Posts, transition: Ember.Transition) { + if (posts.length === 1) { + this.transitionTo('post.show', posts.firstObject); + } + }, +}); + +Route.extend({ + actions: { + showModal(evt: { modalName: string }) { + this.render(evt.modalName, { + outlet: 'modal', + into: 'application', + }); + }, + hideModal(evt: { modalName: string }) { + this.disconnectOutlet({ + outlet: 'modal', + parentView: 'application', + }); + }, + }, +}); + +Ember.Route.extend({ + model() { + return this.modelFor('post'); + }, +}); + +Route.extend({ + queryParams: { + memberQp: { refreshModel: true }, + }, +}); + +Route.extend({ + renderTemplate() { + this.render('photos', { + into: 'application', + outlet: 'anOutletName', + }); + }, +}); + +Route.extend({ + renderTemplate(controller: Ember.Controller, model: {}) { + this.render('posts', { + view: 'someView', // the template to render, referenced by name + into: 'application', // the template to render into, referenced by name + outlet: 'anOutletName', // the outlet inside `options.into` to render into. + controller: 'someControllerName', // the controller to use for this template, referenced by name + model, // the model to set on `options.controller`. + }); + }, +}); + +Route.extend({ + resetController(controller: Ember.Controller, isExiting: boolean, transition: boolean) { + if (isExiting) { + // controller.set('page', 1); + } + }, +}); + +Route.extend({ + setupController(controller: Ember.Controller, model: {}) { + this._super(controller, model); + this.controllerFor('application').set('model', model); + }, +}); diff --git a/types/ember/test/router.ts b/types/ember/test/router.ts new file mode 100755 index 0000000000..a4aa89af1a --- /dev/null +++ b/types/ember/test/router.ts @@ -0,0 +1,23 @@ +import Ember from 'ember'; + +const AppRouter = Ember.Router.extend({ +}); + +AppRouter.map(function() { + this.route('index', { path: '/' }); + this.route('about'); + this.route('favorites', { path: '/favs' }); + this.route('posts', function() { + this.route('index', { path: '/' }); + this.route('new'); + this.route('post', { path: '/post/:post_id', resetNamespace: true }); + this.route('comments', { resetNamespace: true }, function() { + this.route('new'); + }); + }); + this.route('photo', { path: '/photo/:id' }, function() { + this.route('comment', { path: '/comment/:id' }); + }); + this.route('not-found', { path: '/*path' }); + this.mount('my-engine'); +}); diff --git a/types/ember/test/run.ts b/types/ember/test/run.ts new file mode 100755 index 0000000000..8d1c82e6e3 --- /dev/null +++ b/types/ember/test/run.ts @@ -0,0 +1,204 @@ +import Ember from 'ember'; +import RSVP from 'rsvp'; +import { run } from '@ember/runloop'; +import { assertType } from "./lib/assert"; + +assertType(Ember.run.queues); + +function testRun() { + let r = run(function() { + // code to be executed within a RunLoop + return 123; + }); + assertType(r); + + function destroyApp(application: Ember.Application) { + Ember.run(application, 'destroy'); + run(application, function() { + this.destroy(); + }); + } +} + +function testBind() { + Ember.Component.extend({ + init() { + const bound = Ember.run.bind(this, this.setupEditor); + bound(); + }, + + editor: null as string | null, + + setupEditor(editor: string) { + this.set('editor', editor); + } + }); +} + +function testCancel() { + const myContext = {}; + + let runNext = run.next(myContext, function() { + // will not be executed + }); + + run.cancel(runNext); + + let runLater = run.later(myContext, function() { + // will not be executed + }, 500); + + run.cancel(runLater); + + let runScheduleOnce = run.scheduleOnce('afterRender', myContext, function() { + // will not be executed + }); + + run.cancel(runScheduleOnce); + + let runOnce = run.once(myContext, function() { + // will not be executed + }); + + run.cancel(runOnce); + + let throttle = run.throttle(myContext, function() { + // will not be executed + }, 1, false); + + run.cancel(throttle); + + let debounce = run.debounce(myContext, function() { + // will not be executed + }, 1); + + run.cancel(debounce); + + let debounceImmediate = run.debounce(myContext, function() { + // will be executed since we passed in true (immediate) + }, 100, true); + + // the 100ms delay until this method can be called again will be canceled + run.cancel(debounceImmediate); +} + +function testDebounce() { + function runIt() { + } + + let myContext = { name: 'debounce' }; + + run.debounce(runIt, 150); + run.debounce(myContext, runIt, 150); + run.debounce(myContext, runIt, 150, true); + + Ember.Component.extend({ + searchValue: 'test', + fetchResults(value: string) {}, + + actions: { + handleTyping() { + // the fetchResults function is passed into the component from its parent + Ember.run.debounce(this, this.get('fetchResults'), this.get('searchValue'), 250); + } + } + }); +} + +function testBegin() { + run.begin(); + // code to be executed within a RunLoop + run.end(); +} + +function testJoin() { + run.join(function() { + // creates a new run-loop + }); + + run(function() { + // creates a new run-loop + run.join(function() { + // joins with the existing run-loop, and queues for invocation on + // the existing run-loops action queue. + }); + }); + + new RSVP.Promise(function(resolve) { + Ember.run.later(function() { + resolve({ msg: 'Hold Your Horses' }); + }, 3000); + }); +} + +function testLater() { + const myContext = {}; + run.later(myContext, function() { + // code here will execute within a RunLoop in about 500ms with this == myContext + }, 500); +} + +function testNext() { + const myContext = {}; + run.next(myContext, function() { + // code to be executed in the next run loop, + // which will be scheduled after the current one + }); +} + +function testOnce() { + Ember.Component.extend({ + init() { + Ember.run.once(this, 'processFullName'); + }, + + processFullName() { + } + }); +} + +function testSchedule() { + Ember.Component.extend({ + init() { + run.schedule('sync', this, function() { + // this will be executed in the first RunLoop queue, when bindings are synced + console.log('scheduled on sync queue'); + }); + + run.schedule('actions', this, function() { + // this will be executed in the 'actions' queue, after bindings have synced. + console.log('scheduled on actions queue'); + }); + } + }); + + Ember.run.schedule('actions', () => { + // Do more things + }); +} + +function testScheduleOnce() { + function sayHi() { + console.log('hi'); + } + + const myContext = {}; + run(function() { + run.scheduleOnce('afterRender', myContext, sayHi); + run.scheduleOnce('afterRender', myContext, sayHi); + // sayHi will only be executed once, in the afterRender queue of the RunLoop + }); + run.scheduleOnce('actions', myContext, function() { + console.log('Closure'); + }); +} + +function testThrottle() { + function runIt() { + } + + let myContext = { name: 'throttle' }; + + run.throttle(runIt, 150); + run.throttle(myContext, runIt, 150); +} diff --git a/types/ember/test/test.ts b/types/ember/test/test.ts new file mode 100755 index 0000000000..6cd1b2b908 --- /dev/null +++ b/types/ember/test/test.ts @@ -0,0 +1,32 @@ +import Ember from 'ember'; + +let pending = 0; +Ember.Test.registerWaiter(() => pending !== 0); + +declare const MyDb: { + hasPendingTransactions(): boolean; +}; +Ember.Test.registerWaiter(MyDb, MyDb.hasPendingTransactions); + +Ember.Test.promise(function(resolve) { + window.setTimeout(resolve, 500); +}); + +Ember.Test.registerHelper('boot', function(app) { + Ember.run(app, app.advanceReadiness); +}); + +Ember.Test.registerAsyncHelper('boot', function(app) { + Ember.run(app, app.advanceReadiness); +}); + +Ember.Test.registerAsyncHelper('waitForPromise', (app, promise) => { + return new Ember.Test.Promise((resolve) => { + Ember.Test.adapter.asyncStart(); + + promise.then(() => { + Ember.run.schedule('afterRender', null, resolve); + Ember.Test.adapter.asyncEnd(); + }); + }); +}); diff --git a/types/ember/test/transition.ts b/types/ember/test/transition.ts new file mode 100755 index 0000000000..3a64675c24 --- /dev/null +++ b/types/ember/test/transition.ts @@ -0,0 +1,28 @@ +import Ember from 'ember'; + +Ember.Route.extend({ + beforeModel(transition: Ember.Transition) { + if (new Date() > new Date('January 1, 1980')) { + alert('Sorry, you need a time machine to enter this route.'); + transition.abort(); + } + } +}); + +Ember.Controller.extend({ + previousTransition: null, + + actions: { + login() { + // Log the user in, then reattempt previous transition if it exists. + let previousTransition = this.get('previousTransition'); + if (previousTransition) { + this.set('previousTransition', null); + previousTransition.retry(); + } else { + // Default back to homepage + this.transitionToRoute('index'); + } + } + } +}); diff --git a/types/ember/test/utils.ts b/types/ember/test/utils.ts new file mode 100755 index 0000000000..d729d472b8 --- /dev/null +++ b/types/ember/test/utils.ts @@ -0,0 +1,71 @@ +import Ember from 'ember'; +import * as utils from '@ember/utils'; +import { assertType } from "./lib/assert"; + +function testIsNoneType() { + const maybeUndefined: string | undefined = 'not actually undefined'; + if (utils.isNone(maybeUndefined)) { + return; + } + + const anotherString = maybeUndefined + 'another string'; +} + +function testMerge() { + assertType<{ first: string, last: string }>( + Ember.merge({ first: 'Tom' }, { last: 'Dale' }) + ); +} + +function testAssign() { + assertType<{ first: string, middle: string, last: string }>( + Ember.assign({ first: 'Tom' }, { middle: 'M' }, { last: 'Dale' }) + ); +} + +function testOnError() { + Ember.onerror = function(error) { + Ember.$.post('/report-error', { + stack: error.stack, + otherInformation: 'whatever app state you want to provide' + }); + }; +} + +function testMakeArray() { + assertType(Ember.makeArray()); + assertType(Ember.makeArray(null)); + assertType(Ember.makeArray(undefined)); + assertType(Ember.makeArray('lindsay')); + assertType(Ember.makeArray([1, 2, 42])); +} + +function testDeprecateFunc() { + function newMethod(first: string, second: number): string { + return ''; + } + + let oldMethod = Ember.deprecateFunc('Please use the new method', { id: 'deprecated.id', until: '6.0' }, newMethod); + assertType(newMethod('first', 123)); + assertType(oldMethod('first', 123)); +} + +function testDefineProperty() { + const contact = {}; + + // ES5 compatible mode + Ember.defineProperty(contact, 'firstName', { + writable: true, + configurable: false, + enumerable: true, + value: 'Charles' + }); + + // define a simple property + Ember.defineProperty(contact, 'lastName', undefined, 'Jolley'); + + // define a computed property + Ember.defineProperty(contact, 'fullName', Ember.computed('firstName', 'lastName', function() { + return `${this.firstName} ${this.lastName}`; + })); +} diff --git a/types/ember/tsconfig.json b/types/ember/tsconfig.json old mode 100644 new mode 100755 index 194304e853..c0aab2e780 --- a/types/ember/tsconfig.json +++ b/types/ember/tsconfig.json @@ -1,24 +1,49 @@ { "compilerOptions": { "module": "commonjs", + "target": "es5", "lib": [ "es6", "dom" ], "noImplicitAny": true, - "noImplicitThis": false, + "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": true, + "strictFunctionTypes": false, "baseUrl": "../", - "typeRoots": [ - "../" - ], + "typeRoots": ["../"], "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, "files": [ "index.d.ts", - "ember-tests.ts" + "test/lib/assert.ts", + "test/application.ts", + "test/ember-tests.ts", + "test/event.ts", + "test/extend.ts", + "test/create.ts", + "test/object.ts", + "test/observable.ts", + "test/mixin.ts", + "test/reopen.ts", + "test/detect.ts", + "test/detect-instance.ts", + "test/array.ts", + "test/array-ext.ts", + "test/array-proxy.ts", + "test/helper.ts", + "test/computed.ts", + "test/component.ts", + "test/function-ext.ts", + "test/inject.ts", + "test/utils.ts", + "test/transition.ts", + "test/router.ts", + "test/run.ts", + "test/test.ts", + "test/controller.ts", + "test/route.ts" ] -} \ No newline at end of file +} diff --git a/types/ember/tslint.json b/types/ember/tslint.json old mode 100644 new mode 100755 index 309f39a5d1..35e8f3768a --- a/types/ember/tslint.json +++ b/types/ember/tslint.json @@ -4,11 +4,26 @@ // Heavy use of Function type in this older package. "ban-types": false, "jsdoc-format": false, - "no-any-union": false, "no-misused-new": false, - // not sure what this means + + // these are disabled because of rfc176 module exports + "strict-export-declare-modifiers": false, "no-single-declare-module": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false + "no-declare-current-package": false, + "no-self-import": false, + + // We use interfaces in a number of places to express things (including + // mixins in particular, but also including extending a global + // interface) which TS currently can't express correctly. + "no-empty-interface": false, + + "no-duplicate-imports": false, + "no-unnecessary-qualifier": false, + "prefer-const": false, + "no-void-expression": false, + "only-arrow-functions": false, + "no-submodule-imports": false, + + "no-unnecessary-class": false } } diff --git a/types/ember/v1/tslint.json b/types/ember/v1/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/ember/v1/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/emissary/tslint.json b/types/emissary/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/emissary/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/emoji-mart/dist-es/components/category.d.ts b/types/emoji-mart/dist-es/components/category.d.ts new file mode 100644 index 0000000000..8cd4ceefbb --- /dev/null +++ b/types/emoji-mart/dist-es/components/category.d.ts @@ -0,0 +1,20 @@ +import React = require('react'); + +import { EmojiData } from '..'; + +import { Emoji, EmojiProps, I18n } from '.'; + +export interface Props { + emojis?: Array; + hasStickyPosition?: boolean; + name: string; + native: boolean; + perLine: number; + emojiProps: EmojiProps; + recent?: string[]; + i18n: I18n; +} + +export default class Category extends React.Component { + // all methods and properties inside this are most likely intended to be private +} diff --git a/types/emoji-mart/dist-es/components/emoji.d.ts b/types/emoji-mart/dist-es/components/emoji.d.ts new file mode 100644 index 0000000000..030ff7ce12 --- /dev/null +++ b/types/emoji-mart/dist-es/components/emoji.d.ts @@ -0,0 +1,31 @@ +import React = require('react'); + +import { EmojiData, EmojiSkin } from '..'; + +export type BackgroundImageFn = (set: EmojiSet, sheetSize: EmojiSheetSize) => string; +export type EmojiSet = 'apple'|'google'|'twitter'|'emojione'|'messenger'|'facebook'; +export type EmojiSheetSize = 16|20|32|64; + +export interface Props { + onOver?(emoji: EmojiData, e: React.MouseEvent): void; + onLeave?(emoji: EmojiData, e: React.MouseEvent): void; + onClick?(emoji: EmojiData, e: React.MouseEvent): void; + /** defaults to returning a png from unpkg.com-hosted emoji-datasource-${set} */ + backgroundImageFn?: BackgroundImageFn; + native?: boolean; + forceSize?: boolean; + tooltip?: boolean; + /** defaults to 1 */ + skin?: EmojiSkin; + /** defaults to 64 */ + sheetSize?: EmojiSheetSize; + /** defaults to 'apple' */ + set?: EmojiSet; + size: number; + emoji: string|EmojiData; +} + +// tslint:disable-next-line strict-export-declare-modifiers +declare const Emoji: React.SFC; + +export { Emoji as default }; diff --git a/types/emoji-mart/dist-es/components/index.d.ts b/types/emoji-mart/dist-es/components/index.d.ts new file mode 100644 index 0000000000..6fc29ecd54 --- /dev/null +++ b/types/emoji-mart/dist-es/components/index.d.ts @@ -0,0 +1,4 @@ +// The other exports on the components folder are not public API +export { default as Category, Props as CategoryProps } from './category'; +export { default as Emoji, Props as EmojiProps, BackgroundImageFn, EmojiSet, EmojiSheetSize } from './emoji'; +export { default as Picker, Props as PickerProps, I18n, PartialI18n, CustomEmoji } from './picker'; diff --git a/types/emoji-mart/dist-es/components/picker.d.ts b/types/emoji-mart/dist-es/components/picker.d.ts new file mode 100644 index 0000000000..9f9132df05 --- /dev/null +++ b/types/emoji-mart/dist-es/components/picker.d.ts @@ -0,0 +1,54 @@ +import React = require('react'); + +import { EmojiData, EmojiSkin } from '..'; + +import { Category, Emoji, EmojiProps, BackgroundImageFn, EmojiSet, EmojiSheetSize } from '.'; + +// tslint:disable-next-line interface-name +export interface I18n { + search: string; + categories: Record<'search'|'recent'|'people'|'nature'|'foods'|'activity'|'places'|'objects'|'symbols'|'flags'|'custom', string>; + notfound: string; +} + +export type PartialI18n = Partial & { categories: Partial}>; + +export interface CustomEmoji { + // id is overridden by short_names[0] + name: string; + /** Must contain at least one name. The first name is used as the unique id. */ + short_names: string[]; + emoticons?: string[]; + keywords?: string[]; + imageUrl: string; +} + +export interface Props { + /** NOTE: default is not preventable */ + onClick?(emoji: EmojiData, e: React.MouseEvent): void; + perLine?: number; + emojiSize?: number; + i18n?: PartialI18n; + style?: React.CSSProperties; + title?: string; + emoji?: string; + color?: string; + set?: EmojiSet; + skin?: EmojiSkin; + native?: boolean; + backgroundImageFn?: BackgroundImageFn; + sheetSize?: EmojiSheetSize; + emojisToShowFilter?(emoji: EmojiData): boolean; + showPreview?: boolean; + emojiTooltip?: boolean; + include?: string[]; + exclude?: string[]; + recent?: string[]; + autoFocus?: boolean; + /** NOTE: custom emoji are copied into a singleton object on every new mount */ + custom: CustomEmoji[]; +} + +export default class Picker extends React.PureComponent { + // everything inside it is supposed to be private +} diff --git a/types/emoji-mart/dist-es/index.d.ts b/types/emoji-mart/dist-es/index.d.ts new file mode 100644 index 0000000000..e49d37fcf6 --- /dev/null +++ b/types/emoji-mart/dist-es/index.d.ts @@ -0,0 +1,15 @@ +export { default as emojiIndex, EmojiData, EmojiSkin } from './utils/emoji-index'; +export { default as store, StoreHandlers } from './utils/store'; +export { default as frequently } from './utils/frequently'; + +export { + Picker, + PickerProps, + I18n, + PartialI18n, + CustomEmoji, + Emoji, + EmojiProps, + Category, + CategoryProps +} from './components'; diff --git a/types/emoji-mart/dist-es/utils/emoji-index.d.ts b/types/emoji-mart/dist-es/utils/emoji-index.d.ts new file mode 100644 index 0000000000..c6499e663c --- /dev/null +++ b/types/emoji-mart/dist-es/utils/emoji-index.d.ts @@ -0,0 +1,25 @@ +export type EmojiSkin = 1|2|3|4|5|6; + +export interface EmojiData { + id: string; + name: string; + colons: string; + /** Reverse mapping to keyof emoticons */ + emoticons: string[]; + unified: string; + skin: EmojiSkin|null; + native: string; +} + +// tslint:disable-next-line strict-export-declare-modifiers +declare const _default: { + search(query: ''): null + search(query: string): EmojiData|null + + emojis: { [emoji: string]: EmojiData } + + /** Mapping of string to keyof emojis */ + emoticons: { [emoticon: string]: string } +}; + +export { _default as default }; diff --git a/types/emoji-mart/dist-es/utils/frequently.d.ts b/types/emoji-mart/dist-es/utils/frequently.d.ts new file mode 100644 index 0000000000..d2f318de5f --- /dev/null +++ b/types/emoji-mart/dist-es/utils/frequently.d.ts @@ -0,0 +1,9 @@ +import { EmojiData } from '..'; + +// tslint:disable-next-line strict-export-declare-modifiers +declare const _default: { + add(emoji: Pick): void + get(perLine: number): string[] +}; + +export { _default as default }; diff --git a/types/emoji-mart/dist-es/utils/store.d.ts b/types/emoji-mart/dist-es/utils/store.d.ts new file mode 100644 index 0000000000..009284bd7b --- /dev/null +++ b/types/emoji-mart/dist-es/utils/store.d.ts @@ -0,0 +1,15 @@ +export interface StoreHandlers { + getter?(key: string): any; + setter?(key: string, value: any): void; +} + +// tslint:disable-next-line strict-export-declare-modifiers +declare const _default: { + setHandlers(handlers?: StoreHandlers): void + setNamespace(namespace: string): void + update(state: {[key: string]: any}): void + set(key: string, value: any): void + get(key: string): any +}; + +export { _default as default }; diff --git a/types/emoji-mart/emoji-mart-tests.tsx b/types/emoji-mart/emoji-mart-tests.tsx new file mode 100644 index 0000000000..7b7b8d0471 --- /dev/null +++ b/types/emoji-mart/emoji-mart-tests.tsx @@ -0,0 +1,93 @@ +// Port of https://github.com/missive/emoji-mart/blob/master/src/components/emoji.js + +import React = require('react'); + +import { Picker, Emoji, EmojiProps, CustomEmoji } from 'emoji-mart'; + +declare var console: { log(...args: any[]): void; }; + +const CUSTOM_EMOJIS: CustomEmoji[] = [ + { + name: 'Party Parrot', + short_names: ['parrot'], + keywords: ['party'], + imageUrl: 'http://cultofthepartyparrot.com/parrots/hd/parrot.gif' + }, + { + name: 'Octocat', + short_names: ['octocat'], + keywords: ['github'], + imageUrl: 'https://assets-cdn.github.com/images/icons/emoji/octocat.png?v7' + }, + { + name: 'Squirrel', + short_names: ['shipit', 'squirrel'], + keywords: ['github'], + imageUrl: 'https://assets-cdn.github.com/images/icons/emoji/shipit.png?v7' + }, +]; + +interface State { + native: boolean; + set: EmojiProps['set']|'native'; + emoji: string; + title: string; + custom: CustomEmoji[]; +} + +class Example extends React.Component<{}, State> { + readonly state: Readonly = { + native: true, + set: 'apple', + emoji: 'point_up', + title: 'Pick your emoji…', + custom: CUSTOM_EMOJIS + }; + render() { + return ( +
    +
    +

    Emoji Mart 🏬

    +
    + +
    + {(['native', 'apple', 'google', 'twitter', 'emojione', 'messenger', 'facebook'] as Array).map((set) => { + const props = { disabled: !this.state.native && set === this.state.set }; + + if (set === 'native' && this.state.native) { + props.disabled = true; + } + + return ( + + ); + })} +
    + +
    + +
    +
    + ); + } +} diff --git a/types/emoji-mart/index.d.ts b/types/emoji-mart/index.d.ts new file mode 100644 index 0000000000..1116d6eb6f --- /dev/null +++ b/types/emoji-mart/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for emoji-mart 2.2 +// Project: https://github.com/missive/emoji-mart +// Definitions by: Diogo Franco +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +// These definitions should work with 2.3, but the tests doesn't pass on 2.3. + +export * from './dist-es'; diff --git a/types/emoji-mart/tsconfig.json b/types/emoji-mart/tsconfig.json new file mode 100644 index 0000000000..fb776e9a21 --- /dev/null +++ b/types/emoji-mart/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "dist-es/components/category.d.ts", + "dist-es/components/emoji.d.ts", + "dist-es/components/index.d.ts", + "dist-es/components/picker.d.ts", + "dist-es/utils/emoji-index.d.ts", + "dist-es/utils/frequently.d.ts", + "dist-es/utils/store.d.ts", + "dist-es/index.d.ts", + "emoji-mart-tests.tsx" + ] +} diff --git a/types/emoji-mart/tslint.json b/types/emoji-mart/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/emoji-mart/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/empower/tslint.json b/types/empower/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/empower/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/emscripten/emscripten-tests.ts b/types/emscripten/emscripten-tests.ts index 153ea6b5de..627efba590 100644 --- a/types/emscripten/emscripten-tests.ts +++ b/types/emscripten/emscripten-tests.ts @@ -18,6 +18,7 @@ function ModuleTest(): void { Module.print = function(text) { alert('stdout: ' + text) }; var int_sqrt = Module.cwrap('int_sqrt', 'number', ['number']) + int_sqrt = Module.cwrap('int_sqrt', null, ['number']) int_sqrt(12) int_sqrt(28) @@ -27,6 +28,7 @@ function ModuleTest(): void { var x = Module.getValue(buf, 'i32') + 123; Module.HEAPU8.set(myTypedArray, buf); Module.ccall('my_function', 'number', ['number'], [buf]); + Module.ccall('my_function', null, ['number'], [buf]); Module._free(buf); Module.destroy({}); } diff --git a/types/emscripten/index.d.ts b/types/emscripten/index.d.ts index 14260dd9d4..4db8ac4925 100644 --- a/types/emscripten/index.d.ts +++ b/types/emscripten/index.d.ts @@ -40,8 +40,8 @@ declare namespace Module { var Runtime: any; - function ccall(ident: string, returnType: string, argTypes: string[], args: any[]): any; - function cwrap(ident: string, returnType: string, argTypes: string[]): any; + function ccall(ident: string, returnType: string | null, argTypes: string[], args: any[]): any; + function cwrap(ident: string, returnType: string | null, argTypes: string[]): any; function setValue(ptr: number, value: any, type: string, noSafe?: boolean): void; function getValue(ptr: number, type: string, noSafe?: boolean): number; diff --git a/types/emscripten/tslint.json b/types/emscripten/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/emscripten/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/encoding-japanese/tslint.json b/types/encoding-japanese/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/encoding-japanese/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/engine.io-client/index.d.ts b/types/engine.io-client/index.d.ts index 2f1d69a1d6..0abb98eb79 100644 --- a/types/engine.io-client/index.d.ts +++ b/types/engine.io-client/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/socketio/engine.io-client // Definitions by: KentarouTakeda // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// diff --git a/types/enhanced-resolve/tslint.json b/types/enhanced-resolve/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/enhanced-resolve/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/enigma.js/enigma.js-tests.ts b/types/enigma.js/enigma.js-tests.ts new file mode 100644 index 0000000000..10f6aae226 --- /dev/null +++ b/types/enigma.js/enigma.js-tests.ts @@ -0,0 +1,10 @@ +import * as enigma from "enigma.js"; +// import enigma = require("enigma.js"); + +const config: enigmaJS.IConfig = { + url: "http://127.0.0.1:4848/", + schema: {} + }; +enigma.create(config).open().then((global) => { + console.log("connect fine"); +}); diff --git a/types/enigma.js/index.d.ts b/types/enigma.js/index.d.ts new file mode 100644 index 0000000000..38fc18da16 --- /dev/null +++ b/types/enigma.js/index.d.ts @@ -0,0 +1,194 @@ +// Type definitions for enigma.js 2.2 +// Project: https://github.com/qlik-oss/enigma.js/ +// Definitions by: Konrad Mattheis +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +declare module "enigma.js" { + const e: IEnigmaClass; + export = e; +} + +// declare const enigmaJS: IEnigmaClass; +// export = enigmaJS; +// export as namespace enigmaJS; + +interface IEnigmaClass { + /** + * Create a session object. + * @returns - Returns a session. + * Note: See Configuration for the configuration options. + */ + create(config: enigmaJS.IConfig): enigmaJS.ISession; +} + +declare namespace enigmaJS { + type MixinType = "Doc"| "GenericObject"| "GenericBookmark" | string; + + interface IMixin { + /** + * QIX Engine types like for example GenericObject, Doc, GenericBookmark, are supported but also custom GenericObject + * types such as barchart, story and myCustomType. + * An API will get both their generic type as well as custom type mixins applied. + */ + types: MixinType[]; + + init(args: {config: any, api: IGeneratedAPI}): void; + + /** + * mixin.extend is an object containing methods to extend the generated API with. These method names cannot already exist or enigma.js will throw an error. + */ + extend?: [any]; + + /** + * mixin.override is an object containing methods that overrides existing API methods. + * These method names needs to exist already* or engima.js will throw an error. + * Be careful when overriding, you may break expected behaviors in other mixins or your application. + * base is a reference to the previous mixin method, can be used to invoke the mixin chain before this mixin method. + */ + override?: [any]; + } + + interface IProtocol { + // Set to false to disable the use of the bandwidth-reducing delta protocol. + delta?: boolean; + } + + /** + * This section describes the configuration object that is sent into enigma.create(config). + */ + interface IConfig { + /** + * Object containing the specification for the API to generate. Corresponds to a specific version of the QIX Engine API. + */ + schema: object; + /** + * String containing a proper websocket URL to QIX Engine. + */ + url: string; + /** + * A function to use when instantiating the WebSocket, mandatory for Node.js. + */ + createSocket?: any; + /** + * ES6-compatible Promise library. + */ + Promise?: any; + /** + * Set to true if the session should be suspended instead of closed when the websocket is closed. + */ + suspendOnClose?: boolean; + /** + * Mixins to extend/augment the QIX Engine API. + * See Mixins section for more information how each entry in this array should look like. + * Mixins are applied in the array order. + */ + mixins?: [any]; + /** + * Interceptors for augmenting responses before they are passed into mixins and end-users. + * See Interceptors section for more information how each entry in this array should look like. + * Interceptors are applied in the array order. + */ + interceptors?: [any]; + /** + * An object containing additional JSON-RPC request parameters. + * protocol.delta : Set to false to disable the use of the bandwidth-reducing delta protocol. + */ + protocol?: any; + } + + interface ISession { + /** + * Establishes the websocket against the configured URL. Eventually resolved with the QIX global interface when the connection has been established. + * @return Promise. + */ + open(): Promise; + + /** + * Closes the websocket and cleans up internal caches, also triggers the closed event on all generated APIs. + * Eventually resolved when the websocket has been closed. + * + * Note: you need to manually invoke this when you want to close a session and config.suspendOnClose is true. + * @return Promise. + */ + close(): Promise; + + /** + * Suspends the enigma.js session by closing the websocket and rejecting all method calls until it has been resumed again. + * @return Promise. + */ + suspend(): Promise; + + /** + * Resume a previously suspended enigma.js session by re-creating the websocket and, if possible, re-open the document + * as well as refreshing the internal caches. If successful, changed events will be triggered on all generated APIs, + * and on the ones it was unable to restore, the closed event will be triggered. + * @param onlyIfAttached onlyIfAttached can be used to only allow resuming if the QIX Engine session was reattached properly. + * @return Promise. + * Note: Eventually resolved when the websocket (and potentially the previously opened document, and generated APIs) has been restored, + * rejected when it fails any of those steps, or when onlyIfAttached is true and a new QIX Engine session was created. + */ + resume(onlyIfAttached?: boolean): Promise; + + /** + * Handle opened state. This event is triggered whenever the websocket is connected and ready for communication. + * + * Handle closed state. This event is triggered when the underlying websocket is closed and config.suspendOnClose is false. + * + * Handle suspended state. This event is triggered in two cases (listed below). It is useful in scenarios where you for example + * want to block interaction in your application until you are resumed again. + * If config.suspendOnClose is true and there was a network disconnect (socked closed) + * If you ran session.suspend() + * The evt.initiator value is a string indicating what triggered the suspended state. Possible values: network, manual. + * + * Handle resumed state. This event is triggered when the session was properly resumed. + * It is useful in scenarios where you for example can close blocking modal dialogs and allow the user to interact with your application again. + * + * notification:* + * @param event - Event that triggers the function + * @param func - Called function + */ + on(event: "opened" | "close" | "suspended" | "resumed" | string, func: any): void; + } + + interface IGeneratedAPI { + /** + * This property contains the unique identifier for this API. + */ + id: string; + + /** + * This property contains the schema class name for this API. + */ + type: string; + + /** + * Despite the name, this property corresponds to the qInfo.qType property on your generic object's properties object. + */ + genericType: string; + + /** + * This property contains a reference to the session that this API belongs to. + */ + session: ISession; + + /** + * This property contains the handle QIX Engine assigned to the API. + * Used internally in enigma.js for caches and JSON-RPC + */ + handle: number; + + /** + * register a function for events + * @param event - function called if this event occures + * @param func - function that is called + */ + on(event: "changed" | "closed", func: () => void): void; + + /** + * manual emit an events + * @param event - event that occures + */ + emit(event: "changed" | "closed"): void; + } +} diff --git a/types/flatpickr/tsconfig.json b/types/enigma.js/tsconfig.json similarity index 94% rename from types/flatpickr/tsconfig.json rename to types/enigma.js/tsconfig.json index 7980eb3627..b3b93456f0 100644 --- a/types/flatpickr/tsconfig.json +++ b/types/enigma.js/tsconfig.json @@ -19,6 +19,6 @@ }, "files": [ "index.d.ts", - "flatpickr-tests.ts" + "enigma.js-tests.ts" ] } \ No newline at end of file diff --git a/types/enigma.js/tslint.json b/types/enigma.js/tslint.json new file mode 100644 index 0000000000..84cbb5f289 --- /dev/null +++ b/types/enigma.js/tslint.json @@ -0,0 +1,13 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // TODOs + "ban-types": false, + "no-empty-interface": false, + "no-mergeable-namespace": false, + "no-unnecessary-generics": false, + "no-single-declare-module": false, + "no-declare-current-package": false, + "interface-name": false + } +} diff --git a/types/ent/tslint.json b/types/ent/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/ent/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/envify/tslint.json b/types/envify/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/envify/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/enzyme-adapter-react-15/enzyme-adapter-react-15-tests.ts b/types/enzyme-adapter-react-15/enzyme-adapter-react-15-tests.ts new file mode 100644 index 0000000000..9be474c2d8 --- /dev/null +++ b/types/enzyme-adapter-react-15/enzyme-adapter-react-15-tests.ts @@ -0,0 +1,4 @@ +import { configure } from 'enzyme'; +import * as Adapter from 'enzyme-adapter-react-15'; + +configure({ adapter: new Adapter() }); diff --git a/types/enzyme-adapter-react-15/index.d.ts b/types/enzyme-adapter-react-15/index.d.ts new file mode 100644 index 0000000000..01307da953 --- /dev/null +++ b/types/enzyme-adapter-react-15/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for enzyme-adapter-react-15 1.0 +// Project: https://github.com/airbnb/enzyme +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { EnzymeAdapter } from 'enzyme'; + +declare class ReactFifteenAdapter extends EnzymeAdapter { +} + +declare namespace ReactFifteenAdapter { +} + +export = ReactFifteenAdapter; diff --git a/types/enzyme-adapter-react-15/tsconfig.json b/types/enzyme-adapter-react-15/tsconfig.json new file mode 100644 index 0000000000..23f0d0d292 --- /dev/null +++ b/types/enzyme-adapter-react-15/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "module": "commonjs", + "lib": ["es6", "dom"], + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true + }, + "files": [ + "index.d.ts", + "enzyme-adapter-react-15-tests.ts" + ] +} diff --git a/types/enzyme-adapter-react-15/tslint.json b/types/enzyme-adapter-react-15/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/enzyme-adapter-react-15/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/enzyme-adapter-react-16/enzyme-adapter-react-16-tests.ts b/types/enzyme-adapter-react-16/enzyme-adapter-react-16-tests.ts new file mode 100644 index 0000000000..b8acf7f719 --- /dev/null +++ b/types/enzyme-adapter-react-16/enzyme-adapter-react-16-tests.ts @@ -0,0 +1,4 @@ +import { configure } from 'enzyme'; +import * as Adapter from 'enzyme-adapter-react-16'; + +configure({ adapter: new Adapter() }); diff --git a/types/enzyme-adapter-react-16/index.d.ts b/types/enzyme-adapter-react-16/index.d.ts new file mode 100644 index 0000000000..82927b03e5 --- /dev/null +++ b/types/enzyme-adapter-react-16/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for enzyme-adapter-react-16 1.0 +// Project: https://github.com/airbnb/enzyme +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { EnzymeAdapter } from 'enzyme'; + +declare class ReactSixteenAdapter extends EnzymeAdapter { +} + +declare namespace ReactSixteenAdapter { +} + +export = ReactSixteenAdapter; diff --git a/types/enzyme-adapter-react-16/tsconfig.json b/types/enzyme-adapter-react-16/tsconfig.json new file mode 100644 index 0000000000..1c1c8e15f9 --- /dev/null +++ b/types/enzyme-adapter-react-16/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "module": "commonjs", + "lib": ["es6", "dom"], + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true + }, + "files": [ + "index.d.ts", + "enzyme-adapter-react-16-tests.ts" + ] +} diff --git a/types/enzyme-adapter-react-16/tslint.json b/types/enzyme-adapter-react-16/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/enzyme-adapter-react-16/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/enzyme/enzyme-tests.tsx b/types/enzyme/enzyme-tests.tsx index 63e716c50b..c48c050357 100644 --- a/types/enzyme/enzyme-tests.tsx +++ b/types/enzyme/enzyme-tests.tsx @@ -1,5 +1,14 @@ import * as React from "react"; -import { shallow, mount, render, ShallowWrapper, ReactWrapper } from "enzyme"; +import { + shallow, + mount, + render, + ShallowWrapper, + ReactWrapper, + configure, + EnzymeAdapter, + ShallowRendererProps, +} from "enzyme"; import { Component, ReactElement, HTMLAttributes, ComponentClass, StatelessComponent } from "react"; // Help classes/interfaces @@ -24,6 +33,18 @@ class MyComponent extends Component { const MyStatelessComponent = (props: StatelessProps) => ; +// Enzyme.configure +function configureTest() { + const configureAdapter: { adapter: EnzymeAdapter } = { adapter: {} }; + configure(configureAdapter); + + const configureAdapterAndDisableLifecycle: typeof configureAdapter & Pick = { + adapter: {}, + disableLifecycleMethods: true, + }; + configure(configureAdapterAndDisableLifecycle); +} + // ShallowWrapper function ShallowWrapperTest() { let shallowWrapper: ShallowWrapper = @@ -50,7 +71,8 @@ function ShallowWrapperTest() { context: { test: "a", }, - lifecycleExperimental: true + lifecycleExperimental: true, + disableLifecycleMethods: true }); } diff --git a/types/enzyme/index.d.ts b/types/enzyme/index.d.ts index 0659bed99f..3a8ea149f9 100644 --- a/types/enzyme/index.d.ts +++ b/types/enzyme/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Enzyme 2.8 +// Type definitions for Enzyme 3.1 // Project: https://github.com/airbnb/enzyme // Definitions by: Marian Palkus // Cap3 @@ -48,33 +48,28 @@ export type Intercepter = (intercepter: T) => void; export interface CommonWrapper

    { /** * Returns a new wrapper with only the nodes of the current wrapper that, when passed into the provided predicate function, return true. - * @param predicate */ filterWhere(predicate: (wrapper: this) => boolean): this; /** * Returns whether or not the current wrapper has a node anywhere in it's render tree that looks like the one passed in. - * @param node */ - contains(node: ReactElement | string): boolean; + contains(node: ReactElement | Array> | string): boolean; /** * Returns whether or not a given react element exists in the shallow render tree. - * @param node */ - containsMatchingElement(node: ReactElement): boolean; + containsMatchingElement(node: ReactElement | Array>): boolean; /** * Returns whether or not all the given react elements exists in the shallow render tree - * @param nodes */ - containsAllMatchingElements(nodes: Array>): boolean; + containsAllMatchingElements(nodes: Array> | Array>>): boolean; /** * Returns whether or not one of the given react elements exists in the shallow render tree. - * @param nodes */ - containsAnyMatchingElements(nodes: Array>): boolean; + containsAnyMatchingElements(nodes: Array> | Array>>): boolean; /** * Returns whether or not the current render tree is equal to the given node, based on the expected value. @@ -88,13 +83,11 @@ export interface CommonWrapper

    { /** * Returns whether or not the current node has a className prop including the passed in class name. - * @param className */ hasClass(className: string): boolean; /** * Returns whether or not the current node matches a provided selector. - * @param selector */ is(selector: EnzymeSelector): boolean; @@ -112,7 +105,6 @@ export interface CommonWrapper

    { /** * Returns a new wrapper with only the nodes of the current wrapper that don't match the provided selector. * This method is effectively the negation or inverse of filter. - * @param selector */ not(selector: EnzymeSelector): this; @@ -134,7 +126,6 @@ export interface CommonWrapper

    { /** * Returns the node at a given index of the current wrapper. - * @param index */ get(index: number): ReactElement; @@ -165,7 +156,6 @@ export interface CommonWrapper

    { /** * Returns a wrapper around the node at a given index of the current wrapper. - * @param index */ at(index: number): this; @@ -191,7 +181,6 @@ export interface CommonWrapper

    { /** * Returns the state hash for the root node of the wrapper. Optionally pass in a prop name and it will return just that value. - * @param [key] */ state(): S; state(key: K): S[K]; @@ -214,7 +203,6 @@ export interface CommonWrapper

    { * Returns the prop value for the node of the current wrapper with the provided key. * * NOTE: can only be called on a wrapper of a single node. - * @param key */ prop(key: K): P[K]; prop(key: string): T; @@ -228,7 +216,6 @@ export interface CommonWrapper

    { /** * Simulate events. * Returns itself. - * @param event * @param args? */ simulate(event: string, ...args: any[]): this; @@ -242,8 +229,6 @@ export interface CommonWrapper

    { * Returns itself. * * NOTE: can only be called on a wrapper instance that is also the root instance. - * @param state - * @param [callback] */ setState(state: Pick, callback?: () => void): this; @@ -256,7 +241,6 @@ export interface CommonWrapper

    { * Returns itself. * * NOTE: can only be called on a wrapper instance that is also the root instance. - * @param props */ setProps(props: Pick): this; @@ -266,7 +250,6 @@ export interface CommonWrapper

    { * Returns itself. * * NOTE: can only be called on a wrapper instance that is also the root instance. - * @param state */ setContext(context: any): this; @@ -320,40 +303,32 @@ export interface CommonWrapper

    { /** * Applies the provided reducing function to every node in the wrapper to reduce to a single value. Each node * is passed in as a ShallowWrapper, and is processed from left to right. - * @param fn - * @param initialValue */ reduce(fn: (prevVal: R, wrapper: this, index: number) => R, initialValue?: R): R; /** * Applies the provided reducing function to every node in the wrapper to reduce to a single value. * Each node is passed in as a ShallowWrapper, and is processed from right to left. - * @param fn - * @param initialValue */ reduceRight(fn: (prevVal: R, wrapper: this, index: number) => R, initialValue?: R): R; /** * Returns whether or not any of the nodes in the wrapper match the provided selector. - * @param selector */ some(selector: EnzymeSelector): boolean; /** * Returns whether or not any of the nodes in the wrapper pass the provided predicate function. - * @param fn */ someWhere(fn: (wrapper: this) => boolean): boolean; /** * Returns whether or not all of the nodes in the wrapper match the provided selector. - * @param selector */ every(selector: EnzymeSelector): boolean; /** * Returns whether or not all of the nodes in the wrapper pass the provided predicate function. - * @param fn */ everyWhere(fn: (wrapper: this) => boolean): boolean; @@ -378,11 +353,10 @@ export interface CommonWrapper

    { length: number; } -export class ShallowWrapper { +// tslint:disable-next-line no-empty-interface +export interface ShallowWrapper

    extends CommonWrapper {} +export class ShallowWrapper

    { constructor(nodes: JSX.Element[] | JSX.Element, root?: ShallowWrapper, options?: ShallowRendererProps); -} - -export interface ShallowWrapper

    extends CommonWrapper { shallow(options?: ShallowRendererProps): ShallowWrapper; unmount(): this; @@ -404,14 +378,12 @@ export interface ShallowWrapper

    extends CommonWrapper { /** * Finds every node in the render tree that returns true for the provided predicate function. - * @param predicate */ findWhere(predicate: (wrapper: ShallowWrapper) => boolean): ShallowWrapper; /** * Returns a new wrapper with all of the children of the node(s) in the current wrapper. Optionally, a selector * can be provided and it will filter the children by this selector. - * @param [selector] */ children(component: ComponentClass): ShallowWrapper; children(statelessComponent: StatelessComponent): ShallowWrapper; @@ -420,7 +392,6 @@ export interface ShallowWrapper

    extends CommonWrapper { /** * Returns a new wrapper with child at the specified index. - * @param index */ childAt(index: number): ShallowWrapper; childAt(index: number): ShallowWrapper; @@ -428,7 +399,6 @@ export interface ShallowWrapper

    extends CommonWrapper { /** * Shallow render the one non-DOM child of the current wrapper, and return a wrapper around the result. * NOTE: can only be called on wrapper of a single non-DOM component element node. - * @param [options] */ dive(options?: ShallowRendererProps): ShallowWrapper; @@ -445,7 +415,6 @@ export interface ShallowWrapper

    extends CommonWrapper { * current wrapper. Optionally, a selector can be provided and it will filter the parents by this selector. * * Note: can only be called on a wrapper of a single node. - * @param [selector] */ parents(component: ComponentClass): ShallowWrapper; parents(statelessComponent: StatelessComponent): ShallowWrapper; @@ -457,7 +426,6 @@ export interface ShallowWrapper

    extends CommonWrapper { * ancestors in the tree, starting with itself. * * Note: can only be called on a wrapper of a single node. - * @param selector */ closest(component: ComponentClass): ShallowWrapper; closest(statelessComponent: StatelessComponent): ShallowWrapper; @@ -470,11 +438,11 @@ export interface ShallowWrapper

    extends CommonWrapper { parent(): ShallowWrapper; } -export class ReactWrapper { +// tslint:disable-next-line no-empty-interface +export interface ReactWrapper

    extends CommonWrapper {} +export class ReactWrapper

    { constructor(nodes: JSX.Element | JSX.Element[], root?: ReactWrapper, options?: MountRendererProps); -} -export interface ReactWrapper

    extends CommonWrapper { unmount(): this; mount(): this; @@ -517,7 +485,6 @@ export interface ReactWrapper

    extends CommonWrapper { /** * Finds every node in the render tree that returns true for the provided predicate function. - * @param predicate */ findWhere(predicate: (wrapper: ReactWrapper) => boolean): ReactWrapper; @@ -531,7 +498,6 @@ export interface ReactWrapper

    extends CommonWrapper { /** * Returns a new wrapper with all of the children of the node(s) in the current wrapper. Optionally, a selector * can be provided and it will filter the children by this selector. - * @param [selector] */ children(component: ComponentClass): ReactWrapper; children(statelessComponent: StatelessComponent): ReactWrapper; @@ -540,7 +506,6 @@ export interface ReactWrapper

    extends CommonWrapper { /** * Returns a new wrapper with child at the specified index. - * @param index */ childAt(index: number): ReactWrapper; childAt(index: number): ReactWrapper; @@ -550,7 +515,6 @@ export interface ReactWrapper

    extends CommonWrapper { * current wrapper. Optionally, a selector can be provided and it will filter the parents by this selector. * * Note: can only be called on a wrapper of a single node. - * @param [selector] */ parents(component: ComponentClass): ReactWrapper; parents(statelessComponent: StatelessComponent): ReactWrapper; @@ -562,7 +526,6 @@ export interface ReactWrapper

    extends CommonWrapper { * ancestors in the tree, starting with itself. * * Note: can only be called on a wrapper of a single node. - * @param selector */ closest(component: ComponentClass): ReactWrapper; closest(statelessComponent: StatelessComponent): ReactWrapper; @@ -583,13 +546,17 @@ export interface ReactWrapper

    extends CommonWrapper { * Returns itself. * * NOTE: can only be called on a wrapper instance that is also the root instance. - * @param props - * @param [callback] */ setProps(props: Pick, callback?: () => void): this; } export interface ShallowRendererProps { + // See https://github.com/airbnb/enzyme/blob/enzyme@3.1.1/docs/api/shallow.md#arguments + /** + * If set to true, componentDidMount is not called on the component, and componentDidUpdate is not called after + * setProps and setContext. Default to false. + */ + disableLifecycleMethods?: boolean; /** * Enable experimental support for full react lifecycle methods */ @@ -618,30 +585,37 @@ export interface MountRendererProps { /** * Shallow rendering is useful to constrain yourself to testing a component as a unit, and to ensure that * your tests aren't indirectly asserting on behavior of child components. - * @param node - * @param [options] */ export function shallow

    (node: ReactElement

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

    , options?: ShallowRendererProps): ShallowWrapper; /** * Mounts and renders a react component into the document and provides a testing wrapper around it. - * @param node - * @param [options] */ export function mount

    (node: ReactElement

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

    , options?: MountRendererProps): ReactWrapper; /** * Render react components to static HTML and analyze the resulting HTML structure. - * @param node - * @param [options] */ export function render(node: ReactElement

    , options?: any): Cheerio; +// See https://github.com/airbnb/enzyme/blob/v3.1.0/packages/enzyme/src/EnzymeAdapter.js +export class EnzymeAdapter { +} + /** * Configure enzyme to use the correct adapter for the react verstion * This is enabling the Enzyme configuration with adapters in TS - * @param options */ -export function configure(options: { adapter: any }): void; +export function configure(options: { + adapter: EnzymeAdapter, + // See https://github.com/airbnb/enzyme/blob/enzyme@3.1.1/docs/guides/migration-from-2-to-3.md#lifecycle-methods + // Actually, `{adapter:} & Pick` is more precise. However, + // in that case jsdoc won't be shown + /** + * If set to true, componentDidMount is not called on the component, and componentDidUpdate is not called after + * setProps and setContext. Default to false. + */ + disableLifecycleMethods?: boolean; +}): void; diff --git a/types/eonasdan-bootstrap-datetimepicker/package.json b/types/eonasdan-bootstrap-datetimepicker/package.json index fce08a048d..19e5fb0d14 100644 --- a/types/eonasdan-bootstrap-datetimepicker/package.json +++ b/types/eonasdan-bootstrap-datetimepicker/package.json @@ -3,4 +3,4 @@ "dependencies": { "moment": ">=2.14.0" } -} \ No newline at end of file +} diff --git a/types/eonasdan-bootstrap-datetimepicker/tslint.json b/types/eonasdan-bootstrap-datetimepicker/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/eonasdan-bootstrap-datetimepicker/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/epiceditor/tslint.json b/types/epiceditor/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/epiceditor/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/epub/tslint.json b/types/epub/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/epub/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/eq.js/tslint.json b/types/eq.js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/eq.js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/error-stack-parser/error-stack-parser-tests.ts b/types/error-stack-parser/error-stack-parser-tests.ts deleted file mode 100644 index c8b9198261..0000000000 --- a/types/error-stack-parser/error-stack-parser-tests.ts +++ /dev/null @@ -1,3 +0,0 @@ - - -ErrorStackParser.parse(new Error('Boom')); diff --git a/types/error-stack-parser/index.d.ts b/types/error-stack-parser/index.d.ts deleted file mode 100644 index ad722b0f2b..0000000000 --- a/types/error-stack-parser/index.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -// Type definitions for ErrorStackParser v1.3.3 -// Project: https://github.com/stacktracejs/error-stack-parser -// Definitions by: Eric Wendelin -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare module ErrorStackParser { - export interface StackFrame { - constructor(functionName: string, args: any, fileName: string, lineNumber: number, columnNumber: number, source: string): StackFrame; - - functionName?: string; - args?: any[]; - fileName?: string; - lineNumber?: number; - columnNumber?: number; - source?: string; - toString(): string; - } - - /** - * Given an Error object, extract the most information from it. - * - * @param {Error} error object - * @return {Array} of StackFrames - */ - export function parse(error: Error): StackFrame[]; -} diff --git a/types/errorhandler/index.d.ts b/types/errorhandler/index.d.ts index aa6664553b..71f0f3db21 100644 --- a/types/errorhandler/index.d.ts +++ b/types/errorhandler/index.d.ts @@ -2,9 +2,7 @@ // Project: https://github.com/expressjs/errorhandler // Definitions by: Santi Albo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - - +// TypeScript Version: 2.3 import * as express from 'express'; diff --git a/types/errorhandler/tslint.json b/types/errorhandler/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/errorhandler/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/es6-collections/tslint.json b/types/es6-collections/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/es6-collections/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/es6-error/tslint.json b/types/es6-error/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/es6-error/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/es6-promise/tslint.json b/types/es6-promise/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/es6-promise/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/es6-shim/tslint.json b/types/es6-shim/tslint.json new file mode 100644 index 0000000000..637071b426 --- /dev/null +++ b/types/es6-shim/tslint.json @@ -0,0 +1,80 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-object-spread": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/escape-html/tslint.json b/types/escape-html/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/escape-html/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/escape-latex/tslint.json b/types/escape-latex/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/escape-latex/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/escape-string-regexp/index.d.ts b/types/escape-string-regexp/index.d.ts index 1ef18aedb1..7a52a312b1 100644 --- a/types/escape-string-regexp/index.d.ts +++ b/types/escape-string-regexp/index.d.ts @@ -1,10 +1,11 @@ // Type definitions for escape-string-regexp // Project: https://github.com/sindresorhus/escape-string-regexp // Definitions by: kruncher +// faergeek // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare function escapeStringRegexp(str: string): string; +declare const escapeStringRegexp: (str: string) => string; export = escapeStringRegexp; diff --git a/types/escape-string-regexp/tslint.json b/types/escape-string-regexp/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/escape-string-regexp/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/escodegen/tslint.json b/types/escodegen/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/escodegen/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/esprima-walk/tslint.json b/types/esprima-walk/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/esprima-walk/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/esprima/v2/tslint.json b/types/esprima/v2/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/esprima/v2/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/esri-leaflet/index.d.ts b/types/esri-leaflet/index.d.ts index 07cab832e0..69c5eb5827 100644 --- a/types/esri-leaflet/index.d.ts +++ b/types/esri-leaflet/index.d.ts @@ -13,30 +13,18 @@ declare module 'leaflet' { interface LayerOptionsBase { /** * URL of the Map Service - * - * @type {string} - * @memberof LayerOptionsBase */ url: string; /** * URL of an ArcGIS API for JavaScript proxy or ArcGIS Resource Proxy to use for proxying requests. - * - * @type {string} - * @memberof LayerOptionsBase */ proxy?: string; /** * Dictates if the service should use CORS when making GET requests. - * - * @type {boolean} - * @memberof LayerOptionsBase */ useCors?: boolean; /** * Will use this token to authenticate all calls to the service. - * - * @type {string} - * @memberof LayerOptionsBase */ token?: string; } @@ -71,544 +59,357 @@ declare module 'leaflet' { } /** - * Options for L.esri.BasemapLayer - * - * @interface BasemapLayerOptions - * @extends {L.TileLayerOptions} + * Options for `L.esri.BasemapLayer` */ interface BasemapLayerOptions extends L.TileLayerOptions { /** * Will use this token to authenticate all calls to the service. * - * @type {string} - * @memberof BasemapLayerOptions */ token?: string; } /** - * L.esri.BasemapLayer is used to display Esri hosted basemaps and attributes data providers appropriately. The Terms of Use for Esri hosted services apply to all Leaflet applications. - * - * @class BasemapLayer - * @extends {L.TileLayer} + * `L.esri.BasemapLayer` is used to display Esri hosted basemaps and attributes data providers appropriately. + * The Terms of Use for Esri hosted services apply to all Leaflet applications. */ class BasemapLayer extends L.TileLayer { constructor(key: Basemaps, options?: BasemapLayerOptions); } /** - * L.esri.basemapLayer is used to display Esri hosted basemaps and attributes data providers appropriately. The Terms of Use for Esri hosted services apply to all Leaflet applications. - * - * @param {Basemaps} key - * @param {BasemapLayerOptions} [options] - * @returns {BasemapLayer} + * `L.esri.basemapLayer` is used to display Esri hosted basemaps and attributes data providers appropriately. + * The Terms of Use for Esri hosted services apply to all Leaflet applications. */ function basemapLayer(key: Basemaps, options?: BasemapLayerOptions): BasemapLayer; /** - * Options for L.esri.TiledMapLayer - * - * @interface TiledMapLayerOptions - * @extends {L.TileLayerOptions} + * Options for `L.esri.TiledMapLayer` */ interface TiledMapLayerOptions extends L.TileLayerOptions, LayerOptionsBase { /** - * If correctZoomLevels is enabled this controls the amount of tolerance for the difference at each scale level for remapping tile levels. - * Default 0.1 + * If correctZoomLevels is enabled this controls the amount of tolerance for the difference at each scale + * level for remapping tile levels. * - * @type {number} - * @memberof TiledMapLayerOptions + * Default 0.1 */ zoomOffsetAllowance?: number; } /** - * Access tiles from ArcGIS Online and ArcGIS Server to visualize and identify features. Copyright text from the service is added to map attribution automatically. - * - * @class TiledMapLayer - * @extends {L.TileLayer} + * Access tiles from ArcGIS Online and ArcGIS Server to visualize and identify features. Copyright text from the + * service is added to map attribution automatically. */ class TiledMapLayer extends L.TileLayer { constructor(options: TiledMapLayerOptions); /** - * Authenticates this service with a new token and runs any pending requests that required a token. - * - * @param {string} token - * @returns {this} - * @memberof TiledMapLayer + * Authenticates this service with a new token and runs any pending requests that required a token */ authenticate(token: string): this; /** * Requests metadata about this Feature Layer. Callback will be called with error and metadata. - * - * @param {CallbackHandler} callback - * @param {*} context - * @returns {this} - * @memberof TiledMapLayer */ metadata(callback: CallbackHandler, context?: any): this; /** - * Returns a new L.esri.services.IdentifyFeatures object that can be used to identify features on this layer. Your callback function will be passed a GeoJSON FeatureCollection with the results or an error. - * - * @returns {*} - * @memberof TiledMapLayer + * Returns a new `L.esri.services.IdentifyFeatures` object that can be used to identify features on this + * layer. Your callback function will be passed a GeoJSON FeatureCollection with the results or an error. */ identify(): IdentifyFeatures; /** - * Returns a new L.esri.services.Find object that can be used to find features. Your callback function will be passed a GeoJSON FeatureCollection with the results or an error. - * - * @returns {*} - * @memberof TiledMapLayer + * Returns a new `L.esri.services.Find` object that can be used to find features. Your callback function + * will be passed a GeoJSON FeatureCollection with the results or an error. */ find(): Find; /** - * Returns a new L.esri.Query object that can be used to query this service. - * - * @returns {*} - * @memberof TiledMapLayer + * Returns a new `L.esri.Query` object that can be used to query this service. */ query(): Query; } /** - * Access tiles from ArcGIS Online and ArcGIS Server to visualize and identify features. Copyright text from the service is added to map attribution automatically. - * - * @param {TiledMapLayerOptions} options - * @returns {TiledMapLayer} + * Access tiles from ArcGIS Online and ArcGIS Server to visualize and identify features. Copyright text from the + * service is added to map attribution automatically. */ function tiledMapLayer(options: TiledMapLayerOptions): TiledMapLayer; /** * Options for RasterLayer - * - * @interface RasterLayerOptions - * @extends {L.ImageOverlayOptions} */ interface RasterLayerOptions extends L.ImageOverlayOptions { /** * Server response content type. - * Default: 'image' - * - * @type {string} - * @memberof RasterLayerOptions + * @default 'image' */ f?: string; /** * Position of the layer relative to other overlays. - * Default: 'front' - * - * @type {string} - * @memberof RasterLayerOptions + * @default 'front' */ position?: string; /** * Closest zoom level the layer will be displayed on the map. - * - * @type {number} - * @memberof RasterLayerOptions */ maxZoom?: number; /** * Furthest zoom level the layer will be displayed on the map. - * - * @type {number} - * @memberof RasterLayerOptions */ minZoom?: number; } /** * A generic class representing an image layer. This class can be extended to provide support for making export requests from ArcGIS REST services. - * - * @class RasterLayer - * @extends {L.ImageOverlay} */ abstract class RasterLayer extends L.ImageOverlay { /** * Redraws this layer below all other overlay layers. - * - * @returns {this} - * @memberof RasterLayer */ bringToBack(): this; /** * Redraws this layer above all other overlay layers. - * - * @returns {this} - * @memberof RasterLayer */ bringToFront(): this; /** * Returns the current opacity of the layer. - * - * @returns {number} - * @memberof RasterLayer */ getOpacity(): number; /** * Sets the opacity of the layer. - * - * @param {number} opacity - * @returns {this} - * @memberof RasterLayer */ setOpacity(opacity: number): this; /** * Returns the current time range being used for rendering. Array [from, to]; - * - * @returns {Date[]} - * @memberof RasterLayer */ getTimeRange(): Date[]; /** * Redraws the layer with he passed time range. - * - * @param {Date} from - * @param {Date} to - * @returns {this} - * @memberof RasterLayer */ setTimeRange(from: Date, to: Date): this; /** * Used to make a fresh request to the service and draw the response. - * - * @returns {this} - * @memberof RasterLayer */ redraw(): this; /** * Authenticates this service with a new token and runs any pending requests that required a token. - * - * @param {string} token - * @returns {this} - * @memberof TiledMapLayer */ authenticate(token: string): this; /** * Requests metadata about this Feature Layer. Callback will be called with error and metadata. - * - * @param {CallbackHandler} callback - * @param {*} context - * @returns {this} - * @memberof TiledMapLayer */ metadata(callback: CallbackHandler, context?: any): this; } /** - * Options for L.esri.DynamicMapLayer - * - * @interface DynamicMapLayerOptions - * @extends {RasterLayerOptions} + * Options for `L.esri.DynamicMapLayer` */ interface DynamicMapLayerOptions extends RasterLayerOptions, LayerOptionsBase { /** * Output format of the image. - * Default: 'png24' - * - * @type {string} - * @memberof DynamicMapLayerOptions + * @default 'png24' */ format?: string; /** * Allow the server to produce transparent images. - * - * @type {boolean} - * @memberof DynamicMapLayerOptions */ transparent?: boolean; /** - * Attribution from service metadata copyright text is automatically displayed in Leaflet's default control. This property can be used for customization. - * - * @type {string} - * @memberof DynamicMapLayerOptions + * Attribution from service metadata copyright text is automatically displayed in Leaflet's default control. + * This property can be used for customization. */ attribution?: string; - /* + /** * An array of Layer IDs like [3,4,5] to show from the service. - * - * @type {any[]} - * @memberof DynamicMapLayerOptions */ layers?: any[]; /** - * SQL filters to define what features will be included in the image rendered by the service. An object is used with keys that map each query to its respective layer. - * { 3: "STATE_NAME='Kansas'", 9: "POP2007>25000" } + * SQL filters to define what features will be included in the image rendered by the service. An object is + * used with keys that map each query to its respective layer. * - * @type {*} - * @memberof DynamicMapLayerOptions + * { 3: "STATE_NAME='Kansas'", 9: "POP2007>25000" } */ layerDefs?: any; /** - * JSON object literal used to manipulate the layer symbology defined in the service itself. Requires a 10.1 (or above) map service which supports dynamicLayers requests. - * - * @type {*} - * @memberof DynamicMapLayerOptions + * JSON object literal used to manipulate the layer symbology defined in the service itself. Requires a 10.1 + * (or above) map service which supports dynamicLayers requests. */ dynamicLayers?: any; /** * If enabled, appends a timestamp to each request to ensure a fresh image is created server-side. - * - * @type {boolean} - * @memberof DynamicMapLayerOptions */ disableCache?: boolean; } /** - * Render and visualize Map Services from ArcGIS Online and ArcGIS Server. L.esri.DynamicMapLayer also supports custom popups and identification of features. - * Map Services are used when its preferable to ask the server to draw layers at a particular location and scale and pass back the image which was generated on the fly. They also expose capabilities for querying and identifying individual features. + * Render and visualize Map Services from ArcGIS Online and ArcGIS Server. `L.esri.DynamicMapLayer` also + * supports custom popups and identification of features. * - * @class DynamicMapLayer - * @extends {RasterLayer} + * Map Services are used when its preferable to ask the server to draw layers at a particular location and scale + * and pass back the image which was generated on the fly. They also expose capabilities for querying and + * identifying individual features. */ class DynamicMapLayer extends RasterLayer { constructor(options: DynamicMapLayerOptions); /** - * Uses the provided function to create a popup that will identify features whenever the map is clicked. Your function will be passed a GeoJSON FeatureCollection of the features at the clicked location and should return the appropriate HTML. If you do not want to open the popup when there are no results, return false. - * - * @param {any} fn - * @param {L.PopupOptions} popupOptions - * @returns {this} - * @memberof DynamicMapLayer + * Uses the provided function to create a popup that will identify features whenever the map is clicked. + * Your function will be passed a GeoJSON FeatureCollection of the features at the clicked location and + * should return the appropriate HTML. If you do not want to open the popup when there are no results, + * return false. */ bindPopup(fn: FeatureCallbackHandler, popupOptions?: L.PopupOptions): this; bindPopup(content: ((layer: Layer) => Content) | Content | Popup, options?: PopupOptions): this; /** * Removes a popup previously bound with bindPopup. - * - * @returns {this} - * @memberof DynamicMapLayer */ unbindPopup(): this; /** * Returns the current opacity of the layer. - * - * @returns {number} - * @memberof DynamicMapLayer */ getOpacity(): number; /** * Sets the opacity of the layer. - * - * @param {number} opacity - * @returns {this} - * @memberof DynamicMapLayer */ setOpacity(opacity: number): this; /** * Returns the array of visible layers specified in the layer constructor. - * - * @returns {Array} - * @memberof DynamicMapLayer */ getLayers(): any[]; /** * Redraws the layer to show the passed array of layer ids. - * - * @param {Array} layers - * @returns {this} - * @memberof DynamicMapLayer */ setLayers(layers: any[]): this; /** * Returns the current layer definition(s) being used for rendering. - * - * @returns {*} - * @memberof DynamicMapLayer */ getLayerDefs(): any; /** * Redraws the layer with the new layer definitions. Corresponds to the layerDefs option on the export API. - * - * @param {*} layerDefs - * @returns {this} - * @memberof DynamicMapLayer */ setLayerDefs(layerDefs: any): this; /** * Returns the current time options being used for rendering. - * - * @returns {*} - * @memberof DynamicMapLayer */ getTimeOptions(): any; /** - * Sets the current time options being used to render the layer. Corresponds to the layerTimeOptions option on the export API. - * - * @param {*} timeOptions - * @returns {this} - * @memberof DynamicMapLayer + * Sets the current time options being used to render the layer. Corresponds to the layerTimeOptions option + * on the export API. */ setTimeOptions(timeOptions: any): this; /** * Returns a JSON object representing the modified layer symbology being requested from the map service. - * - * @returns {*} - * @memberof DynamicMapLayer */ getDynamicLayers(): any; /** - * Used to insert raw dynamicLayers JSON in situations where you'd like to modify layer symbology defined in the service itself. - * - * @param {*} layers - * @returns {this} - * @memberof DynamicMapLayer + * Used to insert raw dynamicLayers JSON in situations where you'd like to modify layer symbology defined in + * the service itself. */ setDynamicLayers(layers: any): this; /** - * Returns a new L.esri.services.IdentifyFeatures object that can be used to identify features on this layer. Your callback function will be passed a GeoJSON FeatureCollection with the results or an error. - * - * @returns {*} - * @memberof DynamicMapLayer + * Returns a new `L.esri.services.IdentifyFeatures` object that can be used to identify features on this + * layer. Your callback function will be passed a GeoJSON FeatureCollection with the results or an error. */ identify(): IdentifyFeatures; /** - * Returns a new L.esri.services.Find object that can be used to find features. Your callback function will be passed a GeoJSON FeatureCollection with the results or an error. - * - * @returns {*} - * @memberof DynamicMapLayer + * Returns a new `L.esri.services.Find` object that can be used to find features. Your callback function + * will be passed a GeoJSON FeatureCollection with the results or an error. */ find(): Find; /** - * Returns a new L.esri.Query object that can be used to query this service. - * - * @returns {*} - * @memberof DynamicMapLayer + * Returns a new `L.esri.Query` object that can be used to query this service. */ query(): Query; } /** - * Render and visualize Map Services from ArcGIS Online and ArcGIS Server. L.esri.DynamicMapLayer also supports custom popups and identification of features. - * Map Services are used when its preferable to ask the server to draw layers at a particular location and scale and pass back the image which was generated on the fly. They also expose capabilities for querying and identifying individual features. + * Render and visualize Map Services from ArcGIS Online and ArcGIS Server. L.esri.DynamicMapLayer also supports + * custom popups and identification of features. * - * @param {DynamicMapLayerOptions} options - * @returns {DynamicMapLayer} + * Map Services are used when its preferable to ask the server to draw layers at a particular location and scale + * and pass back the image which was generated on the fly. They also expose capabilities for querying and + * identifying individual features. */ function dynamicMapLayer(options: DynamicMapLayerOptions): DynamicMapLayer; /** * Options for FeatureLayer - * - * @interface FeatureLayerOptions - * @extends {LayerOptionsBase} */ interface FeatureLayerOptions extends LayerOptionsBase { /** - * Function that will be used for creating layers for GeoJSON points. If the option is not specified, simple markers will be created). For point layers, custom panes should be passed through pointToLayer (example here). - * - * @memberof FeatureLayerOptions + * Function that will be used for creating layers for GeoJSON points. If the option is not specified, simple + * markers will be created). For point layers, custom panes should be passed through pointToLayer (example here). */ pointToLayer?: (feature: any, latLng: LatLngExpression) => void; /** * Function that will be used to get style options for vector layers created for GeoJSON features. - * - * @memberof FeatureLayerOptions */ style?: (feature: any, layer: L.Layer) => void; /** * Provides an opportunity to introspect individual GeoJSON features in the layer. - * - * @memberof FeatureLayerOptions */ onEachFeature?: (feature: any, layer: L.Layer) => void; /** - * An optional expression to filter features server side. String values should be denoted using single quotes ie: where: "FIELDNAME = 'field value'"; More information about valid SQL syntax can be found here. - * - * @type {string} - * @memberof FeatureLayerOptions + * An optional expression to filter features server side. String values should be denoted using single + * quotes ie: where: "FIELDNAME = 'field value'"; More information about valid SQL syntax can be found here. */ where?: string; /** * Closest zoom level the layer will be displayed on the map. example: maxZoom:19 - * - * @type {number} - * @memberof FeatureLayerOptions */ maxZoom?: number; /** * Furthest zoom level the layer will be displayed on the map. example: minZoom:3 - * - * @type {number} - * @memberof FeatureLayerOptions */ minZoom?: number; /** * Will remove layers from the internal cache when they are removed from the map. - * - * @type {boolean} - * @memberof FeatureLayerOptions */ cacheLayers?: boolean; /** - * An array of fieldnames to pull from the service. Includes all fields by default. You should always specify the name of the unique id for the service. Usually either 'FID' or 'OBJECTID'. - * - * @type {Array} - * @memberof FeatureLayerOptions + * An array of fieldnames to pull from the service. Includes all fields by default. You should always + * specify the name of the unique id for the service. Usually either `FID` or `OBJECTID`. */ fields?: string[]; /** - * When paired with to defines the time range of features to display. Requires the Feature Layer to be time enabled. - * - * @type {Date} - * @memberof FeatureLayerOptions + * When paired with to defines the time range of features to display. Requires the Feature Layer to be time + * enabled. */ from?: Date; /** - * When paired with from defines the time range of features to display. Requires the Feature Layer to be time enabled. - * - * @type {Date} - * @memberof FeatureLayerOptions + * When paired with from defines the time range of features to display. Requires the Feature Layer to be + * time enabled. */ to?: Date; /** - * The name of the field to lookup the time of the feature. Can be an object like {start:'startTime', end:'endTime'} or a string like 'created'. - * - * @type {*} - * @memberof FeatureLayerOptions + * The name of the field to lookup the time of the feature. Can be an object like + * {start:'startTime', end:'endTime'} or a string like 'created'. */ timeField?: any; /** - * Determines where features are filtered by time. By default features will be filtered by the server. If set to 'client' all features are requested and filtered by the app before display. - * - * @type {('server' | 'client')} - * @memberof FeatureLayerOptions + * Determines where features are filtered by time. By default features will be filtered by the server. If + * set to 'client' all features are requested and filtered by the app before display. */ timeFilterMode?: 'server' | 'client'; /** - * How much to simplify polygons and polylines. A higher value gives better performance, a lower value gives a more accurate representation. - * - * @type {number} - * @memberof FeatureLayerOptions + * How much to simplify polygons and polylines. A higher value gives better performance, a lower value + * gives a more accurate representation. */ simplifyFactor?: number; /** - * How many digits of precision to request from the server. Wikipedia has a great reference of digit precision to meters. - * - * @type {number} - * @memberof FeatureLayerOptions + * How many digits of precision to request from the server. Wikipedia has a great reference of digit + * precision to meters. */ precision?: number; /** - * The vector renderer to use to draw the service. Usually L.svg() is preferable but setting to L.canvas() can have performance benefits for large polygon layers. - * - * @type {(L.SVG | L.Canvas)} - * @memberof FeatureLayerOptions + * The vector renderer to use to draw the service. Usually L.svg() is preferable but setting to `L.canvas()` + * can have performance benefits for large polygon layers. */ renderer?: L.SVG | L.Canvas; /** - * Set this to false if your own service supports GeoJSON as an output format but you'd like to ask for Geoservices JSON instead. - * - * @type {boolean} - * @memberof FeatureLayerOptions + * Set this to false if your own service supports GeoJSON as an output format but you'd like to ask for + * Geoservices JSON instead. */ isModern?: boolean; /** - * When utilizing esri-leaflet-renderers '2.0.2' or above, this option makes it possible to override the symbology defined by the service itself. - * - * @type {boolean} - * @memberof FeatureLayerOptions + * When utilizing esri-leaflet-renderers '2.0.2' or above, this option makes it possible to override the + * symbology defined by the service itself. */ ignoreRenderer?: boolean; } @@ -618,221 +419,176 @@ declare module 'leaflet' { // TODO: VirtualGrid extends support /** - * L.esri.FeatureLayer is used to visualize, style, query and edit vector geographic data hosted in both ArcGIS Online and published using ArcGIS Server. Copyright text from the service is added to map attribution automatically. - * Feature Layers reference an individual data source in either a parent Map Service or Feature Service that can contain multiple layers. You can see a sample Map Service URL below: http://sampleserver6.arcgisonline.com/arcgis/rest/services/Hurricanes/MapServer - * This particular service includes two different data sources. The URL for the 'Hurricane Tracks' feature layer will end in a number (representing its position among the other layers). http://sampleserver6.arcgisonline.com/arcgis/rest/services/Hurricanes/MapServer/1 - * Feature Layer URLs always end in a number (ex: /FeatureServer/{LAYER_ID} or /MapServer/{LAYER_ID}). - * You can create a new empty feature service with a single layer on the ArcGIS for Developers website or you can use ArcGIS Online to create a Feature Service from a CSV or Shapefile - * L.esri.FeatureLayer divides the current map extent into a grid of individual cells and uses them to fire queries to fetch nearby features. This technique is comparable to MODE_ONDEMAND in the ArcGIS API for JavaScript. + * `L.esri.FeatureLayer` is used to visualize, style, query and edit vector geographic data hosted in both + * ArcGIS Online and published using ArcGIS Server. Copyright text from the service is added to map attribution + * automatically. * - * @class FeatureLayer - * @extends {L.Layer} + * Feature Layers reference an individual data source in either a parent Map Service or Feature Service that can + * contain multiple layers. You can see a sample Map Service URL below: + * http://sampleserver6.arcgisonline.com/arcgis/rest/services/Hurricanes/MapServer + * + * This particular service includes two different data sources. The URL for the 'Hurricane Tracks' feature layer + * will end in a number (representing its position among the other layers). + * http://sampleserver6.arcgisonline.com/arcgis/rest/services/Hurricanes/MapServer/1 + * + * Feature Layer URLs always end in a number (ex: /FeatureServer/{LAYER_ID} or /MapServer/{LAYER_ID}). + * + * You can create a new empty feature service with a single layer on the ArcGIS for Developers website or you + * can use ArcGIS Online to create a Feature Service from a CSV or Shapefile + * + * `L.esri.FeatureLayer` divides the current map extent into a grid of individual cells and uses them to fire + * queries to fetch nearby features. This technique is comparable to `MODE_ONDEMAND` in the ArcGIS API for + * JavaScript. */ class FeatureLayer extends L.Layer { constructor(options: FeatureLayerOptions); /** - * Sets the given path options to each layer that has a setStyle method. Can also be a Function that will receive a feature argument and should return Path Options - * featureLayer.setStyle({ color: 'white' }) - * featureLayer.setStyle(function(feature){ return { weight: feature.properties.pixelWidth };}) + * Sets the given path options to each layer that has a setStyle method. Can also be a Function that will + * receive a feature argument and should return Path Options * - * @param {(L.PathOptions | StyleCallback)} style - * @returns {this} - * @memberof FeatureLayer + * `featureLayer.setStyle({ color: 'white' })` + * `featureLayer.setStyle(function(feature){ return { weight: feature.properties.pixelWidth };})` */ setStyle(style: L.PathOptions | StyleCallback): this; /** * Changes the style on a specfic feature. - * - * @param {(string | number)} id - * @param {(L.PathOptions | StyleCallback)} style - * @returns {this} - * @memberof FeatureLayer */ setFeatureStyle(id: string | number, style: L.PathOptions | StyleCallback): this; /** * Given the ID of a feature, reset that feature to the original style. - * - * @returns {this} - * @memberof FeatureLayer */ resetStyle(): this; /** - * Calls the passed function against every feature. The function will be passed the layer that represents the feature. - * featureLayer.eachFeature(function(layer){ console.log(layer.feature.properties.NAME); }); + * Calls the passed function against every feature. The function will be passed the layer that represents + * the feature. * - * @param {(feature: any) => void} fn - * @param {*} [context] - * @returns {this} - * @memberof FeatureLayer + * featureLayer.eachFeature(function(layer){ console.log(layer.feature.properties.NAME); }); */ eachFeature(fn: (feature: any) => void, context?: any): this; /** * Calls the passed function against every feature that is currently being displayed. - * - * @param {(feature: any) => void} fn - * @param {*} [context] - * @returns {this} - * @memberof FeatureLayer */ eachActiveFeature(fn: (feature: any) => void, context?: any): this; /** - * Given the id of a Feature return the layer on the map that represents it. This will usually be a Leaflet vector layer like Polyline or Polygon, or a Leaflet Marker. - * - * @param {(string | number)} id - * @returns {L.Layer} - * @memberof FeatureLayer + * Given the id of a Feature return the layer on the map that represents it. This will usually be a Leaflet + * vector layer like Polyline or Polygon, or a Leaflet Marker. */ getFeature(id: string | number): L.Layer; /** * Returns the current where setting - * - * @returns {string} - * @memberof FeatureLayer */ getWhere(): string; /** - * Sets the new where option and refreshes the layer to reflect the new where filter. Accepts an optional callback and function context. - * - * @param {string} where - * @param {FeatureCallbackHandler} [callback] - * @param {*} [context] - * @returns {this} - * @memberof FeatureLayer + * Sets the new where option and refreshes the layer to reflect the new where filter. Accepts an optional + * callback and function context. */ setWhere(where: string, callback?: FeatureCallbackHandler, context?: any): this; /** * Returns the current time range as an array like [from, to] - * - * @returns {Date[]} - * @memberof FeatureLayer */ getTimeRange(): Date[]; /** - * Sets the current time filter applied to features. An optional callback is run upon completion if timeFilterMode is set to 'server'. Also accepts function context as the last argument. - * - * @param {Date} from - * @param {Date} to - * @param {FeatureCallbackHandler} [callback] - * @param {*} [context] - * @returns {this} - * @memberof FeatureLayer + * Sets the current time filter applied to features. An optional callback is run upon completion if + * timeFilterMode is set to 'server'. Also accepts function context as the last argument. */ setTimeRange(from: Date, to: Date, callback?: FeatureCallbackHandler, context?: any): this; /** * Adds a new feature to the feature layer. this also adds the feature to the map if creation is successful. - * Requires authentication as a user who has permission to edit the service in ArcGIS Online or the user who created the service. - * Requires the Create capability be enabled on the service. You can check if creation exists by checking the metadata of your service under capabilities. * - * @param {GeoJSONFeature} feature - * @param {ResponseCallbackHandler} [callback] - * @param {*} context - * @returns {this} - * @memberof FeatureLayer + * Requires authentication as a user who has permission to edit the service in ArcGIS Online or the user who + * created the service. + * + * Requires the Create capability be enabled on the service. You can check if creation exists by checking + * the metadata of your service under capabilities. */ // TODO: GeoJSONFeature addFeature(feature: any, callback?: ResponseCallbackHandler, context?: any): this; /** * Update the provided feature on the Feature Layer. This also updates the feature on the map. - * Requires authentication as a user who has permission to edit the service in ArcGIS Online or the user who created the service. - * Requires the Update capability be enabled on the service. You can check if this operation exists by checking the metadata of your service under capabilities. * - * @param {GeoJSONFeature} feature - * @param {ResponseCallbackHandler} [callback] - * @param {*} context - * @returns {this} - * @memberof FeatureLayer + * Requires authentication as a user who has permission to edit the service in ArcGIS Online or the user who + * created the service. + * + * Requires the Update capability be enabled on the service. You can check if this operation exists by + * checking the metadata of your service under capabilities. */ // TODO: GeoJSONFeature updateFeature(feature: any, callback?: ResponseCallbackHandler, context?: any): this; /** - * Remove the feature with the provided id from the feature layer. This will also remove the feature from the map if it exists. - * Requires authentication as a user who has permission to edit the service in ArcGIS Online or the user who created the service. - * Requires the Delete capability be enabled on the service. You can check if this operation exists by checking the metadata of your service under capabilities. + * Remove the feature with the provided id from the feature layer. This will also remove the feature from + * the map if it exists. * - * @param {(string | number)} id - * @param {ResponseCallbackHandler} [callback] - * @param {*} context - * @returns {this} - * @memberof FeatureLayer + * Requires authentication as a user who has permission to edit the service in ArcGIS Online or the user who + * created the service. + * + * Requires the Delete capability be enabled on the service. You can check if this operation exists by + * checking the metadata of your service under capabilities. */ deleteFeature(id: string | number, callback?: ResponseCallbackHandler, context?: any): this; /** - * Removes an array of features with the provided ids from the feature layer. This will also remove the features from the map if they exist. - * Requires authentication as a user who has permission to edit the service in ArcGIS Online or the user who created the service. - * Requires the Delete capability be enabled on the service. You can check if this operation exists by checking the metadata of your service under capabilities. + * Removes an array of features with the provided ids from the feature layer. This will also remove the + * features from the map if they exist. * - * @param {(Array)} ids - * @param {ResponseCallbackHandler} [callback] - * @param {*} context - * @returns {this} - * @memberof FeatureLayer + * Requires authentication as a user who has permission to edit the service in ArcGIS Online or the user who + * created the service. + * + * Requires the Delete capability be enabled on the service. You can check if this operation exists by + * checking the metadata of your service under capabilities. */ deleteFeatures(ids: string[] | number[], callback?: ResponseCallbackHandler, context?: any): this; /** * Redraws a feature with the provided id from the feature layer. - * - * @param {(string | number)} id - * @returns {this} - * @memberof FeatureLayer */ redraw(id: string | number): this; /** - * Redraws all features from the feature layer that exist on the map. - * - * @returns {this} - * @memberof FeatureLayer + * Redraws all features from the feature layer that exist on the map. */ refresh(): this; /** * Authenticates this service with a new token and runs any pending requests that required a token. - * - * @param {string} token - * @returns {this} - * @memberof TiledMapLayer */ authenticate(token: string): this; /** * Requests metadata about this Feature Layer. Callback will be called with error and metadata. - * - * @param {CallbackHandler} callback - * @param {*} context - * @returns {this} - * @memberof TiledMapLayer */ metadata(callback: CallbackHandler, context?: any): this; /** - * Returns a new L.esri.services.IdentifyFeatures object that can be used to identify features on this layer. Your callback function will be passed a GeoJSON FeatureCollection with the results or an error. - * - * @returns {*} - * @memberof TiledMapLayer + * Returns a new `L.esri.services.IdentifyFeatures` object that can be used to identify features on this + * layer. Your callback function will be passed a GeoJSON FeatureCollection with the results or an error. */ identify(): IdentifyFeatures; /** - * Returns a new L.esri.services.Find object that can be used to find features. Your callback function will be passed a GeoJSON FeatureCollection with the results or an error. - * - * @returns {*} - * @memberof TiledMapLayer + * Returns a new `L.esri.services.Find` object that can be used to find features. Your callback function + * will be passed a GeoJSON FeatureCollection with the results or an error. */ find(): Find; /** - * Returns a new L.esri.Query object that can be used to query this service. - * - * @returns {*} - * @memberof TiledMapLayer + * Returns a new `L.esri.Query` object that can be used to query this service. */ query(): Query; } /** - * L.esri.FeatureLayer is used to visualize, style, query and edit vector geographic data hosted in both ArcGIS Online and published using ArcGIS Server. Copyright text from the service is added to map attribution automatically. - * Feature Layers reference an individual data source in either a parent Map Service or Feature Service that can contain multiple layers. You can see a sample Map Service URL below: http://sampleserver6.arcgisonline.com/arcgis/rest/services/Hurricanes/MapServer - * This particular service includes two different data sources. The URL for the 'Hurricane Tracks' feature layer will end in a number (representing its position among the other layers). http://sampleserver6.arcgisonline.com/arcgis/rest/services/Hurricanes/MapServer/1 - * Feature Layer URLs always end in a number (ex: /FeatureServer/{LAYER_ID} or /MapServer/{LAYER_ID}). - * You can create a new empty feature service with a single layer on the ArcGIS for Developers website or you can use ArcGIS Online to create a Feature Service from a CSV or Shapefile - * L.esri.FeatureLayer divides the current map extent into a grid of individual cells and uses them to fire queries to fetch nearby features. This technique is comparable to MODE_ONDEMAND in the ArcGIS API for JavaScript. + * `L.esri.FeatureLayer` is used to visualize, style, query and edit vector geographic data hosted in both + * ArcGIS Online and published using ArcGIS Server. Copyright text from the service is added to map attribution + * automatically. * - * @param {FeatureLayerOptions} options - * @returns {FeatureLayer} + * Feature Layers reference an individual data source in either a parent Map Service or Feature Service that can + * contain multiple layers. You can see a sample Map Service URL below: + * http://sampleserver6.arcgisonline.com/arcgis/rest/services/Hurricanes/MapServer + * + * This particular service includes two different data sources. The URL for the 'Hurricane Tracks' feature layer + * will end in a number (representing its position among the other layers). + * http://sampleserver6.arcgisonline.com/arcgis/rest/services/Hurricanes/MapServer/1 + * + * Feature Layer URLs always end in a number (ex: /FeatureServer/{LAYER_ID} or /MapServer/{LAYER_ID}). + * + * You can create a new empty feature service with a single layer on the ArcGIS for Developers website or you + * can use ArcGIS Online to create a Feature Service from a CSV or Shapefile + * + * L.esri.FeatureLayer divides the current map extent into a grid of individual cells and uses them to fire + * queries to fetch nearby features. This technique is comparable to MODE_ONDEMAND in the ArcGIS API for + * JavaScript. */ function featureLayer(options: FeatureLayerOptions): FeatureLayer; @@ -840,780 +596,511 @@ declare module 'leaflet' { type ResponseCallbackHandler = (error?: any, response?: any) => void; /** - * Options for L.esri.Service - * - * @interface ServiceOptions + * Options for `L.esri.Service` */ interface ServiceOptions { /** * URL of the ArcGIS service you would like to consume. - * - * @type {string} - * @memberof ServiceOptions */ url?: string; /** * URL of an ArcGIS API for JavaScript proxy or ArcGIS Resource Proxy to use for proxying POST requests. - * - * @type {string} - * @memberof ServiceOptions */ proxy?: string; /** * If this service should use CORS when making GET requests. - * - * @type {boolean} - * @memberof ServiceOptions */ useCors?: boolean; /** * Operation timeout - * - * @type {number} - * @memberof ServiceOptions */ timeout?: number; } /** - * A generic class representing a hosted resource on ArcGIS Online or ArcGIS Server. This class can be extended to provide support for making requests and serves as a standard for authentication and proxying. - * - * @class Service - * @extends {L.Evented} + * A generic class representing a hosted resource on ArcGIS Online or ArcGIS Server. This class can be extended + * to provide support for making requests and serves as a standard for authentication and proxying. */ abstract class Service extends L.Evented { /** - * Makes a GET request to the service. The service's URL will be combined with the path option and parameters will be serialized to a query string. Accepts an optional function context for the callback. - * - * @param {string} url - * @param {*} [params] - * @param {CallbackHandler} [callback] - * @param {*} [context] - * @returns {this} - * @memberof Service + * Makes a GET request to the service. The service's URL will be combined with the path option and + * parameters will be serialized to a query string. Accepts an optional function context for the callback. */ get(url: string, params?: any, callback?: CallbackHandler, context?: any): this; /** - * Makes a POST request to the service. The service's URL will be combined with the path option and parameters will be serialized. Accepts an optional function context for the callback. - * - * @param {string} url - * @param {*} [params] - * @param {CallbackHandler} [callback] - * @param {*} [context] - * @returns {this} - * @memberof Service + * Makes a POST request to the service. The service's URL will be combined with the path option and + * parameters will be serialized. Accepts an optional function context for the callback. */ post(url: string, params?: any, callback?: CallbackHandler, context?: any): this; /** * Authenticates this service with a new token and runs any pending requests that required a token. - * - * @param {string} token - * @returns {this} - * @memberof TiledMapLayer */ authenticate(token: string): this; /** * Requests metadata about this Feature Layer. Callback will be called with error and metadata. - * - * @param {CallbackHandler} callback - * @param {*} context - * @returns {this} - * @memberof TiledMapLayer */ metadata(callback: CallbackHandler, context?: any): this; } /** * Options for MapService - * - * @interface MapServiceOptions - * @extends {ServiceOptions} */ interface MapServiceOptions extends ServiceOptions { } /** - * L.esri.MapService is an abstraction for interacting with Map Services running on ArcGIS Online and ArcGIS Server that allows you to make requests to the API, as well as query and identify published features. - * - * @class MapService - * @extends {Service} + * `L.esri.MapService` is an abstraction for interacting with Map Services running on ArcGIS Online and ArcGIS + * Server that allows you to make requests to the API, as well as query and identify published features. */ class MapService extends Service { constructor(options: MapServiceOptions); /** - * Returns a new L.esri.services.IdentifyFeatures object that can be used to identify features on this layer. Your callback function will be passed a GeoJSON FeatureCollection with the results or an error. - * - * @returns {*} - * @memberof MapService + * Returns a new `L.esri.services.IdentifyFeatures` object that can be used to identify features on this + * layer. Your callback function will be passed a GeoJSON FeatureCollection with the results or an error. */ identify(): IdentifyFeatures; /** - * Returns a new L.esri.services.Find object that can be used to find features. Your callback function will be passed a GeoJSON FeatureCollection with the results or an error. - * - * @returns {*} - * @memberof MapService + * Returns a new `L.esri.services.Find` object that can be used to find features. Your callback function + * will be passed a GeoJSON FeatureCollection with the results or an error. */ find(): Find; /** - * Returns a new L.esri.Query object that can be used to query this service. - * - * @returns {*} - * @memberof MapService + * Returns a new `L.esri.Query` object that can be used to query this service. */ query(): Query; } /** - * L.esri.MapService is an abstraction for interacting with Map Services running on ArcGIS Online and ArcGIS Server that allows you to make requests to the API, as well as query and identify published features. - * - * @param {MapServiceOptions} options - * @returns {MapService} + * `L.esri.MapService` is an abstraction for interacting with Map Services running on ArcGIS Online and ArcGIS + * Server that allows you to make requests to the API, as well as query and identify published features. */ function mapService(options: MapServiceOptions): MapService; /** * Options for Task - * - * @interface TaskOptions - * @extends {ServiceOptions} */ interface TaskOptions extends ServiceOptions { } /** - * L.esri.Task is a generic class that provides the foundation for calling operations on ArcGIS Online and ArcGIS Server Services like query, find and identify. - * - * @class Task - * @extends {L.Class} + * `L.esri.Task` is a generic class that provides the foundation for calling operations on ArcGIS Online and + * ArcGIS Server Services like query, find and identify. */ class Task extends L.Class { constructor(options: TaskOptions | Service); /** - * Makes a request to the associated service. The service's URL will be combined with the path option and parameters will be serialized. Accepts an optional function context for the callback. - * - * @param {string} url - * @param {*} params - * @param {*} callback - * @param {*} context - * @returns {this} - * @memberof Task + * Makes a request to the associated service. The service's URL will be combined with the path option and + * parameters will be serialized. Accepts an optional function context for the callback. */ request(url: string, params?: any, callback?: any, context?: any): this; /** - * Adds a token to this request if the service requires authentication. Will be added automatically if used with a service. - * - * @param {string} token - * @returns {this} - * @memberof Task + * Adds a token to this request if the service requires authentication. Will be added automatically if used + * with a service. */ token(token: string): this; - /** - * - * - * @param {boolean} returnUnformattedValues - * @returns {this} - * @memberof Task - */ format(returnUnformattedValues: boolean): this; } /** - * L.esri.Task is a generic class that provides the foundation for calling operations on ArcGIS Online and ArcGIS Server Services like query, find and identify. - * - * @param {(TaskOptions | Service)} options - * @returns {Task} + * `L.esri.Task` is a generic class that provides the foundation for calling operations on ArcGIS Online and + * ArcGIS Server Services like query, find and identify. */ function task(options: TaskOptions | Service): Task; /** * Options for ImageService - * - * @interface ImageServiceOptions - * @extends {ServiceOptions} */ interface ImageServiceOptions extends ServiceOptions {} /** - * L.esri.ImageService is an abstraction for interacting with Image Services running on ArcGIS Online and ArcGIS Server that allows you to make requests to the API, as well as query and identify features on the service. - * - * @class ImageService - * @extends {Service} + * `L.esri.ImageService` is an abstraction for interacting with Image Services running on ArcGIS Online and + * ArcGIS Server that allows you to make requests to the API, as well as query and identify features on the + * service. */ class ImageService extends Service { constructor(options: ImageServiceOptions); /** - * Returns a new L.esri.Query object that can be used to query this service. - * - * @returns {this} - * @memberof ImageService + * Returns a new `L.esri.Query` object that can be used to query this service. */ query(): Query; } /** - * L.esri.ImageService is an abstraction for interacting with Image Services running on ArcGIS Online and ArcGIS Server that allows you to make requests to the API, as well as query and identify features on the service. - * - * @param {ImageServiceOptions} options - * @returns {ImageService} + * `L.esri.ImageService` is an abstraction for interacting with Image Services running on ArcGIS Online and + * ArcGIS Server that allows you to make requests to the API, as well as query and identify features on the + * service. */ function imageService(options: ImageServiceOptions): ImageService; /** * Options for FeatureLayerService - * - * @interface FeatureLayerServiceOptions - * @extends {ServiceOptions} */ interface FeatureLayerServiceOptions extends ServiceOptions { } /** - * L.esri.FeatureLayerService is an abstraction for interacting with Feature Layers running on ArcGIS Online and ArcGIS Server that allows you to make requests to the API, as well as query, add, update and remove features from the service. - * - * @class FeatureLayerService - * @extends {Service} + * `L.esri.FeatureLayerService` is an abstraction for interacting with Feature Layers running on ArcGIS Online + * and ArcGIS Server that allows you to make requests to the API, as well as query, add, update and remove + * features from the service. */ class FeatureLayerService extends Service { constructor(options: FeatureLayerServiceOptions); /** - * Returns a new L.esri.Query object that can be used to query this layer. - * - * @returns {this} - * @memberof FeatureLayerService + * Returns a new `L.esri.Query` object that can be used to query this layer. */ query(): Query; /** * Adds a new feature to the feature layer. this also adds the feature to the map if creation is successful. - * Requires authentication as a user who has permission to edit the service in ArcGIS Online or the user who created the service. - * Requires the Create capability be enabled on the service. You can check if creation exists by checking the metadata of your service under capabilities. * - * @param {GeoJSONFeature} feature - * @param {ResponseCallbackHandler} [callback] - * @param {*} context - * @returns {this} - * @memberof FeatureLayerService + * Requires authentication as a user who has permission to edit the service in ArcGIS Online or the user + * who created the service. + * + * Requires the Create capability be enabled on the service. You can check if creation exists by checking + * the metadata of your service under capabilities. */ // TODO: GeoJSONFeature addFeature(feature: any, callback?: ResponseCallbackHandler, context?: any): this; /** * Update the provided feature on the Feature Layer. This also updates the feature on the map. - * Requires authentication as a user who has permission to edit the service in ArcGIS Online or the user who created the service. - * Requires the Update capability be enabled on the service. You can check if this operation exists by checking the metadata of your service under capabilities. * - * @param {GeoJSONFeature} feature - * @param {ResponseCallbackHandler} [callback] - * @param {*} context - * @returns {this} - * @memberof FeatureLayerService + * Requires authentication as a user who has permission to edit the service in ArcGIS Online or the user who + * created the service. + * + * Requires the Update capability be enabled on the service. You can check if this operation exists by + * checking the metadata of your service under capabilities. */ // TODO: GeoJSONFeature updateFeature(feature: any, callback?: ResponseCallbackHandler, context?: any): this; /** - * Remove the feature with the provided id from the feature layer. This will also remove the feature from the map if it exists. - * Requires authentication as a user who has permission to edit the service in ArcGIS Online or the user who created the service. - * Requires the Delete capability be enabled on the service. You can check if this operation exists by checking the metadata of your service under capabilities. + * Remove the feature with the provided id from the feature layer. This will also remove the feature from + * the map if it exists. * - * @param {(string | number)} id - * @param {ResponseCallbackHandler} [callback] - * @param {*} context - * @returns {this} - * @memberof FeatureLayerService + * Requires authentication as a user who has permission to edit the service in ArcGIS Online or the user who + * created the service. + * + * Requires the Delete capability be enabled on the service. You can check if this operation exists by + * checking the metadata of your service under capabilities. */ deleteFeature(id: string | number, callback?: ResponseCallbackHandler, context?: any): this; /** - * Removes an array of features with the provided ids from the feature layer. This will also remove the features from the map if they exist. - * Requires authentication as a user who has permission to edit the service in ArcGIS Online or the user who created the service. - * Requires the Delete capability be enabled on the service. You can check if this operation exists by checking the metadata of your service under capabilities. + * Removes an array of features with the provided ids from the feature layer. This will also remove the + * features from the map if they exist. * - * @param {(Array)} ids - * @param {ResponseCallbackHandler} [callback] - * @param {*} context - * @returns {this} - * @memberof FeatureLayerService + * Requires authentication as a user who has permission to edit the service in ArcGIS Online or the user who + * created the service. + * + * Requires the Delete capability be enabled on the service. You can check if this operation exists by + * checking the metadata of your service under capabilities. */ deleteFeatures(ids: string[] | number[], callback?: ResponseCallbackHandler, context?: any): this; } /** - * L.esri.FeatureLayerService is an abstraction for interacting with Feature Layers running on ArcGIS Online and ArcGIS Server that allows you to make requests to the API, as well as query, add, update and remove features from the service. - * - * @param {FeatureLayerServiceOptions} options - * @returns {FeatureLayerService} + * `L.esri.FeatureLayerService` is an abstraction for interacting with Feature Layers running on ArcGIS Online + * and ArcGIS Server that allows you to make requests to the API, as well as query, add, update and remove + * features from the service. */ function featureLayerService(options: FeatureLayerServiceOptions): FeatureLayerService; /** * Options for Query - * - * @interface QueryOptions - * @extends {TaskOptions} */ interface QueryOptions extends TaskOptions { } /** - * L.esri.Query is an abstraction for the query API included in Feature Layers and Image Services. It provides a chainable API for building request parameters and executing queries. - * Note Depending on the type of service you are querying (Feature Layer, Map Service, Image Service) and the version of ArcGIS Server that hosts the service some of these options may not be available. + * `L.esri.Query` is an abstraction for the query API included in Feature Layers and Image Services. It provides + * a chainable API for building request parameters and executing queries. * - * @class Query - * @extends {Task} + * Note Depending on the type of service you are querying (Feature Layer, Map Service, Image Service) and the + * version of ArcGIS Server that hosts the service some of these options may not be available. */ class Query extends Task { constructor(options: QueryOptions); /** - * Queries features from the service within (fully contained by) the passed geometry object. geometry can be an instance of L.Marker, L.Polygon, L.Polyline, L.LatLng, L.LatLngBounds and L.GeoJSON. It can also accept valid GeoJSON Point, Polyline, Polygon objects and GeoJSON Feature objects containing Point, Polyline, Polygon. - * - * @param {Geometry} geometry - * @returns {this} - * @memberof Query + * Queries features from the service within (fully contained by) the passed geometry object. geometry can be + * an instance of `L.Marker`, `L.Polygon`, `L.Polyline`, `L.LatLng`, `L.LatLngBounds` and `L.GeoJSON`. It + * can also accept valid GeoJSON Point, Polyline, Polygon objects and GeoJSON Feature objects containing + * Point, Polyline, Polygon. */ within(geometry: Geometry): this; /** - * Queries features from the service that fully contain the passed geometry object. geometry can be an instance of L.Marker, L.Polygon, L.Polyline, L.LatLng, L.LatLngBounds and L.GeoJSON. It can also accept valid GeoJSON Point, Polyline, Polygon objects and GeoJSON Feature objects containing Point, Polyline, Polygon. - * - * @param {Geometry} geometry - * @returns {this} - * @memberof Query + * Queries features from the service that fully contain the passed geometry object. geometry can be an + * instance of `L.Marker`, `L.Polygon`, `L.Polyline`, `L.LatLng`, `L.LatLngBounds` and `L.GeoJSON`. It can + * also accept valid GeoJSON Point, Polyline, Polygon objects and GeoJSON Feature objects containing Point, + * Polyline, Polygon. */ contains(geometry: Geometry): this; /** - * Queries features from the service that intersect (touch anywhere) the passed geometry object. geometry can be an instance of L.Marker, L.Polygon, L.Polyline, L.LatLng, L.LatLngBounds and L.GeoJSON. It can also accept valid GeoJSON Point, Polyline, Polygon objects and GeoJSON Feature objects containing Point, Polyline, Polygon. - * - * @param {Geometry} geometry - * @returns {this} - * @memberof Query + * Queries features from the service that intersect (touch anywhere) the passed geometry object. geometry + * can be an instance of `L.Marker`, `L.Polygon`, `L.Polyline`, `L.LatLng`, `L.LatLngBounds` and + * `L.GeoJSON`. It can also accept valid GeoJSON Point, Polyline, Polygon objects and GeoJSON Feature + * objects containing Point, Polyline, Polygon. */ intersects(geometry: Geometry): this; /** - * Queries features from the service that have a bounding box that intersects the bounding box of the passed geometry object. geometry can be an instance of L.Marker, L.Polygon, L.Polyline, L.LatLng, L.LatLngBounds and L.GeoJSON. It can also accept valid GeoJSON Point, Polyline, Polygon objects and GeoJSON Feature objects containing Point, Polyline, Polygon. - * - * @param {Geometry} geometry - * @returns {this} - * @memberof Query + * Queries features from the service that have a bounding box that intersects the bounding box of the passed + * geometry object. geometry can be an instance of `L.Marker`, `L.Polygon`, `L.Polyline`, `L.LatLng`, + * `L.LatLngBounds` and `L.GeoJSON`. It can also accept valid GeoJSON Point, Polyline, Polygon objects and + * GeoJSON Feature objects containing Point, Polyline, Polygon. */ bboxIntersects(geometry: Geometry): this; /** - * Queries features from the service that overlap (touch but are not fully contained by) the passed geometry object. geometry can be an instance of L.Marker, L.Polygon, L.Polyline, L.LatLng, L.LatLngBounds and L.GeoJSON. It can also accept valid GeoJSON Point, Polyline, Polygon objects and GeoJSON Feature objects containing Point, Polyline, Polygon. - * - * @param {Geometry} geometry - * @returns {this} - * @memberof Query + * Queries features from the service that overlap (touch but are not fully contained by) the passed geometry + * object. geometry can be an instance of `L.Marker`, `L.Polygon`, `L.Polyline`, `L.LatLng`, + * `L.LatLngBounds` and `L.GeoJSON`. It can also accept valid GeoJSON Point, Polyline, Polygon objects and + * GeoJSON Feature objects containing Point, Polyline, Polygon. */ overlap(geometry: Geometry): this; /** * Queries features a given distance in meters around a LatLng. - * Only available for Feature Layers hosted on ArcGIS Online or ArcGIS Server 10.3 that include the capability supportQueryWithDistance. * - * @param {L.LatLng} latlng - * @param {number} distance - * @returns {this} - * @memberof Query + * Only available for Feature Layers hosted on ArcGIS Online or ArcGIS Server 10.3 that include the + * capability supportQueryWithDistance. */ nearby(latlng: L.LatLng, distance: number): this; /** - * Adds a where clause to the query. String values should be denoted using single quotes ie: query.where("FIELDNAME = 'field value'"); More info about valid SQL can be found here. + * Adds a where clause to the query. String values should be denoted using single quotes ie: * - * @param {string} where - * @returns {this} - * @memberof Query + * `query.where("FIELDNAME = 'field value'");` + * + * More info about valid SQL can be found here. */ where(where: string): this; /** * Define the offset of the results, when combined with limit can be used for paging. - * Only available for Feature Layers hosted on ArcGIS Online or ArcGIS Server 10.3. * - * @param {number} offset - * @returns {this} - * @memberof Query + * Only available for Feature Layers hosted on ArcGIS Online or ArcGIS Server 10.3. */ offset(offset: number): this; /** * Limit the number of results returned by this query, when combined with offset can be used for paging. - * Only available for Feature Layers hosted on ArcGIS Online or ArcGIS Server 10.3. * - * @param {number} limit - * @returns {this} - * @memberof Query + * Only available for Feature Layers hosted on ArcGIS Online or ArcGIS Server 10.3. */ limit(limit: number): this; /** - * Queries features within a given time range. Only available for Layers/Services with timeInfo in their metadata. - * - * @param {Date} from - * @param {Date} to - * @returns {this} - * @memberof Query + * Queries features within a given time range. Only available for Layers/Services with timeInfo in their + * metadata. */ between(from: Date, to: Date): this; /** * An array of associated fields to request for each feature. - * - * @param {(string | Array)} fields - * @returns {this} - * @memberof Query */ fields(fields: string | string[]): this; /** * Return geometry with results. Default is true. - * - * @param {boolean} returnGeometry - * @returns {this} - * @memberof Query */ returnGeometry(returnGeometry: boolean): this; /** - * Simplify the geometries of the output features for the current map view. the factor parameter controls the amount of simplification between 0 (no simplification) and 1 (the most basic shape possible). - * - * @param {L.Map} map - * @param {number} factor - * @returns {this} - * @memberof Query + * Simplify the geometries of the output features for the current map view. the factor parameter controls + * the amount of simplification between 0 (no simplification) and 1 (the most basic shape possible). */ simplify(map: L.Map, factor: number): this; /** - * Sort output features using values from an individual field. "ASC" (ascending) is the default sort order, but "DESC" can be passed as an alternative. This method can be called more than once to apply advanced sorting. - * - * @param {string} fieldName - * @param {string} order - * @returns {this} - * @memberof Query + * Sort output features using values from an individual field. "ASC" (ascending) is the default sort order, + * but "DESC" can be passed as an alternative. This method can be called more than once to apply advanced + * sorting. */ orderBy(fieldName: string, order: string): this; /** * Return only specific feature IDs if they match other query parameters. - * - * @param {Array} ids - * @returns {this} - * @memberof Query */ featureIds(ids: any[]): this; /** * Return only this many decimal points of precision in the output geometries. - * - * @param {number} precision - * @returns {this} - * @memberof Query */ precision(precision: number): this; /** * Used to select which layer inside a Map Service to perform the query on. - * Only available for Map Services. * - * @param {(number | string)} layer - * @returns {this} - * @memberof Query + * Only available for Map Services. */ layer(layer: number | string): this; /** * Override the default pixelSize when querying an Image Service. - * Only available for Image Services. * - * @param {L.Point} point - * @returns {this} - * @memberof Query + * Only available for Image Services. */ pixelSize(point: L.Point): this; /** - * Exectues the query request with the current parameters, features will be passed to callback as a GeoJSON FeatureCollection. Accepts an optional function context. - * - * @param {FeatureCallbackHandler} callback - * @param {*} [context] - * @returns {this} - * @memberof Query + * Executes the query request with the current parameters, features will be passed to callback as a GeoJSON + * FeatureCollection. Accepts an optional function context. */ run(callback: FeatureCallbackHandler, context?: any): this; /** - * Exectues the query request with the current parameters, passing only the number of features matching the query to callback as an Integer. Accepts an optional function context. - * - * @param {FeatureCallbackHandler} callback - * @param {*} [context] - * @returns {this} - * @memberof Query + * Executes the query request with the current parameters, passing only the number of features matching the + * query to callback as an Integer. Accepts an optional function context. */ count(callback: FeatureCallbackHandler, context?: any): this; /** - * Exectues the query request with the current parameters, passing only an array of the feature ids matching the query to callbackcallback. Accepts an optional function context. - * - * @param {FeatureCallbackHandler} callback - * @param {*} [context] - * @returns {this} - * @memberof Query + * Executes the query request with the current parameters, passing only an array of the feature ids matching + * the query to callbackcallback. Accepts an optional function context. */ ids(callback: FeatureCallbackHandler, context?: any): this; /** - * Executes the query request with the current parameters, passing only the LatLngBounds of all features matching the query in the callback. Accepts an optional function context. Only available for Feature Layers hosted on ArcGIS Online or ArcGIS Server 10.3.1. - * - * @param {FeatureCallbackHandler} callback - * @param {*} [context] - * @returns {this} - * @memberof Query + * Executes the query request with the current parameters, passing only the LatLngBounds of all features + * matching the query in the callback. Accepts an optional function context. Only available for Feature + * Layers hosted on ArcGIS Online or ArcGIS Server 10.3.1. */ bounds(callback: FeatureCallbackHandler, context?: any): this; /** * The WKID of a datum transformation for the server to apply when reprojecting output features. - * - * @param {SpatialReferenceExpression} datumTranformation - * @returns {this} - * @memberof Query */ transform(datumTranformation: SpatialReferenceExpression): this; } /** - * L.esri.Query is an abstraction for the query API included in Feature Layers and Image Services. It provides a chainable API for building request parameters and executing queries. - * Note Depending on the type of service you are querying (Feature Layer, Map Service, Image Service) and the version of ArcGIS Server that hosts the service some of these options may not be available. + * `L.esri.Query` is an abstraction for the query API included in Feature Layers and Image Services. It provides + * a chainable API for building request parameters and executing queries. * - * @param {QueryOptions} options - * @returns {Query} + * Note Depending on the type of service you are querying (Feature Layer, Map Service, Image Service) and the + * version of ArcGIS Server that hosts the service some of these options may not be available. */ function query(options: QueryOptions): Query; /** * Options for IdentifyFeatures - * - * @interface IdentifyFeaturesOptions - * @extends {ServiceOptions} */ interface IdentifyFeaturesOptions extends ServiceOptions { } /** - * L.esri.IdentifyFeatures is an abstraction for the Identify API found in Map Services. It provides a chainable API for building request parameters and executing the request. - * - * @class IdentifyFeatures - * @extends {Task} + * `L.esri.IdentifyFeatures` is an abstraction for the Identify API found in Map Services. It provides a + * chainable API for building request parameters and executing the request. */ class IdentifyFeatures extends Task { constructor(options: IdentifyFeaturesOptions | ImageService); /** * The map to identify features on. - * - * @param {L.Map} map - * @returns {this} - * @memberof IdentifyFeatures */ on(map: L.Map): this; /** - * Identifies features at a given LatLng geometry can also be an instance of L.Marker, L.Polygon, L.Polyline, L.LatLngBounds, L.GeoJSON or a valid GeoJSON object literal. - * - * @param {Geometry} geometry - * @returns {this} - * @memberof IdentifyFeatures + * Identifies features at a given LatLng geometry can also be an instance of `L.Marker`, `L.Polygon`, + * `L.Polyline`, `L.LatLngBounds`, `L.GeoJSON` or a valid GeoJSON object literal. */ at(geometry: Geometry): this; /** * Add a layer definition to the query. - * - * @param {number} id - * @param {string} where - * @returns {this} - * @memberof IdentifyFeatures */ layerDef(id: number, where: string): this; /** * Identifies features within a given time range. - * - * @param {Date} from - * @param {Date} to - * @returns {this} - * @memberof IdentifyFeatures */ between(from: Date, to: Date): this; /** - * By default, only the topmost feature will be identified, but it is possible to specify both an alternative strategy and array of individual layers. See the REST API documentation for more information about valid combinations. - * ex: .layers('all:0'). + * By default, only the topmost feature will be identified, but it is possible to specify both an + * alternative strategy and array of individual layers. See the REST API documentation for more information + * about valid combinations. * - * @param {string} layers - * @returns {this} - * @memberof IdentifyFeatures + * ex: `.layers('all:0')`. */ layers(layers: string | string[]): this; /** * Return only this many decimal points of precision in the output geometries. - * - * @param {number} precision - * @returns {this} - * @memberof IdentifyFeatures */ precision(precision: number): this; /** * Buffer the identify area by a given number of screen pixels. - * - * @param {number} precision - * @returns {this} - * @memberof IdentifyFeatures */ tolerance(precision: number): this; /** * Return geometry with results. Default is true. - * - * @param {boolean} returnGeometry - * @returns {this} - * @memberof IdentifyFeatures */ returnGeometry(returnGeometry: boolean): this; /** - * Simplify the geometries of the output features for the current map view. the factor parameter controls the amount of simplification between 0 (no simplification) and 1 (the most basic shape possible). - * - * @param {L.Map} map - * @param {number} factor - * @returns {this} - * @memberof IdentifyFeatures + * Simplify the geometries of the output features for the current map view. the factor parameter controls + * the amount of simplification between `0` (no simplification) and `1` (the most basic shape possible). */ simplify(map: L.Map, factor: number): this; /** - * Executes the identify request with the current parameters, identified features will be passed to callback as a GeoJSON FeatureCollection. Accepts an optional function context - * - * @param {FeatureCallbackHandler} callback - * @param {*} context - * @returns {this} - * @memberof IdentifyFeatures + * Executes the identify request with the current parameters, identified features will be passed to callback + * as a GeoJSON FeatureCollection. Accepts an optional function context */ run(callback: FeatureCallbackHandler, context?: any): this; } /** - * L.esri.IdentifyFeatures is an abstraction for the Identify API found in Map Services. It provides a chainable API for building request parameters and executing the request. - * - * @param {(IdentifyFeaturesOptions | ImageService)} options - * @returns {IdentifyFeatures} + * `L.esri.IdentifyFeatures` is an abstraction for the Identify API found in Map Services. It provides a + * chainable API for building request parameters and executing the request. */ function identifyFeatures(options: IdentifyFeaturesOptions | ImageService): IdentifyFeatures; /** * Options for Find Task - * - * @interface FindOptions - * @extends {ServiceOptions} */ interface FindOptions extends ServiceOptions { } /** - * L.esri.Find is an abstraction for the find API included in Map Services. It provides a chainable API for building request parameters and executing find tasks. - * - * @class Find - * @extends {Task} + * `L.esri.Find` is an abstraction for the find API included in Map Services. It provides a chainable API for + * building request parameters and executing find tasks. */ class Find extends Task { constructor(options: FindOptions | MapService); /** * Text that is searched across the layers and fields the user specifies. - * - * @param {string} text - * @returns {this} - * @memberof Find */ text(text: string): this; /** - * When true find task will search for a value that contains the searchText. When false it will do an exact match on the searchText string. Default is true. - * - * @param {boolean} contains - * @returns {this} - * @memberof Find + * When true find task will search for a value that contains the searchText. When false it will do an exact + * match on the searchText string. Default is true. */ contains(contains: boolean): this; /** * An array or comma-separated list of field names to search. If not specified, all fields are searched. - * - * @param {(string | Array)} fields - * @returns {this} - * @memberof Find */ fields(fields: string | string[]): this; /** * The well known ID (ex. 4326) for the results. - * - * @param {number} sr - * @returns {this} - * @memberof Find */ spatialReference(sr: number): this; /** * Add a layer definition to the find task. - * - * @param {number} id - * @param {string} where - * @returns {this} - * @memberof Find */ layerDef(id: number, where: string): this; /** * Layers to perform find task on. Accepts an array of layer IDs or comma-separated list. - * - * @param {(string | Array)} layers - * @returns {this} - * @memberof Find */ layers(layers: string | string[]): this; /** * Return geometry with results. Default is true. - * - * @param {boolean} returnGeometry - * @returns {this} - * @memberof Find */ returnGeometry(returnGeometry: boolean): this; /** * Specifies the maximum allowable offset to be used for generalizing geometries returned by the find task. - * - * @param {number} maxAllowableOffset - * @returns {this} - * @memberof Find */ maxAllowableOffset(maxAllowableOffset: number): this; /** * Specifies the number of decimal places in returned geometries. - * - * @param {number} precision - * @returns {this} - * @memberof Find */ precision(precision: number): this; /** - * Include Z values in the results. Default value is true. This parameter only applies if returnGeometry=true. - * - * @param {boolean} returnZ - * @returns {this} - * @memberof Find + * Include Z values in the results. Default value is true. This parameter only applies if + * `returnGeometry=true`. */ returnZ(returnZ: boolean): this; /** - * Includes M values if the features have them. Default value is false. This parameter only applies if returnGeometry=true. - * - * @param {boolean} returnM - * @returns {this} - * @memberof Find + * Includes M values if the features have them. Default value is false. This parameter only applies if + * `returnGeometry=true`. */ returnM(returnM: boolean): this; /** - * Property used for adding new layers or modifying the data source of existing ones in the current map service. - * - * @param {*} dynamicLayers - * @returns {this} - * @memberof Find + * Property used for adding new layers or modifying the data source of existing ones in the current map + * service. */ dynamicLayers(dynamicLayers: any): this; /** - * Simplify the geometries of the output features for the current map view. the factor parameter controls the amount of simplification between 0 (no simplification) and 1 (simplify to the most basic shape possible). - * - * @param {L.Map} map - * @param {number} factor - * @returns {this} - * @memberof Find + * Simplify the geometries of the output features for the current map view. the factor parameter controls + * the amount of simplification between `0` (no simplification) and `1` + * (simplify to the most basic shape possible). */ simplify(map: L.Map, factor: number): this; /** - * Exectues the find request with the current parameters, features will be passed to callback as a GeoJSON FeatureCollection. Accepts an optional function context. - * - * @param {FeatureCallbackHandler} callback - * @param {*} [context] - * @returns {this} - * @memberof Find + * Executes the find request with the current parameters, features will be passed to callback as a GeoJSON + * FeatureCollection. Accepts an optional function context. */ run(callback: FeatureCallbackHandler, context?: any): this; } /** - * L.esri.Find is an abstraction for the find API included in Map Services. It provides a chainable API for building request parameters and executing find tasks. - * - * @param {(FindOptions | MapService)} options - * @returns {Find} + * L.esri.Find is an abstraction for the find API included in Map Services. It provides a chainable API for + * building request parameters and executing find tasks. */ function find(options: FindOptions | MapService): Find; } diff --git a/types/estraverse/tslint.json b/types/estraverse/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/estraverse/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/estree/index.d.ts b/types/estree/index.d.ts index 23c5b19f86..068cbfd8ce 100644 --- a/types/estree/index.d.ts +++ b/types/estree/index.d.ts @@ -21,23 +21,28 @@ // but it has the notable advantage of making ESTree much easier to use as // an end user. -interface BaseNode { +interface BaseNodeWithoutComments { // Every leaf interface that extends BaseNode must specify a type property. // The type property should be a string literal. For example, Identifier // has: `type: "Identifier"` - - leadingComments?: Array; - trailingComments?: Array; + type: string; loc?: SourceLocation | null; range?: [number, number]; } + +interface BaseNode extends BaseNodeWithoutComments { + leadingComments?: Array; + trailingComments?: Array; +} + export type Node = Identifier | Literal | Program | Function | SwitchCase | CatchClause | VariableDeclarator | Statement | Expression | Property | AssignmentProperty | Super | TemplateElement | SpreadElement | Pattern | ClassBody | Class | MethodDefinition | ModuleDeclaration | ModuleSpecifier; -export interface Comment { +export interface Comment extends BaseNodeWithoutComments { + type: "Line" | "Block"; value: string; } @@ -74,13 +79,13 @@ interface BaseFunction extends BaseNode { export type Function = FunctionDeclaration | FunctionExpression | ArrowFunctionExpression; - export type Statement = ExpressionStatement | BlockStatement | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | Declaration; + interface BaseStatement extends BaseNode { } export interface EmptyStatement extends BaseStatement { @@ -186,6 +191,7 @@ export interface DebuggerStatement extends BaseStatement { export type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration; + interface BaseDeclaration extends BaseStatement { } export interface FunctionDeclaration extends BaseFunction, BaseDeclaration { @@ -214,6 +220,7 @@ type Expression = CallExpression | NewExpression | SequenceExpression | TemplateLiteral | TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier | AwaitExpression; + export interface BaseExpression extends BaseNode { } export interface ThisExpression extends BaseExpression { @@ -254,7 +261,7 @@ export interface SequenceExpression extends BaseExpression { export interface UnaryExpression extends BaseExpression { type: "UnaryExpression"; operator: UnaryOperator; - prefix: boolean; + prefix: true; argument: Expression; } @@ -317,6 +324,7 @@ export interface MemberExpression extends BaseExpression, BasePattern { export type Pattern = Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression; + interface BasePattern extends BaseNode { } export interface SwitchCase extends BaseNode { @@ -341,17 +349,17 @@ export type Literal = SimpleLiteral | RegExpLiteral; export interface SimpleLiteral extends BaseNode, BaseExpression { type: "Literal"; value: string | boolean | number | null; - raw: string; + raw?: string; } export interface RegExpLiteral extends BaseNode, BaseExpression { type: "Literal"; - value: RegExp; + value?: RegExp | null; regex: { pattern: string; flags: string; }; - raw: string; + raw?: string; } export type UnaryOperator = diff --git a/types/estree/tslint.json b/types/estree/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/estree/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/evaporate/tslint.json b/types/evaporate/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/evaporate/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/event-kit/.editorconfig b/types/event-kit/.editorconfig deleted file mode 100644 index 2b997514d2..0000000000 --- a/types/event-kit/.editorconfig +++ /dev/null @@ -1,3 +0,0 @@ -[*.ts] -indent_style = tab -indent_size = 2 diff --git a/types/event-kit/README.md b/types/event-kit/README.md deleted file mode 100644 index 90835ef13e..0000000000 --- a/types/event-kit/README.md +++ /dev/null @@ -1,22 +0,0 @@ -## Event Kit Type Definitions - -TypeScript type definitions for [event-kit](https://github.com/atom/event-kit), which is published [under the same name](https://www.npmjs.com/package/event-kit) on NPM. - -### Usage Notes - -#### Exports - -The three classes exported from this module are: [CompositeDisposable](https://github.com/atom/event-kit/blob/master/src/composite-disposable.coffee), [Disposable](https://github.com/atom/event-kit/blob/master/src/disposable.coffee), and [Emitter](https://github.com/atom/event-kit/blob/master/src/emitter.coffee). - -```ts -import { CompositeDisposable, Disposable, Emitter } from "event-kit"; -let subscriptions = new CompositeDisposable(); -``` - -#### The EventKit Namespace - -All types used by "event-kit" can be referenced from the EventKit namespace. - -```ts -function example(disposable: EventKit.DisposableLike) {} -``` diff --git a/types/event-kit/event-kit-tests.ts b/types/event-kit/event-kit-tests.ts index 41fa6ba22a..8ff96d66e8 100644 --- a/types/event-kit/event-kit-tests.ts +++ b/types/event-kit/event-kit-tests.ts @@ -1,34 +1,34 @@ import { Disposable, CompositeDisposable, Emitter } from "event-kit"; declare let bool: boolean; -declare let subscription: EventKit.Disposable; -declare let subscriptions: EventKit.CompositeDisposable; -declare let emitter: EventKit.Emitter; +declare let subscription: Disposable; +declare let subscriptions: CompositeDisposable; +declare let emitter: Emitter; // NPM Usage Tests ============================================================ class User { - private readonly emitter: EventKit.Emitter; - name: string; + private readonly emitter: Emitter; + name: string; - constructor() { - this.emitter = new Emitter(); - } + constructor() { + this.emitter = new Emitter(); + } - onDidChangeName(callback: (value: any) => void) { - return this.emitter.on("did-change-name", callback); - } + onDidChangeName(callback: (value: string) => void) { + return this.emitter.on("did-change-name", callback); + } - setName(name: string) { - if (name !== this.name) { - this.name = name; - this.emitter.emit("did-change-name", name); - } - return name; - } + setName(name: string) { + if (name !== this.name) { + this.name = name; + this.emitter.emit("did-change-name", name); + } + return name; + } - destroy() { - this.emitter.dispose(); - } + destroy() { + this.emitter.dispose(); + } } const user = new User(); @@ -55,8 +55,8 @@ subscriptions.dispose(); // Managing Disposables subscriptions.add(subscription); subscriptions.add( - subscription, - { dispose() {} } + subscription, + { dispose() {} } ); subscriptions.remove(subscription); @@ -81,3 +81,8 @@ subscription = emitter.preempt("test-event", value => {}); // Event Emission emitter.emit("test-event"); emitter.emit("test-event", 42); + +async function testEmitAsync() { + await emitter.emitAsync("test-event"); + await emitter.emitAsync("test-event", 42); +} diff --git a/types/event-kit/index.d.ts b/types/event-kit/index.d.ts index 8ce9bd8fbe..01b68e8f26 100644 --- a/types/event-kit/index.d.ts +++ b/types/event-kit/index.d.ts @@ -4,123 +4,119 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -declare global { - namespace EventKit { - /** The static side to each exported class. Should generally only be used internally. */ - namespace Statics { - /* tslint:disable:no-unnecessary-qualifier */ - /** The static side to the Disposable class. */ - interface Disposable { - /** Ensure that Object correctly implements the Disposable contract. */ - isDisposable(object: object): boolean; - - /** Construct a Disposable. */ - new (disposableAction?: () => void): EventKit.Disposable; - } - - /** The static side to the CompositeDisposable class. */ - interface CompositeDisposable { - /** Construct an instance, optionally with one or more disposables. */ - new (...disposables: DisposableLike[]): EventKit.CompositeDisposable; - } - - /** The static side to the Emitter class. */ - interface Emitter { - /** Construct an emitter. */ - new (): EventKit.Emitter; - } - /* tslint:enable:no-unnecessary-qualifier */ - } - - interface DisposableLike { - dispose(): void; - } - - /** A handle to a resource that can be disposed. */ - interface Disposable extends DisposableLike { - disposed: boolean; - - /** A callback which will be called within dispose(). */ - disposalAction?(): void; - - /** Perform the disposal action, indicating that the resource associated - * with this disposable is no longer needed. - */ - dispose(): void; - } - - /** An object that aggregates multiple Disposable instances together into a - * single disposable, so they can all be disposed as a group. - */ - interface CompositeDisposable extends DisposableLike { - disposed: boolean; - - /** Dispose all disposables added to this composite disposable. - * If this object has already been disposed, this method has no effect. - */ - dispose(): void; - - // Managing Disposables - /** Add disposables to be disposed when the composite is disposed. - * If this object has already been disposed, this method has no effect. - */ - add(...disposables: DisposableLike[]): void; - - /** Remove a previously added disposable. */ - remove(disposable: DisposableLike): void; - - /** Alias to CompositeDisposable::remove. */ - delete(disposable: DisposableLike): void; - - /** Clear all disposables. They will not be disposed by the next call to - * dispose. - */ - clear(): void; - } - - /** Utility class to be used when implementing event-based APIs that allows - * for handlers registered via ::on to be invoked with calls to ::emit. - */ - interface Emitter extends DisposableLike { - disposed: boolean; - - /** Clear out any existing subscribers. */ - clear(): void; - - /** Unsubscribe all handlers. */ - dispose(): boolean; - - // Event Subscription - /** Registers a handler to be invoked whenever the given event is emitted. */ - on(eventName: string, handler: (value: any) => void): Disposable; - - /** Register the given handler function to be invoked the next time an event - * with the given name is emitted via ::emit. - */ - once(eventName: string, handler: (value: any) => void): Disposable; - - /** Register the given handler function to be invoked before all other - * handlers existing at the time of subscription whenever events by the - * given name are emitted via ::emit. - */ - preempt(eventName: string, handler: (value: any) => void): Disposable; - - // Event Emission - /** Invoke handlers registered via ::on for the given event name. */ - emit(eventName: string, value?: any): void; - } - } +export interface DisposableLike { + dispose(): void; } /** A handle to a resource that can be disposed. */ -export const Disposable: EventKit.Statics.Disposable; +export class Disposable implements DisposableLike { + disposed: boolean; -/** An object that aggregates multiple Disposable instances together into a + /** Ensure that Object correctly implements the Disposable contract. */ + static isDisposable(object: object): boolean; + + /** Construct a Disposable. */ + constructor(disposableAction?: () => void); + + /** A callback which will be called within dispose(). */ + disposalAction?: () => void; + + /** + * Perform the disposal action, indicating that the resource associated + * with this disposable is no longer needed. + */ + dispose(): void; +} + +/** + * An object that aggregates multiple Disposable instances together into a * single disposable, so they can all be disposed as a group. */ -export const CompositeDisposable: EventKit.Statics.CompositeDisposable; +export class CompositeDisposable implements DisposableLike { + disposed: boolean; -/** Utility class to be used when implementing event-based APIs that allows + /** Construct an instance, optionally with one or more disposables. */ + constructor(...disposables: DisposableLike[]); + + /** + * Dispose all disposables added to this composite disposable. + * If this object has already been disposed, this method has no effect. + */ + dispose(): void; + + // Managing Disposables + /** + * Add disposables to be disposed when the composite is disposed. + * If this object has already been disposed, this method has no effect. + */ + add(...disposables: DisposableLike[]): void; + + /** Remove a previously added disposable. */ + remove(disposable: DisposableLike): void; + + /** Alias to CompositeDisposable::remove. */ + delete(disposable: DisposableLike): void; + + /** + * Clear all disposables. They will not be disposed by the next call to + * dispose. + */ + clear(): void; +} + +/** + * Allows you to strongly type event emissions across your codebase. Additional + * key:value pairings merged into this interface will result in emissions under + * the value of each key being templated by the type of the associated value. + */ +export interface Emissions { + // tslint:disable-next-line:no-any + [key: string]: any; +} + +/** + * Utility class to be used when implementing event-based APIs that allows * for handlers registered via ::on to be invoked with calls to ::emit. */ -export const Emitter: EventKit.Statics.Emitter; +export class Emitter implements DisposableLike { + disposed: boolean; + + /** Construct an emitter. */ + constructor(); + + /** Clear out any existing subscribers. */ + clear(): void; + + /** Unsubscribe all handlers. */ + dispose(): boolean; + + // Event Subscription + /** Registers a handler to be invoked whenever the given event is emitted. */ + on(eventName: T, handler: (value?: Emissions[T]) => void): + Disposable; + + /** + * Register the given handler function to be invoked the next time an event + * with the given name is emitted via ::emit. + */ + once(eventName: T, handler: (value?: Emissions[T]) => void): + Disposable; + + /** + * Register the given handler function to be invoked before all other + * handlers existing at the time of subscription whenever events by the + * given name are emitted via ::emit. + */ + preempt(eventName: T, handler: (value?: Emissions[T]) => void): + Disposable; + + // Event Emission + /** Invoke the handlers registered via ::on for the given event name. */ + emit(eventName: T, value?: Emissions[T]): void; + + /** + * Asynchronously invoke the handlers registered via ::on for the given event name. + * @return A promise that will be fulfilled once all handlers have been invoked. + */ + emitAsync(eventName: T, value?: Emissions[T]): Promise; +} diff --git a/types/event-kit/tsconfig.json b/types/event-kit/tsconfig.json index 0097bf6ba3..0b6a81c5f8 100644 --- a/types/event-kit/tsconfig.json +++ b/types/event-kit/tsconfig.json @@ -8,7 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -21,4 +21,4 @@ "index.d.ts", "event-kit-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/event-kit/tslint.json b/types/event-kit/tslint.json index 10fd9f0654..e0508241c7 100644 --- a/types/event-kit/tslint.json +++ b/types/event-kit/tslint.json @@ -1,38 +1,8 @@ { "extends": "dtslint/dt.json", "rules": { - // Custom rules. - "class-name": true, - "indent": [true, "tabs"], - "jsdoc-format": true, - "linebreak-style": [true, "LF"], + "indent": [true, "spaces", 4], "max-line-length": [true, 100], - "no-any": false, - "quotemark": [true, "double", "avoid-escape"], - "trailing-comma": [true, { - "multiline": { "objects": "always", "arrays": "always", "functions": "never" }, - "singleline": { "objects": "never", "arrays": "never", "functions": "never" } - }], - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-module", - "check-separator", - "check-type", - "check-typecast", - "check-rest-spread", - "check-preblock" - ], - // Soon to be defaults. - "arrow-return-shorthand": [true, "multiline"], - "no-floating-promises": true, - "no-unbound-method": true, - "no-unsafe-any": true, - "number-literal-format": true, - "restrict-plus-operands": true, - "return-undefined": true, - "switch-final-break": true + "no-any": true } } diff --git a/types/event-kit/v1/.editorconfig b/types/event-kit/v1/.editorconfig deleted file mode 100644 index 570211f898..0000000000 --- a/types/event-kit/v1/.editorconfig +++ /dev/null @@ -1,3 +0,0 @@ -[*.ts] -indent_style = tab -indent_size = 4 diff --git a/types/event-kit/v1/event-kit-tests.ts b/types/event-kit/v1/event-kit-tests.ts deleted file mode 100644 index 4b4a0d4e7c..0000000000 --- a/types/event-kit/v1/event-kit-tests.ts +++ /dev/null @@ -1,57 +0,0 @@ - - -import { Disposable, CompositeDisposable, Emitter } from "event-kit"; - -// Emitter - -class User { - private emitter: Emitter; - name: string; - - constructor() { - this.emitter = new Emitter(); - } - - onDidChangeName(callback: (name: string) => void): Disposable { - return this.emitter.on('did-change-name', callback); - } - - setName(name: string): void { - if (this.name != name) { - this.name = name; - this.emitter.emit('did-change-name', name); - } - } - - destroy(): void { - this.emitter.clear(); - this.emitter.dispose(); - } -} - -// Disposable - -var disposable = new Disposable(() => { - // cleanup -}); -disposable.dispose(); - -var user = new User(); -var subscription = user.onDidChangeName((name: string) => { - console.log('User name change to: ' + name); -}); -if(Disposable.isDisposable(subscription)) {} -subscription.dispose(); - -// CompositeDisposable - -var subscriptions = new CompositeDisposable(); -subscriptions.add( - user.onDidChangeName((name: string) => { - console.log('subscriber #1'); - }), - user.onDidChangeName((name: string) => { - console.log('subscriber #2'); - }) -); -subscriptions.dispose(); diff --git a/types/event-kit/v1/index.d.ts b/types/event-kit/v1/index.d.ts deleted file mode 100644 index 74f270c40f..0000000000 --- a/types/event-kit/v1/index.d.ts +++ /dev/null @@ -1,91 +0,0 @@ -// Type definitions for event-kit v1.2.0 -// Project: https://github.com/atom/event-kit -// Definitions by: Vadim Macagon -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export = AtomEventKit; - -declare namespace AtomEventKit { - interface IDisposable { - dispose(): void; - } - - /** Static side of the Disposable class. */ - interface DisposableStatic { - prototype: Disposable; - new (disposalAction: Function): Disposable; - /** - * Ensure that Object correctly implements the Disposable. - */ - isDisposable(object: Object): boolean; - } - - /** Instance side of the Disposable class. */ - interface Disposable extends IDisposable { - disposed: boolean; - - constructor: DisposableStatic; - } - - /** A class that represent a handle to a resource that can be disposed. */ - var Disposable: DisposableStatic; - - /** Static side of the CompositeDisposable class. */ - interface CompositeDisposableStatic { - prototype: CompositeDisposable; - new (...disposables: IDisposable[]): CompositeDisposable; - } - - /** Instance side of the CompositeDisposable class. */ - interface CompositeDisposable extends IDisposable { - disposed: boolean; - - constructor: CompositeDisposableStatic; - add(...disposables: IDisposable[]): void; - remove(disposable: IDisposable): void; - clear(): void; - } - - /** - * A class that aggregates multiple [[Disposable]] instances together into a single disposable, - * so that they can all be disposed as a group. - */ - var CompositeDisposable: CompositeDisposableStatic; - - /** Static side of the Emitter class. */ - interface EmitterStatic { - prototype: Emitter; - new (): Emitter; - } - - /** Instance side of the Emitter class. */ - interface Emitter { - isDisposed: boolean; - - constructor: EmitterStatic; - /** - * Clear out any existing subscribers. - */ - clear(): void; - /** - * Unsubscribe all handlers. - */ - dispose(): void; - /** - * Registers a handler to be invoked whenever the given event is emitted. - * @return An object that will unregister the handler when disposed. - */ - on(eventName: string, handler: (value: any) => void, unshift?: boolean): Disposable; - /** - * Registers a handler to be invoked *before* all previously registered handlers for - * the given event. - * @return An object that will unregister the handler when disposed. - */ - preempt(eventName: string, handler: (value: any) => void): Disposable; - /** Invokes any registered handlers for the given event. */ - emit(eventName: string, value: any): void; - } - - /** A utility class for implementing event-based APIs. */ - var Emitter: EmitterStatic; -} diff --git a/types/event-loop-lag/tslint.json b/types/event-loop-lag/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/event-loop-lag/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/event-stream/event-stream-tests.ts b/types/event-stream/event-stream-tests.ts index cdb541b382..38525be696 100644 --- a/types/event-stream/event-stream-tests.ts +++ b/types/event-stream/event-stream-tests.ts @@ -1,18 +1,14 @@ - - - import gulp = require("gulp"); import * as es from "event-stream"; gulp.task("es:concat", () => { - var streams = gulp.src(["*"]) + var streams = gulp.src(["*"]) .pipe(gulp.dest("build")); - + return es.concat.apply(null, streams); }); gulp.task("es:readArray ", () => { var reader = es.readArray([1, 2, 3]); - }); diff --git a/types/event-stream/tsconfig.json b/types/event-stream/tsconfig.json index 93e6b0c016..6f3624e82f 100644 --- a/types/event-stream/tsconfig.json +++ b/types/event-stream/tsconfig.json @@ -12,11 +12,6 @@ "typeRoots": [ "../" ], - "paths": { - "q": [ - "q/v0" - ] - }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/event-stream/tslint.json b/types/event-stream/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/event-stream/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/event-to-promise/tslint.json b/types/event-to-promise/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/event-to-promise/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/evernote/tslint.json b/types/evernote/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/evernote/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/execa/index.d.ts b/types/execa/index.d.ts index c74c60672d..ee33bea59e 100644 --- a/types/execa/index.d.ts +++ b/types/execa/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for execa 0.7 +// Type definitions for execa 0.8 // Project: https://github.com/sindresorhus/execa#readme // Definitions by: Douglas Duteil // BendingBender +// Borek Bernard // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -10,46 +11,46 @@ import { ChildProcess, ExecOptions, SpawnOptions, SpawnSyncOptions } from "child_process"; import { Stream } from 'stream'; -type StdIOOption = 'pipe' | 'ipc' | 'ignore' | number | Stream | undefined | null; - -interface ExecaOptions { - input: string | Buffer | Stream; - preferLocal: boolean; - stripEof: boolean; - extendEnv: boolean; - argv0: string; - localDir: string; - reject: boolean; - cleanup: boolean; - stdin: StdIOOption; - stdout: StdIOOption; - stderr: StdIOOption; -} - -type Options = SpawnOptions & ExecaOptions & ExecOptions; -type SyncOptions = SpawnSyncOptions & ExecaOptions & ExecOptions; - -interface ExecaReturns { - cmd: string; - code: number; - failed: boolean; - killed: boolean; - signal: string | null; - stderr: string; - stdout: string; - timedOut: boolean; -} - -type ExecaError = Error & ExecaReturns; - -interface ExecaChildPromise { - catch(onrejected?: ((reason: ExecaError) => TResult | PromiseLike) | undefined | null): Promise; -} -type ExecaChildProcess = ChildProcess & ExecaChildPromise & Promise; - -declare function execa(file: string, options?: Partial): ExecaChildProcess; -declare function execa(file: string, args?: string[], options?: Partial): ExecaChildProcess; +declare function execa(file: string, options?: Partial): execa.ExecaChildProcess; +declare function execa(file: string, args?: string[], options?: Partial): execa.ExecaChildProcess; declare namespace execa { + type StdIOOption = 'pipe' | 'ipc' | 'ignore' | number | Stream | undefined | null; + + interface ExecaOptions { + input: string | Buffer | Stream; + preferLocal: boolean; + stripEof: boolean; + extendEnv: boolean; + argv0: string; + localDir: string; + reject: boolean; + cleanup: boolean; + stdin: StdIOOption; + stdout: StdIOOption; + stderr: StdIOOption; + } + + type Options = SpawnOptions & ExecaOptions & ExecOptions; + type SyncOptions = SpawnSyncOptions & ExecaOptions & ExecOptions; + + interface ExecaReturns { + cmd: string; + code: number; + failed: boolean; + killed: boolean; + signal: string | null; + stderr: string; + stdout: string; + timedOut: boolean; + } + + type ExecaError = Error & ExecaReturns; + + interface ExecaChildPromise { + catch(onrejected?: ((reason: ExecaError) => TResult | PromiseLike) | null): Promise; + } + type ExecaChildProcess = ChildProcess & ExecaChildPromise & Promise; + function stdout(file: string, options?: Partial): Promise; function stdout(file: string, args?: string[], options?: Partial): Promise; function stderr(file: string, options?: Partial): Promise; diff --git a/types/exit/tslint.json b/types/exit/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/exit/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/exorcist/tslint.json b/types/exorcist/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/exorcist/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/expect.js/tslint.json b/types/expect.js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/expect.js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/expectations/tslint.json b/types/expectations/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/expectations/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/express-brute-memcached/index.d.ts b/types/express-brute-memcached/index.d.ts index dd7f2d2573..ca8cccda4d 100644 --- a/types/express-brute-memcached/index.d.ts +++ b/types/express-brute-memcached/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/AdamPflug/express-brute-memcached // Definitions by: Cyril Schumacher // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /** * @summary Memcached options. diff --git a/types/express-brute-memcached/tslint.json b/types/express-brute-memcached/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/express-brute-memcached/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/express-brute-mongo/index.d.ts b/types/express-brute-mongo/index.d.ts index 56af09a099..0b637ed37b 100644 --- a/types/express-brute-mongo/index.d.ts +++ b/types/express-brute-mongo/index.d.ts @@ -8,15 +8,8 @@ import { Collection } from "mongodb"; /** * @summary MongoDB store adapter. - * @class */ declare class MongoStore { - /** - * @summary Constructor. - * @constructor - * @param {Function} getCollection The collection. - * @param {Object} options The otpions. - */ constructor(getCollection: (collection: (c: Collection) => void) => void, options?: Object); } export = MongoStore; diff --git a/types/express-brute-mongo/tslint.json b/types/express-brute-mongo/tslint.json index c0ad422b87..81e3db2614 100644 --- a/types/express-brute-mongo/tslint.json +++ b/types/express-brute-mongo/tslint.json @@ -1,8 +1,9 @@ { "extends": "dtslint/dt.json", "rules": { - // TODO + // TODOs "ban-types": false, - "dt-header": false + "dt-header": false, + "no-unnecessary-class": false } } diff --git a/types/express-brute-redis/index.d.ts b/types/express-brute-redis/index.d.ts index ea720c4c85..a03c589123 100644 --- a/types/express-brute-redis/index.d.ts +++ b/types/express-brute-redis/index.d.ts @@ -2,12 +2,12 @@ // Project: https://github.com/AdamPflug/express-brute-redis // Definitions by: Scott Harwell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import { ClientOpts } from "redis"; /** * @summary Redis store for Express Brute - * @class */ declare class express_brute_redis { /** @@ -23,24 +23,16 @@ declare class express_brute_redis { /** * @summary Sets a key in Redis storage. - * @param key - * @param value - * @param lifetime - * @param callback */ set(key: string, value: string, lifetime?: number, callback?: (sender: express_brute_redis) => void): void; /** * @summary Gets a key in Redis storage. - * @param key - * @param callback */ get(key: string, callback?: (err: Error, data: any) => void): void; /** * @summary Resets a key in Redis storage. - * @param key - * @param callback */ reset(key: string, callback?: (err: Error, data: any) => void, ...args: any[]): void; } diff --git a/types/express-brute/index.d.ts b/types/express-brute/index.d.ts index d948eb7bf6..b7961ea597 100644 --- a/types/express-brute/index.d.ts +++ b/types/express-brute/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/AdamPflug/express-brute // Definitions by: Cyril Schumacher // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/express-brute/tslint.json b/types/express-brute/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/express-brute/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/express-cluster/express-cluster-tests.ts b/types/express-cluster/express-cluster-tests.ts new file mode 100644 index 0000000000..4eb096ffd6 --- /dev/null +++ b/types/express-cluster/express-cluster-tests.ts @@ -0,0 +1,6 @@ +import cluster = require('express-cluster'); + +() => { + cluster(worker => {}, {count: 5}); + cluster({count: 5}, worker => {}); +}; diff --git a/types/express-cluster/index.d.ts b/types/express-cluster/index.d.ts new file mode 100644 index 0000000000..bee845d02e --- /dev/null +++ b/types/express-cluster/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for express-cluster 0.0 +// Project: https://github.com/Flipboard/express-cluster +// Definitions by: Miloslav Nenadál +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import cluster = require('cluster'); + +interface Config { + count?: number; + respawn?: boolean; + verbose?: boolean; + workerListener?(): void; + outputStream?: NodeJS.WritableStream; +} + +type WorkerFunction = (worker: cluster.Worker) => void; + +interface Cluster { + (fn: WorkerFunction, config: Config): void; + (config: Config, fn: WorkerFunction): void; +} + +declare const c: Cluster; +export = c; diff --git a/types/express-cluster/tsconfig.json b/types/express-cluster/tsconfig.json new file mode 100644 index 0000000000..5d27d3ec2e --- /dev/null +++ b/types/express-cluster/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", + "express-cluster-tests.ts" + ] +} \ No newline at end of file diff --git a/types/express-cluster/tslint.json b/types/express-cluster/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/express-cluster/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/express-debug/index.d.ts b/types/express-debug/index.d.ts index b5cfb43c97..b897e9bd07 100644 --- a/types/express-debug/index.d.ts +++ b/types/express-debug/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/devoidfury/express-debug // Definitions by: Federico Bond // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /* =================== USAGE =================== diff --git a/types/express-debug/tslint.json b/types/express-debug/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/express-debug/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/express-domain-middleware/index.d.ts b/types/express-domain-middleware/index.d.ts index 935f315dd4..7b4df930de 100644 --- a/types/express-domain-middleware/index.d.ts +++ b/types/express-domain-middleware/index.d.ts @@ -2,6 +2,7 @@ // Project: https://www.npmjs.com/package/express-domain-middleware // Definitions by: Hookclaw // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// diff --git a/types/express-domain-middleware/tslint.json b/types/express-domain-middleware/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/express-domain-middleware/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/express-ejs-layouts/express-ejs-layouts-tests.ts b/types/express-ejs-layouts/express-ejs-layouts-tests.ts new file mode 100644 index 0000000000..9d77105a9d --- /dev/null +++ b/types/express-ejs-layouts/express-ejs-layouts-tests.ts @@ -0,0 +1,7 @@ +import * as express from 'express'; +import * as expressEjsLayouts from 'express-ejs-layouts'; + +function expressRequestHandlerTest() { + const app = express() + .use(expressEjsLayouts()); +} diff --git a/types/express-ejs-layouts/index.d.ts b/types/express-ejs-layouts/index.d.ts new file mode 100644 index 0000000000..958cd158e2 --- /dev/null +++ b/types/express-ejs-layouts/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for express-ejs-layouts 2.3 +// Project: https://github.com/Soarez/express-ejs-layouts +// Definitions by: Erik Mavrinac +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +import { RequestHandler } from 'express'; + +declare function expressEjsLayouts(): RequestHandler; + +declare namespace expressEjsLayouts { +} + +export = expressEjsLayouts; diff --git a/types/express-ejs-layouts/tsconfig.json b/types/express-ejs-layouts/tsconfig.json new file mode 100644 index 0000000000..7ade9f8819 --- /dev/null +++ b/types/express-ejs-layouts/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", + "express-ejs-layouts-tests.ts" + ] +} diff --git a/types/express-ejs-layouts/tslint.json b/types/express-ejs-layouts/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/express-ejs-layouts/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/express-enforces-ssl/index.d.ts b/types/express-enforces-ssl/index.d.ts index f4c1d424a4..271485b61c 100644 --- a/types/express-enforces-ssl/index.d.ts +++ b/types/express-enforces-ssl/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/aredo/express-enforces-ssl // Definitions by: Kevin Stubbs // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import { Request, Response, NextFunction } from 'express'; diff --git a/types/express-flash-2/index.d.ts b/types/express-flash-2/index.d.ts index 06c1bc6591..42ace71f78 100644 --- a/types/express-flash-2/index.d.ts +++ b/types/express-flash-2/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/jack2gs/express-flash-2 // Definitions by: Matheus Salmi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 import express = require('express'); diff --git a/types/express-formidable/express-formidable-tests.ts b/types/express-formidable/express-formidable-tests.ts index 91f9e34519..f508f0be95 100644 --- a/types/express-formidable/express-formidable-tests.ts +++ b/types/express-formidable/express-formidable-tests.ts @@ -3,7 +3,12 @@ import expform = require("express-formidable"); const app = express(); -app.use("/form1", expform()); +app.use("/form1", expform(), (req, res, next) => { + console.log(req.fields); + console.log(req.files); + next(); +}); + app.use("/form2", expform({ encoding: "utf-8", uploadDir: "./uploads", diff --git a/types/express-formidable/index.d.ts b/types/express-formidable/index.d.ts index 57342521c2..75a34d0350 100644 --- a/types/express-formidable/index.d.ts +++ b/types/express-formidable/index.d.ts @@ -1,9 +1,21 @@ -// Type definitions for express-formidable 1.0.0 +// Type definitions for express-formidable 1.0 // Project: https://github.com/noraesae/express-formidable -// Definitions by: Torkild Dyvik Olsen +// Definitions by: Torkild Dyvik Olsen , Evan Shortiss // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 -import { RequestHandler } from "express"; +import * as express from "express"; +import { Fields, Files } from "formidable"; + +// Extend the express request object with attached formidable files and fields +declare global { + namespace Express { + interface Request { + fields?: Fields; + files?: Files; + } + } +} interface ExpressFormidableOptions { encoding?: string; @@ -16,6 +28,8 @@ interface ExpressFormidableOptions { multiples?: boolean; } -declare function ExpressFormidable(options?: ExpressFormidableOptions): RequestHandler; +declare function ExpressFormidable(options?: ExpressFormidableOptions): express.RequestHandler; + +declare namespace ExpressFormidable {} export = ExpressFormidable; diff --git a/types/express-formidable/tsconfig.json b/types/express-formidable/tsconfig.json index 9deeebd96f..45a7b6c12b 100644 --- a/types/express-formidable/tsconfig.json +++ b/types/express-formidable/tsconfig.json @@ -20,4 +20,4 @@ "index.d.ts", "express-formidable-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/express-formidable/tslint.json b/types/express-formidable/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/express-formidable/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} diff --git a/types/express-graphql/index.d.ts b/types/express-graphql/index.d.ts index 077e3ab736..82f988a506 100644 --- a/types/express-graphql/index.d.ts +++ b/types/express-graphql/index.d.ts @@ -4,6 +4,7 @@ // Nitin Tutlani // Daniel Fader // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import { Request, Response } from "express"; diff --git a/types/express-graphql/tslint.json b/types/express-graphql/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/express-graphql/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/express-handlebars/index.d.ts b/types/express-handlebars/index.d.ts index 3f11234d46..2c718e08b8 100644 --- a/types/express-handlebars/index.d.ts +++ b/types/express-handlebars/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/ericf/express-handlebars // Definitions by: Sam Saint-Pettersen , Igor Dultsev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 interface PartialTemplateOptions { cache?: boolean; diff --git a/types/express-handlebars/tslint.json b/types/express-handlebars/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/express-handlebars/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/express-jwt/index.d.ts b/types/express-jwt/index.d.ts index 300e20a311..de0a2dd337 100644 --- a/types/express-jwt/index.d.ts +++ b/types/express-jwt/index.d.ts @@ -2,6 +2,7 @@ // Project: https://www.npmjs.org/package/express-jwt // Definitions by: Wonshik Kim , Kacper Polak , Sl1MBoy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import express = require('express'); import unless = require('express-unless'); diff --git a/types/express-jwt/tslint.json b/types/express-jwt/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/express-jwt/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/express-less/index.d.ts b/types/express-less/index.d.ts index c414e759f7..4a4accaa51 100644 --- a/types/express-less/index.d.ts +++ b/types/express-less/index.d.ts @@ -2,6 +2,7 @@ // Project: https://www.npmjs.com/package/express-less // Definitions by: xyb // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 diff --git a/types/express-less/tslint.json b/types/express-less/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/express-less/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/express-minify/index.d.ts b/types/express-minify/index.d.ts index c4fe760c58..f3c02b4acd 100644 --- a/types/express-minify/index.d.ts +++ b/types/express-minify/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/SummerWish/express-minify // Definitions by: Borislav Zhivkov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// /// diff --git a/types/express-minify/tslint.json b/types/express-minify/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/express-minify/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/express-mongo-sanitize/express-mongo-sanitize-tests.ts b/types/express-mongo-sanitize/express-mongo-sanitize-tests.ts new file mode 100644 index 0000000000..21a5028b27 --- /dev/null +++ b/types/express-mongo-sanitize/express-mongo-sanitize-tests.ts @@ -0,0 +1,26 @@ +import * as express from 'express'; +import * as mongoSanitize from 'express-mongo-sanitize'; + +const app: express.Express = express(); + +app.use(mongoSanitize()); + +app.use(mongoSanitize({ + replaceWith: '_' +})); + +interface TestPayload { + foo: string; +} + +const testPayload: TestPayload = { + foo: 'bar' +}; + +const sanitize1: TestPayload = mongoSanitize.sanitize(testPayload); + +const sanitize2: TestPayload = mongoSanitize.sanitize(testPayload, { + replaceWith: '_' +}); + +const isCorrect: boolean = mongoSanitize.has(testPayload); diff --git a/types/express-mongo-sanitize/index.d.ts b/types/express-mongo-sanitize/index.d.ts new file mode 100644 index 0000000000..c7c76d32c5 --- /dev/null +++ b/types/express-mongo-sanitize/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for express-mongo-sanitize 1.3 +// Project: https://github.com/fiznool/express-mongo-sanitize#readme +// Definitions by: Eric Byers +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import express = require('express'); + +interface MongoSanitizeOptions { + replaceWith: any; +} + +declare namespace expressMongoSanitize { + function sanitize(payload: T, options?: MongoSanitizeOptions): T; + function has(payload: any): boolean; +} + +declare function expressMongoSanitize(options?: MongoSanitizeOptions): (req: express.Request, res: express.Response, next: express.NextFunction) => void; + +export = expressMongoSanitize; diff --git a/types/express-mongo-sanitize/tsconfig.json b/types/express-mongo-sanitize/tsconfig.json new file mode 100644 index 0000000000..0834820a85 --- /dev/null +++ b/types/express-mongo-sanitize/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", + "express-mongo-sanitize-tests.ts" + ] +} diff --git a/types/express-mongo-sanitize/tslint.json b/types/express-mongo-sanitize/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/express-mongo-sanitize/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/express-mung/index.d.ts b/types/express-mung/index.d.ts index 85bd8e6aff..e6de726cd8 100644 --- a/types/express-mung/index.d.ts +++ b/types/express-mung/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/richardschneider/express-mung // Definitions by: Cyril Schumacher // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// /// diff --git a/types/express-mung/tslint.json b/types/express-mung/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/express-mung/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/express-myconnection/express-myconnection-tests.ts b/types/express-myconnection/express-myconnection-tests.ts index ea744f926b..40101b364e 100644 --- a/types/express-myconnection/express-myconnection-tests.ts +++ b/types/express-myconnection/express-myconnection-tests.ts @@ -23,10 +23,10 @@ app.use( app.use(function list(req: express.Request, res: express.Response, next: Function){ - req.getConnection(function(err: mysql.IError, connection: mysql.IConnection) { + req.getConnection(function(err: mysql.MysqlError, connection: mysql.Connection) { if (err) return next(err); - connection.query('SELECT 1 AS RESULT', [], function(err: mysql.IError, results: any) { + connection.query('SELECT 1 AS RESULT', [], function(err: mysql.MysqlError, results: any) { if (err) return next(err); results[0].RESULT; @@ -36,4 +36,3 @@ app.use(function list(req: express.Request, res: express.Response, next: Functio }); }); }); - diff --git a/types/express-myconnection/index.d.ts b/types/express-myconnection/index.d.ts index 1f789eed09..5014c73571 100644 --- a/types/express-myconnection/index.d.ts +++ b/types/express-myconnection/index.d.ts @@ -2,19 +2,20 @@ // Project: https://www.npmjs.org/package/express-myconnection // Definitions by: Michael Ferris // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 /// /// -declare namespace mysql{ - export interface IConnection {} - export interface IError {} +declare namespace mysql { + export interface Connection {} + export interface MysqlError {} } declare namespace Express { export interface Request { - getConnection?: (callback: (err: mysql.IError, connection: mysql.IConnection) => void) => void; + getConnection?: (callback: (err: mysql.MysqlError, connection: mysql.Connection) => void) => void; } } @@ -22,8 +23,7 @@ declare module "express-myconnection" { import express = require('express'); import mysql = require('mysql'); - function connection(mysql: mysql.IMySql, dbConfig: mysql.IConnectionConfig, strategy: string): express.RequestHandler; + function connection(mysqlInstance: (typeof mysql), dbConfig: mysql.ConnectionConfig, strategy: string): express.RequestHandler; export = connection; } - diff --git a/types/express-myconnection/tslint.json b/types/express-myconnection/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/express-myconnection/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/express-mysql-session/index.d.ts b/types/express-mysql-session/index.d.ts index f8d6282ecd..14c857b5dc 100644 --- a/types/express-mysql-session/index.d.ts +++ b/types/express-mysql-session/index.d.ts @@ -30,106 +30,35 @@ declare namespace MySQLStore { } declare class MySQLStore { - /** - * @param {MySQLStore.Options} options - * @param {any} connection? - * @param {(error:any)=>void} callback? - */ constructor(options: MySQLStore.Options, connection?: any, callback?: (error: any) => void); - /** - * @returns void - */ setDefaultOptions(): void; - /** - * @param {(error:any)=>void} callback? - * @returns void - */ createDatabaseTable(callback?: (error: any) => void): void; - /** - * @param {string} sessionId - * @param {(error:any,session:any)=>void} callback? - * @returns void - */ get(sessionId: string, callback?: (error: any, session: any) => void): void; - /** - * @param {string} sessionId - * @param {any} data - * @param {(error:any)=>void} callback? - * @returns void - */ set(sessionId: string, data: any, callback?: (error: any) => void): void; - /** - * @param {string} sessionId - * @param {any} data - * @param {(error:any)=>void} callback? - * @returns void - */ touch(sessionId: string, data: any, callback?: (error: any) => void): void; - /** - * @param {string} sessionId - * @param {(error:any)=>void} callback? - * @returns void - */ destroy(sessionId: string, callback?: (error: any) => void): void; - /** - * @param {(error:any,count:any)=>void} callback? - * @returns void - */ length(callback?: (error: any, count: any) => void): void; - /** - * @param {(error:any)=>void} callback? - * @returns void - */ clear(callback?: (error: any) => void): void; - /** - * @param {(error:any)=>void} callback? - * @returns void - */ clearExpiredSessions(callback?: (error: any) => void): void; - /** - * @param {number} interval - * @returns void - */ setExpirationInterval(interval: number): void; - /** - * @returns void - */ clearExpirationInterval(): void; - /** - * @param {()=>void} callback? - * @returns void - */ close(callback?: () => void): void; - /** - * @param {any} object - * @param {any} defaultValues - * @param {any} options? - * @returns void - */ default(object: any, defaultValues: any, options?: any): void; - /** - * @param {any} object - * @returns void - */ clone(object: any): void; - /** - * @param {any} value - * @returns void - */ isObject(value: any): void; } diff --git a/types/express-oauth-server/express-oauth-server-tests.ts b/types/express-oauth-server/express-oauth-server-tests.ts new file mode 100644 index 0000000000..436763b9b8 --- /dev/null +++ b/types/express-oauth-server/express-oauth-server-tests.ts @@ -0,0 +1,83 @@ +import ExpressOAuthServer = require("express-oauth-server"); +import * as OAuth2Server from "oauth2-server"; +import * as express from "express"; + +const oauth2Model: OAuth2Server.AuthorizationCodeModel = { + getClient: async (clientId: string, clientSecret: string): Promise => { + return undefined; + }, + saveToken: async (token: OAuth2Server.Token, client: OAuth2Server.Client, user: OAuth2Server.User): Promise => { + return token; + }, + getAccessToken: async (accessToken: string): Promise => { + return { + accessToken, + client: {id: "testClient", grants: ["access_token"]}, + user: {id: "testUser"} + }; + }, + verifyScope: async (token: OAuth2Server.Token, scope: string): Promise => { + return true; + }, + getAuthorizationCode: async (authorizationCode: string): Promise => { + return { + authorizationCode, + expiresAt: new Date(), + redirectUri: "www.test.com", + client: {id: "testClient", grants: ["access_token"]}, + user: {id: "testUser"} + }; + }, + saveAuthorizationCode: async (code: OAuth2Server.AuthorizationCode, client: OAuth2Server.Client, user: OAuth2Server.User): Promise => { + return code; + }, + revokeAuthorizationCode: async (code: OAuth2Server.AuthorizationCode): Promise => { + return true; + } +}; + +const serverOptions: OAuth2Server.ServerOptions = { + model: oauth2Model, +}; +const expressOAuthServer: ExpressOAuthServer = new ExpressOAuthServer(serverOptions); + +let oAuthServer: OAuth2Server; +let resultingTokenMiddleware: ( + request: express.Request, + response: express.Response, + next: express.NextFunction, +) => Promise; +let resultingAuthorizationCodeMiddleware: ( + request: express.Request, + response: express.Response, + next: express.NextFunction, +) => Promise; + +oAuthServer = expressOAuthServer.server; +resultingTokenMiddleware = expressOAuthServer.authenticate(); +resultingTokenMiddleware = expressOAuthServer.token(); +resultingAuthorizationCodeMiddleware = expressOAuthServer.authorize(); + +// Real-life example + +const expressApp = express(); + +expressApp.all( + "/path", + expressOAuthServer.authenticate(), + (req: express.Request, res: express.Response, next: express.NextFunction) => { + res.json({message: "Secure data"}); + }, +); + +expressApp.get( + "/profile", + expressOAuthServer.authenticate({scope: "profile"}), + (req: express.Request & {user?: OAuth2Server.Token}, res: express.Response, next: express.NextFunction) => { + res.json({ + profile: req.user + }); + }, +); + +expressApp.listen(1234); diff --git a/types/express-oauth-server/index.d.ts b/types/express-oauth-server/index.d.ts new file mode 100644 index 0000000000..0a5a1162ea --- /dev/null +++ b/types/express-oauth-server/index.d.ts @@ -0,0 +1,34 @@ +// Type definitions for express-oauth-server 2.0 +// Project: https://github.com/oauthjs/express-oauth-server#readme +// Definitions by: Arne Schubert +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import * as express from 'express'; +import * as OAuth2Server from 'oauth2-server'; + +declare class ExpressOAuthServer { + server: OAuth2Server; + + constructor(options: OAuth2Server.ServerOptions); + + authenticate(options?: OAuth2Server.AuthenticateOptions): ( + request: express.Request, + response: express.Response, + next: express.NextFunction, + ) => Promise; + + authorize(options?: OAuth2Server.AuthorizeOptions): ( + request: express.Request, + response: express.Response, + next: express.NextFunction, + ) => Promise; + + token(options?: OAuth2Server.TokenOptions): ( + request: express.Request, + response: express.Response, + next: express.NextFunction, + ) => Promise; +} + +export = ExpressOAuthServer; diff --git a/types/express-oauth-server/tsconfig.json b/types/express-oauth-server/tsconfig.json new file mode 100644 index 0000000000..197ec65f00 --- /dev/null +++ b/types/express-oauth-server/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", + "express-oauth-server-tests.ts" + ] +} diff --git a/types/express-oauth-server/tslint.json b/types/express-oauth-server/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/express-oauth-server/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/express-openapi/index.d.ts b/types/express-openapi/index.d.ts index cfb38fee5c..a6ac5bda65 100644 --- a/types/express-openapi/index.d.ts +++ b/types/express-openapi/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/kogosoftwarellc/express-openapi // Definitions by: TANAKA Koichi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /* =================== USAGE =================== import express = require('express'); diff --git a/types/express-openapi/tslint.json b/types/express-openapi/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/express-openapi/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/express-partials/index.d.ts b/types/express-partials/index.d.ts index fb043b1307..6a604a2996 100644 --- a/types/express-partials/index.d.ts +++ b/types/express-partials/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/publicclass/express-partials // Definitions by: jt000 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 diff --git a/types/express-partials/tslint.json b/types/express-partials/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/express-partials/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/express-rate-limit/express-rate-limit-tests.ts b/types/express-rate-limit/express-rate-limit-tests.ts index fab5badeb8..677c46254b 100644 --- a/types/express-rate-limit/express-rate-limit-tests.ts +++ b/types/express-rate-limit/express-rate-limit-tests.ts @@ -11,7 +11,12 @@ const createAccountLimiter = new RateLimit({ delayAfter: 1, // begin slowing down responses after the first request delayMs: 3 * 1000, // slow down subsequent responses by 3 seconds per request max: 5, // start blocking after 5 requests - message: "Too many accounts created from this IP, please try again after an hour" + message: "Too many accounts created from this IP, please try again after an hour", + handler: (req, _, next) => next(new Error(`TooManyRequests: ${req.ip}`)) +}); + +const callbackWithFewerParams = new RateLimit({ + handler: (req, res) => res.status(429).json(`TooManyRequests: ${req.ip}`) }); class SomeStore implements RateLimit.Store { diff --git a/types/express-rate-limit/index.d.ts b/types/express-rate-limit/index.d.ts index 86b8d497b0..a46e0ed6cc 100644 --- a/types/express-rate-limit/index.d.ts +++ b/types/express-rate-limit/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for express-rate-limit 2.8 +// Type definitions for express-rate-limit 2.9 // Project: https://github.com/nfriedly/express-rate-limit -// Definitions by: Cyril Schumacher +// Definitions by: Cyril Schumacher , makepost // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 import express = require("express"); @@ -17,15 +18,15 @@ declare namespace RateLimit { interface Options { delayAfter?: number; delayMs?: number; - handlers?(req?: express.Request, res?: express.Response, next?: express.NextFunction): any; + handler?(req: express.Request, res: express.Response, next: express.NextFunction): any; headers?: boolean; - keyGenerator?(req?: express.Request, res?: express.Response): string; + keyGenerator?(req: express.Request, res: express.Response): string; max?: number; message?: string; - skip?(req?: express.Request, res?: express.Response): boolean; + skip?(req: express.Request, res: express.Response): boolean; statusCode?: number; store?: Store; - onLimitReached?(req?: express.Request, res?: express.Response, optionsUsed?: Options): void; + onLimitReached?(req: express.Request, res: express.Response, optionsUsed: Options): void; windowMs?: number; } } diff --git a/types/express-route-fs/index.d.ts b/types/express-route-fs/index.d.ts index a16f7dd171..ddc6e90e46 100644 --- a/types/express-route-fs/index.d.ts +++ b/types/express-route-fs/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/kripod/express-route-fs // Definitions by: Kristóf Poduszló // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /** diff --git a/types/express-route-fs/tslint.json b/types/express-route-fs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/express-route-fs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/express-sanitized/index.d.ts b/types/express-sanitized/index.d.ts index abb6be788a..c120c3b09f 100644 --- a/types/express-sanitized/index.d.ts +++ b/types/express-sanitized/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/askhogan/express-sanitized // Definitions by: Chris Barth // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import * as express from "express"; diff --git a/types/express-serve-static-core/express-serve-static-core-tests.ts b/types/express-serve-static-core/express-serve-static-core-tests.ts index 5803337a65..4c2f0919c2 100644 --- a/types/express-serve-static-core/express-serve-static-core-tests.ts +++ b/types/express-serve-static-core/express-serve-static-core-tests.ts @@ -1,5 +1,3 @@ - - import * as express from 'express-serve-static-core'; -// null test file - everything should be tested from express.d.ts and serve-static.d.ts \ No newline at end of file +// null test file - everything should be tested from express.d.ts and serve-static.d.ts diff --git a/types/express-serve-static-core/index.d.ts b/types/express-serve-static-core/index.d.ts index 00597aa17c..2f8d862b14 100644 --- a/types/express-serve-static-core/index.d.ts +++ b/types/express-serve-static-core/index.d.ts @@ -2,90 +2,85 @@ // Project: http://expressjs.com // Definitions by: Boris Yankov , Michał Lytek , Kacper Polak // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + // This extracts the core definitions from express to prevent a circular dependency between express and serve-static /// declare global { namespace Express { - // These open interfaces may be extended in an application-specific manner via declaration merging. - // See for example method-override.d.ts (https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/method-override/method-override.d.ts) - export interface Request { } - export interface Response { } - export interface Application { } + // See for example method-override.d.ts (https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/method-override/index.d.ts) + interface Request { } + interface Response { } + interface Application { } } } import * as http from "http"; -interface NextFunction { +export interface NextFunction { + // tslint:disable-next-line callable-types (In ts2.1 it thinks the type alias has no call signatures) (err?: any): void; } -interface RequestHandler { +export interface RequestHandler { + // tslint:disable-next-line callable-types (This is extended from and can't extend from a type alias in ts<2.2 (req: Request, res: Response, next: NextFunction): any; } -interface ErrorRequestHandler { - (err: any, req: Request, res: Response, next: NextFunction): any; -} +export type ErrorRequestHandler = (err: any, req: Request, res: Response, next: NextFunction) => any; -type PathParams = string | RegExp | (string | RegExp)[]; +export type PathParams = string | RegExp | Array; -type RequestHandlerParams = RequestHandler | ErrorRequestHandler | (RequestHandler | ErrorRequestHandler)[]; +export type RequestHandlerParams = RequestHandler | ErrorRequestHandler | Array; -interface IRouterMatcher { +export interface IRouterMatcher { (path: PathParams, ...handlers: RequestHandler[]): T; (path: PathParams, ...handlers: RequestHandlerParams[]): T; } -interface IRouterHandler { +export interface IRouterHandler { (...handlers: RequestHandler[]): T; (...handlers: RequestHandlerParams[]): T; } -interface IRouter extends RequestHandler { +export interface IRouter extends RequestHandler { /** - * Map the given param placeholder `name`(s) to the given callback(s). - * - * Parameter mapping is used to provide pre-conditions to routes - * which use normalized placeholders. For example a _:user_id_ parameter - * could automatically load a user's information from the database without - * any additional code, - * - * The callback uses the samesignature as middleware, the only differencing - * being that the value of the placeholder is passed, in this case the _id_ - * of the user. Once the `next()` function is invoked, just like middleware - * it will continue on to execute the route, or subsequent parameter functions. - * - * app.param('user_id', function(req, res, next, id){ - * User.find(id, function(err, user){ - * if (err) { - * next(err); - * } else if (user) { - * req.user = user; - * next(); - * } else { - * next(new Error('failed to load user')); - * } - * }); - * }); - * - * @param name - * @param fn - */ + * Map the given param placeholder `name`(s) to the given callback(s). + * + * Parameter mapping is used to provide pre-conditions to routes + * which use normalized placeholders. For example a _:user_id_ parameter + * could automatically load a user's information from the database without + * any additional code, + * + * The callback uses the samesignature as middleware, the only differencing + * being that the value of the placeholder is passed, in this case the _id_ + * of the user. Once the `next()` function is invoked, just like middleware + * it will continue on to execute the route, or subsequent parameter functions. + * + * app.param('user_id', function(req, res, next, id){ + * User.find(id, function(err, user){ + * if (err) { + * next(err); + * } else if (user) { + * req.user = user; + * next(); + * } else { + * next(new Error('failed to load user')); + * } + * }); + * }); + */ param(name: string, handler: RequestParamHandler): this; // Alternatively, you can pass only a callback, in which case you have the opportunity to alter the app.param() API // deprecated since express 4.11.0 param(callback: (name: string, matcher: RegExp) => RequestParamHandler): this; /** - * Special-cased "all" method, applying the given route `path`, - * middleware, and callback to _every_ HTTP method. - * - * @param path - * @param fn - */ + * Special-cased "all" method, applying the given route `path`, + * middleware, and callback to _every_ HTTP method. + */ all: IRouterMatcher; get: IRouterMatcher; post: IRouterMatcher; @@ -124,7 +119,7 @@ interface IRouter extends RequestHandler { stack: any[]; } -interface IRoute { +export interface IRoute { path: string; stack: any; all: IRouterHandler; @@ -151,12 +146,12 @@ interface IRoute { subscribe: IRouterHandler; trace: IRouterHandler; unlock: IRouterHandler; - unsubscribe: IRouterHandler + unsubscribe: IRouterHandler; } export interface Router extends IRouter { } -interface CookieOptions { +export interface CookieOptions { maxAge?: number; signed?: boolean; expires?: Date | boolean; @@ -168,35 +163,32 @@ interface CookieOptions { sameSite?: boolean | string; } -interface ByteRange { start: number; end: number; } +export interface ByteRange { start: number; end: number; } -interface RequestRanges extends Array { type: string; } +export interface RequestRanges extends Array { type: string; } -interface Errback { (err: Error): void; } - -interface Request extends http.IncomingMessage, Express.Request { +export type Errback = (err: Error) => void; +export interface Request extends http.IncomingMessage, Express.Request { /** - * Return request header. - * - * The `Referrer` header field is special-cased, - * both `Referrer` and `Referer` are interchangeable. - * - * Examples: - * - * req.get('Content-Type'); - * // => "text/plain" - * - * req.get('content-type'); - * // => "text/plain" - * - * req.get('Something'); - * // => undefined - * - * Aliased as `req.header()`. - * - * @param name - */ + * Return request header. + * + * The `Referrer` header field is special-cased, + * both `Referrer` and `Referer` are interchangeable. + * + * Examples: + * + * req.get('Content-Type'); + * // => "text/plain" + * + * req.get('content-type'); + * // => "text/plain" + * + * req.get('Something'); + * // => undefined + * + * Aliased as `req.header()`. + */ get(name: "set-cookie"): string[] | undefined; get(name: string): string | undefined; @@ -204,234 +196,223 @@ interface Request extends http.IncomingMessage, Express.Request { header(name: string): string | undefined; /** - * Check if the given `type(s)` is acceptable, returning - * the best match when true, otherwise `undefined`, in which - * case you should respond with 406 "Not Acceptable". - * - * The `type` value may be a single mime type string - * such as "application/json", the extension name - * such as "json", a comma-delimted list such as "json, html, text/plain", - * or an array `["json", "html", "text/plain"]`. When a list - * or array is given the _best_ match, if any is returned. - * - * Examples: - * - * // Accept: text/html - * req.accepts('html'); - * // => "html" - * - * // Accept: text/*, application/json - * req.accepts('html'); - * // => "html" - * req.accepts('text/html'); - * // => "text/html" - * req.accepts('json, text'); - * // => "json" - * req.accepts('application/json'); - * // => "application/json" - * - * // Accept: text/*, application/json - * req.accepts('image/png'); - * req.accepts('png'); - * // => undefined - * - * // Accept: text/*;q=.5, application/json - * req.accepts(['html', 'json']); - * req.accepts('html, json'); - * // => "json" - */ + * Check if the given `type(s)` is acceptable, returning + * the best match when true, otherwise `undefined`, in which + * case you should respond with 406 "Not Acceptable". + * + * The `type` value may be a single mime type string + * such as "application/json", the extension name + * such as "json", a comma-delimted list such as "json, html, text/plain", + * or an array `["json", "html", "text/plain"]`. When a list + * or array is given the _best_ match, if any is returned. + * + * Examples: + * + * // Accept: text/html + * req.accepts('html'); + * // => "html" + * + * // Accept: text/*, application/json + * req.accepts('html'); + * // => "html" + * req.accepts('text/html'); + * // => "text/html" + * req.accepts('json, text'); + * // => "json" + * req.accepts('application/json'); + * // => "application/json" + * + * // Accept: text/*, application/json + * req.accepts('image/png'); + * req.accepts('png'); + * // => undefined + * + * // Accept: text/*;q=.5, application/json + * req.accepts(['html', 'json']); + * req.accepts('html, json'); + * // => "json" + */ accepts(): string[]; accepts(type: string): string | false; accepts(type: string[]): string | false; accepts(...type: string[]): string | false; /** - * Returns the first accepted charset of the specified character sets, - * based on the request's Accept-Charset HTTP header field. - * If none of the specified charsets is accepted, returns false. - * - * For more information, or if you have issues or concerns, see accepts. - * @param charset - */ + * Returns the first accepted charset of the specified character sets, + * based on the request's Accept-Charset HTTP header field. + * If none of the specified charsets is accepted, returns false. + * + * For more information, or if you have issues or concerns, see accepts. + */ acceptsCharsets(): string[]; acceptsCharsets(charset: string): string | false; acceptsCharsets(charset: string[]): string | false; acceptsCharsets(...charset: string[]): string | false; /** - * Returns the first accepted encoding of the specified encodings, - * based on the request's Accept-Encoding HTTP header field. - * If none of the specified encodings is accepted, returns false. - * - * For more information, or if you have issues or concerns, see accepts. - * @param encoding - */ + * Returns the first accepted encoding of the specified encodings, + * based on the request's Accept-Encoding HTTP header field. + * If none of the specified encodings is accepted, returns false. + * + * For more information, or if you have issues or concerns, see accepts. + */ acceptsEncodings(): string[]; acceptsEncodings(encoding: string): string | false; acceptsEncodings(encoding: string[]): string | false; acceptsEncodings(...encoding: string[]): string | false; /** - * Returns the first accepted language of the specified languages, - * based on the request's Accept-Language HTTP header field. - * If none of the specified languages is accepted, returns false. - * - * For more information, or if you have issues or concerns, see accepts. - * - * @param lang - */ + * Returns the first accepted language of the specified languages, + * based on the request's Accept-Language HTTP header field. + * If none of the specified languages is accepted, returns false. + * + * For more information, or if you have issues or concerns, see accepts. + */ acceptsLanguages(): string[]; acceptsLanguages(lang: string): string | false; acceptsLanguages(lang: string[]): string | false; acceptsLanguages(...lang: string[]): string | false; /** - * Parse Range header field, - * capping to the given `size`. - * - * Unspecified ranges such as "0-" require - * knowledge of your resource length. In - * the case of a byte range this is of course - * the total number of bytes. If the Range - * header field is not given `null` is returned, - * `-1` when unsatisfiable, `-2` when syntactically invalid. - * - * NOTE: remember that ranges are inclusive, so - * for example "Range: users=0-3" should respond - * with 4 users when available, not 3. - * - * @param size - */ + * Parse Range header field, + * capping to the given `size`. + * + * Unspecified ranges such as "0-" require + * knowledge of your resource length. In + * the case of a byte range this is of course + * the total number of bytes. If the Range + * header field is not given `null` is returned, + * `-1` when unsatisfiable, `-2` when syntactically invalid. + * + * NOTE: remember that ranges are inclusive, so + * for example "Range: users=0-3" should respond + * with 4 users when available, not 3. + */ range(size: number): RequestRanges|null|-1|-2; /** - * Return an array of Accepted media types - * ordered from highest quality to lowest. - */ + * Return an array of Accepted media types + * ordered from highest quality to lowest. + */ accepted: MediaType[]; /** - * @deprecated Use either req.params, req.body or req.query, as applicable. - * - * Return the value of param `name` when present or `defaultValue`. - * - * - Checks route placeholders, ex: _/user/:id_ - * - Checks body params, ex: id=12, {"id":12} - * - Checks query string params, ex: ?id=12 - * - * To utilize request bodies, `req.body` - * should be an object. This can be done by using - * the `connect.bodyParser()` middleware. - * - * @param name - * @param defaultValue - */ + * @deprecated Use either req.params, req.body or req.query, as applicable. + * + * Return the value of param `name` when present or `defaultValue`. + * + * - Checks route placeholders, ex: _/user/:id_ + * - Checks body params, ex: id=12, {"id":12} + * - Checks query string params, ex: ?id=12 + * + * To utilize request bodies, `req.body` + * should be an object. This can be done by using + * the `connect.bodyParser()` middleware. + */ param(name: string, defaultValue?: any): string; /** - * Check if the incoming request contains the "Content-Type" - * header field, and it contains the give mime `type`. - * - * Examples: - * - * // With Content-Type: text/html; charset=utf-8 - * req.is('html'); - * req.is('text/html'); - * req.is('text/*'); - * // => true - * - * // When Content-Type is application/json - * req.is('json'); - * req.is('application/json'); - * req.is('application/*'); - * // => true - * - * req.is('html'); - * // => false - * - * @param type - */ + * Check if the incoming request contains the "Content-Type" + * header field, and it contains the give mime `type`. + * + * Examples: + * + * // With Content-Type: text/html; charset=utf-8 + * req.is('html'); + * req.is('text/html'); + * req.is('text/*'); + * // => true + * + * // When Content-Type is application/json + * req.is('json'); + * req.is('application/json'); + * req.is('application/*'); + * // => true + * + * req.is('html'); + * // => false + */ is(type: string): string | false; /** - * Return the protocol string "http" or "https" - * when requested with TLS. When the "trust proxy" - * setting is enabled the "X-Forwarded-Proto" header - * field will be trusted. If you're running behind - * a reverse proxy that supplies https for you this - * may be enabled. - */ + * Return the protocol string "http" or "https" + * when requested with TLS. When the "trust proxy" + * setting is enabled the "X-Forwarded-Proto" header + * field will be trusted. If you're running behind + * a reverse proxy that supplies https for you this + * may be enabled. + */ protocol: string; /** - * Short-hand for: - * - * req.protocol == 'https' - */ + * Short-hand for: + * + * req.protocol == 'https' + */ secure: boolean; /** - * Return the remote address, or when - * "trust proxy" is `true` return - * the upstream addr. - */ + * Return the remote address, or when + * "trust proxy" is `true` return + * the upstream addr. + */ ip: string; /** - * When "trust proxy" is `true`, parse - * the "X-Forwarded-For" ip address list. - * - * For example if the value were "client, proxy1, proxy2" - * you would receive the array `["client", "proxy1", "proxy2"]` - * where "proxy2" is the furthest down-stream. - */ + * When "trust proxy" is `true`, parse + * the "X-Forwarded-For" ip address list. + * + * For example if the value were "client, proxy1, proxy2" + * you would receive the array `["client", "proxy1", "proxy2"]` + * where "proxy2" is the furthest down-stream. + */ ips: string[]; /** - * Return subdomains as an array. - * - * Subdomains are the dot-separated parts of the host before the main domain of - * the app. By default, the domain of the app is assumed to be the last two - * parts of the host. This can be changed by setting "subdomain offset". - * - * For example, if the domain is "tobi.ferrets.example.com": - * If "subdomain offset" is not set, req.subdomains is `["ferrets", "tobi"]`. - * If "subdomain offset" is 3, req.subdomains is `["tobi"]`. - */ + * Return subdomains as an array. + * + * Subdomains are the dot-separated parts of the host before the main domain of + * the app. By default, the domain of the app is assumed to be the last two + * parts of the host. This can be changed by setting "subdomain offset". + * + * For example, if the domain is "tobi.ferrets.example.com": + * If "subdomain offset" is not set, req.subdomains is `["ferrets", "tobi"]`. + * If "subdomain offset" is 3, req.subdomains is `["tobi"]`. + */ subdomains: string[]; /** - * Short-hand for `url.parse(req.url).pathname`. - */ + * Short-hand for `url.parse(req.url).pathname`. + */ path: string; /** - * Parse the "Host" header field hostname. - */ + * Parse the "Host" header field hostname. + */ hostname: string; /** - * @deprecated Use hostname instead. - */ + * @deprecated Use hostname instead. + */ host: string; /** - * Check if the request is fresh, aka - * Last-Modified and/or the ETag - * still match. - */ + * Check if the request is fresh, aka + * Last-Modified and/or the ETag + * still match. + */ fresh: boolean; /** - * Check if the request is stale, aka - * "Last-Modified" and / or the "ETag" for the - * resource has changed. - */ + * Check if the request is stale, aka + * "Last-Modified" and / or the "ETag" for the + * resource has changed. + */ stale: boolean; /** - * Check if the request was an _XMLHttpRequest_. - */ + * Check if the request was an _XMLHttpRequest_. + */ xhr: boolean; //body: { username: string; password: string; remember: boolean; title: string; }; @@ -444,12 +425,7 @@ interface Request extends http.IncomingMessage, Express.Request { params: any; - /** - * Clear cookie `name`. - * - * @param name - * @param options - */ + /** Clear cookie `name`. */ clearCookie(name: string, options?: any): Response; query: any; @@ -467,275 +443,259 @@ interface Request extends http.IncomingMessage, Express.Request { app: Application; } -interface MediaType { +export interface MediaType { value: string; quality: number; type: string; subtype: string; } -interface Send { - (body?: any): Response; -} +export type Send = (body?: any) => Response; -interface Response extends http.ServerResponse, Express.Response { +export interface Response extends http.ServerResponse, Express.Response { /** - * Set status `code`. - * - * @param code - */ + * Set status `code`. + */ status(code: number): Response; /** - * Set the response HTTP status code to `statusCode` and send its string representation as the response body. - * @link http://expressjs.com/4x/api.html#res.sendStatus - * - * Examples: - * - * res.sendStatus(200); // equivalent to res.status(200).send('OK') - * res.sendStatus(403); // equivalent to res.status(403).send('Forbidden') - * res.sendStatus(404); // equivalent to res.status(404).send('Not Found') - * res.sendStatus(500); // equivalent to res.status(500).send('Internal Server Error') - * - * @param code - */ + * Set the response HTTP status code to `statusCode` and send its string representation as the response body. + * @link http://expressjs.com/4x/api.html#res.sendStatus + * + * Examples: + * + * res.sendStatus(200); // equivalent to res.status(200).send('OK') + * res.sendStatus(403); // equivalent to res.status(403).send('Forbidden') + * res.sendStatus(404); // equivalent to res.status(404).send('Not Found') + * res.sendStatus(500); // equivalent to res.status(500).send('Internal Server Error') + */ sendStatus(code: number): Response; /** - * Set Link header field with the given `links`. - * - * Examples: - * - * res.links({ - * next: 'http://api.example.com/users?page=2', - * last: 'http://api.example.com/users?page=5' - * }); - * - * @param links - */ + * Set Link header field with the given `links`. + * + * Examples: + * + * res.links({ + * next: 'http://api.example.com/users?page=2', + * last: 'http://api.example.com/users?page=5' + * }); + */ links(links: any): Response; /** - * Send a response. - * - * Examples: - * - * res.send(new Buffer('wahoo')); - * res.send({ some: 'json' }); - * res.send('

    some html

    '); - * res.send(404, 'Sorry, cant find that'); - * res.send(404); - */ + * Send a response. + * + * Examples: + * + * res.send(new Buffer('wahoo')); + * res.send({ some: 'json' }); + * res.send('

    some html

    '); + * res.send(404, 'Sorry, cant find that'); + * res.send(404); + */ send: Send; /** - * Send JSON response. - * - * Examples: - * - * res.json(null); - * res.json({ user: 'tj' }); - * res.json(500, 'oh noes!'); - * res.json(404, 'I dont have that'); - */ + * Send JSON response. + * + * Examples: + * + * res.json(null); + * res.json({ user: 'tj' }); + * res.json(500, 'oh noes!'); + * res.json(404, 'I dont have that'); + */ json: Send; /** - * Send JSON response with JSONP callback support. - * - * Examples: - * - * res.jsonp(null); - * res.jsonp({ user: 'tj' }); - * res.jsonp(500, 'oh noes!'); - * res.jsonp(404, 'I dont have that'); - */ + * Send JSON response with JSONP callback support. + * + * Examples: + * + * res.jsonp(null); + * res.jsonp({ user: 'tj' }); + * res.jsonp(500, 'oh noes!'); + * res.jsonp(404, 'I dont have that'); + */ jsonp: Send; /** - * Transfer the file at the given `path`. - * - * Automatically sets the _Content-Type_ response header field. - * The callback `fn(err)` is invoked when the transfer is complete - * or when an error occurs. Be sure to check `res.sentHeader` - * if you wish to attempt responding, as the header and some data - * may have already been transferred. - * - * Options: - * - * - `maxAge` defaulting to 0 (can be string converted by `ms`) - * - `root` root directory for relative filenames - * - `headers` object of headers to serve with file - * - `dotfiles` serve dotfiles, defaulting to false; can be `"allow"` to send them - * - * Other options are passed along to `send`. - * - * Examples: - * - * The following example illustrates how `res.sendFile()` may - * be used as an alternative for the `static()` middleware for - * dynamic situations. The code backing `res.sendFile()` is actually - * the same code, so HTTP cache support etc is identical. - * - * app.get('/user/:uid/photos/:file', function(req, res){ - * var uid = req.params.uid - * , file = req.params.file; - * - * req.user.mayViewFilesFrom(uid, function(yes){ - * if (yes) { - * res.sendFile('/uploads/' + uid + '/' + file); - * } else { - * res.send(403, 'Sorry! you cant see that.'); - * } - * }); - * }); - * - * @api public - */ + * Transfer the file at the given `path`. + * + * Automatically sets the _Content-Type_ response header field. + * The callback `fn(err)` is invoked when the transfer is complete + * or when an error occurs. Be sure to check `res.sentHeader` + * if you wish to attempt responding, as the header and some data + * may have already been transferred. + * + * Options: + * + * - `maxAge` defaulting to 0 (can be string converted by `ms`) + * - `root` root directory for relative filenames + * - `headers` object of headers to serve with file + * - `dotfiles` serve dotfiles, defaulting to false; can be `"allow"` to send them + * + * Other options are passed along to `send`. + * + * Examples: + * + * The following example illustrates how `res.sendFile()` may + * be used as an alternative for the `static()` middleware for + * dynamic situations. The code backing `res.sendFile()` is actually + * the same code, so HTTP cache support etc is identical. + * + * app.get('/user/:uid/photos/:file', function(req, res){ + * var uid = req.params.uid + * , file = req.params.file; + * + * req.user.mayViewFilesFrom(uid, function(yes){ + * if (yes) { + * res.sendFile('/uploads/' + uid + '/' + file); + * } else { + * res.send(403, 'Sorry! you cant see that.'); + * } + * }); + * }); + * + * @api public + */ sendFile(path: string): void; sendFile(path: string, options: any): void; sendFile(path: string, fn: Errback): void; sendFile(path: string, options: any, fn: Errback): void; /** - * @deprecated Use sendFile instead. - */ + * @deprecated Use sendFile instead. + */ sendfile(path: string): void; /** - * @deprecated Use sendFile instead. - */ + * @deprecated Use sendFile instead. + */ sendfile(path: string, options: any): void; /** - * @deprecated Use sendFile instead. - */ + * @deprecated Use sendFile instead. + */ sendfile(path: string, fn: Errback): void; /** - * @deprecated Use sendFile instead. - */ + * @deprecated Use sendFile instead. + */ sendfile(path: string, options: any, fn: Errback): void; /** - * Transfer the file at the given `path` as an attachment. - * - * Optionally providing an alternate attachment `filename`, - * and optional callback `fn(err)`. The callback is invoked - * when the data transfer is complete, or when an error has - * ocurred. Be sure to check `res.headerSent` if you plan to respond. - * - * This method uses `res.sendfile()`. - */ + * Transfer the file at the given `path` as an attachment. + * + * Optionally providing an alternate attachment `filename`, + * and optional callback `fn(err)`. The callback is invoked + * when the data transfer is complete, or when an error has + * ocurred. Be sure to check `res.headerSent` if you plan to respond. + * + * This method uses `res.sendfile()`. + */ download(path: string): void; download(path: string, filename: string): void; download(path: string, fn: Errback): void; download(path: string, filename: string, fn: Errback): void; /** - * Set _Content-Type_ response header with `type` through `mime.lookup()` - * when it does not contain "/", or set the Content-Type to `type` otherwise. - * - * Examples: - * - * res.type('.html'); - * res.type('html'); - * res.type('json'); - * res.type('application/json'); - * res.type('png'); - * - * @param type - */ + * Set _Content-Type_ response header with `type` through `mime.lookup()` + * when it does not contain "/", or set the Content-Type to `type` otherwise. + * + * Examples: + * + * res.type('.html'); + * res.type('html'); + * res.type('json'); + * res.type('application/json'); + * res.type('png'); + */ contentType(type: string): Response; /** - * Set _Content-Type_ response header with `type` through `mime.lookup()` - * when it does not contain "/", or set the Content-Type to `type` otherwise. - * - * Examples: - * - * res.type('.html'); - * res.type('html'); - * res.type('json'); - * res.type('application/json'); - * res.type('png'); - * - * @param type - */ + * Set _Content-Type_ response header with `type` through `mime.lookup()` + * when it does not contain "/", or set the Content-Type to `type` otherwise. + * + * Examples: + * + * res.type('.html'); + * res.type('html'); + * res.type('json'); + * res.type('application/json'); + * res.type('png'); + */ type(type: string): Response; /** - * Respond to the Acceptable formats using an `obj` - * of mime-type callbacks. - * - * This method uses `req.accepted`, an array of - * acceptable types ordered by their quality values. - * When "Accept" is not present the _first_ callback - * is invoked, otherwise the first match is used. When - * no match is performed the server responds with - * 406 "Not Acceptable". - * - * Content-Type is set for you, however if you choose - * you may alter this within the callback using `res.type()` - * or `res.set('Content-Type', ...)`. - * - * res.format({ - * 'text/plain': function(){ - * res.send('hey'); - * }, - * - * 'text/html': function(){ - * res.send('

    hey

    '); - * }, - * - * 'appliation/json': function(){ - * res.send({ message: 'hey' }); - * } - * }); - * - * In addition to canonicalized MIME types you may - * also use extnames mapped to these types: - * - * res.format({ - * text: function(){ - * res.send('hey'); - * }, - * - * html: function(){ - * res.send('

    hey

    '); - * }, - * - * json: function(){ - * res.send({ message: 'hey' }); - * } - * }); - * - * By default Express passes an `Error` - * with a `.status` of 406 to `next(err)` - * if a match is not made. If you provide - * a `.default` callback it will be invoked - * instead. - * - * @param obj - */ + * Respond to the Acceptable formats using an `obj` + * of mime-type callbacks. + * + * This method uses `req.accepted`, an array of + * acceptable types ordered by their quality values. + * When "Accept" is not present the _first_ callback + * is invoked, otherwise the first match is used. When + * no match is performed the server responds with + * 406 "Not Acceptable". + * + * Content-Type is set for you, however if you choose + * you may alter this within the callback using `res.type()` + * or `res.set('Content-Type', ...)`. + * + * res.format({ + * 'text/plain': function(){ + * res.send('hey'); + * }, + * + * 'text/html': function(){ + * res.send('

    hey

    '); + * }, + * + * 'appliation/json': function(){ + * res.send({ message: 'hey' }); + * } + * }); + * + * In addition to canonicalized MIME types you may + * also use extnames mapped to these types: + * + * res.format({ + * text: function(){ + * res.send('hey'); + * }, + * + * html: function(){ + * res.send('

    hey

    '); + * }, + * + * json: function(){ + * res.send({ message: 'hey' }); + * } + * }); + * + * By default Express passes an `Error` + * with a `.status` of 406 to `next(err)` + * if a match is not made. If you provide + * a `.default` callback it will be invoked + * instead. + */ format(obj: any): Response; /** - * Set _Content-Disposition_ header to _attachment_ with optional `filename`. - * - * @param filename - */ + * Set _Content-Disposition_ header to _attachment_ with optional `filename`. + */ attachment(filename?: string): Response; /** - * Set header `field` to `val`, or pass - * an object of header fields. - * - * Examples: - * - * res.set('Foo', ['bar', 'baz']); - * res.set('Accept', 'application/json'); - * res.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' }); - * - * Aliased as `res.header()`. - */ + * Set header `field` to `val`, or pass + * an object of header fields. + * + * Examples: + * + * res.set('Foo', ['bar', 'baz']); + * res.set('Accept', 'application/json'); + * res.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' }); + * + * Aliased as `res.header()`. + */ set(field: any): Response; set(field: string, value?: string): Response; @@ -745,102 +705,91 @@ interface Response extends http.ServerResponse, Express.Response { // Property indicating if HTTP headers has been sent for the response. headersSent: boolean; - /** - * Get value for header `field`. - * - * @param field - */ + /** Get value for header `field`. */ get(field: string): string; - /** - * Clear cookie `name`. - * - * @param name - * @param options - */ + /** Clear cookie `name`. */ clearCookie(name: string, options?: any): Response; /** - * Set cookie `name` to `val`, with the given `options`. - * - * Options: - * - * - `maxAge` max-age in milliseconds, converted to `expires` - * - `signed` sign the cookie - * - `path` defaults to "/" - * - * Examples: - * - * // "Remember Me" for 15 minutes - * res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true }); - * - * // save as above - * res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true }) - */ + * Set cookie `name` to `val`, with the given `options`. + * + * Options: + * + * - `maxAge` max-age in milliseconds, converted to `expires` + * - `signed` sign the cookie + * - `path` defaults to "/" + * + * Examples: + * + * // "Remember Me" for 15 minutes + * res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true }); + * + * // save as above + * res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true }) + */ cookie(name: string, val: string, options: CookieOptions): Response; cookie(name: string, val: any, options: CookieOptions): Response; cookie(name: string, val: any): Response; /** - * Set the location header to `url`. - * - * The given `url` can also be the name of a mapped url, for - * example by default express supports "back" which redirects - * to the _Referrer_ or _Referer_ headers or "/". - * - * Examples: - * - * res.location('/foo/bar').; - * res.location('http://example.com'); - * res.location('../login'); // /blog/post/1 -> /blog/login - * - * Mounting: - * - * When an application is mounted and `res.location()` - * is given a path that does _not_ lead with "/" it becomes - * relative to the mount-point. For example if the application - * is mounted at "/blog", the following would become "/blog/login". - * - * res.location('login'); - * - * While the leading slash would result in a location of "/login": - * - * res.location('/login'); - * - * @param url - */ + * Set the location header to `url`. + * + * The given `url` can also be the name of a mapped url, for + * example by default express supports "back" which redirects + * to the _Referrer_ or _Referer_ headers or "/". + * + * Examples: + * + * res.location('/foo/bar').; + * res.location('http://example.com'); + * res.location('../login'); // /blog/post/1 -> /blog/login + * + * Mounting: + * + * When an application is mounted and `res.location()` + * is given a path that does _not_ lead with "/" it becomes + * relative to the mount-point. For example if the application + * is mounted at "/blog", the following would become "/blog/login". + * + * res.location('login'); + * + * While the leading slash would result in a location of "/login": + * + * res.location('/login'); + */ location(url: string): Response; /** - * Redirect to the given `url` with optional response `status` - * defaulting to 302. - * - * The resulting `url` is determined by `res.location()`, so - * it will play nicely with mounted apps, relative paths, - * `"back"` etc. - * - * Examples: - * - * res.redirect('/foo/bar'); - * res.redirect('http://example.com'); - * res.redirect(301, 'http://example.com'); - * res.redirect('http://example.com', 301); - * res.redirect('../login'); // /blog/post/1 -> /blog/login - */ + * Redirect to the given `url` with optional response `status` + * defaulting to 302. + * + * The resulting `url` is determined by `res.location()`, so + * it will play nicely with mounted apps, relative paths, + * `"back"` etc. + * + * Examples: + * + * res.redirect('/foo/bar'); + * res.redirect('http://example.com'); + * res.redirect(301, 'http://example.com'); + * res.redirect('http://example.com', 301); + * res.redirect('../login'); // /blog/post/1 -> /blog/login + */ redirect(url: string): void; redirect(status: number, url: string): void; redirect(url: string, status: number): void; /** - * Render `view` with the given `options` and optional callback `fn`. - * When a callback function is given a response will _not_ be made - * automatically, otherwise a response of _200_ and _text/html_ is given. - * - * Options: - * - * - `cache` boolean hinting to the engine it should cache - * - `filename` filename of the view being rendered - */ + * Render `view` with the given `options` and optional callback `fn`. + * When a callback function is given a response will _not_ be made + * automatically, otherwise a response of _200_ and _text/html_ is given. + * + * Options: + * + * - `cache` boolean hinting to the engine it should cache + * - `filename` filename of the view being rendered + */ render(view: string, options?: Object, callback?: (err: Error, html: string) => void): void; render(view: string, callback?: (err: Error, html: string) => void): void; @@ -860,183 +809,163 @@ interface Response extends http.ServerResponse, Express.Response { app: Application; } -interface Handler extends RequestHandler { } +export interface Handler extends RequestHandler { } -interface RequestParamHandler { - (req: Request, res: Response, next: NextFunction, value: any, name: string): any; -} +export type RequestParamHandler = (req: Request, res: Response, next: NextFunction, value: any, name: string) => any; -type ApplicationRequestHandler = IRouterHandler & IRouterMatcher & { - (...handlers: RequestHandlerParams[]): T; -}; +export type ApplicationRequestHandler = IRouterHandler & IRouterMatcher & ((...handlers: RequestHandlerParams[]) => T); -interface Application extends IRouter, Express.Application { +export interface Application extends IRouter, Express.Application { /** * Express instance itself is a request handler, which could be invoked without * third argument. */ - (req: Request, res: Response): any; + (req: Request | http.IncomingMessage, res: Response | http.ServerResponse): any; /** - * Initialize the server. - * - * - setup default configuration - * - setup default middleware - * - setup route reflection methods - */ + * Initialize the server. + * + * - setup default configuration + * - setup default middleware + * - setup route reflection methods + */ init(): void; /** - * Initialize application configuration. - */ + * Initialize application configuration. + */ defaultConfiguration(): void; /** - * Register the given template engine callback `fn` - * as `ext`. - * - * By default will `require()` the engine based on the - * file extension. For example if you try to render - * a "foo.jade" file Express will invoke the following internally: - * - * app.engine('jade', require('jade').__express); - * - * For engines that do not provide `.__express` out of the box, - * or if you wish to "map" a different extension to the template engine - * you may use this method. For example mapping the EJS template engine to - * ".html" files: - * - * app.engine('html', require('ejs').renderFile); - * - * In this case EJS provides a `.renderFile()` method with - * the same signature that Express expects: `(path, options, callback)`, - * though note that it aliases this method as `ejs.__express` internally - * so if you're using ".ejs" extensions you dont need to do anything. - * - * Some template engines do not follow this convention, the - * [Consolidate.js](https://github.com/visionmedia/consolidate.js) - * library was created to map all of node's popular template - * engines to follow this convention, thus allowing them to - * work seamlessly within Express. - */ + * Register the given template engine callback `fn` + * as `ext`. + * + * By default will `require()` the engine based on the + * file extension. For example if you try to render + * a "foo.jade" file Express will invoke the following internally: + * + * app.engine('jade', require('jade').__express); + * + * For engines that do not provide `.__express` out of the box, + * or if you wish to "map" a different extension to the template engine + * you may use this method. For example mapping the EJS template engine to + * ".html" files: + * + * app.engine('html', require('ejs').renderFile); + * + * In this case EJS provides a `.renderFile()` method with + * the same signature that Express expects: `(path, options, callback)`, + * though note that it aliases this method as `ejs.__express` internally + * so if you're using ".ejs" extensions you dont need to do anything. + * + * Some template engines do not follow this convention, the + * [Consolidate.js](https://github.com/visionmedia/consolidate.js) + * library was created to map all of node's popular template + * engines to follow this convention, thus allowing them to + * work seamlessly within Express. + */ engine(ext: string, fn: Function): Application; /** - * Assign `setting` to `val`, or return `setting`'s value. - * - * app.set('foo', 'bar'); - * app.get('foo'); - * // => "bar" - * app.set('foo', ['bar', 'baz']); - * app.get('foo'); - * // => ["bar", "baz"] - * - * Mounted servers inherit their parent server's settings. - * - * @param setting - * @param val - */ + * Assign `setting` to `val`, or return `setting`'s value. + * + * app.set('foo', 'bar'); + * app.get('foo'); + * // => "bar" + * app.set('foo', ['bar', 'baz']); + * app.get('foo'); + * // => ["bar", "baz"] + * + * Mounted servers inherit their parent server's settings. + */ set(setting: string, val: any): Application; - get: { (name: string): any; } & IRouterMatcher; + get: ((name: string) => any) & IRouterMatcher; param(name: string | string[], handler: RequestParamHandler): this; // Alternatively, you can pass only a callback, in which case you have the opportunity to alter the app.param() API param(callback: (name: string, matcher: RegExp) => RequestParamHandler): this; /** - * Return the app's absolute pathname - * based on the parent(s) that have - * mounted it. - * - * For example if the application was - * mounted as "/admin", which itself - * was mounted as "/blog" then the - * return value would be "/blog/admin". - */ + * Return the app's absolute pathname + * based on the parent(s) that have + * mounted it. + * + * For example if the application was + * mounted as "/admin", which itself + * was mounted as "/blog" then the + * return value would be "/blog/admin". + */ path(): string; /** - * Check if `setting` is enabled (truthy). - * - * app.enabled('foo') - * // => false - * - * app.enable('foo') - * app.enabled('foo') - * // => true - */ + * Check if `setting` is enabled (truthy). + * + * app.enabled('foo') + * // => false + * + * app.enable('foo') + * app.enabled('foo') + * // => true + */ enabled(setting: string): boolean; /** - * Check if `setting` is disabled. - * - * app.disabled('foo') - * // => true - * - * app.enable('foo') - * app.disabled('foo') - * // => false - * - * @param setting - */ + * Check if `setting` is disabled. + * + * app.disabled('foo') + * // => true + * + * app.enable('foo') + * app.disabled('foo') + * // => false + */ disabled(setting: string): boolean; - /** - * Enable `setting`. - * - * @param setting - */ + /** Enable `setting`. */ enable(setting: string): Application; - /** - * Disable `setting`. - * - * @param setting - */ + /** Disable `setting`. */ disable(setting: string): Application; /** - * Configure callback for zero or more envs, - * when no `env` is specified that callback will - * be invoked for all environments. Any combination - * can be used multiple times, in any order desired. - * - * Examples: - * - * app.configure(function(){ - * // executed for all envs - * }); - * - * app.configure('stage', function(){ - * // executed staging env - * }); - * - * app.configure('stage', 'production', function(){ - * // executed for stage and production - * }); - * - * Note: - * - * These callbacks are invoked immediately, and - * are effectively sugar for the following: - * - * var env = process.env.NODE_ENV || 'development'; - * - * switch (env) { - * case 'development': - * ... - * break; - * case 'stage': - * ... - * break; - * case 'production': - * ... - * break; - * } - * - * @param env - * @param fn - */ + * Configure callback for zero or more envs, + * when no `env` is specified that callback will + * be invoked for all environments. Any combination + * can be used multiple times, in any order desired. + * + * Examples: + * + * app.configure(function(){ + * // executed for all envs + * }); + * + * app.configure('stage', function(){ + * // executed staging env + * }); + * + * app.configure('stage', 'production', function(){ + * // executed for stage and production + * }); + * + * Note: + * + * These callbacks are invoked immediately, and + * are effectively sugar for the following: + * + * var env = process.env.NODE_ENV || 'development'; + * + * switch (env) { + * case 'development': + * ... + * break; + * case 'stage': + * ... + * break; + * case 'production': + * ... + * break; + * } + */ configure(fn: Function): Application; configure(env0: string, fn: Function): Application; configure(env0: string, env1: string, fn: Function): Application; @@ -1045,41 +974,36 @@ interface Application extends IRouter, Express.Application { configure(env0: string, env1: string, env2: string, env3: string, env4: string, fn: Function): Application; /** - * Render the given view `name` name with `options` - * and a callback accepting an error and the - * rendered template string. - * - * Example: - * - * app.render('email', { name: 'Tobi' }, function(err, html){ - * // ... - * }) - * - * @param name - * @param options or fn - * @param fn - */ + * Render the given view `name` name with `options` + * and a callback accepting an error and the + * rendered template string. + * + * Example: + * + * app.render('email', { name: 'Tobi' }, function(err, html){ + * // ... + * }) + */ render(name: string, options?: Object, callback?: (err: Error, html: string) => void): void; render(name: string, callback: (err: Error, html: string) => void): void; - /** - * Listen for connections. - * - * A node `http.Server` is returned, with this - * application (which is a `Function`) as its - * callback. If you wish to create both an HTTP - * and HTTPS server you may do so with the "http" - * and "https" modules as shown here: - * - * var http = require('http') - * , https = require('https') - * , express = require('express') - * , app = express(); - * - * http.createServer(app).listen(80); - * https.createServer({ ... }, app).listen(443); - */ + * Listen for connections. + * + * A node `http.Server` is returned, with this + * application (which is a `Function`) as its + * callback. If you wish to create both an HTTP + * and HTTPS server you may do so with the "http" + * and "https" modules as shown here: + * + * var http = require('http') + * , https = require('https') + * , express = require('express') + * , app = express(); + * + * http.createServer(app).listen(80); + * https.createServer({ ... }, app).listen(443); + */ listen(port: number, hostname: string, backlog: number, callback?: Function): http.Server; listen(port: number, hostname: string, callback?: Function): http.Server; listen(port: number, callback?: Function): http.Server; @@ -1097,13 +1021,13 @@ interface Application extends IRouter, Express.Application { locals: any; /** - * The app.routes object houses all of the routes defined mapped by the - * associated HTTP verb. This object may be used for introspection - * capabilities, for example Express uses this internally not only for - * routing but to provide default OPTIONS behaviour unless app.options() - * is used. Your application or framework may also remove routes by - * simply by removing them from this object. - */ + * The app.routes object houses all of the routes defined mapped by the + * associated HTTP verb. This object may be used for introspection + * capabilities, for example Express uses this internally not only for + * routing but to provide default OPTIONS behaviour unless app.options() + * is used. Your application or framework may also remove routes by + * simply by removing them from this object. + */ routes: any; /** @@ -1114,8 +1038,7 @@ interface Application extends IRouter, Express.Application { use: ApplicationRequestHandler; } -interface Express extends Application { +export interface Express extends Application { request: Request; - response: Response; } diff --git a/types/express-serve-static-core/tslint.json b/types/express-serve-static-core/tslint.json new file mode 100644 index 0000000000..9b8c6a0c20 --- /dev/null +++ b/types/express-serve-static-core/tslint.json @@ -0,0 +1,11 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // TODOs + "ban-types": false, + "comment-format": false, + "interface-name": false, + "no-empty-interface": false, + "unified-signatures": false + } + } diff --git a/types/express-session/index.d.ts b/types/express-session/index.d.ts index 1a4d473a44..13ce6ab8b2 100644 --- a/types/express-session/index.d.ts +++ b/types/express-session/index.d.ts @@ -1,8 +1,8 @@ // Type definitions for express-session 1.15 // Project: https://www.npmjs.org/package/express-session -// Definitions by: Hiroki Horiuchi +// Definitions by: Hiroki Horiuchi , Jacob Bogers // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Definitions by: Jacob Bogers diff --git a/types/express-unless/index.d.ts b/types/express-unless/index.d.ts index 8a64ab87a8..7d7056f766 100644 --- a/types/express-unless/index.d.ts +++ b/types/express-unless/index.d.ts @@ -2,9 +2,7 @@ // Project: https://www.npmjs.org/package/express-unless // Definitions by: Wonshik Kim // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - - +// TypeScript Version: 2.3 import express = require('express'); diff --git a/types/express-unless/tslint.json b/types/express-unless/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/express-unless/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/express-useragent/index.d.ts b/types/express-useragent/index.d.ts index a8d55b113b..d6f47aa206 100644 --- a/types/express-useragent/index.d.ts +++ b/types/express-useragent/index.d.ts @@ -2,6 +2,7 @@ // Project: https://www.npmjs.org/package/express-useragent // Definitions by: Isman Usoh // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 /// diff --git a/types/express-useragent/tslint.json b/types/express-useragent/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/express-useragent/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/express/express-tests.ts b/types/express/express-tests.ts index 62e9fc7124..0c1081b49b 100644 --- a/types/express/express-tests.ts +++ b/types/express/express-tests.ts @@ -1,109 +1,122 @@ import * as express from 'express'; namespace express_tests { - - var app = express(); + const app = express(); app.engine('jade', require('jade').__express); app.engine('html', require('ejs').renderFile); express.static.mime.define({ - 'application/fx': ['fx'] + 'application/fx': ['fx'] }); app.use('/static', express.static(__dirname + '/public')); // simple logger - app.use(function(req, res, next) { - console.log('%s %s', req.method, req.url); - next(); + app.use((req, res, next) => { + console.log('%s %s', req.method, req.url); + next(); }); - app.use(function(err: any, req: express.Request, res: express.Response, next: express.NextFunction) { - console.error(err); - next(err); + app.use((err: any, req: express.Request, res: express.Response, next: express.NextFunction) => { + console.error(err); + next(err); }); + app.get('/', (req, res) => { + res.send('hello world'); + }); - app.get('/', function(req, res) { - res.send('hello world'); + // Accept json app-wide or on one endpoint. + app.use(express.json({ limit: "200kb" })); + app.post('/echo', express.json(), (req, res) => { + res.json(req.body); + }); + + // Accept urlencoded app-wide or on one endpoint. + app.use(express.urlencoded({ + extended: false, + parameterLimit: 16 + })); + app.post('/search', express.urlencoded(), (req, res) => { + res.json(Object.keys(req.body)); }); const router = express.Router({ caseSensitive: true, mergeParams: true, strict: true }); - const pathStr: string = 'test'; + const pathStr = 'test'; const pathRE: RegExp = /test/; const path = true ? pathStr : pathRE; router.get(path); - router.put(path) + router.put(path); router.post(path); router.delete(path); router.get(pathStr); - router.put(pathStr) + router.put(pathStr); router.post(pathStr); router.delete(pathStr); router.get(pathRE); - router.put(pathRE) + router.put(pathRE); router.post(pathRE); router.delete(pathRE); - router.use((req, res, next) => { next(); }) + router.use((req, res, next) => { next(); }); router.route('/users') - .get((req, res, next) => { - let types: string[] = req.accepts(); - let type: string | false = req.accepts('json'); - type = req.accepts(['json', 'text']); - type = req.accepts('json', 'text'); + .get((req, res, next) => { + const types: string[] = req.accepts(); + let type: string | false = req.accepts('json'); + type = req.accepts(['json', 'text']); + type = req.accepts('json', 'text'); - let charsets: string[] = req.acceptsCharsets(); - let charset: string | false = req.acceptsCharsets('utf-8'); - charset = req.acceptsCharsets(['utf-8', 'utf-16']); - charset = req.acceptsCharsets('utf-8', 'utf-16'); + const charsets: string[] = req.acceptsCharsets(); + let charset: string | false = req.acceptsCharsets('utf-8'); + charset = req.acceptsCharsets(['utf-8', 'utf-16']); + charset = req.acceptsCharsets('utf-8', 'utf-16'); - let encodings: string[] = req.acceptsEncodings(); - let encoding: string | false = req.acceptsEncodings('gzip'); - encoding = req.acceptsEncodings(['gzip', 'deflate']); - encoding = req.acceptsEncodings('gzip', 'deflate'); + const encodings: string[] = req.acceptsEncodings(); + let encoding: string | false = req.acceptsEncodings('gzip'); + encoding = req.acceptsEncodings(['gzip', 'deflate']); + encoding = req.acceptsEncodings('gzip', 'deflate'); - let languages: string[] = req.acceptsLanguages(); - let language: string | false = req.acceptsLanguages('en'); - language = req.acceptsLanguages(['en', 'ja']); - language = req.acceptsLanguages('en', 'ja'); + const languages: string[] = req.acceptsLanguages(); + let language: string | false = req.acceptsLanguages('en'); + language = req.acceptsLanguages(['en', 'ja']); + language = req.acceptsLanguages('en', 'ja'); - // downcasting - req.get('set-cookie') as undefined; - req.get('set-cookie') as string[]; - const setCookieHeader1 = req.get('set-cookie'); - if (setCookieHeader1 !== undefined) { - const setCookieHeader2: string[] = setCookieHeader1; - } - req.get('header') as undefined; - req.get('header') as string; - const header1 = req.get('header'); - if (header1 !== undefined) { - const header2: string = header1; - } + // downcasting + req.get('set-cookie') as undefined; + req.get('set-cookie') as string[]; + const setCookieHeader1 = req.get('set-cookie'); + if (setCookieHeader1 !== undefined) { + const setCookieHeader2: string[] = setCookieHeader1; + } + req.get('header') as undefined; + req.get('header') as string; + const header1 = req.get('header'); + if (header1 !== undefined) { + const header2: string = header1; + } - // upcasting - const setCookieHeader3: string[] | undefined = req.get('set-cookie'); - const header3: string | undefined = req.header('header'); + // upcasting + const setCookieHeader3: string[] | undefined = req.get('set-cookie'); + const header3: string | undefined = req.header('header'); - req.headers.existingHeader as string; - req.headers.nonExistingHeader as any as undefined; + req.headers.existingHeader as string; + req.headers.nonExistingHeader as any as undefined; - res.send(req.query['token']); - }); + res.send(req.query['token']); + }); - router.get('/user/:id', function(req, res, next) { - if (req.params.id == 0) next('route'); - else next(); - }, function(req, res, next) { - res.render('regular'); + router.get('/user/:id', (req, res, next) => { + if (Number(req.params.id) === 0) next('route'); + else next(); + }, (req, res, next) => { + res.render('regular'); }); app.use((req, res, next) => { - // hacky trick, router is just a handler - router(req, res, next); + // hacky trick, router is just a handler + router(req, res, next); }); app.use(router); @@ -120,9 +133,7 @@ namespace express_tests { ***************************/ import * as http from 'http'; - namespace node_tests { - { // http.createServer can take express application const app: express.Application = express(); diff --git a/types/express/index.d.ts b/types/express/index.d.ts index e127d6d5ed..59f60e92df 100644 --- a/types/express/index.d.ts +++ b/types/express/index.d.ts @@ -14,6 +14,7 @@ /// /// +import * as bodyParser from "body-parser"; import * as serveStatic from "serve-static"; import * as core from "express-serve-static-core"; @@ -23,12 +24,23 @@ import * as core from "express-serve-static-core"; declare function e(): core.Express; declare namespace e { + /** + * This is a built-in middleware function in Express. It parses incoming requests with JSON payloads and is based on body-parser. + * @since 4.16.0 + */ + var json: typeof bodyParser.json; /** - * This is the only built-in middleware function in Express. It serves static files and is based on serve-static. + * This is a built-in middleware function in Express. It serves static files and is based on serve-static. */ var static: typeof serveStatic; + /** + * This is a built-in middleware function in Express. It parses incoming requests with urlencoded payloads and is based on body-parser. + * @since 4.16.0 + */ + var urlencoded: typeof bodyParser.urlencoded; + export function Router(options?: RouterOptions): core.Router; interface RouterOptions { @@ -60,7 +72,7 @@ declare namespace e { interface Handler extends core.Handler { } interface IRoute extends core.IRoute { } interface IRouter extends core.IRouter { } - interface IRouterHandler extends core.IRouterHandler { } + interface IRouterHandler extends core.IRouterHandler { } interface IRouterMatcher extends core.IRouterMatcher { } interface MediaType extends core.MediaType { } interface NextFunction extends core.NextFunction { } diff --git a/types/express/tslint.json b/types/express/tslint.json new file mode 100644 index 0000000000..7b39baf22b --- /dev/null +++ b/types/express/tslint.json @@ -0,0 +1,12 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // Not sure if changing these won't break apps. + "interface-name": false, + "no-empty-interface": false, + "no-namespace": false, + "no-reference-import": false, + "no-var-keyword": false, + "strict-export-declare-modifiers": false + } +} \ No newline at end of file diff --git a/types/extend/extend-tests.ts b/types/extend/extend-tests.ts index 38e816f020..0bf977e6e8 100644 --- a/types/extend/extend-tests.ts +++ b/types/extend/extend-tests.ts @@ -1,38 +1,43 @@ -import extend = require('extend'); -declare function assert(cond: boolean): void; +/// +import * as assert from 'assert'; +import * as extend from 'extend'; -var objectBase = { +const objectBase = { test: 'base' }; -var objectOne = { +const objectOne = { test: 'one', iamone: true }; -var objectTwo = { +const objectTwo = { test: 2, iamtwo: true }; -var objectThree = { +const objectThree = { iamthree: true, depth: { innerType: 'deep' } }; -var extended = extend(objectBase, objectOne); +type ExtendedType = typeof objectBase & typeof objectOne; +const extended: ExtendedType = extend(objectBase, objectOne); assert(extended.test === 'one'); -assert(extended.iamone === true); +assert(extended.iamone); -var moreExtended = extend(objectBase, objectOne, objectTwo); +type MoreExtendedType = typeof objectBase & typeof objectOne & typeof objectTwo; +const moreExtended: MoreExtendedType = extend(objectBase, objectOne, objectTwo); assert(moreExtended.test === 2); -assert(moreExtended.iamone === true); -assert(moreExtended.iamtwo === true); +assert(moreExtended.iamone); +assert(moreExtended.iamtwo); -var deepExtended = extend(true, objectBase, objectOne, objectTwo, objectThree); -assert(deepExtended.iamone === true); -assert(moreExtended.iamtwo === true); -assert(deepExtended.iamthree === true); -assert(deepExtended.depth.innerType === 'one'); \ No newline at end of file +type DeepExtendedType = typeof objectBase & typeof objectOne & + typeof objectTwo & typeof objectThree; +const deepExtended = extend(true, objectBase, objectOne, objectTwo, objectThree); +assert(deepExtended.iamone); +assert(deepExtended.iamtwo); +assert(deepExtended.iamthree); +assert(deepExtended.depth.innerType === 'deep'); diff --git a/types/extend/index.d.ts b/types/extend/index.d.ts index e0af478a47..b94d1a7cb1 100644 --- a/types/extend/index.d.ts +++ b/types/extend/index.d.ts @@ -1,9 +1,20 @@ -// Type definitions for extend v2.0.0 +// Type definitions for extend 3.0 // Project: https://www.npmjs.com/package/extend // Definitions by: Stefan Steinhart // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare function extend(deepOrObject: boolean | Object, ...objectN: Object[]): any; -declare namespace extend { } +declare function extend(deep: boolean, target: T, source: U): T & U; +declare function extend(deep: boolean, target: T, source1: U, source2: V): T & U & V; +declare function extend(deep: boolean, target: T, source1: U, source2: V, + source3: W): T & U & V & W; +declare function extend(deep: boolean, target: T, source1: U, source2: V, + source3: W, source4: X): T & U & V & W & X; +declare function extend(target: T, source: U): T & U; +declare function extend(target: T, source1: U, source2: V): T & U & V; +declare function extend(target: T, source1: U, source2: V, source3: W): T & U & V & W; +declare function extend(target: T, source1: U, source2: V, + source3: W, source4: X): T & U & V & W & X; +declare function extend(deep: boolean, target: any, ...sources: any[]): any; +declare function extend(target: any, ...sources: any[]): any; +declare namespace extend {} export = extend; diff --git a/types/extend/tslint.json b/types/extend/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/extend/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/extended-listbox/tslint.json b/types/extended-listbox/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/extended-listbox/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/extjs/tslint.json b/types/extjs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/extjs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/eyes/tslint.json b/types/eyes/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/eyes/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fabric/index.d.ts b/types/fabric/index.d.ts index c24a413b40..ac6104d419 100644 --- a/types/fabric/index.d.ts +++ b/types/fabric/index.d.ts @@ -18,82 +18,78 @@ export function createCanvasForNode(width: number, height: number): Canvas; // ---------------------------------------------------------- /** * Creates markup containing SVG referenced elements like patterns, gradients etc. - * @param {fabric.Canvas} canvas instance of fabric.Canvas + * @param canvas instance of fabric.Canvas */ export function createSVGRefElementsMarkup(canvas: StaticCanvas): string; /** * Creates markup containing SVG font faces - * @param {Array} objects Array of fabric objects + * @param objects Array of fabric objects */ export function createSVGFontFacesMarkup(objects: Object[]): string; /** * Takes string corresponding to an SVG document, and parses it into a set of fabric objects - * @param {String} string - * @param {Function} callback - * @param {Function} [reviver] Method for further parsing of SVG elements, called after each fabric object created. + * @param [reviver] Method for further parsing of SVG elements, called after each fabric object created. */ export function loadSVGFromString(string: string, callback: (results: Object[], options: any) => void, reviver?: Function): void; /** * Takes url corresponding to an SVG document, and parses it into a set of fabric objects. * Note that SVG is fetched via XMLHttpRequest, so it needs to conform to SOP (Same Origin Policy) - * @param {String} url - * @param {Function} callback - * @param {Function} [reviver] Method for further parsing of SVG elements, called after each fabric object created. + * @param [reviver] Method for further parsing of SVG elements, called after each fabric object created. */ export function loadSVGFromURL(url: string, callback: (results: Object[], options: any) => void, reviver?: Function): void; /** * Returns CSS rules for a given SVG document - * @param {SVGDocument} doc SVG document to parse + * @param doc SVG document to parse */ export function getCSSRules(doc: SVGElement): any; export function parseElements(elements: any[], callback: Function, options: any, reviver?: Function): void; /** * Parses "points" attribute, returning an array of values - * @param {String} points points attribute string + * @param points points attribute string */ export function parsePointsAttribute(points: string): any[]; /** * Parses "style" attribute, retuning an object with values - * @param {SVGElement} element Element to parse + * @param element Element to parse */ export function parseStyleAttribute(element: SVGElement): any; /** * Transforms an array of svg elements to corresponding fabric.* instances - * @param {Array} elements Array of elements to parse - * @param {Function} callback Being passed an array of fabric instances (transformed from SVG elements) - * @param {Object} [options] Options object - * @param {Function} [reviver] Method for further parsing of SVG elements, called after each fabric object created. + * @param elements Array of elements to parse + * @param callback Being passed an array of fabric instances (transformed from SVG elements) + * @param [options] Options object + * @param [reviver] Method for further parsing of SVG elements, called after each fabric object created. */ export function parseElements(elements: any[], callback: Function, options?: any, reviver?: Function): void; /** * Returns an object of attributes' name/value, given element and an array of attribute names; * Parses parent "g" nodes recursively upwards. - * @param {DOMElement} element Element to parse - * @param {Array} attributes Array of attributes to parse + * @param element Element to parse + * @param attributes Array of attributes to parse */ export function parseAttributes(element: HTMLElement, attributes: string[], svgUid?: string): { [key: string]: string }; /** * Parses an SVG document, returning all of the gradient declarations found in it - * @param {SVGDocument} doc SVG document to parse + * @param doc SVG document to parse */ export function getGradientDefs(doc: SVGElement): { [key: string]: any }; /** * Parses a short font declaration, building adding its properties to a style object - * @param {String} value font declaration - * @param {Object} oStyle definition + * @param value font declaration + * @param oStyle definition */ export function parseFontDeclaration(value: string, oStyle: any): void; /** * Parses an SVG document, converts it to an array of corresponding fabric.* instances and passes them to a callback - * @param {SVGDocument} doc SVG document to parse - * @param {Function} callback Callback to call when parsing is finished; It's being passed an array of elements (parsed from a document). - * @param {Function} [reviver] Method for further parsing of SVG elements, called after each fabric object created. + * @param doc SVG document to parse + * @param callback Callback to call when parsing is finished; It's being passed an array of elements (parsed from a document). + * @param [reviver] Method for further parsing of SVG elements, called after each fabric object created. */ export function parseSVGDocument(doc: SVGElement, callback: (results: Object[], options: any) => void, reviver?: Function): void; /** * Parses "transform" attribute, returning an array of values - * @param {String} attributeValue String containing attribute value + * @param attributeValue String containing attribute value */ export function parseTransformAttribute(attributeValue: string): number[]; @@ -208,74 +204,71 @@ interface ICollection { /** * Adds objects to collection, then renders canvas (if `renderOnAddRemove` is not `false`) * Objects should be instances of (or inherit from) fabric.Object - * @param {...fabric.Object} object Zero or more fabric instances + * @param object Zero or more fabric instances */ add(...object: Object[]): T; /** * Inserts an object into collection at specified index, then renders canvas (if `renderOnAddRemove` is not `false`) * An object should be an instance of (or inherit from) fabric.Object - * @param {Object} object Object to insert - * @param {Number} index Index to insert object at - * @param {Boolean} nonSplicing When `true`, no splicing (shifting) of objects occurs - * @return {Self} thisArg + * @param object Object to insert + * @param index Index to insert object at + * @param nonSplicing When `true`, no splicing (shifting) of objects occurs + * @return thisArg * @chainable */ insertAt(object: Object, index: number, nonSplicing: boolean): T; /** * Removes objects from a collection, then renders canvas (if `renderOnAddRemove` is not `false`) - * @param {...fabric.Object} object Zero or more fabric instances - * @return {Self} thisArg + * @param object Zero or more fabric instances + * @return thisArg * @chainable */ remove(...object: Object[]): T; /** * Executes given function for each object in this group - * @param {Function} callback - * @param {Object} context Context (aka thisObject) - * @return {Self} thisArg + * @param context Context (aka thisObject) + * @return thisArg */ forEachObject(callback: (element: Object, index: number, array: Object[]) => any, context?: any): T; /** * Returns an array of children objects of this instance * Type parameter introduced in 1.3.10 - * @param {String} [type] When specified, only objects of this type are returned - * @return {Array} + * @param [type] When specified, only objects of this type are returned */ getObjects(type?: string): Object[]; /** * Returns object at specified index - * @param {Number} index - * @return {Self} thisArg + * @return thisArg */ item(index: number): T; /** * Returns true if collection contains no objects - * @return {Boolean} true if collection is empty + * @return true if collection is empty */ isEmpty(): boolean; /** * Returns a size of a collection (i.e: length of an array containing its objects) - * @return {Number} Collection size + * @return Collection size */ size(): number; /** * Returns true if collection contains an object - * @param {Object} object Object to check against - * @return {Boolean} `true` if collection contains an object + * @param object Object to check against + * @return `true` if collection contains an object */ contains(object: Object): boolean; /** * Returns number representation of a collection complexity - * @return {Number} complexity + * @return complexity */ complexity(): number; } @@ -295,8 +288,8 @@ interface IObservable { on(eventName: {[key: string]: Function}): T; /** * Fires event with an optional options object - * @param {String} eventName Event name to fire - * @param {Object} [options] Options object + * @param eventName Event name to fire + * @param [options] Options object */ trigger(eventName: string, options?: any): T; /** @@ -308,38 +301,35 @@ interface IObservable { off(eventName?: string|any, handler?: (e: IEvent) => any): T; } +interface Callbacks { + /** Invoked on completion */ + onComplete?: Function; + /** Invoked on every step of animation */ + onChange?: Function; +} + // animation mixin // ---------------------------------------------------- interface ICanvasAnimation { FX_DURATION: number; /** * Centers object horizontally with animation. - * @param {fabric.Object} object Object to center - * @param {Object} [callbacks] Callbacks object with optional "onComplete" and/or "onChange" properties - * @param {Function} [callbacks.onComplete] Invoked on completion - * @param {Function} [callbacks.onChange] Invoked on every step of animation + * @param object Object to center */ - fxCenterObjectH(object: Object, callbacks?: { onComplete: Function; onChange: Function; }): T; + fxCenterObjectH(object: Object, callbacks?: Callbacks): T; /** * Centers object vertically with animation. - * @param {fabric.Object} object Object to center - * @param {Object} [callbacks] Callbacks object with optional "onComplete" and/or "onChange" properties - * @param {Function} [callbacks.onComplete] Invoked on completion - * @param {Function} [callbacks.onChange] Invoked on every step of animation + * @param object Object to center */ - fxCenterObjectV(object: Object, callbacks?: { onComplete: Function; onChange: Function; }): T; + fxCenterObjectV(object: Object, callbacks?: Callbacks): T; /** * Same as `fabric.Canvas#remove` but animated - * @param {fabric.Object} object Object to remove - * @param {Object} [callbacks] Callbacks object with optional "onComplete" and/or "onChange" properties - * @param {Function} [callbacks.onComplete] Invoked on completion - * @param {Function} [callbacks.onChange] Invoked on every step of animation - * @return {fabric.Canvas} thisArg + * @param object Object to remove * @chainable */ - fxRemove(object: Object, callbacks?: { onComplete: Function; onChange: Function; }): T; + fxRemove(object: Object): T; } interface IObjectAnimation { /** @@ -393,7 +383,7 @@ export class Color { /** * Color class * The purpose of Color is to abstract and encapsulate common color operations; - * @param {String} color optional in hex or rgb(a) format + * @param color optional in hex or rgb(a) format */ constructor(color?: string); @@ -439,7 +429,7 @@ export class Color { /** * Sets value of alpha channel for this color - * @param {Number} alpha Alpha value 0-1 + * @param alpha Alpha value 0-1 */ setAlpha(alpha: number): void; @@ -450,66 +440,63 @@ export class Color { /** * Transforms color to its black and white representation - * @param {Number} threshold */ toBlackWhite(threshold: number): Color; /** * Overlays color with another color - * @param {String|fabric.Color} otherColor */ overlayWith(otherColor: string|Color): Color; /** * Returns new color object, when given a color in RGB format - * @param {String} color Color value ex: rgb(0-255,0-255,0-255) + * @param color Color value ex: rgb(0-255,0-255,0-255) */ static fromRgb(color: string): Color; /** * Returns new color object, when given a color in RGBA format - * @param {String} color Color value ex: rgb(0-255,0-255,0-255) + * @param color Color value ex: rgb(0-255,0-255,0-255) */ static fromRgba(color: string): Color; /** * Returns array represenatation (ex: [100, 100, 200, 1]) of a color that's in RGB or RGBA format - * @param {String} color Color value ex: rgb(0-255,0-255,0-255), rgb(0%-100%,0%-100%,0%-100%) + * @param color Color value ex: rgb(0-255,0-255,0-255), rgb(0%-100%,0%-100%,0%-100%) */ static sourceFromRgb(color: string): number[]; /** * Returns new color object, when given a color in HSL format - * @param {String} color Color value ex: hsl(0-260,0%-100%,0%-100%) + * @param color Color value ex: hsl(0-260,0%-100%,0%-100%) */ static fromHsl(color: string): Color; /** * Returns new color object, when given a color in HSLA format - * @param {String} color Color value ex: hsl(0-260,0%-100%,0%-100%) + * @param color Color value ex: hsl(0-260,0%-100%,0%-100%) */ static fromHsla(color: string): Color; /** * Returns array represenatation (ex: [100, 100, 200, 1]) of a color that's in HSL or HSLA format. - * @param {String} color Color value ex: hsl(0-360,0%-100%,0%-100%) or hsla(0-360,0%-100%,0%-100%, 0-1) + * @param color Color value ex: hsl(0-360,0%-100%,0%-100%) or hsla(0-360,0%-100%,0%-100%, 0-1) */ static sourceFromHsl(color: string): number[]; /** * Returns new color object, when given a color in HEX format - * @param {String} color Color value ex: FF5555 + * @param color Color value ex: FF5555 */ static fromHex(color: string): Color; /** * Returns array represenatation (ex: [100, 100, 200, 1]) of a color that's in HEX format - * @param {String} color ex: FF5555 + * @param color ex: FF5555 */ static sourceFromHex(color: string): number[]; /** * Returns new color object, when given color in array representation (ex: [200, 100, 100, 0.5]) - * @param {Array} source */ static fromSource(source: number[]): Color; } interface IGradientOptions { /** - * @param {String} [options.type] Type of gradient 'radial' or 'linear' + * @param [options.type] Type of gradient 'radial' or 'linear' */ type?: string; /** @@ -544,7 +531,7 @@ interface IGradientOptions { interface IGradient extends IGradientOptions { /** * Adds another colorStop - * @param {Object} colorStop Object with offset and color + * @param colorStop Object with offset and color */ addColorStop(colorStop: any): IGradient; /** @@ -553,15 +540,15 @@ interface IGradient extends IGradientOptions { toObject(): any; /** * Returns SVG representation of an gradient - * @param {Object} object Object to create a gradient for - * @param {Boolean} normalize Whether coords should be normalized - * @return {String} SVG representation of an gradient (linear/radial) + * @param object Object to create a gradient for + * @param normalize Whether coords should be normalized + * @return SVG representation of an gradient (linear/radial) */ toSVG(object: Object, normalize?: boolean): string; /** * Returns an instance of CanvasGradient - * @param {CanvasRenderingContext2D} ctx Context to render on + * @param ctx Context to render on */ toLive(ctx: CanvasRenderingContext2D, object?: PathGroup): CanvasGradient; } @@ -569,14 +556,12 @@ interface IGrandientStatic { new (options?: IGradientOptions): IGradient; /** * Returns instance from an SVG element - * @param {SVGGradientElement} el SVG gradient element - * @param {fabric.Object} instance + * @param el SVG gradient element */ fromElement(el: SVGGradientElement, instance: Object): IGradient; /** * Returns instance from its object representation - * @param {Object} obj - * @param {Object} [options] Options object + * @param [options] Options object */ fromObject(obj: any, options: any[]): IGradient; } @@ -647,7 +632,6 @@ export class Pattern { toObject(): any; /** * Returns SVG representation of a pattern - * @param {fabric.Object} object */ toSVG(object: Object): string; } @@ -660,134 +644,111 @@ export class Point { /** * Adds another point to this one and returns another one - * @param {fabric.Point} that */ add(that: Point): Point; /** * Adds another point to this one - * @param {fabric.Point} that */ addEquals(that: Point): Point; /** * Adds value to this point and returns a new one - * @param {Number} scalar */ scalarAdd(scalar: number): Point; /** * Adds value to this point - * @param {Number} scalar */ scalarAddEquals(scalar: number): Point; /** * Subtracts another point from this point and returns a new one - * @param {fabric.Point} that */ subtract(that: Point): Point; /** * Subtracts another point from this point - * @param {fabric.Point} that */ subtractEquals(that: Point): Point; /** * Subtracts value from this point and returns a new one - * @param {Number} scalar */ scalarSubtract(scalar: number): Point; /** * Subtracts value from this point - * @param {Number} scalar */ scalarSubtractEquals(scalar: number): Point; /** * Miltiplies this point by a value and returns a new one - * @param {Number} scalar */ multiply(scalar: number): Point; /** * Miltiplies this point by a value - * @param {Number} scalar */ multiplyEquals(scalar: number): Point; /** * Divides this point by a value and returns a new one - * @param {Number} scalar */ divide(scalar: number): Point; /** * Divides this point by a value - * @param {Number} scalar */ divideEquals(scalar: number): Point; /** * Returns true if this point is equal to another one - * @param {fabric.Point} that */ eq(that: Point): Point; /** * Returns true if this point is less than another one - * @param {fabric.Point} that */ lt(that: Point): Point; /** * Returns true if this point is less than or equal to another one - * @param {fabric.Point} that */ lte(that: Point): Point; /** * Returns true if this point is greater another one - * @param {fabric.Point} that */ gt(that: Point): Point; /** * Returns true if this point is greater than or equal to another one - * @param {fabric.Point} that */ gte(that: Point): Point; /** * Returns new point which is the result of linear interpolation with this one and another one - * @param {fabric.Point} that - * @param {Number} t */ lerp(that: Point, t: number): Point; /** * Returns distance from this point and another one - * @param {fabric.Point} that */ distanceFrom(that: Point): number; /** * Returns the point between this point and another one - * @param {fabric.Point} that */ midPointFrom(that: Point): Point; /** * Returns a new point which is the min of this and another one - * @param {fabric.Point} that */ min(that: Point): Point; /** * Returns a new point which is the max of this and another one - * @param {fabric.Point} that */ max(that: Point): Point; @@ -798,20 +759,16 @@ export class Point { /** * Sets x/y of this point - * @param {Number} x - * @param {Number} y */ setXY(x: number, y: number): Point; /** * Sets x/y of this point from another point - * @param {fabric.Point} that */ setFromPoint(that: Point): Point; /** * Swaps x/y of this point and another point - * @param {fabric.Point} that */ swap(that: Point): Point; } @@ -856,7 +813,6 @@ export class IShadow { toString(): string; /** * Returns SVG representation of a shadow - * @param {fabric.Object} object */ toSVG(object: Object): string; @@ -972,8 +928,8 @@ export interface StaticCanvas extends IObservable, IStaticCanvasOp export class StaticCanvas { /** * Constructor - * @param {HTMLElement|String} element element to initialize instance on - * @param {Object} [options] Options object + * @param element element to initialize instance on + * @param [options] Options object */ constructor(element: HTMLCanvasElement|string, options?: ICanvasOptions); @@ -985,31 +941,31 @@ export class StaticCanvas { /** * Sets {@link fabric.StaticCanvas#overlayImage|overlay image} for this canvas - * @param {(fabric.Image|String)} image fabric.Image instance or URL of an image to set overlay to - * @param {Function} callback callback to invoke when image is loaded and set as an overlay - * @param {Object} [options] Optional options to set for the {@link fabric.Image|overlay image}. + * @param image fabric.Image instance or URL of an image to set overlay to + * @param callback callback to invoke when image is loaded and set as an overlay + * @param [options] Optional options to set for the {@link fabric.Image|overlay image}. */ setOverlayImage(image: Image|string, callback: Function, options?: IObjectOptions): StaticCanvas; /** * Sets {@link fabric.StaticCanvas#backgroundImage|background image} for this canvas - * @param {(fabric.Image|String)} image fabric.Image instance or URL of an image to set background to - * @param {Function} callback Callback to invoke when image is loaded and set as background - * @param {Object} [options] Optional options to set for the {@link fabric.Image|background image}. + * @param image fabric.Image instance or URL of an image to set background to + * @param callback Callback to invoke when image is loaded and set as background + * @param [options] Optional options to set for the {@link fabric.Image|background image}. */ setBackgroundImage(image: Image|string, callback: Function, options?: IObjectOptions): StaticCanvas; /** * Sets {@link fabric.StaticCanvas#overlayColor|background color} for this canvas - * @param {(String|fabric.Pattern)} overlayColor Color or pattern to set background color to - * @param {Function} callback Callback to invoke when background color is set + * @param overlayColor Color or pattern to set background color to + * @param callback Callback to invoke when background color is set */ setOverlayColor(overlayColor: string|Pattern, callback: Function): StaticCanvas; /** * Sets {@link fabric.StaticCanvas#backgroundColor|background color} for this canvas - * @param {(String|fabric.Pattern)} backgroundColor Color or pattern to set background color to - * @param {Function} callback Callback to invoke when background color is set + * @param backgroundColor Color or pattern to set background color to + * @param callback Callback to invoke when background color is set */ setBackgroundColor(backgroundColor: string|Pattern, callback: Function): StaticCanvas; @@ -1025,22 +981,22 @@ export class StaticCanvas { /** * Sets width of this canvas instance - * @param {Number|String} value Value to set width to - * @param {Object} [options] Options object + * @param value Value to set width to + * @param [options] Options object */ setWidth(value: number|string, options?: ICanvasDimensionsOptions): StaticCanvas; /** * Sets height of this canvas instance - * @param {Number|String} value Value to set height to - * @param {Object} [options] Options object + * @param value Value to set height to + * @param [options] Options object */ setHeight(value: number|string, options?: ICanvasDimensionsOptions): StaticCanvas; /** * Sets dimensions (width, height) of this canvas instance. when options.cssOnly flag active you should also supply the unit of measure (px/%/em) - * @param {Object} dimensions Object with width/height properties - * @param {Object} [options] Options object + * @param dimensions Object with width/height properties + * @param [options] Options object */ setDimensions(dimensions: ICanvasDimensions, options?: ICanvasDimensionsOptions): StaticCanvas; @@ -1051,32 +1007,32 @@ export class StaticCanvas { /** * Sets viewport transform of this canvas instance - * @param {Array} vpt the transform in the form of context.transform + * @param vpt the transform in the form of context.transform */ setViewportTransform(vpt: number[]): StaticCanvas; /** * Sets zoom level of this canvas instance, zoom centered around point - * @param {fabric.Point} point to zoom with respect to - * @param {Number} value to set zoom to, less than 1 zooms out + * @param point to zoom with respect to + * @param value to set zoom to, less than 1 zooms out */ zoomToPoint(point: Point, value: number): StaticCanvas; /** * Sets zoom level of this canvas instance - * @param {Number} value to set zoom to, less than 1 zooms out + * @param value to set zoom to, less than 1 zooms out */ setZoom(value: number): StaticCanvas; /** * Pan viewport so as to place point at top left corner of canvas - * @param {fabric.Point} point to move to + * @param point to move to */ absolutePan(point: Point): StaticCanvas; /** * Pans viewpoint relatively - * @param {fabric.Point} point (position vector) to move by + * @param point (position vector) to move by */ relativePan(point: Point): StaticCanvas; @@ -1097,7 +1053,7 @@ export class StaticCanvas { /** * Clears specified context of canvas element - * @param {CanvasRenderingContext2D} ctx Context to clear + * @param ctx Context to clear * @chainable */ clearContext(ctx: CanvasRenderingContext2D): StaticCanvas; @@ -1114,7 +1070,7 @@ export class StaticCanvas { /** * Renders both the top canvas and the secondary container canvas. - * @param {Boolean} [allOnTop] Whether we want to force all images to be rendered on the top canvas + * @param [allOnTop] Whether we want to force all images to be rendered on the top canvas * @chainable */ renderAll(allOnTop?: boolean): StaticCanvas; @@ -1134,39 +1090,39 @@ export class StaticCanvas { /** * Centers object horizontally. * You might need to call `setCoords` on an object after centering, to update controls area. - * @param {fabric.Object} object Object to center horizontally + * @param object Object to center horizontally */ centerObjectH(object: Object): StaticCanvas; /** * Centers object vertically. * You might need to call `setCoords` on an object after centering, to update controls area. - * @param {fabric.Object} object Object to center vertically + * @param object Object to center vertically */ centerObjectV(object: Object): StaticCanvas; /** * Centers object vertically and horizontally. * You might need to call `setCoords` on an object after centering, to update controls area. - * @param {fabric.Object} object Object to center vertically and horizontally + * @param object Object to center vertically and horizontally */ centerObject(object: Object): StaticCanvas; /** * Returs dataless JSON representation of canvas - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output + * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ toDatalessJSON(propertiesToInclude?: any[]): string; /** * Returns object representation of canvas - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output + * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ toObject(propertiesToInclude?: any[]): any; /** * Returns dataless object representation of canvas - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output + * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ toDatalessObject(propertiesToInclude?: any[]): any; @@ -1178,44 +1134,44 @@ export class StaticCanvas { /** * Returns SVG representation of canvas - * @param {Object} [options] Options object for SVG output - * @param {Function} [reviver] Method for further parsing of svg elements, called after each fabric object converted into svg representation. + * @param [options] Options object for SVG output + * @param [reviver] Method for further parsing of svg elements, called after each fabric object converted into svg representation. */ toSVG(options: IToSVGOptions, reviver?: Function): string; /** * Moves an object to the bottom of the stack of drawn objects - * @param {fabric.Object} object Object to send to back + * @param object Object to send to back * @chainable */ sendToBack(object: Object): StaticCanvas; /** * Moves an object to the top of the stack of drawn objects - * @param {fabric.Object} object Object to send + * @param object Object to send * @chainable */ bringToFront(object: Object): StaticCanvas; /** * Moves an object down in stack of drawn objects - * @param {fabric.Object} object Object to send - * @param {Boolean} [intersecting] If `true`, send object behind next lower intersecting object + * @param object Object to send + * @param [intersecting] If `true`, send object behind next lower intersecting object * @chainable */ sendBackwards(object: Object): StaticCanvas; /** * Moves an object up in stack of drawn objects - * @param {fabric.Object} object Object to send - * @param {Boolean} [intersecting] If `true`, send object in front of next upper intersecting object + * @param object Object to send + * @param [intersecting] If `true`, send object in front of next upper intersecting object * @chainable */ bringForward(object: Object): StaticCanvas; /** * Moves an object to specified level in stack of drawn objects - * @param {fabric.Object} object Object to send - * @param {Number} index Position to move to + * @param object Object to send + * @param index Position to move to * @chainable */ moveTo(object: Object, index: number): StaticCanvas; @@ -1232,32 +1188,32 @@ export class StaticCanvas { /** * Exports canvas element to a dataurl image. Note that when multiplier is used, cropping is scaled appropriately - * @param {Object} [options] Options object + * @param [options] Options object */ toDataURL(options?: IDataURLOptions): string; /** * Provides a way to check support of some of the canvas methods * (either those of HTMLCanvasElement itself, or rendering context) - * @param {String} methodName Method to check support for; Could be one of "getImageData", "toDataURL", "toDataURLWithQuality" or "setLineDash" - * @return {Boolean | null} `true` if method is supported (or at least exists), null` if canvas element or context can not be initialized + * @param methodName Method to check support for; Could be one of "getImageData", "toDataURL", "toDataURLWithQuality" or "setLineDash" + * @return `true` if method is supported (or at least exists), null` if canvas element or context can not be initialized */ supports(methodName: string): boolean; /** * Populates canvas with data from the specified JSON. * JSON format must conform to the one of toJSON formats - * @param {String|Object} json JSON string or object - * @param {Function} callback Callback, invoked when json is parsed + * @param json JSON string or object + * @param callback Callback, invoked when json is parsed * and corresponding objects (e.g: {@link fabric.Image}) * are initialized - * @param {Function} [reviver] Method for further parsing of JSON elements, called after each fabric object created. + * @param [reviver] Method for further parsing of JSON elements, called after each fabric object created. */ loadFromJSON(json: string|any, callback: Function, reviver?: Function): Canvas; /** * Clones canvas instance - * @param {Object} [callback] Receives cloned instance as a first argument - * @param {Array} [properties] Array of properties to include in the cloned canvas and children + * @param [callback] Receives cloned instance as a first argument + * @param [properties] Array of properties to include in the cloned canvas and children */ clone(callback: (canvas: StaticCanvas) => any, properties?: any[]): void; @@ -1265,7 +1221,7 @@ export class StaticCanvas { * Clones canvas instance without cloning existing data. * This essentially copies canvas dimensions, clipping properties, etc. * but leaves data empty (so that you can populate it with your own) - * @param {Object} [callback] Receives cloned instance as a first argument + * @param [callback] Receives cloned instance as a first argument */ cloneWithoutData(callback: (canvas: StaticCanvas) => any): void; @@ -1279,13 +1235,13 @@ export class StaticCanvas { /** * Straightens object, then rerenders canvas - * @param {fabric.Object} object Object to straighten + * @param object Object to straighten */ straightenObject(object: Object): StaticCanvas; /** * Same as straightenObject, but animated - * @param {fabric.Object} object Object to straighten + * @param object Object to straighten */ fxStraightenObject(object: Object): StaticCanvas; @@ -1293,12 +1249,12 @@ export class StaticCanvas { /** * Provides a way to check support of some of the canvas methods * (either those of HTMLCanvasElement itself, or rendering context) - * @param {String} methodName Method to check support for; Could be one of "getImageData", "toDataURL", "toDataURLWithQuality" or "setLineDash" + * @param methodName Method to check support for; Could be one of "getImageData", "toDataURL", "toDataURLWithQuality" or "setLineDash" */ static supports(methodName: string): boolean; /** * Returns JSON representation of canvas - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output + * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ static toJSON(propertiesToInclude?: any[]): string; } @@ -1409,8 +1365,8 @@ export interface Canvas extends ICanvasOptions {} export class Canvas { /** * Constructor - * @param {HTMLElement|String} element element to initialize instance on - * @param {Object} [options] Options object + * @param element element to initialize instance on + * @param [options] Options object */ constructor(element: HTMLCanvasElement | string, options?: ICanvasOptions); @@ -1418,93 +1374,90 @@ export class Canvas { /** * Checks if point is contained within an area of given object - * @param {Event} e Event object - * @param {fabric.Object} target Object to test against + * @param e Event object + * @param target Object to test against */ containsPoint(e: Event, target: Object): boolean; /** * Deactivates all objects on canvas, removing any active group or object - * @return {fabric.Canvas} thisArg + * @return thisArg */ deactivateAll(): Canvas; /** * Deactivates all objects and dispatches appropriate events - * @param {Event} [e] Event (passed along when firing) - * @return {fabric.Canvas} thisArg + * @param [e] Event (passed along when firing) + * @return thisArg */ deactivateAllWithDispatch(e?: Event): Canvas; /** * Discards currently active group - * @param {Event} [e] Event (passed along when firing) - * @return {fabric.Canvas} thisArg + * @param [e] Event (passed along when firing) + * @return thisArg */ discardActiveGroup(e?: Event): Canvas; /** * Discards currently active object - * @param {Event} [e] Event (passed along when firing) - * @return {fabric.Canvas} thisArg + * @param [e] Event (passed along when firing) + * @return thisArg * @chainable */ discardActiveObject(e?: Event): Canvas; /** * Draws objects' controls (borders/controls) - * @param {CanvasRenderingContext2D} ctx Context to render controls on + * @param ctx Context to render controls on */ drawControls(ctx: CanvasRenderingContext2D): void; /** * Method that determines what object we are clicking on - * @param {Event} e mouse event - * @param {Boolean} skipGroup when true, group is skipped and only objects are traversed through + * @param e mouse event + * @param skipGroup when true, group is skipped and only objects are traversed through */ findTarget(e: MouseEvent, skipGroup: boolean): Canvas; /** * Returns currently active group - * @return {fabric.Group} Current group + * @return Current group */ getActiveGroup(): Group; /** * Returns currently active object - * @return {fabric.Object} active object + * @return active object */ getActiveObject(): Object; /** * Returns pointer coordinates relative to canvas. - * @param {Event} e - * @return {Object} object with "x" and "y" number values + * @return object with "x" and "y" number values */ getPointer(e: Event, ignoreZoom?: boolean, upperCanvasEl?: CanvasRenderingContext2D): { x: number; y: number; }; /** * Returns context of canvas where object selection is drawn - * @return {CanvasRenderingContext2D} */ getSelectionContext(): CanvasRenderingContext2D; /** * Returns element on which object selection is drawn - * @return {HTMLCanvasElement} */ getSelectionElement(): HTMLCanvasElement; /** * Returns true if object is transparent at a certain location - * @param {fabric.Object} target Object to check - * @param {Number} x Left coordinate - * @param {Number} y Top coordinate + * @param target Object to check + * @param x Left coordinate + * @param y Top coordinate */ isTargetTransparent(target: Object, x: number, y: number): boolean; /** * Sets active group to a speicified one - * @param {fabric.Group} group Group to set as a current one - * @param {Event} [e] Event (passed along when firing) + * @param group Group to set as a current one + * @param [e] Event (passed along when firing) */ setActiveGroup(group: Group, e?: Event): Canvas; /** * Sets given object as the only active object on canvas - * @param {fabric.Object} object Object to set as an active one - * @param {Event} [e] Event (passed along when firing "object:selected") + * @param object Object to set as an active one + * @param [e] Event (passed along when firing "object:selected") */ setActiveObject(object: Object, e?: Event): Canvas; /** * Set the cursor type of the canvas element - * @param {String} value Cursor type of the canvas element. + * @param value Cursor type of the canvas element. * @see http://www.w3.org/TR/css3-ui/#cursor */ setCursor(value: string): void; @@ -1518,12 +1471,12 @@ export class Canvas { /** * Provides a way to check support of some of the canvas methods * (either those of HTMLCanvasElement itself, or rendering context) - * @param {String} methodName Method to check support for; Could be one of "getImageData", "toDataURL", "toDataURLWithQuality" or "setLineDash" + * @param methodName Method to check support for; Could be one of "getImageData", "toDataURL", "toDataURLWithQuality" or "setLineDash" */ static supports(methodName: string): boolean; /** * Returns JSON representation of canvas - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output + * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ static toJSON(propertiesToInclude?: any[]): string; } @@ -1553,35 +1506,32 @@ export class Circle { /** * Returns complexity of an instance - * @return {Number} complexity of this instance + * @return complexity of this instance */ complexity(): number; /** * Returns horizontal radius of an object (according to how an object is scaled) - * @return {Number} */ getRadiusX(): number; /** * Returns vertical radius of an object (according to how an object is scaled) - * @return {Number} */ getRadiusY(): number; /** * Sets radius of an object (and updates width accordingly) - * @return {Number} */ setRadius(value: number): number; /** * Returns object representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} object representation of an instance + * @param [propertiesToInclude] Any properties that you might want to additionally include in the output + * @return object representation of an instance */ toObject(propertiesToInclude?: any[]): any; /** * Returns svg representation of an instance - * @param {Function} [reviver] Method for further parsing of svg representation. - * @return {String} svg representation of an instance + * @param [reviver] Method for further parsing of svg representation. + * @return svg representation of an instance */ toSVG(reviver?: Function): string; @@ -1591,13 +1541,13 @@ export class Circle { static ATTRIBUTE_NAMES: string[]; /** * Returns Circle instance from an SVG element - * @param {SVGElement} element Element to parse - * @param {Object} [options] Options object + * @param element Element to parse + * @param [options] Options object */ static fromElement(element: SVGElement, options: ICircleOptions): Circle; /** * Returns Circle instance from an object representation - * @param {Object} object Object to create an instance from + * @param object Object to create an instance from */ static fromObject(object: any): Circle; } @@ -1618,30 +1568,28 @@ export class Ellipse { /** * Returns horizontal radius of an object (according to how an object is scaled) - * @return {Number} */ getRx(): number; /** * Returns Vertical radius of an object (according to how an object is scaled) - * @return {Number} */ getRy(): number; /** * Returns object representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} object representation of an instance + * @param [propertiesToInclude] Any properties that you might want to additionally include in the output + * @return object representation of an instance */ toObject(propertiesToInclude?: any[]): any; /** * Returns svg representation of an instance - * @param {Function} [reviver] Method for further parsing of svg representation. - * @return {String} svg representation of an instance + * @param [reviver] Method for further parsing of svg representation. + * @return svg representation of an instance */ toSVG(reviver?: Function): string; /** * Returns complexity of an instance - * @return {Number} complexity + * @return complexity */ complexity(): number; @@ -1652,14 +1600,14 @@ export class Ellipse { /** * Returns Ellipse instance from an SVG element - * @param {SVGElement} element Element to parse - * @param {Object} [options] Options object + * @param element Element to parse + * @param [options] Options object */ static fromElement(element: SVGElement, options?: IEllipseOptions): Ellipse; /** * Returns Ellipse instance from an object representation - * @param {Object} object Object to create an instance from + * @param object Object to create an instance from */ static fromObject(object: any): Ellipse; } @@ -1668,91 +1616,87 @@ export interface Group extends Object, ICollection {} export class Group { /** * Constructor - * @param {Object} objects Group objects - * @param {Object} [options] Options object + * @param objects Group objects + * @param [options] Options object */ constructor(items?: any[], options?: IObjectOptions); activateAllObjects(): Group; /** * Adds an object to a group; Then recalculates group's dimension, position. - * @param {Object} object - * @return {fabric.Group} thisArg + * @return thisArg * @chainable */ addWithUpdate(object: Object): Group; containsPoint(point: Point): boolean; /** * Destroys a group (restoring state of its objects) - * @return {fabric.Group} thisArg + * @return thisArg * @chainable */ destroy(): Group; /** * Returns requested property - * @param {String} prop Property to get - * @return {Any} + * @param prop Property to get */ get(prop: string): any; /** * Checks whether this group was moved (since `saveCoords` was called last) - * @return {Boolean} true if an object was moved (since fabric.Group#saveCoords was called) + * @return true if an object was moved (since fabric.Group#saveCoords was called) */ hasMoved(): boolean; /** * Removes an object from a group; Then recalculates group's dimension, position. - * @param {Object} object - * @return {fabric.Group} thisArg + * @return thisArg * @chainable */ removeWithUpdate(object: Object): Group; /** * Renders instance on a given context - * @param {CanvasRenderingContext2D} ctx context to render instance on + * @param ctx context to render instance on */ render(ctx: CanvasRenderingContext2D): void; /** * Removes objects from a collection, then renders canvas (if `renderOnAddRemove` is not `false`) - * @param {...fabric.Object} object Zero or more fabric instances - * @return {Self} thisArg + * @param object Zero or more fabric instances + * @return thisArg * @chainable */ remove(...object: Object[]): Group; /** * Saves coordinates of this instance (to be used together with `hasMoved`) * @saveCoords - * @return {fabric.Group} thisArg + * @return thisArg * @chainable */ saveCoords(): Group; /** * Sets coordinates of all group objects - * @return {fabric.Group} thisArg + * @return thisArg * @chainable */ setObjectsCoords(): Group; /** * Returns object representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} object representation of an instance + * @param [propertiesToInclude] Any properties that you might want to additionally include in the output + * @return object representation of an instance */ toObject(propertiesToInclude?: any[]): any; /** * Returns string represenation of a group - * @return {String} */ toString(): string; /** * Returns svg representation of an instance - * @param {Function} [reviver] Method for further parsing of svg representation. - * @return {String} svg representation of an instance + * @param [reviver] Method for further parsing of svg representation. + * @return svg representation of an instance */ toSVG(reviver?: Function): string; /** * Returns {@link fabric.Group} instance from an object representation - * @param {Object} object Object to create a group from - * @param {Function} [callback] Callback to invoke when an group instance is created + * @param object Object to create a group from + * @param [callback] Callback to invoke when an group instance is created */ static fromObject(object: any, callback: (group: Group) => any): void; } @@ -1791,41 +1735,41 @@ interface Image extends Object, IImageOptions {} export class Image { /** * Constructor - * @param {HTMLImageElement | String} element Image element - * @param {Object} [options] Options object + * @param element Image element + * @param [options] Options object */ constructor(element: HTMLImageElement, objObjects: IObjectOptions); initialize(element?: string|HTMLImageElement, options?: IImageOptions): void; /** * Applies filters assigned to this image (from "filters" array) - * @param {Function} callback Callback is invoked when all filters have been applied and new image is generated + * @param callback Callback is invoked when all filters have been applied and new image is generated */ applyFilters(callback: Function): void; /** * Returns a clone of an instance - * @param {Function} callback Callback is invoked with a clone as a first argument - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output + * @param callback Callback is invoked with a clone as a first argument + * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ clone(callback?: Function, propertiesToInclude?: any[]): Object; /** * Returns complexity of an instance - * @return {Number} complexity of this instance + * @return complexity of this instance */ complexity(): number; /** * Returns image element which this instance if based on - * @return {HTMLImageElement} Image element + * @return Image element */ getElement(): HTMLImageElement; /** * Returns original size of an image - * @return {Object} Object with "width" and "height" properties + * @return Object with "width" and "height" properties */ getOriginalSize(): { width: number; height: number; }; /** * Returns source of an image - * @return {String} Source of an image + * @return Source of an image */ getSrc(): string; render(ctx: CanvasRenderingContext2D, noTransform: boolean): void; @@ -1834,9 +1778,8 @@ export class Image { * Sets image element for this instance to a specified one. * If filters defined they are applied to new image. * You might need to call `canvas.renderAll` and `object.setCoords` after replacing, to render new image and update controls area. - * @param {HTMLImageElement} element - * @param {Function} [callback] Callback is invoked when all filters have been applied and new image is generated - * @param {Object} [options] Options object + * @param [callback] Callback is invoked when all filters have been applied and new image is generated + * @param [options] Options object */ setElement(element: HTMLImageElement, callback: Function, options: IImageOptions): Image; /** @@ -1845,48 +1788,47 @@ export class Image { setCrossOrigin(value: string): Image; /** * Returns object representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} Object representation of an instance + * @param [propertiesToInclude] Any properties that you might want to additionally include in the output + * @return Object representation of an instance */ toObject(propertiesToInclude?: any[]): any; /** * Returns string representation of an instance - * @return {String} String representation of an instance + * @return String representation of an instance */ toString(): string; /** * Returns SVG representation of an instance - * @param {Function} [reviver] Method for further parsing of svg representation. - * @return {String} svg representation of an instance + * @param [reviver] Method for further parsing of svg representation. + * @return svg representation of an instance */ toSVG(reviver?: Function): string; /** * Sets source of an image - * @param {String} src Source string (URL) - * @param {Function} [callback] Callback is invoked when image has been loaded (and all filters have been applied) - * @param {Object} [options] Options object + * @param src Source string (URL) + * @param [callback] Callback is invoked when image has been loaded (and all filters have been applied) + * @param [options] Options object */ setSrc(src: string, callback?: Function, options?: IImageOptions): Image; /** * Creates an instance of fabric.Image from an URL string - * @param {String} url URL to create an image from - * @param {Function} [callback] Callback to invoke when image is created (newly created image is passed as a first argument) - * @param {Object} [imgOptions] Options object + * @param url URL to create an image from + * @param [callback] Callback to invoke when image is created (newly created image is passed as a first argument) + * @param [imgOptions] Options object */ static fromURL(url: string, callback?: (image: Image) => any, objObjects?: IObjectOptions): Image; /** * Creates an instance of fabric.Image from its object representation - * @static - * @param {Object} object Object to create an instance from - * @param {Function} [callback] Callback to invoke when an image instance is created + * @param object Object to create an instance from + * @param [callback] Callback to invoke when an image instance is created */ static fromObject(object: any, callback: (image: Image) => {}): void; /** * Returns Image instance from an SVG element - * @param {SVGElement} element Element to parse - * @param {Function} callback Callback to execute when fabric.Image object is created - * @param {Object} [options] Options object + * @param element Element to parse + * @param callback Callback to execute when fabric.Image object is created + * @param [options] Options object */ static fromElement(element: SVGElement, callback: Function, options?: IImageOptions): void; /** @@ -1919,40 +1861,40 @@ export interface Line extends Object, ILineOptions {} export class Line { /** * Constructor - * @param {Array} [points] Array of points - * @param {Object} [options] Options object + * @param [points] Array of points + * @param [options] Options object */ constructor(points?: number[], objObjects?: IObjectOptions); /** * Returns complexity of an instance - * @return {Number} complexity + * @return complexity */ complexity(): number; initialize(points?: number[], options?: ILineOptions): Line; /** * Returns object representation of an instance * @methd toObject - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} object representation of an instance + * @param [propertiesToInclude] Any properties that you might want to additionally include in the output + * @return object representation of an instance */ toObject(propertiesToInclude: any[]): any; /** * Returns SVG representation of an instance - * @param {Function} [reviver] Method for further parsing of svg representation. - * @return {String} svg representation of an instance + * @param [reviver] Method for further parsing of svg representation. + * @return svg representation of an instance */ toSVG(reviver?: Function): string; static ATTRIBUTE_NAMES: string[]; /** * Returns fabric.Line instance from an SVG element - * @param {SVGElement} element Element to parse - * @param {Object} [options] Options object + * @param element Element to parse + * @param [options] Options object */ static fromElement(element: SVGElement, options?: ILineOptions): Line; /** * Returns fabric.Line instance from an object representation - * @param {Object} object Object to create an instance from + * @param object Object to create an instance from */ static fromObject(object: any): Line; } @@ -2195,7 +2137,6 @@ interface IObjectOptions { /** * Function that determines clipping of an object (context is passed as a first argument) * Note that context origin is at the object's center point (not left/top corner) - * @type Function */ clipTo?: Function; @@ -2308,20 +2249,20 @@ export class Object { /** * Transforms context when rendering an object - * @param {CanvasRenderingContext2D} ctx Context - * @param {Boolean} fromLeft When true, context is transformed to object's top/left corner. This is used when rendering text on Node + * @param ctx Context + * @param fromLeft When true, context is transformed to object's top/left corner. This is used when rendering text on Node */ transform(ctx: CanvasRenderingContext2D, fromLeft: boolean): void; /** * Returns an object representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output + * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ toObject(propertiesToInclude?: any[]): any; /** * Returns (dataless) object representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output + * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ toDatalessObject(propertiesToInclude?: any[]): any; @@ -2332,7 +2273,7 @@ export class Object { /** * Basic getter - * @param {String} property Property name + * @param property Property name */ get(property: string): any; @@ -2340,8 +2281,8 @@ export class Object { * Sets property to a given value. * When changing position/dimension -related properties (left, top, scale, angle, etc.) `set` does not update position of object's borders/controls. * If you need to update those, call `setCoords()`. - * @param {String} key Property name - * @param {Object|Function} value Property value (if function, the value is passed into it and its return value is used as a new one) + * @param key Property name + * @param value Property value (if function, the value is passed into it and its return value is used as a new one) */ set(key: string, value: any|Function): Object; /** @@ -2354,13 +2295,13 @@ export class Object { /** * Toggles specified property from `true` to `false` or from `false` to `true` - * @param {String} property Property to toggle + * @param property Property to toggle */ toggle(property: string): Object; /** * Sets sourcePath of an object - * @param {String} value Value to set sourcePath to + * @param value Value to set sourcePath to */ setSourcePath(value: string): Object; @@ -2371,21 +2312,21 @@ export class Object { /** * Renders an object on a specified context - * @param {CanvasRenderingContext2D} ctx Context to render on - * @param {Boolean} [noTransform] When true, context is not transformed + * @param ctx Context to render on + * @param [noTransform] When true, context is not transformed */ render(ctx: CanvasRenderingContext2D, noTransform?: boolean): void; /** * Clones an instance - * @param {Function} callback Callback is invoked with a clone as a first argument - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output + * @param callback Callback is invoked with a clone as a first argument + * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ clone(callback: Function, propertiesToInclude?: any[]): Object; /** * Creates an instance of fabric.Image out of an object - * @param {Function} callback callback, invoked with an instance as a first argument + * @param callback callback, invoked with an instance as a first argument */ cloneAsImage(callback: (image: Image) => any): Object; @@ -2397,7 +2338,7 @@ export class Object { /** * Returns true if specified type is identical to the type of an instance - * @param {String} type Type to check against + * @param type Type to check against */ isType(type: string): boolean; @@ -2408,26 +2349,26 @@ export class Object { /** * Returns a JSON representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output + * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ toJSON(propertiesToInclude?: any[]): any; /** * Sets gradient (fill or stroke) of an object * Backwards incompatibility note: This method was named "setGradientFill" until v1.1.0 - * @param {String} property Property name 'stroke' or 'fill' - * @param {Object} [options] Options object + * @param property Property name 'stroke' or 'fill' + * @param [options] Options object */ setGradient(property: string, options: IGradientOptions): Object; /** * Sets pattern fill of an object - * @param {Object} options Options object + * @param options Options object */ setPatternFill(options: IFillOptions): Object; /** * Sets shadow of an object - * @param {String} [options] Options object or string (e.g. "2px 2px 10px rgba(0,0,0,0.2)") + * @param [options] Options object or string (e.g. "2px 2px 10px rgba(0,0,0,0.2)") */ setShadow(options?: string): Object; /** @@ -2438,19 +2379,19 @@ export class Object { /** * Sets "color" of an instance (alias of `set('fill', …)`) - * @param {String} color Color value + * @param color Color value */ setColor(color: string): Object; /** * Sets "angle" of an instance - * @param {Number} angle Angle value + * @param angle Angle value */ setAngle(angle: number): Object; /** * Sets "angle" of an instance - * @param {Number} angle Angle value + * @param angle Angle value */ rotate(angle: number): Object; @@ -2479,19 +2420,19 @@ export class Object { /** * Returns coordinates of a pointer relative to an object - * @param {Event} e Event to operate upon - * @param {Object} [pointer] Pointer to operate upon (instead of event) + * @param e Event to operate upon + * @param [pointer] Pointer to operate upon (instead of event) */ getLocalPointer(e: Event, pointer: any): any; /** * Sets object's properties from options - * @param {Object} [options] Options object + * @param [options] Options object */ setOptions(options: any): void; /** * Sets sourcePath of an object - * @param {String} value Value to set sourcePath to + * @param value Value to set sourcePath to */ setSourcePath(value: string): Object; // functions from object svg export mixin @@ -2517,8 +2458,8 @@ export class Object { hasStateChanged(): boolean; /** * Saves state of an object - * @param {Object} [options] Object with additional `stateProperties` array to include when saving state - * @return {fabric.Object} thisArg + * @param [options] Object with additional `stateProperties` array to include when saving state + * @return thisArg */ saveState(options?: { stateProperties: any[] }): Object; /** @@ -2533,17 +2474,14 @@ export class Object { straighten(): Object; /** * Same as straighten but with animation - * @param {Object} callbacks Object with callback functions - * @param {Function} [callbacks.onComplete] Invoked on completion - * @param {Function} [callbacks.onChange] Invoked on every step of animation */ - fxStraighten(callbacks: { onComplete?: Function; onChange: Function }): Object; + fxStraighten(callbacks: Callbacks): Object; // functions from object stacking mixin // ----------------------------------------------------------------------------------------------------------------------------------- /** * Moves an object up in stack of drawn objects - * @param {Boolean} [intersecting] If `true`, send object in front of next upper intersecting object + * @param [intersecting] If `true`, send object in front of next upper intersecting object */ bringForward(intersecting?: boolean): Object; /** @@ -2552,7 +2490,7 @@ export class Object { bringToFront(): Object; /** * Moves an object down in stack of drawn objects - * @param {Boolean} [intersecting] If `true`, send object behind next lower intersecting object + * @param [intersecting] If `true`, send object behind next lower intersecting object */ sendBackwards(intersecting?: boolean): Object; /** @@ -2561,7 +2499,7 @@ export class Object { sendToBack(): Object; /** * Moves an object to specified level in stack of drawn objects - * @param {Number} index New position of object + * @param index New position of object */ moveTo(index: number): Object; @@ -2569,17 +2507,17 @@ export class Object { // ----------------------------------------------------------------------------------------------------------------------------------- /** * Translates the coordinates from origin to center coordinates (based on the object's dimensions) - * @param {fabric.Point} point The point which corresponds to the originX and originY params - * @param {String} originX Horizontal origin: 'left', 'center' or 'right' - * @param {String} originY Vertical origin: 'top', 'center' or 'bottom' + * @param point The point which corresponds to the originX and originY params + * @param originX Horizontal origin: 'left', 'center' or 'right' + * @param originY Vertical origin: 'top', 'center' or 'bottom' */ translateToCenterPoint(point: Point, originX: string, originY: string): Point; /** * Translates the coordinates from center to origin coordinates (based on the object's dimensions) - * @param {fabric.Point} center The point which corresponds to center of the object - * @param {String} originX Horizontal origin: 'left', 'center' or 'right' - * @param {String} originY Vertical origin: 'top', 'center' or 'bottom' + * @param center The point which corresponds to center of the object + * @param originX Horizontal origin: 'left', 'center' or 'right' + * @param originY Vertical origin: 'top', 'center' or 'bottom' */ translateToOriginPoint(center: Point, originX: string, originY: string): Point; /** @@ -2589,40 +2527,39 @@ export class Object { /** * Returns the coordinates of the object as if it has a different origin - * @param {String} originX Horizontal origin: 'left', 'center' or 'right' - * @param {String} originY Vertical origin: 'top', 'center' or 'bottom' + * @param originX Horizontal origin: 'left', 'center' or 'right' + * @param originY Vertical origin: 'top', 'center' or 'bottom' */ getPointByOrigin(): Point; /** * Returns the point in local coordinates - * @param {fabric.Point} point The point relative to the global coordinate system - * @param {String} originX Horizontal origin: 'left', 'center' or 'right' - * @param {String} originY Vertical origin: 'top', 'center' or 'bottom' + * @param point The point relative to the global coordinate system + * @param originX Horizontal origin: 'left', 'center' or 'right' + * @param originY Vertical origin: 'top', 'center' or 'bottom' */ toLocalPoint(point: Point, originX: string, originY: string): Point; /** * Sets the position of the object taking into consideration the object's origin - * @param {fabric.Point} pos The new position of the object - * @param {String} originX Horizontal origin: 'left', 'center' or 'right' - * @param {String} originY Vertical origin: 'top', 'center' or 'bottom' - * @return {void} + * @param pos The new position of the object + * @param originX Horizontal origin: 'left', 'center' or 'right' + * @param originY Vertical origin: 'top', 'center' or 'bottom' */ setPositionByOrigin(pos: Point, originX: string, originY: string): void; /** - * @param {String} to One of 'left', 'center', 'right' + * @param to One of 'left', 'center', 'right' */ adjustPosition(to: string): void; // functions from interactivity mixin // ----------------------------------------------------------------------------------------------------------------------------------- - /**- + /** * Draws borders of an object's bounding box. * Requires public properties: width, height * Requires public options: padding, borderColor - * @param {CanvasRenderingContext2D} ctx Context to draw on + * @param ctx Context to draw on */ drawBorders(context: CanvasRenderingContext2D): Object; @@ -2630,25 +2567,25 @@ export class Object { * Draws corners of an object's bounding box. * Requires public properties: width, height * Requires public options: cornerSize, padding - * @param {CanvasRenderingContext2D} ctx Context to draw on + * @param ctx Context to draw on */ drawCorners(context: CanvasRenderingContext2D): Object; /** * Returns true if the specified control is visible, false otherwise. - * @param {String} controlName The name of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'. + * @param controlName The name of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'. */ isControlVisible(controlName: string): boolean; /** * Sets the visibility of the specified control. - * @param {String} controlName The name of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'. - * @param {Boolean} visible true to set the specified control visible, false otherwise + * @param controlName The name of the control. Possible values are 'tl', 'tr', 'br', 'bl', 'ml', 'mt', 'mr', 'mb', 'mtr'. + * @param visible true to set the specified control visible, false otherwise */ setControlVisible(controlName: string, visible: boolean): Object; /** * Sets the visibility state of object controls. - * @param {Object} [options] Options object + * @param [options] Options object */ setControlsVisibility(options?: { bl?: boolean; @@ -2670,50 +2607,50 @@ export class Object { setCoords(): Object; /** * Returns coordinates of object's bounding rectangle (left, top, width, height) - * @return {Object} Object with left, top, width, height properties + * @return Object with left, top, width, height properties */ getBoundingRect(): { left: number; top: number; width: number; height: number }; /** * Checks if object is fully contained within area of another object - * @param {Object} other Object to test + * @param other Object to test */ isContainedWithinObject(other: Object): boolean; /** * Checks if object is fully contained within area formed by 2 points - * @param {Object} pointTL top-left point of area - * @param {Object} pointBR bottom-right point of area + * @param pointTL top-left point of area + * @param pointBR bottom-right point of area */ isContainedWithinRect(pointTL: any, pointBR: any): boolean; /** * Checks if point is inside the object - * @param {fabric.Point} point Point to check against + * @param point Point to check against */ containsPoint(point: Point): boolean; /** * Scales an object (equally by x and y) - * @param {Number} value Scale factor - * @return {fabric.Object} thisArg + * @param value Scale factor + * @return thisArg */ scale(value: number): Object; /** * Scales an object to a given height, with respect to bounding box (scaling by x/y equally) - * @param {Number} value New height value + * @param value New height value */ scaleToHeight(value: number): Object; /** * Scales an object to a given width, with respect to bounding box (scaling by x/y equally) - * @param {Number} value New width value + * @param value New width value */ scaleToWidth(value: number): Object; /** * Checks if object intersects with another object - * @param {Object} other Object to test + * @param other Object to test */ intersectsWithObject(other: Object): boolean; /** * Checks if object intersects with an area formed by 2 points - * @param {Object} pointTL top-left point of area - * @param {Object} pointBR bottom-right point of area + * @param pointTL top-left point of area + * @param pointBR bottom-right point of area */ intersectsWithRect(pointTL: any, pointBR: any): boolean; } @@ -2738,8 +2675,8 @@ export interface IPath extends Object, IPathOptions {} export class IPath { /** * Constructor - * @param {Array|String} path Path data (sequence of coordinates and corresponding "command" tokens) - * @param {Object} [options] Options object + * @param path Path data (sequence of coordinates and corresponding "command" tokens) + * @param [options] Options object */ constructor(path?: string|any[], options?: IPathOptions); @@ -2747,51 +2684,50 @@ export class IPath { /** * Returns number representation of an instance complexity - * @return {Number} complexity of this instance + * @return complexity of this instance */ complexity(): number; /** * Renders path on a specified context - * @param {CanvasRenderingContext2D} ctx context to render path on - * @param {Boolean} [noTransform] When true, context is not transformed + * @param ctx context to render path on + * @param [noTransform] When true, context is not transformed */ render(ctx: CanvasRenderingContext2D, noTransform: boolean): void; /** * Returns dataless object representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} object representation of an instance + * @param [propertiesToInclude] Any properties that you might want to additionally include in the output + * @return object representation of an instance */ toDatalessObject(propertiesToInclude?: any[]): any; /** * Returns object representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} object representation of an instance + * @param [propertiesToInclude] Any properties that you might want to additionally include in the output + * @return object representation of an instance */ toObject(propertiesToInclude?: any[]): any; /** * Returns string representation of an instance - * @return {String} string representation of an instance + * @return string representation of an instance */ toString(): string; /** * Returns svg representation of an instance - * @param {Function} [reviver] Method for further parsing of svg representation. - * @return {String} svg representation of an instance + * @param [reviver] Method for further parsing of svg representation. + * @return svg representation of an instance */ toSVG(reviver?: Function): string; /** * Creates an instance of fabric.Path from an SVG element - * @param {SVGElement} element to parse - * @param {Function} callback Callback to invoke when an fabric.Path instance is created - * @param {Object} [options] Options object + * @param element to parse + * @param callback Callback to invoke when an fabric.Path instance is created + * @param [options] Options object */ static fromElement(element: SVGElement, callback: (path: IPath) => any, options?: IPathOptions): void; /** * Creates an instance of fabric.Path from an object - * @param {Object} object - * @param {Function} callback Callback to invoke when an fabric.Path instance is created + * @param callback Callback to invoke when an fabric.Path instance is created */ static fromObject(object: any, callback: (path: IPath) => any): void; } @@ -2799,63 +2735,60 @@ export class IPath { export class PathGroup extends Object { /** * Constructor - * @param {Array} paths - * @param {Object} [options] Options object + * @param [options] Options object */ constructor(paths: IPath[], options?: IObjectOptions); initialize(paths: IPath[], options?: IObjectOptions): void; /** * Returns number representation of object's complexity - * @return {Number} complexity + * @return complexity */ complexity(): number; /** * Returns true if all paths in this group are of same color - * @return {Boolean} true if all paths are of the same color (`fill`) + * @return true if all paths are of the same color (`fill`) */ isSameColor(): boolean; /** * Renders this group on a specified context - * @param {CanvasRenderingContext2D} ctx Context to render this instance on + * @param ctx Context to render this instance on */ render(ctx: CanvasRenderingContext2D): void; /** * Returns dataless object representation of this path group - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} dataless object representation of an instance + * @param [propertiesToInclude] Any properties that you might want to additionally include in the output + * @return dataless object representation of an instance */ toDatalessObject(propertiesToInclude?: any[]): any; /** * Returns object representation of this path group - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} object representation of an instance + * @param [propertiesToInclude] Any properties that you might want to additionally include in the output + * @return object representation of an instance */ toObject(propertiesToInclude?: any[]): any; /** * Returns a string representation of this path group - * @return {String} string representation of an object + * @return string representation of an object */ toString(): string; /** * Returns svg representation of an instance - * @param {Function} [reviver] Method for further parsing of svg representation. - * @return {String} svg representation of an instance + * @param [reviver] Method for further parsing of svg representation. + * @return svg representation of an instance */ toSVG(reviver?: Function): string; /** * Returns all paths in this path group - * @return {Array} array of path objects included in this path group + * @return array of path objects included in this path group */ getObjects(): IPath[]; static fromObject(object: any): PathGroup; /** * Creates fabric.PathGroup instance from an object representation - * @static - * @memberOf fabric.PathGroup - * @param {Object} object Object to create an instance from - * @param {Function} callback Callback to invoke when an fabric.PathGroup instance is created + * @param object Object to create an instance from + * @param callback Callback to invoke when an fabric.PathGroup instance is created */ static fromObject(object: any, callback: (group: PathGroup) => any): void; } @@ -2880,27 +2813,27 @@ export interface Polygon extends IPolygonOptions {} export class Polygon extends Object { /** * Constructor - * @param {Array} points Array of points - * @param {Object} [options] Options object + * @param points Array of points + * @param [options] Options object */ constructor(points: Array<{ x: number; y: number }>, options?: IObjectOptions, skipOffset?: boolean); /** * Returns complexity of an instance - * @return {Number} complexity of this instance + * @return complexity of this instance */ complexity(): number; /** * Returns object representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} object representation of an instance + * @param [propertiesToInclude] Any properties that you might want to additionally include in the output + * @return object representation of an instance */ toObject(propertiesToInclude?: any[]): any; /** * Returns svg representation of an instance - * @param {Function} [reviver] Method for further parsing of svg representation. - * @return {String} svg representation of an instance + * @param [reviver] Method for further parsing of svg representation. + * @return svg representation of an instance */ toSVG(reviver?: Function): string; @@ -2911,13 +2844,13 @@ export class Polygon extends Object { /** * Returns Polygon instance from an SVG element - * @param {SVGElement} element Element to parse - * @param {Object} [options] Options object + * @param element Element to parse + * @param [options] Options object */ static fromElement(element: SVGElement, options?: IPolygonOptions): Polygon; /** * Returns fabric.Polygon instance from an object representation - * @param {Object} object Object to create an instance from + * @param object Object to create an instance from */ static fromObject(object: any): Polygon; } @@ -2942,27 +2875,27 @@ export interface Polyline extends IPolylineOptions {} export class Polyline extends Object { /** * Constructor - * @param {Array} points Array of points (where each point is an object with x and y) - * @param {Object} [options] Options object - * @param {Boolean} [skipOffset] Whether points offsetting should be skipped + * @param points Array of points (where each point is an object with x and y) + * @param [options] Options object + * @param [skipOffset] Whether points offsetting should be skipped */ constructor(points: Array<{ x: number; y: number }>, options?: IPolylineOptions); initialize(points: Point[], options?: IPolylineOptions): void; /** * Returns complexity of an instance - * @return {Number} complexity of this instance + * @return complexity of this instance */ complexity(): number; /** * Returns object representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} Object representation of an instance + * @param [propertiesToInclude] Any properties that you might want to additionally include in the output + * @return Object representation of an instance */ toObject(propertiesToInclude?: any[]): any; /** * Returns SVG representation of an instance - * @param {Function} [reviver] Method for further parsing of svg representation. - * @return {String} svg representation of an instance + * @param [reviver] Method for further parsing of svg representation. + * @return svg representation of an instance */ toSVG(reviver?: Function): string; @@ -2973,13 +2906,13 @@ export class Polyline extends Object { /** * Returns Polyline instance from an SVG element - * @param {SVGElement} element Element to parse - * @param {Object} [options] Options object + * @param element Element to parse + * @param [options] Options object */ static fromElement(element: SVGElement, options?: IPolylineOptions): Polyline; /** * Returns fabric.Polyline instance from an object representation - * @param {Object} object Object to create an instance from + * @param object Object to create an instance from */ static fromObject(object: any): Polyline; } @@ -3002,25 +2935,25 @@ export interface Rect extends IRectOptions {} export class Rect extends Object { /** * Constructor - * @param {Object} [options] Options object + * @param [options] Options object */ constructor(options?: IRectOptions); initialize(points?: number[], options?: any): Rect; /** * Returns complexity of an instance - * @return {Number} complexity + * @return complexity */ complexity(): number; /** * Returns object representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} object representation of an instance + * @param [propertiesToInclude] Any properties that you might want to additionally include in the output + * @return object representation of an instance */ toObject(propertiesToInclude: any[]): any; /** * Returns svg representation of an instance - * @param {Function} [reviver] Method for further parsing of svg representation. - * @return {String} svg representation of an instance + * @param [reviver] Method for further parsing of svg representation. + * @return svg representation of an instance */ toSVG(reviver?: Function): string; @@ -3030,13 +2963,13 @@ export class Rect extends Object { static ATTRIBUTE_NAMES: string[]; /** * Returns Rect instance from an SVG element - * @param {SVGElement} element Element to parse - * @param {Object} [options] Options object + * @param element Element to parse + * @param [options] Options object */ static fromElement(element: SVGElement, options?: IRectOptions): Rect; /** * Returns Rect instance from an object representation - * @param {Object} object Object to create an instance from + * @param object Object to create an instance from */ static fromObject(object: any): Rect; } @@ -3093,8 +3026,8 @@ export interface Text extends ITextOptions {} export class Text extends Object { /** * Constructor - * @param {String} text Text string - * @param {Object} [options] Options object + * @param text Text string + * @param [options] Options object */ constructor(text: string, options?: ITextOptions); /** @@ -3107,17 +3040,17 @@ export class Text extends Object { toString(): string; /** * Renders text instance on a specified context - * @param {CanvasRenderingContext2D} ctx Context to render on + * @param ctx Context to render on */ render(ctx: CanvasRenderingContext2D, noTransform: boolean): void; /** * Returns object representation of an instance - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output + * @param [propertiesToInclude] Any properties that you might want to additionally include in the output */ toObject(propertiesToInclude?: any[]): Object; /** * Returns SVG representation of an instance - * @param {Function} [reviver] Method for further parsing of svg representation. + * @param [reviver] Method for further parsing of svg representation. */ toSVG(reviver?: Function): string; /** @@ -3126,7 +3059,7 @@ export class Text extends Object { getFontSize(): number; /** * Sets object's fontSize - * @param {Number} fontSize Font size (in pixels) + * @param fontSize Font size (in pixels) */ setFontSize(fontSize: number): Text; /** @@ -3135,7 +3068,7 @@ export class Text extends Object { getFontWeight(): number|string; /** * Sets object's fontWeight - * @param {(Number|String)} fontWeight Font weight + * @param fontWeight Font weight */ setFontWeight(fontWeight: string|number): Text; /** @@ -3144,7 +3077,7 @@ export class Text extends Object { getFontFamily(): string; /** * Sets object's fontFamily - * @param {String} fontFamily Font family + * @param fontFamily Font family */ setFontFamily(fontFamily: string): Text; /** @@ -3153,7 +3086,7 @@ export class Text extends Object { getText(): string; /** * Sets object's text - * @param {String} text Text + * @param text Text */ setText(text: string): Text; /** @@ -3162,7 +3095,7 @@ export class Text extends Object { getTextDecoration(): string; /** * Sets object's textDecoration - * @param {String} textDecoration Text decoration + * @param textDecoration Text decoration */ setTextDecoration(textDecoration: string): Text; /** @@ -3171,7 +3104,7 @@ export class Text extends Object { getFontStyle(): string; /** * Sets object's fontStyle - * @param {String} fontStyle Font style + * @param fontStyle Font style */ setFontStyle(fontStyle: string): Text; /** @@ -3180,7 +3113,7 @@ export class Text extends Object { getLineHeight(): number; /** * Sets object's lineHeight - * @param {Number} lineHeight Line height + * @param lineHeight Line height */ setLineHeight(lineHeight: number): Text; /** @@ -3189,7 +3122,7 @@ export class Text extends Object { getTextAlign(): string; /** * Sets object's textAlign - * @param {String} textAlign Text alignment + * @param textAlign Text alignment */ setTextAlign(textAlign: string): Text; /** @@ -3198,7 +3131,7 @@ export class Text extends Object { getTextBackgroundColor(): string; /** * Sets object's textBackgroundColor - * @param {String} textBackgroundColor Text background color + * @param textBackgroundColor Text background color */ setTextBackgroundColor(textBackgroundColor: string): Text; @@ -3213,13 +3146,13 @@ export class Text extends Object { /** * Returns fabric.Text instance from an SVG element (not yet implemented) - * @param {SVGElement} element Element to parse - * @param {Object} [options] Options object + * @param element Element to parse + * @param [options] Options object */ static fromElement(element: SVGElement, options?: ITextOptions): Text; /** * Returns fabric.Text instance from an object representation - * @param {Object} object Object to create an instance from + * @param object Object to create an instance from */ static fromObject(object: any): Text; } @@ -3290,8 +3223,8 @@ export interface IText extends Text, IITextOptions {} export class IText extends Object { /** * Constructor - * @param {String} text Text string - * @param {Object} [options] Options object + * @param text Text string + * @param [options] Options object */ constructor(text: string, options?: IITextOptions); /** @@ -3301,34 +3234,33 @@ export class IText extends Object { render(ctx: CanvasRenderingContext2D, noTransform: boolean): void; /** * Returns object representation of an instance - * @method toObject - * @param {Array} [propertiesToInclude] Any properties that you might want to additionally include in the output - * @return {Object} object representation of an instance + * @param [propertiesToInclude] Any properties that you might want to additionally include in the output + * @return object representation of an instance */ toObject(propertiesToInclude?: any[]): Object; setText(value: string): Text; /** * Sets selection start (left boundary of a selection) - * @param {Number} index Index to set selection start to + * @param index Index to set selection start to */ setSelectionStart(index: number): void; /** * Sets selection end (right boundary of a selection) - * @param {Number} index Index to set selection end to + * @param index Index to set selection end to */ setSelectionEnd(index: number): void; /** * Gets style of a current selection/cursor (at the start position) - * @param {Number} [startIndex] Start index to get styles at - * @param {Number} [endIndex] End index to get styles at - * @return {Object} styles Style object at a specified (or current) index + * @param [startIndex] Start index to get styles at + * @param [endIndex] End index to get styles at + * @return styles Style object at a specified (or current) index */ getSelectionStyles(startIndex: number, endIndex: number): any; /** * Sets style of a current selection - * @param {Object} [styles] Styles object - * @return {fabric.IText} thisArg + * @param [styles] Styles object + * @return thisArg * @chainable */ setSelectionStyles(styles: any): Text; @@ -3340,42 +3272,41 @@ export class IText extends Object { /** * Returns 2d representation (lineIndex and charIndex) of cursor (or selection start) - * @param {Number} [selectionStart] Optional index. When not given, current selectionStart is used. + * @param [selectionStart] Optional index. When not given, current selectionStart is used. */ get2DCursorLocation(selectionStart?: number): void; /** * Returns complete style of char at the current cursor - * @param {Number} lineIndex Line index - * @param {Number} charIndex Char index - * @return {Object} Character style + * @param lineIndex Line index + * @param charIndex Char index + * @return Character style */ getCurrentCharStyle(lineIndex: number, charIndex: number): any; /** * Returns fontSize of char at the current cursor - * @param {Number} lineIndex Line index - * @param {Number} charIndex Char index - * @return {Number} Character font size + * @param lineIndex Line index + * @param charIndex Char index + * @return Character font size */ getCurrentCharFontSize(lineIndex: number, charIndex: number): number; /** * Returns color (fill) of char at the current cursor - * @param {Number} lineIndex Line index - * @param {Number} charIndex Char index - * @return {String} Character color (fill) + * @param lineIndex Line index + * @param charIndex Char index + * @return Character color (fill) */ getCurrentCharColor(lineIndex: number, charIndex: number): string; /** * Renders cursor - * @param {Object} boundaries */ renderCursor(boundaries: any): void; /** * Renders text selection - * @param {Array} chars Array of characters - * @param {Object} boundaries Object with left/top/leftOffset/topOffset + * @param chars Array of characters + * @param boundaries Object with left/top/leftOffset/topOffset */ renderSelection(chars: string[], boundaries: any): void; @@ -3420,27 +3351,27 @@ export class IText extends Object { /** * Find new selection index representing start of current word according to current selection index - * @param {Number} startFrom Surrent selection index - * @return {Number} New selection index + * @param startFrom Surrent selection index + * @return New selection index */ findWordBoundaryLeft(startFrom: number): number; /** * Find new selection index representing end of current word according to current selection index - * @param {Number} startFrom Current selection index - * @return {Number} New selection index + * @param startFrom Current selection index + * @return New selection index */ findWordBoundaryRight(startFrom: number): number; /** * Find new selection index representing start of current line according to current selection index - * @param {Number} startFrom Current selection index + * @param startFrom Current selection index */ findLineBoundaryLeft(startFrom: number): number; /** * Find new selection index representing end of current line according to current selection index - * @param {Number} startFrom Current selection index + * @param startFrom Current selection index */ findLineBoundaryRight(startFrom: number): number; @@ -3451,19 +3382,19 @@ export class IText extends Object { /** * Finds index corresponding to beginning or end of a word - * @param {Number} selectionStart Index of a character - * @param {Number} direction: 1 or -1 + * @param selectionStart Index of a character + * @param direction: 1 or -1 */ searchWordBoundary(selectionStart: number, direction: number): number; /** * Selects a word based on the index - * @param {Number} selectionStart Index of a character + * @param selectionStart Index of a character */ selectWord(selectionStart: number): void; /** * Selects a line based on the index - * @param {Number} selectionStart Index of a character + * @param selectionStart Index of a character */ selectLine(selectionStart: number): void; @@ -3478,51 +3409,51 @@ export class IText extends Object { initMouseMoveHandler(): void; /** * Exits from editing state - * @return {fabric.IText} thisArg + * @return thisArg * @chainable */ exitEditing(): IText; /** * Inserts a character where cursor is (replacing selection if one exists) - * @param {String} _chars Characters to insert + * @param _chars Characters to insert */ insertChars(_chars: string, useCopiedStyle?: boolean): void; /** * Inserts new style object - * @param {Number} lineIndex Index of a line - * @param {Number} charIndex Index of a char - * @param {Boolean} isEndOfLine True if it's end of line + * @param lineIndex Index of a line + * @param charIndex Index of a char + * @param isEndOfLine True if it's end of line */ insertNewlineStyleObject(lineIndex: number, charIndex: number, isEndOfLine: boolean): void; /** * Inserts style object for a given line/char index - * @param {Number} lineIndex Index of a line - * @param {Number} charIndex Index of a char - * @param {Object} [style] Style object to insert, if given + * @param lineIndex Index of a line + * @param charIndex Index of a char + * @param [style] Style object to insert, if given */ insertCharStyleObject(lineIndex: number, charIndex: number, isEndOfLine: boolean): void; /** * Inserts style object(s) - * @param {String} _chars Characters at the location where style is inserted - * @param {Boolean} isEndOfLine True if it's end of line - * @param {Boolean} [useCopiedStyle] Style to insert + * @param _chars Characters at the location where style is inserted + * @param isEndOfLine True if it's end of line + * @param [useCopiedStyle] Style to insert */ insertStyleObjects(_chars: string, isEndOfLine: boolean, useCopiedStyle?: boolean): void; /** * Shifts line styles up or down - * @param {Number} lineIndex Index of a line - * @param {Number} offset Can be -1 or +1 + * @param lineIndex Index of a line + * @param offset Can be -1 or +1 */ shiftLineStyles(lineIndex: number, offset: number): void; /** * Removes style object - * @param {Boolean} isBeginningOfLine True if cursor is at the beginning of line - * @param {Number} [index] Optional index. When not given, current selectionStart is used. + * @param isBeginningOfLine True if cursor is at the beginning of line + * @param [index] Optional index. When not given, current selectionStart is used. */ removeStyleObject(isBeginningOfLine: boolean, index?: number): void; /** @@ -3532,7 +3463,7 @@ export class IText extends Object { /** * Returns fabric.IText instance from an object representation - * @param {Object} object Object to create an instance from + * @param object Object to create an instance from */ static fromObject(object: any): IText; } @@ -3541,25 +3472,25 @@ interface ITriangleOptions extends IObjectOptions { } export class Triangle extends Object { /** * Constructor - * @param {Object} [options] Options object + * @param [options] Options object */ constructor(options?: ITriangleOptions); /** * Returns complexity of an instance - * @return {Number} complexity of this instance + * @return complexity of this instance */ complexity(): number; /** * Returns SVG representation of an instance - * @param {Function} [reviver] Method for further parsing of svg representation. - * @return {String} svg representation of an instance + * @param [reviver] Method for further parsing of svg representation. + * @return svg representation of an instance */ toSVG(reviver?: Function): string; /** * Returns Triangle instance from an object representation - * @param {Object} object Object to create an instance from + * @param object Object to create an instance from */ static fromObject(object: any): Triangle; } @@ -3571,200 +3502,184 @@ interface IAllFilters { BaseFilter: { /** * Constructor - * @param {Object} [options] Options object + * @param [options] Options object */ new (options?: any): IBaseFilter; }; Blend: { /** * Constructor - * @param {Object} [options] Options object + * @param [options] Options object */ new (options?: { color?: string; mode?: string; alpha?: number; image?: Image }): IBlendFilter; /** * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from + * @param object Object to create an instance from */ fromObject(object: any): IBlendFilter }; Brightness: { - /** - * Constructor - * @param {Object} [options] Options object - * @param {Number} [options.brightness=0] Value to brighten the image up (0..255) - */ - new (options?: { brightness: number }): IBrightnessFilter; + new (options?: { + /** + * Value to brighten the image up (0..255) + * @default 0 + */ + brightness: number + }): IBrightnessFilter; /** * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from + * @param object Object to create an instance from */ fromObject(object: any): IBrightnessFilter }; Convolute: { - /** - * Constructor - * @param {Object} [options] Options object - * @param {Boolean} [options.opaque=false] Opaque value (true/false) - * @param {Array} [options.matrix] Filter matrix - */ - new (options?: { opaque?: boolean; matrix?: number[] }): IConvoluteFilter; + new (options?: { + opaque?: boolean, + /** Filter matrix */ + matrix?: number[], + }): IConvoluteFilter; /** * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from + * @param object Object to create an instance from */ fromObject(object: any): IConvoluteFilter }; GradientTransparency: { - /** - * Constructor - * @param {Object} [options] Options object - * @param {Number} [options.threshold=100] Threshold value - */ - new (options?: { threshold?: number; }): IGradientTransparencyFilter; + new (options?: { + /** @default 100 */ + threshold?: number; + }): IGradientTransparencyFilter; /** * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from + * @param object Object to create an instance from */ fromObject(object: any): IGradientTransparencyFilter }; Grayscale: { - /** - * Constructor - * @param {Object} [options] Options object - */ new (options?: any): IGrayscaleFilter; /** * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from + * @param object Object to create an instance from */ fromObject(object: any): IGrayscaleFilter }; Invert: { /** * Constructor - * @param {Object} [options] Options object + * @param [options] Options object */ new (options?: any): IInvertFilter; /** * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from + * @param object Object to create an instance from */ fromObject(object: any): IInvertFilter }; Mask: { - /** - * Constructor - * @param {Object} [options] Options object - * @param {fabric.Image} [options.mask] Mask image object - * @param {Number} [options.channel=0] Rgb channel (0, 1, 2 or 3) - */ - new (options?: { mask?: Image; channel: number; }): IMaskFilter; + new (options?: { + /** Mask image object */ + mask?: Image, + /** + * Rgb channel (0, 1, 2 or 3) + * @default 0 + */ + channel: number, + }): IMaskFilter; /** * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from + * @param object Object to create an instance from */ fromObject(object: any): IMaskFilter }; Multiply: { - /** - * Constructor - * @param {Object} [options] Options object - * @param {Number} [options.color=#000000] Color to multiply the image pixels with - */ - new (options?: { color: string; }): IMultiplyFilter; + new (options?: { + /** + * Color to multiply the image pixels with + * @default #000000 + */ + color: string; + }): IMultiplyFilter; /** * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from + * @param object Object to create an instance from */ fromObject(object: any): IMultiplyFilter }; Noise: { - /** - * Constructor - * @param {Object} [options] Options object - * @param {Number} [options.noise=0] Noise value - */ - new (options?: { noise: number; }): INoiseFilter; + new (options?: { + /** @default 0 */ + noise: number, + }): INoiseFilter; /** * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from + * @param object Object to create an instance from */ fromObject(object: any): INoiseFilter }; Pixelate: { - /** - * Constructor - * @param {Object} [options] Options object - * @param {Number} [options.blocksize=4] Blocksize for pixelate - */ - new (options?: { blocksize?: number; }): IPixelateFilter; + new (options?: { + /** + * Blocksize for pixelate + * @default 4 + */ + blocksize?: number, + }): IPixelateFilter; /** * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from + * @param object Object to create an instance from */ fromObject(object: any): IPixelateFilter }; RemoveWhite: { - /** - * Constructor - * @param {Object} [options] Options object - * @param {Number} [options.threshold=30] Threshold value - * @param {Number} [options.distance=20] Distance value - */ - new (options?: { threshold?: number; distance?: number; }): IRemoveWhiteFilter; + new (options?: { + /** @default 30 */ + threshold?: number, + /** @default 20 */ + distance?: number, + }): IRemoveWhiteFilter; /** * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from + * @param object Object to create an instance from */ fromObject(object: any): IRemoveWhiteFilter }; Resize: { - /** - * Constructor - * @param {Object} [options] Options object - */ new (options?: any): IResizeFilter; /** * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from + * @param object Object to create an instance from */ fromObject(object: any): IResizeFilter }; Sepia2: { - /** - * Constructor - * @param {Object} [options] Options object - */ new (options?: any): ISepia2Filter; /** * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from + * @param object Object to create an instance from */ fromObject(object: any): ISepia2Filter }; Sepia: { - /** - * Constructor - * @param {Object} [options] Options object - */ new (options?: any): ISepiaFilter; /** * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from + * @param object Object to create an instance from */ fromObject(object: any): ISepiaFilter }; Tint: { - /** - * Constructor - * @param {Object} [options] Options object - * @param {String} [options.color=#000000] Color to tint the image with - * @param {Number} [options.opacity] Opacity value that controls the tint effect's transparency (0..1) - */ - new (options?: { color?: string; opacity?: number; }): ITintFilter; + new (options?: { + /** + * Color to tint the image with + * @default #000000 + */ + color?: string; + /** Opacity value that controls the tint effect's transparency (0..1) */ + opacity?: number; + }): ITintFilter; /** * Returns filter instance from an object representation - * @param {Object} object Object to create an instance from + * @param object Object to create an instance from */ fromObject(object: any): ITintFilter }; @@ -3772,7 +3687,7 @@ interface IAllFilters { interface IBaseFilter { /** * Sets filter's properties from options - * @param {Object} [options] Options object + * @param [options] Options object */ setOptions(options?: any): void; /** @@ -3787,77 +3702,77 @@ interface IBaseFilter { interface IBlendFilter extends IBaseFilter { /** * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to + * @param canvasEl Canvas element to apply filter to */ applyTo(canvasEl: HTMLCanvasElement): void; } interface IBrightnessFilter extends IBaseFilter { /** * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to + * @param canvasEl Canvas element to apply filter to */ applyTo(canvasEl: HTMLCanvasElement): void; } interface IConvoluteFilter extends IBaseFilter { /** * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to + * @param canvasEl Canvas element to apply filter to */ applyTo(canvasEl: HTMLCanvasElement): void; } interface IGradientTransparencyFilter { /** * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to + * @param canvasEl Canvas element to apply filter to */ applyTo(canvasEl: HTMLCanvasElement): void; } interface IGrayscaleFilter { /** * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to + * @param canvasEl Canvas element to apply filter to */ applyTo(canvasEl: HTMLCanvasElement): void; } interface IInvertFilter { /** * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to + * @param canvasEl Canvas element to apply filter to */ applyTo(canvasEl: HTMLCanvasElement): void; } interface IMaskFilter { /** * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to + * @param canvasEl Canvas element to apply filter to */ applyTo(canvasEl: HTMLCanvasElement): void; } interface IMultiplyFilter { /** * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to + * @param canvasEl Canvas element to apply filter to */ applyTo(canvasEl: HTMLCanvasElement): void; } interface INoiseFilter { /** * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to + * @param canvasEl Canvas element to apply filter to */ applyTo(canvasEl: HTMLCanvasElement): void; } interface IPixelateFilter { /** * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to + * @param canvasEl Canvas element to apply filter to */ applyTo(canvasEl: HTMLCanvasElement): void; } interface IRemoveWhiteFilter { /** * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to + * @param canvasEl Canvas element to apply filter to */ applyTo(canvasEl: HTMLCanvasElement): void; } @@ -3883,28 +3798,28 @@ interface IResizeFilter { lanczosLobes: number; /** * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to + * @param canvasEl Canvas element to apply filter to */ applyTo(canvasEl: HTMLCanvasElement): void; } interface ISepiaFilter { /** * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to + * @param canvasEl Canvas element to apply filter to */ applyTo(canvasEl: HTMLCanvasElement): void; } interface ISepia2Filter { /** * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to + * @param canvasEl Canvas element to apply filter to */ applyTo(canvasEl: HTMLCanvasElement): void; } interface ITintFilter { /** * Applies filter to canvas element - * @param {Object} canvasEl Canvas element to apply filter to + * @param canvasEl Canvas element to apply filter to */ applyTo(canvasEl: HTMLCanvasElement): void; } @@ -3946,7 +3861,7 @@ export class BaseBrush { /** * Sets shadow of an object - * @param {Object|String} [options] Options object or string (e.g. "2px 2px 10px rgba(0,0,0,0.2)") + * @param [options] Options object or string (e.g. "2px 2px 10px rgba(0,0,0,0.2)") */ setShadow(options: string|any): BaseBrush; } @@ -3958,13 +3873,11 @@ export class CircleBrush extends BaseBrush { width: number; /** * Invoked inside on mouse down and mouse move - * @param {Object} pointer */ drawDot(pointer: any): void; /** - * @param {Object} pointer - * @return {fabric.Point} Just added pointer point + * @return Just added pointer point */ addPoint(pointer: any): Point; } @@ -3996,9 +3909,7 @@ export class SprayBrush extends BaseBrush { * Whether overlapping dots (rectangles) should be removed (for performance reasons) */ optimizeOverlapping: boolean; - /** - * @param {Object} pointer - */ + addSprayChunk(pointer: any): void; } export class PatternBrush extends PencilBrush { @@ -4018,15 +3929,13 @@ export class PatternBrush extends PencilBrush { export class PencilBrush extends BaseBrush { /** * Converts points to SVG path - * @param {Array} points Array of points - * @param {Number} minX - * @param {Number} minY + * @param points Array of points */ convertPointsToSVGPath(points: Array<{ x: number; y: number }>, minX?: number, minY?: number): string[]; /** * Creates fabric.Path object to add on canvas - * @param {String} pathData Path data + * @param pathData Path data */ createPath(pathData: string): IPath; } @@ -4067,13 +3976,13 @@ interface IUtilAnimationOptions { interface IUtilAnimation { /** * Changes value from one to another within certain period of time, invoking callbacks as value is being changed. - * @param {Object} [options] Animation options + * @param [options] Animation options */ animate(options?: IUtilAnimationOptions): void; /** * requestAnimationFrame polyfill based on http://paulirish.com/2011/requestanimationframe-for-smart-animating/ * In order to get a precise start time, `requestAnimFrame` should be called as an entry into the method - * @param {Function} callback Callback to invoke + * @param callback Callback to invoke */ requestAnimFrame(callback: Function): void; } @@ -4116,35 +4025,25 @@ interface IUtilAnimEase { interface IUtilArc { /** * Draws arc - * @param {CanvasRenderingContext2D} ctx - * @param {Number} fx - * @param {Number} fy - * @param {Array} coords */ drawArc(ctx: CanvasRenderingContext2D, fx: number, fy: number, coords: number[]): void; /** * Calculate bounding box of a elliptic-arc - * @param {Number} fx start point of arc - * @param {Number} fy - * @param {Number} rx horizontal radius - * @param {Number} ry vertical radius - * @param {Number} rot angle of horizontal axe - * @param {Number} large 1 or 0, whatever the arc is the big or the small on the 2 points - * @param {Number} sweep 1 or 0, 1 clockwise or counterclockwise direction - * @param {Number} tx end point of arc - * @param {Number} ty + * @param fx start point of arc + * @param rx horizontal radius + * @param ry vertical radius + * @param rot angle of horizontal axe + * @param large 1 or 0, whatever the arc is the big or the small on the 2 points + * @param sweep 1 or 0, 1 clockwise or counterclockwise direction + * @param tx end point of arc */ getBoundsOfArc(fx: number, fy: number, rx: number, ry: number, rot: number, large: number, sweep: number, tx: number, ty: number): Point[]; /** * Calculate bounding box of a beziercurve - * @param {Number} x0 starting point - * @param {Number} y0 - * @param {Number} x1 first control point - * @param {Number} y1 - * @param {Number} x2 secondo control point - * @param {Number} y2 - * @param {Number} x3 end of beizer - * @param {Number} y3 + * @param x0 starting point + * @param x1 first control point + * @param x2 secondo control point + * @param x3 end of beizer */ getBoundsOfCurve(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number): Point[]; } @@ -4152,24 +4051,18 @@ interface IUtilArc { interface IUtilDomEvent { /** * Cross-browser wrapper for getting event's coordinates - * @param {Event} event Event object - * @param {HTMLCanvasElement} upperCanvasEl <canvas> element on which object selection is drawn + * @param event Event object + * @param upperCanvasEl <canvas> element on which object selection is drawn */ getPointer(event: Event, upperCanvasEl: HTMLCanvasElement): Point; /** * Adds an event listener to an element - * @param {HTMLElement} element - * @param {String} eventName - * @param {Function} handler */ addListener(element: HTMLElement, eventName: string, handler: Function): void; /** * Removes an event listener from an element - * @param {HTMLElement} element - * @param {String} eventName - * @param {Function} handler */ removeListener(element: HTMLElement, eventName: string, handler: Function): void; } @@ -4177,67 +4070,63 @@ interface IUtilDomEvent { interface IUtilDomMisc { /** * Takes id and returns an element with that id (if one exists in a document) - * @param {String|HTMLElement} id */ getById(id: string|HTMLElement): HTMLElement; /** * Converts an array-like object (e.g. arguments or NodeList) to an array - * @param {Object} arrayLike */ toArray(arrayLike: any): any[]; /** * Creates specified element with specified attributes - * @memberOf fabric.util - * @param {String} tagName Type of an element to create - * @param {Object} [attributes] Attributes to set on an element - * @return {HTMLElement} Newly created element + * @param tagName Type of an element to create + * @param [attributes] Attributes to set on an element + * @return Newly created element */ makeElement(tagName: string, attributes?: any): HTMLElement; /** * Adds class to an element - * @param {HTMLElement} element Element to add class to - * @param {String} className Class to add to an element + * @param element Element to add class to + * @param className Class to add to an element */ addClass(element: HTMLElement, classname: string): void; /** * Wraps element with another element - * @param {HTMLElement} element Element to wrap - * @param {HTMLElement|String} wrapper Element to wrap with - * @param {Object} [attributes] Attributes to set on a wrapper + * @param element Element to wrap + * @param wrapper Element to wrap with + * @param [attributes] Attributes to set on a wrapper */ wrapElement(element: HTMLElement, wrapper: HTMLElement|string, attributes?: any): HTMLElement; /** * Returns element scroll offsets - * @param {HTMLElement} element Element to operate on - * @param {HTMLElement} upperCanvasEl Upper canvas element + * @param element Element to operate on + * @param upperCanvasEl Upper canvas element */ getScrollLeftTop(element: HTMLElement, upperCanvasEl: HTMLElement): { left: number; right: number; }; /** * Returns offset for a given element - * @param {HTMLElement} element Element to get offset for + * @param element Element to get offset for */ getElementOffset(element: HTMLElement): { left: number; right: number; }; /** * Returns style attribute value of a given element - * @param {HTMLElement} element Element to get style attribute for - * @param {String} attr Style attribute to get for element + * @param element Element to get style attribute for + * @param attr Style attribute to get for element */ getElementStyle(elment: HTMLElement, attr: string): string; /** * Inserts a script element with a given url into a document; invokes callback, when that script is finished loading - * @memberOf fabric.util - * @param {String} url URL of a script to load - * @param {Function} callback Callback to execute when script is finished loading + * @param url URL of a script to load + * @param callback Callback to execute when script is finished loading */ getScript(url: string, callback: Function): void; /** * Makes element unselectable - * @param {HTMLElement} element Element to make unselectable + * @param element Element to make unselectable */ makeElementUnselectable(element: HTMLElement): HTMLElement; /** * Makes element selectable - * @param {HTMLElement} element Element to make selectable + * @param element Element to make selectable */ makeElementSelectable(element: HTMLElement): HTMLElement; } @@ -4245,19 +4134,19 @@ interface IUtilDomMisc { interface IUtilDomRequest { /** * Cross-browser abstraction for sending XMLHttpRequest - * @param {String} url URL to send XMLHttpRequest to - * @param {Object} [options] Options object - * @param {String} [options.method="GET"] - * @param {Function} options.onComplete Callback to invoke when request is completed + * @param url URL to send XMLHttpRequest to */ - request(url: string, options?: { method?: string; onComplete: Function }): XMLHttpRequest; + request(url: string, options?: { + /** @default "GET" */ + method?: string, + /** Callback to invoke when request is completed */ + onComplete: Function, + }): XMLHttpRequest; } interface IUtilDomStyle { /** * Cross-browser wrapper for setting element's style - * @param {HTMLElement} element - * @param {Object} styles */ setStyle(element: HTMLElement, styles: any): HTMLElement; } @@ -4265,20 +4154,18 @@ interface IUtilDomStyle { interface IUtilArray { /** * Invokes method on all items in a given array - * @param {Array} array Array to iterate over - * @param {String} method Name of a method to invoke + * @param array Array to iterate over + * @param method Name of a method to invoke */ invoke(array: any[], method: string): any[]; /** * Finds minimum value in array (not necessarily "first" one) - * @param {Array} array Array to iterate over - * @param {String} byProperty + * @param array Array to iterate over */ min(array: any[], byProperty: string): any; /** * Finds maximum value in array (not necessarily "first" one) - * @param {Array} array Array to iterate over - * @param {String} byProperty + * @param array Array to iterate over */ max(array: any[], byProperty: string): any; } @@ -4286,14 +4173,14 @@ interface IUtilArray { interface IUtilClass { /** * Helper for creation of "classes". - * @param {Function} [parent] optional "Class" to inherit from - * @param {Object} [properties] Properties shared by all instances of this class + * @param [parent] optional "Class" to inherit from + * @param [properties] Properties shared by all instances of this class * (be careful modifying objects defined here as this would affect all instances) */ createClass(parent: Function, properties?: any): void; /** * Helper for creation of "classes". - * @param {Object} [properties] Properties shared by all instances of this class + * @param [properties] Properties shared by all instances of this class * (be careful modifying objects defined here as this would affect all instances) */ createClass(properties?: any): void; @@ -4302,16 +4189,14 @@ interface IUtilClass { interface IUtilObject { /** * Copies all enumerable properties of one object to another - * @param {Object} destination Where to copy to - * @param {Object} source Where to copy from + * @param destination Where to copy to + * @param source Where to copy from */ extend(destination: any, source: any): any; /** * Creates an empty object and copies all enumerable properties of another object to it - * @memberOf fabric.util.object - * @param {Object} object Object to clone - * @return {Object} + * @param object Object to clone */ clone(object: any): any; } @@ -4319,14 +4204,14 @@ interface IUtilObject { interface IUtilString { /** * Camelizes a string - * @param {String} string String to camelize + * @param string String to camelize */ camelize(string: string): string; /** * Capitalizes a string - * @param {String} string String to capitalize - * @param {Boolean} [firstLetterOnly] If true only first letter is capitalized + * @param string String to capitalize + * @param [firstLetterOnly] If true only first letter is capitalized * and other letters stay untouched, if false first letter is capitalized * and other letters are converted to lowercase. */ @@ -4334,7 +4219,7 @@ interface IUtilString { /** * Escapes XML in a string - * @param {String} string String to escape + * @param string String to escape */ escapeXml(string: string): string; } @@ -4343,64 +4228,61 @@ interface IUtilMisc { /** * Removes value from an array. * Presence of value (and its position in an array) is determined via `Array.prototype.indexOf` - * @param {Array} array - * @param {Any} value */ removeFromArray(array: any[], value: any): any[]; /** * Returns random number between 2 specified ones. - * @param {Number} min lower limit - * @param {Number} max upper limit + * @param min lower limit + * @param max upper limit */ getRandomInt(min: number, max: number): number; /** * Transforms degrees to radians. - * @param {Number} degrees value in degrees + * @param degrees value in degrees */ degreesToRadians(degrees: number): number; /** * Transforms radians to degrees. - * @memberOf fabric.util - * @param {Number} radians value in radians + * @param radians value in radians */ radiansToDegrees(radians: number): number; /** * Rotates `point` around `origin` with `radians` - * @param {fabric.Point} point The point to rotate - * @param {fabric.Point} origin The origin of the rotation - * @param {Number} radians The radians of the angle for the rotation + * @param point The point to rotate + * @param origin The origin of the rotation + * @param radians The radians of the angle for the rotation */ rotatePoint(point: Point, origin: Point, radians: number): Point; /** * Apply transform t to point p - * @param {fabric.Point} p The point to transform - * @param {Array} t The transform - * @param {Boolean} [ignoreOffset] Indicates that the offset should not be applied + * @param p The point to transform + * @param t The transform + * @param [ignoreOffset] Indicates that the offset should not be applied */ transformPoint(p: Point, t: any[], ignoreOffset?: boolean): Point; /** * Invert transformation t - * @param {Array} t The transform + * @param t The transform */ invertTransform(t: any[]): any[]; /** * A wrapper around Number#toFixed, which contrary to native method returns number, not string. - * @param {Number|String} number number to operate on - * @param {Number} fractionDigits number of fraction digits to "leave" + * @param number number to operate on + * @param fractionDigits number of fraction digits to "leave" */ toFixed(number: number, fractionDigits: number): number; /** * Converts from attribute value to pixel value if applicable. * Returns converted pixels or original value not converted. - * @param {Number|String} value number to operate on + * @param value number to operate on */ parseUnit(value: number|string, fontSize?: number): number|string; @@ -4411,65 +4293,65 @@ interface IUtilMisc { /** * Returns klass "Class" object of given namespace - * @param {String} type Type of object (eg. 'circle') - * @param {String} namespace Namespace to get klass "Class" object from + * @param type Type of object (eg. 'circle') + * @param namespace Namespace to get klass "Class" object from */ getKlass(type: string, namespace: string): any; /** * Returns object of given namespace - * @param {String} namespace Namespace string e.g. 'fabric.Image.filter' or 'fabric' + * @param namespace Namespace string e.g. 'fabric.Image.filter' or 'fabric' */ resolveNamespace(namespace: string): any; /** * Loads image element from given url and passes it to a callback - * @param {String} url URL representing an image - * @param {Function} callback Callback; invoked with loaded image - * @param {Any} [context] Context to invoke callback in - * @param {Object} [crossOrigin] crossOrigin value to set image element to + * @param url URL representing an image + * @param callback Callback; invoked with loaded image + * @param [context] Context to invoke callback in + * @param [crossOrigin] crossOrigin value to set image element to */ loadImage(url: string, callback: (image: HTMLImageElement) => {}, context?: any, crossOrigin?: boolean): void; /** * Creates corresponding fabric instances from their object representations - * @param {Array} objects Objects to enliven - * @param {Function} callback Callback to invoke when all objects are created - * @param {String} namespace Namespace to get klass "Class" object from - * @param {Function} reviver Method for further parsing of object elements, called after each fabric object created. + * @param objects Objects to enliven + * @param callback Callback to invoke when all objects are created + * @param namespace Namespace to get klass "Class" object from + * @param reviver Method for further parsing of object elements, called after each fabric object created. */ enlivenObjects(objects: any[], callback: Function, namespace: string, reviver?: Function): void; /** * Groups SVG elements (usually those retrieved from SVG document) - * @param {Array} elements SVG elements to group - * @param {Object} [options] Options object + * @param elements SVG elements to group + * @param [options] Options object */ groupSVGElements(elements: any[], options?: any, path?: any): PathGroup; /** * Populates an object with properties of another object - * @param {Object} source Source object - * @param {Object} destination Destination object - * @param {Array} properties Propertie names to include + * @param source Source object + * @param destination Destination object + * @param properties Propertie names to include */ populateWithProperties(source: any, destination: any, properties: any): void; /** * Draws a dashed line between two points * This method is used to draw dashed line around selection area. - * @param {CanvasRenderingContext2D} ctx context - * @param {Number} x start x coordinate - * @param {Number} y start y coordinate - * @param {Number} x2 end x coordinate - * @param {Number} y2 end y coordinate - * @param {Array} da dash array pattern + * @param ctx context + * @param x start x coordinate + * @param y start y coordinate + * @param x2 end x coordinate + * @param y2 end y coordinate + * @param da dash array pattern */ drawDashedLine(ctx: CanvasRenderingContext2D, x: number, y: number, x2: number, y2: number, da: any[]): void; /** * Creates canvas element and initializes it via excanvas if necessary - * @param {CanvasElement} [canvasEl] optional canvas element to initialize; + * @param [canvasEl] optional canvas element to initialize; * when not given, element is created implicitly */ createCanvasElement(canvasEl?: HTMLCanvasElement): HTMLCanvasElement; @@ -4481,36 +4363,36 @@ interface IUtilMisc { /** * Creates accessors (getXXX, setXXX) for a "class", based on "stateProperties" array - * @param {Object} klass "Class" to create accessors for + * @param klass "Class" to create accessors for */ createAccessors(klass: any): any; /** - * @param {fabric.Object} receiver Object implementing `clipTo` method - * @param {CanvasRenderingContext2D} ctx Context to clip + * @param receiver Object implementing `clipTo` method + * @param ctx Context to clip */ clipContext(receiver: Object, ctx: CanvasRenderingContext2D): void; /** * Multiply matrix A by matrix B to nest transformations - * @param {Array} a First transformMatrix - * @param {Array} b Second transformMatrix + * @param a First transformMatrix + * @param b Second transformMatrix */ multiplyTransformMatrices(a: any[], b: any[]): any[]; /** * Returns string representation of function body - * @param {Function} fn Function to get body of + * @param fn Function to get body of */ getFunctionBody(fn: Function): string; /** * Returns true if context has transparent pixel * at specified location (taking tolerance into account) - * @param {CanvasRenderingContext2D} ctx context - * @param {Number} x x coordinate - * @param {Number} y y coordinate - * @param {Number} tolerance Tolerance + * @param ctx context + * @param x x coordinate + * @param y y coordinate + * @param tolerance Tolerance */ isTransparent(ctx: CanvasRenderingContext2D, x: number, y: number, tolerance: number): boolean; } diff --git a/types/facebook-js-sdk/tslint.json b/types/facebook-js-sdk/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/facebook-js-sdk/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/facebook-pixel/tslint.json b/types/facebook-pixel/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/facebook-pixel/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/faker/faker-tests.ts b/types/faker/faker-tests.ts index 5fb6a53746..df671dcf6a 100644 --- a/types/faker/faker-tests.ts +++ b/types/faker/faker-tests.ts @@ -1,5 +1,3 @@ - - let resultStr: string; let resultBool: boolean; let resultNum: number; @@ -17,7 +15,7 @@ resultStr = faker.address.cityPrefix(); resultStr = faker.address.citySuffix(); resultStr = faker.address.streetName(); resultStr = faker.address.streetAddress(); -resultStr = faker.address.streetAddress(false);; +resultStr = faker.address.streetAddress(false); resultStr = faker.address.streetSuffix(); resultStr = faker.address.streetPrefix(); resultStr = faker.address.secondaryAddress(); @@ -63,6 +61,8 @@ resultDate = faker.date.between('foo', 'bar'); resultDate = faker.date.between(new Date(), new Date()); resultDate = faker.date.recent(); resultDate = faker.date.recent(100); +resultDate = faker.date.soon(); +resultDate = faker.date.soon(30); resultStr = faker.date.month(); resultStr = faker.date.month({ abbr: true, @@ -86,6 +86,9 @@ resultStr = faker.finance.currencyCode(); resultStr = faker.finance.currencyName(); resultStr = faker.finance.currencySymbol(); resultStr = faker.finance.bitcoinAddress(); +resultStr = faker.finance.ethereumAddress(); +resultStr = faker.finance.iban(); +resultStr = faker.finance.iban(true); resultStr = faker.finance.bic(); resultStr = faker.hacker.abbreviation(); @@ -96,7 +99,7 @@ resultStr = faker.hacker.ingverb(); resultStr = faker.hacker.phrase(); resultStr = faker.helpers.randomize(); -resultNum = faker.helpers.randomize([1,2,3,4]); +resultNum = faker.helpers.randomize([1, 2, 3, 4]); resultStr = faker.helpers.randomize(['foo', 'bar', 'quux']); resultStr = faker.helpers.slugify('foo bar quux'); resultStr = faker.helpers.replaceSymbolWithNumber('foo# bar#'); @@ -167,7 +170,6 @@ resultStr = faker.name.jobType(); resultStr = faker.phone.phoneNumber(); resultStr = faker.phone.phoneNumber('#'); resultStr = faker.phone.phoneNumberFormat(); -// https://github.com/Marak/faker.js/blob/master/lib/phone_number.js#L9-L13 resultStr = faker.phone.phoneNumberFormat(0); resultStr = faker.phone.phoneFormats(); @@ -179,27 +181,104 @@ resultNum = faker.random.number({ precision: 0 }); resultStr = faker.random.arrayElement(); -resultStr = faker.random.arrayElement(['foo', 'bar', 'quux']) +resultStr = faker.random.arrayElement(['foo', 'bar', 'quux']); resultStr = faker.random.objectElement(); resultStr = faker.random.objectElement({foo: 'bar', field: 'foo'}); resultStr = faker.random.uuid(); resultBool = faker.random.boolean(); resultStr = faker.random.word(); +resultStr = faker.random.word("noun"); resultStr = faker.random.words(); resultStr = faker.random.words(0); resultStr = faker.random.image(); resultStr = faker.random.locale(); resultStr = faker.random.alphaNumeric(); resultStr = faker.random.alphaNumeric(0); +resultStr = faker.random.hexaDecimal(); +resultStr = faker.random.hexaDecimal(3); -resultStr = faker.system.fileName( "foo", "bar" ); -resultStr = faker.system.commonFileName( "foo", "bar" ); +resultStr = faker.system.fileName("foo", "bar"); +resultStr = faker.system.commonFileName("foo", "bar"); resultStr = faker.system.mimeType(); resultStr = faker.system.commonFileType(); resultStr = faker.system.commonFileExt(); resultStr = faker.system.fileType(); -resultStr = faker.system.fileExt( "foo" ); +resultStr = faker.system.fileExt("foo"); +resultStr = faker.system.directoryPath(); +resultStr = faker.system.filePath(); resultStr = faker.system.semver(); +import fakerAz = require('faker/locale/az'); +resultStr = fakerAz.name.firstName(); +import fakerCz = require('faker/locale/cz'); +resultStr = fakerCz.name.firstName(); +import fakerDe = require('faker/locale/de'); +resultStr = fakerDe.name.firstName(); +import fakerDeAT = require('faker/locale/de_AT'); +resultStr = fakerDeAT.name.firstName(); +import fakerdeCH = require('faker/locale/de_CH'); +resultStr = fakerdeCH.name.firstName(); import fakerEn = require('faker/locale/en'); -resultStr = faker.name.firstName(); +resultStr = fakerEn.name.firstName(); +import fakerEnAU = require('faker/locale/en_AU'); +resultStr = fakerEnAU.name.firstName(); +import fakerEnBORK = require('faker/locale/en_BORK'); +resultStr = fakerEnBORK.name.firstName(); +import fakerEnCA = require('faker/locale/en_CA'); +resultStr = fakerEnCA.name.firstName(); +import fakerEnGB = require('faker/locale/en_GB'); +resultStr = fakerEnGB.name.firstName(); +import fakerEnIE = require('faker/locale/en_IE'); +resultStr = fakerEnIE.name.firstName(); +import fakerEnIND = require('faker/locale/en_IND'); +resultStr = fakerEnIND.name.firstName(); +import fakerEnUS = require('faker/locale/en_US'); +resultStr = fakerEnUS.name.firstName(); +import fakerEnAuOcker = require('faker/locale/en_au_ocker'); +resultStr = fakerEnAuOcker.name.firstName(); +import fakerEs = require('faker/locale/es'); +resultStr = fakerEs.name.firstName(); +import fakerEsMX = require('faker/locale/es_MX'); +resultStr = fakerEsMX.name.firstName(); +import fakerFa = require('faker/locale/fa'); +resultStr = fakerFa.name.firstName(); +import fakerFr = require('faker/locale/fr'); +resultStr = fakerFr.name.firstName(); +import fakerFrCA = require('faker/locale/fr_CA'); +resultStr = fakerFrCA.name.firstName(); +import fakerGe = require('faker/locale/ge'); +resultStr = fakerGe.name.firstName(); +import fakerIdID = require('faker/locale/id_ID'); +resultStr = fakerIdID.name.firstName(); +import fakerIt = require('faker/locale/it'); +resultStr = fakerIt.name.firstName(); +import fakerJa = require('faker/locale/ja'); +resultStr = fakerJa.name.firstName(); +import fakerKo = require('faker/locale/ko'); +resultStr = fakerKo.name.firstName(); +import fakerNbNO = require('faker/locale/nb_NO'); +resultStr = fakerNbNO.name.firstName(); +import fakerNep = require('faker/locale/nep'); +resultStr = fakerNep.name.firstName(); +import fakerNl = require('faker/locale/nl'); +resultStr = fakerNl.name.firstName(); +import fakerPl = require('faker/locale/pl'); +resultStr = fakerPl.name.firstName(); +import fakerPtBR = require('faker/locale/pt_BR'); +resultStr = fakerPtBR.name.firstName(); +import fakerRu = require('faker/locale/ru'); +resultStr = fakerRu.name.firstName(); +import fakerSk = require('faker/locale/sk'); +resultStr = fakerSk.name.firstName(); +import fakerSv = require('faker/locale/sv'); +resultStr = fakerSv.name.firstName(); +import fakerTr = require('faker/locale/tr'); +resultStr = fakerTr.name.firstName(); +import fakerUk = require('faker/locale/uk'); +resultStr = fakerUk.name.firstName(); +import fakerVi = require('faker/locale/vi'); +resultStr = fakerVi.name.firstName(); +import fakerZhCN = require('faker/locale/zh_CN'); +resultStr = fakerZhCN.name.firstName(); +import fakerZhTW = require('faker/locale/zh_TW'); +resultStr = fakerZhTW.name.firstName(); diff --git a/types/faker/index.d.ts b/types/faker/index.d.ts index eda944d515..552e7d3eeb 100644 --- a/types/faker/index.d.ts +++ b/types/faker/index.d.ts @@ -1,9 +1,12 @@ -// Type definitions for faker v4.1.0 +// Type definitions for faker 4.1 // Project: http://marak.com/faker.js/ -// Definitions by: Ben Swartz , Bas Pennings , Yuki Kokubun +// Definitions by: Ben Swartz , +// Bas Pennings , +// Yuki Kokubun , +// Matt Bishop // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare var fakerStatic: Faker.FakerStatic; +declare const fakerStatic: Faker.FakerStatic; declare namespace Faker { interface FakerStatic { @@ -64,6 +67,7 @@ declare namespace Faker { future(years?: number, refDate?: string|Date): Date; between(from: string|number|Date, to: string|Date): Date; recent(days?: number): Date; + soon(days?: number): Date; month(options?: { abbr?: boolean, context?: boolean }): string; weekday(options?: { abbr?: boolean, context?: boolean }): string; }; @@ -74,12 +78,14 @@ declare namespace Faker { account(length?: number): string; accountName(): string; mask(length?: number, parens?: boolean, elipsis?: boolean): string; - amount(min?:number, max?: number, dec?: number, symbol?: string): string; + amount(min?: number, max?: number, dec?: number, symbol?: string): string; transactionType(): string; currencyCode(): string; currencyName(): string; currencySymbol(): string; bitcoinAddress(): string; + ethereumAddress(): string; + iban(formatted?: boolean): string bic(): string }; @@ -101,13 +107,12 @@ declare namespace Faker { shuffle(o: T[]): T[]; shuffle(): string[]; mustache(str: string, data: { [key: string]: string|((substring: string, ...args: any[]) => string) }): string; - createCard(): Faker.Card; - contextualCard(): Faker.ContextualCard; - userCard(): Faker.UserCard; - createTransaction(): Faker.Transaction; + createCard(): Card; + contextualCard(): ContextualCard; + userCard(): UserCard; + createTransaction(): Transaction; }; - image: { image(): string; avatar(): string; @@ -186,11 +191,12 @@ declare namespace Faker { objectElement(object?: { [key: string]: T }, field?: any): T; uuid(): string; boolean(): boolean; - word(): string; // TODO: have ability to return specific type of word? As in: noun, adjective, verb, etc + word(type?: string): string; words(count?: number): string; image(): string; locale(): string; alphaNumeric(count?: number): string; + hexaDecimal(count?: number): string; }; system: { @@ -201,8 +207,8 @@ declare namespace Faker { commonFileExt(): string; fileType(): string; fileExt(mimeType: string): string; - //directoryPath(): string; - //filePath(): string; + directoryPath(): string; + filePath(): string; semver(): string; }; @@ -315,10 +321,6 @@ declare module "faker/locale/de_CH" { export = fakerStatic; } -declare module "faker/locale/el_GR" { - export = fakerStatic; -} - declare module "faker/locale/en" { export = fakerStatic; } diff --git a/types/faker/tslint.json b/types/faker/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/faker/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/faker/v3/tslint.json b/types/faker/v3/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/faker/v3/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/falcor-express/index.d.ts b/types/falcor-express/index.d.ts index 172813baa1..7bd42aa1d8 100644 --- a/types/falcor-express/index.d.ts +++ b/types/falcor-express/index.d.ts @@ -2,11 +2,10 @@ // Project: https://github.com/Netflix/falcor-express // Definitions by: Quramy // Definitions: https://github.com/borisyankov/DefinitelyTyped +// TypeScript Version: 2.3 /// - - import { Request, Response, Handler } from 'express'; import {DataSource} from 'falcor'; declare function dataSourceRoute(getDataSource: (req: Request, res: Response) => DataSource): Handler; diff --git a/types/falcor-express/tslint.json b/types/falcor-express/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/falcor-express/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/falcor-http-datasource/tslint.json b/types/falcor-http-datasource/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/falcor-http-datasource/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/falcor-json-graph/tslint.json b/types/falcor-json-graph/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/falcor-json-graph/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/falcor-router/tslint.json b/types/falcor-router/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/falcor-router/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/famous/tslint.json b/types/famous/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/famous/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fancy-log/fancy-log-tests.ts b/types/fancy-log/fancy-log-tests.ts new file mode 100644 index 0000000000..581f75e42a --- /dev/null +++ b/types/fancy-log/fancy-log-tests.ts @@ -0,0 +1,26 @@ +import log = require('fancy-log'); + +log(); +log(1); +log('foo'); +log('foo', 'bar'); + +log.dir(); +log.dir(1); +log.dir('foo'); +log.dir('foo', 'bar'); + +log.error(); +log.error(1); +log.error('foo'); +log.error('foo', 'bar'); + +log.info(); +log.info(1); +log.info('foo'); +log.info('foo', 'bar'); + +log.warn(); +log.warn(1); +log.warn('foo'); +log.warn('foo', 'bar'); diff --git a/types/fancy-log/index.d.ts b/types/fancy-log/index.d.ts new file mode 100644 index 0000000000..2fbdb3f0d2 --- /dev/null +++ b/types/fancy-log/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for fancy-log 1.3 +// Project: https://github.com/js-cli/fancy-log +// Definitions by: Pine Mizune +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace FancyLog { + interface Logger { + (...args: any[]): Logger; + dir(...args: any[]): Logger; + error(...args: any[]): Logger; + info(...args: any[]): Logger; + warn(...args: any[]): Logger; + } +} + +declare var logger: FancyLog.Logger; +export = logger; diff --git a/types/fancy-log/tsconfig.json b/types/fancy-log/tsconfig.json new file mode 100644 index 0000000000..0ef3d95d9e --- /dev/null +++ b/types/fancy-log/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", + "fancy-log-tests.ts" + ] +} diff --git a/types/fancy-log/tslint.json b/types/fancy-log/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/fancy-log/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/farbtastic/tslint.json b/types/farbtastic/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/farbtastic/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fast-levenshtein/tslint.json b/types/fast-levenshtein/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/fast-levenshtein/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fast-stats/tslint.json b/types/fast-stats/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/fast-stats/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fastclick/tslint.json b/types/fastclick/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/fastclick/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/favico.js/tslint.json b/types/favico.js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/favico.js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fb/tslint.json b/types/fb/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/fb/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fbemitter/tslint.json b/types/fbemitter/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/fbemitter/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/featherlight/tslint.json b/types/featherlight/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/featherlight/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/feedme/feedme-tests.ts b/types/feedme/feedme-tests.ts new file mode 100644 index 0000000000..5efce41168 --- /dev/null +++ b/types/feedme/feedme-tests.ts @@ -0,0 +1,63 @@ +import FeedMe = require("feedme"); +import * as http from "http"; + +http.get('https://nodejs.org/en/feed/blog.xml', (res) => { + const feedme = new FeedMe(true); + const feedmeWithoutBuffer = new FeedMe(); + + res.pipe(feedme); + + feedme.on('end', () => { + const document: FeedMe.Document = feedme.done(); + + const metatype: FeedMe.Type = document.type; + // "#version": string; + const metatitle: string = document.title; + const metadescription: string = document.description; + const metadate: string = document.date; + const metapubdate: string = document.pubdate; + const metalink: string = document.link; + const metaxmlurl: string = document.xmlurl; + const metaauthor: string = document.author; + const metalanguage: string = document.language; + const metaimage: FeedMe.Image = document.image; + const metafavicon: string = document.favicon; + const metacopyright: string = document.copyright; + const metagenerator: string = document.generator; + const metacategories: string[] = document.categories; + + switch (document.type) { + case "atom": + case "json": + case "rss 0.90": + case "rss 0.91": + case "rss 0.92": + case "rss 0.93": + case "rss 0.94": + case "rss 1.0": + case "rss 2.0": + break; + } + + const misc: string = document["misc"]; + }); + + feedme.on('item', (item) => { + const title: string = item.title; + const description: string = item.description; + const summary: string = item.summary; + const date: string = item.date; + const pubdate: string = item.pubdate; + const link: string = item.link; + const origlink: string = item.origlink; + const author: string = item.author; + const guid: FeedMe.Guid | string = item.guid; + const comments: string = item.comments; + const image: FeedMe.Image = item.image; + const categories: string[] = item.categories; + const enclosures: string[] = item.enclosures; + const meta: FeedMe.Meta = item.meta; + + const misc: string = item["misc"]; + }); +}); diff --git a/types/feedme/index.d.ts b/types/feedme/index.d.ts new file mode 100644 index 0000000000..35859cd698 --- /dev/null +++ b/types/feedme/index.d.ts @@ -0,0 +1,109 @@ +// Type definitions for feedme 1.0 +// Project: https://github.com/fent/feedme.js +// Definitions by: Peter Harris +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +import { EventEmitter } from 'events'; +import { Writable, Readable } from 'stream'; + +declare class FeedMe extends Writable { + /** + * Creates a new instance of the FeedMe parser. + * + * @param buffer Can be true if you want the parser to buffer the entire feed document as a JSON object, letting you use the FeedMe#done() method. + */ + constructor(buffer?: boolean); + + /** + * Can only be used if buffer is true. It returns the feed as a Javascript object, should be called after end is emitted from the parser. + * Subelements are put as children objects with their names as keys. When one object has more than one child of the same name, they are + * put into an array. Items are always put into an array. + */ + done(): FeedMe.Document; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close" | "drain" | "finish", listener: () => void): this; + on(event: "pipe" | "unpipe", listener: (src: Readable) => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "item", listener: (item: FeedMe.Item) => void): this; + on(event: "type", listener: (type: FeedMe.Type) => void): this; +} + +declare namespace FeedMe { + type Type = "atom" | "rss 0.90" | "rss 0.91" | "rss 0.92" | "rss 0.93" | "rss 0.94" | "rss 1.0" | "rss 2.0" | "json"; + + interface Document extends Meta { + items: Item[]; + } + + interface Attrs { + name: string; + value: any; + prefix: string; + local: string; + uri: string; + } + + interface NS { + [key: string]: string; + } + + interface Image { + url: string; + title: string; + link: string; + width: string; + height: string; + } + + interface Meta { + [key: string]: any; + + // "#ns": NS[]; + "type": Type; + // "#version": string; + title: string; + description: string; + date: string; + pubdate: string; + lastbuilddate: string; + link: string; + xmlurl: string; + author: string; + language: string; + image: Image; + favicon: string; + copyright: string; + generator: string; + categories: string[]; + } + + interface Item { + [key: string]: any; + + title: string; + description: string; + summary: string; + date: string; + pubdate: string; + link: string; + origlink: string; + author: string; + guid: string | Guid; + comments: string; + image: Image; + categories: string[]; + enclosures: string[]; + // meta: Meta; + } + + interface Guid { + ispermalink: string; + text: string; + } +} + +export = FeedMe; diff --git a/types/feedme/tsconfig.json b/types/feedme/tsconfig.json new file mode 100644 index 0000000000..aa5f186309 --- /dev/null +++ b/types/feedme/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" : false + }, + "files": [ + "index.d.ts", + "feedme-tests.ts" + ] +} \ No newline at end of file diff --git a/types/feedme/tslint.json b/types/feedme/tslint.json new file mode 100644 index 0000000000..1fa97d3027 --- /dev/null +++ b/types/feedme/tslint.json @@ -0,0 +1,11 @@ +{ + "defaultSeverity": "error", + "extends": "dtslint/dt.json", + "jsRules": {}, + "rules": { + // "ban-types": false, + // "no-single-declare-module": false, + // "no-var": false + }, + "rulesDirectory": [] +} \ No newline at end of file diff --git a/types/node-feedparser/node-feedparser-tests.ts b/types/feedparser/feedparser-tests.ts similarity index 94% rename from types/node-feedparser/node-feedparser-tests.ts rename to types/feedparser/feedparser-tests.ts index f36698372b..25d652de8c 100644 --- a/types/node-feedparser/node-feedparser-tests.ts +++ b/types/feedparser/feedparser-tests.ts @@ -1,5 +1,5 @@ import request = require('request'); -import * as FeedParser from "node-feedparser"; +import * as FeedParser from "feedparser"; const req = request('https://news.google.com/news?cf=all&hl=en&pz=1&ned=us&output=rss'); const feedparser = new FeedParser({}); diff --git a/types/node-feedparser/index.d.ts b/types/feedparser/index.d.ts similarity index 99% rename from types/node-feedparser/index.d.ts rename to types/feedparser/index.d.ts index 7c257f15b5..75f3dde979 100644 --- a/types/node-feedparser/index.d.ts +++ b/types/feedparser/index.d.ts @@ -2,6 +2,8 @@ // Project: https://github.com/danmactough/node-feedparser // Definitions by: Juan J. Jimenez-Anca // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + /** Declaration file generated by dts-gen */ /// diff --git a/types/feedparser/tsconfig.json b/types/feedparser/tsconfig.json new file mode 100644 index 0000000000..683adf9415 --- /dev/null +++ b/types/feedparser/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", + "feedparser-tests.ts" + ] +} diff --git a/types/node-feedparser/tslint.json b/types/feedparser/tslint.json similarity index 100% rename from types/node-feedparser/tslint.json rename to types/feedparser/tslint.json diff --git a/types/fetch-mock/fetch-mock-tests.ts b/types/fetch-mock/fetch-mock-tests.ts index cfd595cb16..459c8e1076 100644 --- a/types/fetch-mock/fetch-mock-tests.ts +++ b/types/fetch-mock/fetch-mock-tests.ts @@ -1,6 +1,11 @@ import * as fetchMock from "fetch-mock"; fetchMock.mock("http://test.com", 200); +fetchMock.mock("http://test.com", 200, { + headers: { + test: "header" + } +}); fetchMock.mock(/test\.com/, 200); fetchMock.mock(() => true, 200); fetchMock.mock((url, opts) => true, 200); diff --git a/types/fetch-mock/index.d.ts b/types/fetch-mock/index.d.ts index 4b89b1decd..13563277b4 100644 --- a/types/fetch-mock/index.d.ts +++ b/types/fetch-mock/index.d.ts @@ -12,8 +12,6 @@ declare namespace fetchMock { /** * Mock matcher function - * @param url - * @param opts */ type MockMatcherFunction = (url: string, opts: MockRequest) => boolean; /** @@ -77,8 +75,6 @@ declare namespace fetchMock { | MockResponseObject | Promise; /** * Mock response function - * @param url - * @param opts */ type MockResponseFunction = (url: string, opts: MockRequest) => MockResponse; @@ -100,6 +96,10 @@ declare namespace fetchMock { * http method to match */ method?: string; + /** + * key/value map of headers to match + */ + headers?: { [key: string]: string }; /** * as specified above */ diff --git a/types/ffi/tslint.json b/types/ffi/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/ffi/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fhir/tslint.json b/types/fhir/tslint.json new file mode 100644 index 0000000000..e87060ef20 --- /dev/null +++ b/types/fhir/tslint.json @@ -0,0 +1,80 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-invalid-template-strings": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fibers/tslint.json b/types/fibers/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/fibers/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/field/tslint.json b/types/field/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/field/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/file-saver/file-saver-tests.ts b/types/file-saver/file-saver-tests.ts index 1cc06f58ba..7e704663d8 100644 --- a/types/file-saver/file-saver-tests.ts +++ b/types/file-saver/file-saver-tests.ts @@ -1,30 +1,40 @@ - - -import { saveAs as importedSaveAs } from "file-saver"; -function testImportedSaveAs() { - var data: Blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"}); - var filename: string = 'hello world.txt'; - var disableAutoBOM = true; - - importedSaveAs(data, filename, disableAutoBOM); -} +import "file-saver"; /** * @summary Test for "saveAs" function. */ function testSaveAs() { - var data: Blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"}); - var filename: string = 'hello world.txt'; - var disableAutoBOM = true; + const data: Blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"}); + const filename = 'hello world.txt'; + const disableAutoBOM = true; saveAs(data, filename, disableAutoBOM); } /** - * @summary Test for "saveAs" function. + * @summary Test for "saveAs" function on the window object. */ -function testSaveAsFile() { - const data = new File(["Hello, world!"], "hello world.txt" ,{type: "text/plain;charset=utf-8"}); - +function testWindowSaveAs() { + const data: Blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"}); + const filename = 'hello world.txt'; + const disableAutoBOM = true; + + window.saveAs(data, filename, disableAutoBOM); +} + +/** + * @summary Test for "saveAs" function with the 3rd parameter omitted + */ +function testOptionalOneParamSaveAs() { + const data: Blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"}); + const filename = 'hello world.txt'; + saveAs(data, filename); +} + +/** + * @summary Test for "saveAs" function with the 2nd and 3rd parameters omitted + */ +function testOptionalTwoParamsSaveAs() { + const data: Blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"}); saveAs(data); } diff --git a/types/file-saver/index.d.ts b/types/file-saver/index.d.ts index 8d78e10682..935fed44c2 100644 --- a/types/file-saver/index.d.ts +++ b/types/file-saver/index.d.ts @@ -1,46 +1,26 @@ -// Type definitions for FileSaver.js +// Type definitions for FileSaver.js 1.3 // Project: https://github.com/eligrey/FileSaver.js/ -// Definitions by: Cyril Schumacher , Daniel Roth -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Definitions by: Cyril Schumacher +// Daniel Roth +// Chris Barr +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/file-saver -/** - * @summary Interface for "saveAs" function. - * @author Cyril Schumacher - * @version 1.0 - */ -interface FileSaver { - ( - /** - * @summary Data. - * @type {Blob} - */ - data: Blob, - - /** - * @summary File name. - * @type {DOMString} - */ - filename: string, - - /** - * @summary Disable Unicode text encoding hints or not. - * @type {boolean} - */ - disableAutoBOM?: boolean - ): void - - ( - /** - * @summary File. - * @type {File} - */ - data: File - ): void +declare namespace FileSaver { + /** + * FileSaver.js implements the saveAs() FileSaver interface in browsers that do not natively support it. + * @param data - The actual file data blob. + * @param filename - The optional name of the file to be downloaded. If omitted, the name used in the file data will be used. If none is provided "download" will be used. + * @param disableAutoBOM - Optional & defaults to `false`. Set to `true` if you don't want FileSaver.js to automatically provide Unicode text encoding hints + */ + function saveAs(data: Blob, filename?: string, disableAutoBOM?: boolean): void; } -declare var saveAs: FileSaver; +declare global { + const saveAs: typeof FileSaver.saveAs; -declare module "file-saver" { - var fileSaver: { saveAs: typeof saveAs }; - export = fileSaver + interface Window { + saveAs: typeof FileSaver.saveAs; + } } + +export = FileSaver; diff --git a/types/file-saver/tsconfig.json b/types/file-saver/tsconfig.json index 1dc5a6f8f4..803ff5f510 100644 --- a/types/file-saver/tsconfig.json +++ b/types/file-saver/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -21,4 +21,4 @@ "index.d.ts", "file-saver-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/file-saver/tslint.json b/types/file-saver/tslint.json new file mode 100644 index 0000000000..adaee1b55f --- /dev/null +++ b/types/file-saver/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "export-just-namespace": false + } +} diff --git a/types/filesize/tslint.json b/types/filesize/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/filesize/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/filesystem/tslint.json b/types/filesystem/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/filesystem/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/filewriter/tslint.json b/types/filewriter/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/filewriter/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fill-pdf/tslint.json b/types/fill-pdf/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/fill-pdf/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/finalhandler/tslint.json b/types/finalhandler/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/finalhandler/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/finch/tslint.json b/types/finch/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/finch/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/find/find-tests.ts b/types/find/find-tests.ts new file mode 100644 index 0000000000..c6c1cd04f5 --- /dev/null +++ b/types/find/find-tests.ts @@ -0,0 +1,32 @@ +import * as find from "find"; + +const stringPattern = ".d.ts"; +const regexPattern = /ts(config|lint)\.json/; +const rootDir = "."; + +const emptyCb = (): void => { }; +const errorCb = (err: Error): void => { }; +const stringArrayCallback = (paths: string[]): void => { }; +const singleStringCb = (paths: string): void => { }; + +find.file(rootDir, (dirs: string[]): void => { }).error(emptyCb); // $ExpectType void +find.file(rootDir, (dirs: string[]): void => { }).error(errorCb); // $ExpectType void +find.file(stringPattern, rootDir, (dirs: string[]): void => { }).error(errorCb); // $ExpectType void +find.file(regexPattern, rootDir, (dirs: string[]): void => { }).error(errorCb); // $ExpectType void +find.fileSync(rootDir); // $ExpectType string[] +find.fileSync(stringPattern, rootDir); // $ExpectType string[] +find.fileSync(regexPattern, rootDir); // $ExpectType string[] +find.eachFile(rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream +find.eachFile(stringPattern, rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream +find.eachFile(regexPattern, rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream + +find.dir(stringPattern, rootDir, (dirs: string[]): void => { }).error(emptyCb); // $ExpectType void +find.dir(stringPattern, rootDir, (dirs: string[]): void => { }).error(errorCb); // $ExpectType void +find.dir(regexPattern, rootDir, (dirs: string[]): void => { }).error(errorCb); // $ExpectType void +find.dir(rootDir, (dirs: string[]): void => { }).error(errorCb); // $ExpectType void +find.dirSync(rootDir); // $ExpectType string[] +find.dirSync(stringPattern, rootDir); // $ExpectType string[] +find.dirSync(regexPattern, rootDir); // $ExpectType string[] +find.eachDir(rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream +find.eachDir(stringPattern, rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream +find.eachDir(regexPattern, rootDir, singleStringCb).end(emptyCb).error(errorCb).end(emptyCb); // $ExpectType FindEachStream diff --git a/types/find/index.d.ts b/types/find/index.d.ts new file mode 100644 index 0000000000..61166669db --- /dev/null +++ b/types/find/index.d.ts @@ -0,0 +1,116 @@ +// Type definitions for find 0.2 +// Project: https://github.com/yuanchuan/find#readme +// Definitions by: Andrey Lalev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface AsyncFindStream { + /** + * Handling errors in asynchronous interfaces. + * @param callback The callback that is called upon an error + */ + error(callback: (() => void) | ((err: Error) => void)): void; +} + +export interface FindEachStream { + /** + * Handling errors in asynchronous interfaces. + * @param callback The callback that is called upon an error + */ + error(callback: (() => void) | ((err: Error) => void)): FindEachStream; + + /** + * Detect end in find.eachfile and find.eachdir. + * @param callback The callback called at the end of find.eachfile and find.eachdir + */ + end(callback: () => void): FindEachStream; +} + +/** + * Find all files in a given directory asynchronously. + * @param root The root directory + * @param callback A callback that accepts an array of the found files + */ +export function file(root: string, callback: (files: string[]) => void): AsyncFindStream; + +/** + * Find all files that match a glob pattern in a given directory asynchronously. + * @param pattern The pattern to filter the files with + * @param root The root directory + * @param callback A callback that accepts an array of the found files + */ +export function file(pattern: string | RegExp, root: string, callback: (files: string[]) => void): AsyncFindStream; + +/** + * Find all files in a given directory asynchronously. + * @param root The root directory + * @param callback A callback that accepts each file separately + */ +export function eachFile(root: string, callback: (file: string) => void): FindEachStream; + +/** + * Find all files that match a glob pattern in a given directory asynchronously. + * @param pattern The pattern to filter the files with + * @param root The root directory + * @param callback A callback that accepts an array of the found files + */ +export function eachFile(pattern: string | RegExp, root: string, callback: (file: string) => void): FindEachStream; + +/** + * Find all files in a given directory synchronously. + * @param root The root directory + * @returns The files that have been found + */ +export function fileSync(root: string): string[]; + +/** + * Find all files that match a glob pattern in a given directory synchronously. + * @param pattern The pattern to filter the files with + * @param root The root directory + * @returns The files that have been found + */ +export function fileSync(pattern: string | RegExp, root: string): string[]; + +/** + * Find all directories in a given directory asynchronously. + * @param root The root directory + * @param callback A callback that accepts an array of the found directories + */ +export function dir(root: string, callback: (directories: string[]) => void): AsyncFindStream; + +/** + * Find all directories that match a glob pattern in a given directory asynchronously. + * @param pattern The pattern to filter the directories with + * @param root The root directory + * @param callback A callback that accepts an array of the found directories + */ +export function dir(pattern: RegExp | string, root: string, callback: (directories: string[]) => void): AsyncFindStream; + +/** + * Find all directories in a given directory synchronously. + * @param root The root directory + * @returns The directories that have been found + */ +export function dirSync(root: string): string[]; + +/** + * Find all directories that match a glob pattern in a given directory synchronously. + * @param pattern The pattern to filter the directories with + * @param root The root directory + * @returns The directories that have been found + */ +export function dirSync(pattern: string | RegExp, root: string): string[]; + +/** + * Find all directories in a given directory asynchronously. + * @param root The root directory + * @param callback A callback that accepts each of the found directories separately + */ +export function eachDir(root: string, callback: (directory: string) => void): FindEachStream; + +/** + * Find all directories that match a glob pattern in a given directory asynchronously. + * @param pattern The pattern to filter the directories with + * @param root The root directory + * @param callback A callback that accepts each of the found directories separately + */ +export function eachDir(pattern: string | RegExp, root: string, callback: (directory: string) => void): FindEachStream; diff --git a/types/find/tsconfig.json b/types/find/tsconfig.json new file mode 100644 index 0000000000..e231e78ff5 --- /dev/null +++ b/types/find/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", + "find-tests.ts" + ] +} diff --git a/types/find/tslint.json b/types/find/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/find/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/findup-sync/tslint.json b/types/findup-sync/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/findup-sync/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fingerprintjs/tslint.json b/types/fingerprintjs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/fingerprintjs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fingerprintjs2/index.d.ts b/types/fingerprintjs2/index.d.ts index c9fc9b2a39..94b705b807 100644 --- a/types/fingerprintjs2/index.d.ts +++ b/types/fingerprintjs2/index.d.ts @@ -13,7 +13,7 @@ declare class Fingerprint2 { interface Fingerprint2Options { swfContainerId?: string; swfPath?: string; - userDefinedFonts?: [string]; + userDefinedFonts?: string[]; excludeUserAgent?: boolean; excludeLanguage?: boolean; excludeColorDepth?: boolean; diff --git a/types/firebase-client/index.d.ts b/types/firebase-client/index.d.ts index fe5dd5b9e7..f13c8499f5 100644 --- a/types/firebase-client/index.d.ts +++ b/types/firebase-client/index.d.ts @@ -2,6 +2,7 @@ // Project: https://www.github.com/jpstevens/firebase-client // Definitions by: Andrew Breen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 import * as Q from "q"; diff --git a/types/firebase-client/tslint.json b/types/firebase-client/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/firebase-client/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/firebase-token-generator/tslint.json b/types/firebase-token-generator/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/firebase-token-generator/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/firebase/tslint.json b/types/firebase/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/firebase/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/firebird/firebird-tests.ts b/types/firebird/firebird-tests.ts index 96600a7f2d..d248fe427c 100644 --- a/types/firebird/firebird-tests.ts +++ b/types/firebird/firebird-tests.ts @@ -119,4 +119,4 @@ blob._write(buffer, 10); blob._write(buffer, 10, (err: Error | null) => {}); /* Stream */ -const strm: NodeJS.ReadWriteStream = new fb.Stream(blob); +const strm = new fb.Stream(blob); diff --git a/types/firebird/index.d.ts b/types/firebird/index.d.ts index 430a3b3b60..37d88324fc 100644 --- a/types/firebird/index.d.ts +++ b/types/firebird/index.d.ts @@ -12,6 +12,8 @@ * Original document is [here](https://www.npmjs.com/package/firebird). */ declare module 'firebird' { + import * as stream from 'stream'; + /** * @see createConnection() method will create Firebird Connection object for you */ @@ -27,10 +29,6 @@ declare module 'firebird' { * Connects you to database, * * @param database a database name in Firebird notation, i.e. : - * @param username user name - * @param pasword - * @param role - * * @throws raises exception on error (try to catch it). */ connectSync(db: string, user: string, pass: string, role: string): void; @@ -39,9 +37,6 @@ declare module 'firebird' { * Asynchronously connects you to Database. * * @param database a database name in Firebird notation, i.e. : - * @param username user name - * @param pasword - * @param role * @param callback function(err), where err is error object in case of error. */ connect(db: string, user: string, pass: string, role: string, callback: (err: Error | null) => void): void; @@ -146,7 +141,8 @@ declare module 'firebird' { */ start(callback: (err: Error | null) => void): void; - /**Synchronously prepares SQL statement and returns FBStatement object. + /** + * Synchronously prepares SQL statement and returns FBStatement object. * * @param sql an SQL query to prepare. */ @@ -325,7 +321,7 @@ declare module 'firebird' { * Synchronously prepares SQL statement * * @param sql an SQL query to prepare. - * @returns @see FBStatement object in context of this transaction. + * @returns object in context of this transaction. */ prepareSync(sql: string): FBStatement; @@ -355,9 +351,6 @@ declare module 'firebird' { /** * Same as @see execSync but executes statement in context of given @see Transaction obejct. - * - * @param transaction - * @param params */ execInTransSync(transaction: Transaction, ...params: DataType[]): void; @@ -375,9 +368,6 @@ declare module 'firebird' { /** * Same as @see exec but executes statement in context of given @see Transaction obejct. - * - * @param transaction - * @param params */ execInTrans(transaction: Transaction, ...params: DataType[]): void; } @@ -453,24 +443,13 @@ declare module 'firebird' { * You may pipe strm to/from NodeJS Stream objects (fs or socket). * You may also look at [NodeJS Streams reference](https://nodejs.org/api/stream.html). */ - class Stream implements NodeJS.ReadWriteStream { + class Stream extends stream.Stream { constructor(blob: FBBlob); - /* Following lines is JUST AS NodeJS.ReadStream, NodeJS.WriteStream, and NodeJS.Emmiter */ - /* tslint:disable */ - /* NodeJS.ReadStream */ readable: boolean; - read(size?: number): string | Buffer; - setEncoding(encoding: string | null): this; pause(): this; resume(): this; - isPaused(): boolean; - pipe(destination: T, options?: { end?: boolean; }): T; - unpipe(destination?: T): this; - unshift(chunk: string): void; - unshift(chunk: Buffer): void; - wrap(oldStream: NodeJS.ReadableStream): NodeJS.ReadableStream; /* NodeJS.WriteStream */ writable: boolean; @@ -480,22 +459,8 @@ declare module 'firebird' { end(buffer: Buffer, cb?: Function): void; end(str: string, cb?: Function): void; end(str: string, encoding?: string, cb?: Function): void; + destroy(error?: Error): void; - /* EventEmitter */ - addListener(event: string | symbol, listener: Function): this; - on(event: string | symbol, listener: Function): this; - once(event: string | symbol, listener: Function): this; - removeListener(event: string | symbol, listener: Function): this; - removeAllListeners(event?: string | symbol): this; - setMaxListeners(n: number): this; - getMaxListeners(): number; - listeners(event: string | symbol): Function[]; - emit(event: string | symbol, ...args: any[]): boolean; - listenerCount(type: string | symbol): number; - prependListener(event: string | symbol, listener: Function): this; - prependOnceListener(event: string | symbol, listener: Function): this; - eventNames(): (string | symbol)[]; - - /* tslint:enable */ + check_destroyed(): void; } } diff --git a/types/firebird/tslint.json b/types/firebird/tslint.json index 4b3c58f2c3..b9ced8ae6f 100644 --- a/types/firebird/tslint.json +++ b/types/firebird/tslint.json @@ -2,8 +2,11 @@ "extends": "dtslint/dt.json", "rules": { // TODO + "ban-types": false, "no-boolean-literal-compare": false, "no-declare-current-package": false, - "no-unnecessary-generics": false + "no-single-declare-module": false, + "no-unnecessary-generics": false, + "unified-signatures": false } } diff --git a/types/firefox/tslint.json b/types/firefox/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/firefox/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/firmata/index.d.ts b/types/firmata/index.d.ts index b89402b9d4..6f72107a07 100644 --- a/types/firmata/index.d.ts +++ b/types/firmata/index.d.ts @@ -155,7 +155,7 @@ declare namespace Board { interface Options { reportVersionTimeout?: number; samplingInterval?: number; - serialport?: SerialPort.options; + serialport?: SerialPort.Options; } interface PinModes { diff --git a/types/firmata/tsconfig.json b/types/firmata/tsconfig.json index bf87f0bba2..d843e1300d 100644 --- a/types/firmata/tsconfig.json +++ b/types/firmata/tsconfig.json @@ -12,6 +12,9 @@ "typeRoots": [ "../" ], + "paths": { + "serialport": ["serialport/v4"] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true diff --git a/types/first-mate/.editorconfig b/types/first-mate/.editorconfig deleted file mode 100644 index 2b997514d2..0000000000 --- a/types/first-mate/.editorconfig +++ /dev/null @@ -1,3 +0,0 @@ -[*.ts] -indent_style = tab -indent_size = 2 diff --git a/types/first-mate/README.md b/types/first-mate/README.md deleted file mode 100644 index e83328a13e..0000000000 --- a/types/first-mate/README.md +++ /dev/null @@ -1,22 +0,0 @@ -## First Mate Type Definitions - -TypeScript type definitions for [First Mate](https://github.com/atom/first-mate), which is published as "[first-mate](https://www.npmjs.com/package/first-mate)" on NPM. - -### Usage Notes - -#### Exports - -The three classes exported from this module are: [Grammar](https://github.com/atom/first-mate/blob/master/src/grammar.coffee), [GrammarRegistry](https://github.com/atom/first-mate/blob/master/src/grammar-registry.coffee), and [ScopeSelector](https://github.com/atom/first-mate/blob/master/src/scope-selector.coffee). - -```ts -import { Grammar, GrammarRegistry, ScopeSelector } from "first-mate"; -let selector = new ScopeSelector("a | b"); -``` - -#### The FirstMate Namespace - -Many of the types used by First Mate can be referenced from the FirstMate namespace. - -```ts -function example(grammar: FirstMate.Grammar) {} -``` diff --git a/types/first-mate/first-mate-tests.ts b/types/first-mate/first-mate-tests.ts index b0fd70d4e2..3d3be512a1 100644 --- a/types/first-mate/first-mate-tests.ts +++ b/types/first-mate/first-mate-tests.ts @@ -1,8 +1,9 @@ +import { Disposable } from "event-kit"; import { GrammarRegistry, Grammar, ScopeSelector } from "first-mate"; -declare let subscription: EventKit.Disposable; -declare let grammar: FirstMate.Grammar; -declare let grammars: FirstMate.Grammar[]; +declare let subscription: Disposable; +declare let grammar: Grammar; +declare let grammars: Grammar[]; // NPM Examples =============================================================== const selector = new ScopeSelector("a | b"); @@ -15,7 +16,7 @@ const { line, tags } = grammar.tokenizeLine("var offset = 3;"); // Convert compact tags representation into convenient, space-inefficient tokens. const tokens = registry.decodeTokens(line, tags); for (const { value, scopes } of tokens) { - console.log(`Token text: '${value}' with scopes: ${scopes}`); + console.log(`Token text: '${value}' with scopes: ${scopes}`); } // General Usage ============================================================== @@ -25,13 +26,13 @@ new GrammarRegistry({ maxTokensPerLine: 100 }); registry.loadGrammarSync("javascript.json"); const result = grammar.tokenizeLine('var text = "hello world";'); result.tokens.forEach((token) => { - console.log(`Token text: '${token.value}' with scopes: ${token.scopes}`); + console.log(`Token text: '${token.value}' with scopes: ${token.scopes}`); }); new ScopeSelector("source.file"); let prefix = selector.getPrefix("test"); if (prefix) { - str = prefix.charAt(0); + str = prefix.charAt(0); } prefix = selector.getPrefix(["test", "test"]); @@ -43,10 +44,10 @@ subscription = grammar.onDidUpdate(() => {}); const tokenizeLinesResult = grammar.tokenizeLines("Test String"); for (const tokenizedLine of tokenizeLinesResult) { - for (const token of tokenizedLine) { - token.scopes; - token.value; - } + for (const token of tokenizedLine) { + token.scopes; + token.value; + } } grammar.tokenizeLine("Test String"); @@ -75,19 +76,19 @@ potentialGrammar = registry.removeGrammarForScopeName("scope.test"); grammar = registry.readGrammarSync("/test/path"); registry.readGrammar("/test/path", (error, grammar) => { - if (grammar) { - grammar.name; - } else { - if (error) error.name; - } + if (grammar) { + grammar.name; + } else { + if (error) error.name; + } }); grammar = registry.loadGrammarSync("/test/path"); registry.loadGrammar("/test/path", (error, grammar) => { - if (grammar) { - grammar.name; - } else { - if (error) error.name; - } + if (grammar) { + grammar.name; + } else { + if (error) error.name; + } }); diff --git a/types/first-mate/index.d.ts b/types/first-mate/index.d.ts index 0986b80aa5..c7df2365c3 100644 --- a/types/first-mate/index.d.ts +++ b/types/first-mate/index.d.ts @@ -4,255 +4,249 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -/// - -declare global { - /** TextMate helpers. */ - namespace FirstMate { - /** Objects that appear as parameters to functions. */ - namespace Options { - interface Grammar { - name?: string; - fileTypes?: ReadonlyArray; - scopeName?: string; - foldingStopMarker?: string; - maxTokensPerLine?: number; - maxLineLength?: number; - - injections?: any; - injectionSelector?: any; - patterns?: ReadonlyArray; - repository?: object; - firstLineMatch?: any; - } - } - - /** The static side to each exported class. Should generally only be used internally. */ - namespace Statics { - /* tslint:disable:no-unnecessary-qualifier */ - /** The static side to the Grammar class. */ - interface Grammar { - new (registry: FirstMate.GrammarRegistry, options?: FirstMate.Options.Grammar): - FirstMate.Grammar; - } - - /** The static side to the GrammarRegistry class. */ - interface GrammarRegistry { - new (options?: { maxTokensPerLine?: number, maxLineLength?: number }): - FirstMate.GrammarRegistry; - } - - /** The static side to the ScopeSelector class. */ - interface ScopeSelector { - /** Create a new scope selector. - * @param source The string to parse as a scope selector. - * @return A newly constructed ScopeSelector. - */ - new (source: string): FirstMate.ScopeSelector; - } - /* tslint:enable:no-unnecessary-qualifier */ - } - - /** Data structures that are used within classes. */ - namespace Structures { - interface GrammarToken { - value: string; - scopes: string[]; - } - - /** Result returned by `Grammar.tokenizeLine`. */ - interface TokenizeLineResult { - /** The string of text that was tokenized. */ - line: string; - - /** An array of integer scope ids and strings. Positive ids indicate the - * beginning of a scope, and negative tags indicate the end. To resolve ids - * to scope names, call {GrammarRegistry::scopeForId} with the absolute - * value of the id. - */ - tags: Array; - - /** This is a dynamic property. Invoking it will incur additional overhead, - * but will automatically translate the `tags` into token objects with `value` - * and `scopes` properties. - */ - tokens: GrammarToken[]; - - /** An array of rules representing the tokenized state at the end of the line. - * These should be passed back into this method when tokenizing the next line - * in the file. - */ - ruleStack: GrammarRule[]; - } - - interface GrammarRule { - // https://github.com/atom/first-mate/blob/v7.0.7/src/rule.coffee - // This is private. Don't go down the rabbit hole. - rule: object; - scopeName: string; - contentScopeName: string; - } - } - - /** Grammar that tokenizes lines of text. */ - interface Grammar { - name: string; - fileTypes: string[]; - scopeName: string; - maxTokensPerLine: number; - maxLineLength: number; - - // Event Subscription - onDidUpdate(callback: () => void): EventKit.Disposable; - - // Tokenizing - /** Tokenize all lines in the given text. - * @param text A string containing one or more lines. - * @return An array of token arrays for each line tokenized. - */ - tokenizeLines(text: string): Structures.GrammarToken[][]; - - /** Tokenizes the line of text. - * @param line A string of text to tokenize. - * @param ruleStack An optional array of rules previously returned from this - * method. This should be null when tokenizing the first line in the file. - * @param firstLine A optional boolean denoting whether this is the first line - * in the file which defaults to `false`. - * @return An object representing the result of the tokenize. - */ - tokenizeLine(line: string, ruleStack?: null, firstLine?: boolean): - Structures.TokenizeLineResult; - /** Tokenizes the line of text. - * @param line A string of text to tokenize. - * @param ruleStack An optional array of rules previously returned from this - * method. This should be null when tokenizing the first line in the file. - * @param firstLine A optional boolean denoting whether this is the first line - * in the file which defaults to `false`. - * @return An object representing the result of the tokenize. - */ - tokenizeLine(line: string, ruleStack: Structures.GrammarRule[], firstLine?: false): - Structures.TokenizeLineResult; - } - - /** Instance side of GrammarRegistry class. */ - interface GrammarRegistry { - maxTokensPerLine: number; - maxLineLength: number; - - // Event Subscription - /** Invoke the given callback when a grammar is added to the registry. - * @param callback The callback to be invoked whenever a grammar is added. - * @return A Disposable on which `.dispose()` can be called to unsubscribe. - */ - onDidAddGrammar(callback: (grammar: Grammar) => void): EventKit.Disposable; - - /** Invoke the given callback when a grammar is updated due to a grammar it - * depends on being added or removed from the registry. - * @param callback The callback to be invoked whenever a grammar is updated. - * @return A Disposable on which `.dispose()` can be called to unsubscribe. - */ - onDidUpdateGrammar(callback: (grammar: Grammar) => void): EventKit.Disposable; - - // Managing Grammars - /** Get all the grammars in this registry. - * @return A non-empty array of Grammar instances. - */ - getGrammars(): Grammar[]; - - /** Get a grammar with the given scope name. - * @param scopeName A string such as `source.js`. - * @return A Grammar or undefined. - */ - grammarForScopeName(scopeName: string): Grammar|undefined; - - /** Add a grammar to this registry. - * A 'grammar-added' event is emitted after the grammar is added. - * @param grammar The Grammar to add. This should be a value previously returned - * from ::readGrammar or ::readGrammarSync. - * @return Returns a Disposable on which `.dispose()` can be called to remove - * the grammar. - */ - addGrammar(grammar: Grammar): EventKit.Disposable; - - /** Remove the given grammar from this registry. - * @param grammar The grammar to remove. This should be a grammar previously - * added to the registry from ::addGrammar. - */ - removeGrammar(grammar: Grammar): void; - - /** Remove the grammar with the given scope name. - * @param scopeName A string such as `source.js`. - * @return Returns the removed Grammar or undefined. - */ - removeGrammarForScopeName(scopeName: string): Grammar|undefined; - - /** Read a grammar synchronously but don't add it to the registry. - * @param grammarPath The absolute file path to a grammar. - * @return The newly loaded Grammar. - */ - readGrammarSync(grammarPath: string): Grammar; - - /** Read a grammar asynchronously but don't add it to the registry. - * @param grammarPath The absolute file path to the grammar. - * @param callback The function to be invoked once the Grammar has been read in. - */ - readGrammar(grammarPath: string, callback: (error: Error|null, grammar?: Grammar) => - void): void; - - /** Read a grammar synchronously and add it to this registry. - * @param grammarPath The absolute file path to the grammar. - * @return The newly loaded Grammar. - */ - loadGrammarSync(grammarPath: string): Grammar; - - /** Read a grammar asynchronously and add it to the registry. - * @param grammarPath The absolute file path to the grammar. - * @param callback The function to be invoked once the Grammar has been read in - * and added to the registry. - */ - loadGrammar(grammarPath: string, callback: (error: Error|null, grammar?: Grammar) => - void): void; - - /** Convert compact tags representation into convenient, space-inefficient tokens. - * @param lineText The text of the tokenized line. - * @param tags The tags returned from a call to Grammar::tokenizeLine(). - * @return An array of Token instances decoded from the given tags. - */ - decodeTokens(lineText: string, tags: Array): Structures.GrammarToken[]; - } - - interface ScopeSelector { - /** Check if this scope selector matches the scopes. - * @param scopes A single scope or an array of them to be compared against. - * @return A boolean indicating whether or not this ScopeSelector matched. - */ - matches(scopes: string|ReadonlyArray): boolean; - - /** Gets the prefix of this scope selector. - * @param scopes The scopes to match a prefix against. - * @return The matching prefix, if there is one. - */ - getPrefix(scopes: string|ReadonlyArray): string|undefined; - - /** Convert this TextMate scope selector to a CSS selector. - * @return A string with the CSSSelector representation of this ScopeSelector. - */ - toCssSelector(): string; - - /** Convert this TextMate scope selector to a CSS selector, prefixing scopes - * with `syntax--`. - * @return A string with the syntax-specific CSSSelector representation of this - * ScopeSelector. - */ - toCssSyntaxSelector(): string; - } - } -} - -/** Registry containing one or more grammars. */ -export const GrammarRegistry: FirstMate.Statics.GrammarRegistry; - -export const ScopeSelector: FirstMate.Statics.ScopeSelector; +import { Disposable } from "event-kit"; /** Grammar that tokenizes lines of text. */ -export const Grammar: FirstMate.Statics.Grammar; +export class Grammar { + name: string; + fileTypes: string[]; + scopeName: string; + maxTokensPerLine: number; + maxLineLength: number; + + constructor(registry: GrammarRegistry, options?: GrammarOptions); + + // Event Subscription + onDidUpdate(callback: () => void): Disposable; + + // Tokenizing + /** + * Tokenize all lines in the given text. + * @param text A string containing one or more lines. + * @return An array of token arrays for each line tokenized. + */ + tokenizeLines(text: string): GrammarToken[][]; + + /** + * Tokenizes the line of text. + * @param line A string of text to tokenize. + * @param ruleStack An optional array of rules previously returned from this + * method. This should be null when tokenizing the first line in the file. + * @param firstLine A optional boolean denoting whether this is the first line + * in the file which defaults to `false`. + * @return An object representing the result of the tokenize. + */ + tokenizeLine(line: string, ruleStack?: null, firstLine?: boolean): TokenizeLineResult; + /** + * Tokenizes the line of text. + * @param line A string of text to tokenize. + * @param ruleStack An optional array of rules previously returned from this + * method. This should be null when tokenizing the first line in the file. + * @param firstLine A optional boolean denoting whether this is the first line + * in the file which defaults to `false`. + * @return An object representing the result of the tokenize. + */ + tokenizeLine(line: string, ruleStack: GrammarRule[], firstLine?: false): + TokenizeLineResult; +} + +/** Instance side of GrammarRegistry class. */ +export class GrammarRegistry { + maxTokensPerLine: number; + maxLineLength: number; + + constructor(options?: { maxTokensPerLine?: number, maxLineLength?: number }); + + // Event Subscription + /** + * Invoke the given callback when a grammar is added to the registry. + * @param callback The callback to be invoked whenever a grammar is added. + * @return A Disposable on which `.dispose()` can be called to unsubscribe. + */ + onDidAddGrammar(callback: (grammar: Grammar) => void): Disposable; + + /** + * Invoke the given callback when a grammar is updated due to a grammar it + * depends on being added or removed from the registry. + * @param callback The callback to be invoked whenever a grammar is updated. + * @return A Disposable on which `.dispose()` can be called to unsubscribe. + */ + onDidUpdateGrammar(callback: (grammar: Grammar) => void): Disposable; + + // Managing Grammars + /** + * Get all the grammars in this registry. + * @return A non-empty array of Grammar instances. + */ + getGrammars(): Grammar[]; + + /** + * Get a grammar with the given scope name. + * @param scopeName A string such as `source.js`. + * @return A Grammar or undefined. + */ + grammarForScopeName(scopeName: string): Grammar|undefined; + + /** + * Add a grammar to this registry. + * A 'grammar-added' event is emitted after the grammar is added. + * @param grammar The Grammar to add. This should be a value previously returned + * from ::readGrammar or ::readGrammarSync. + * @return Returns a Disposable on which `.dispose()` can be called to remove + * the grammar. + */ + addGrammar(grammar: Grammar): Disposable; + + /** + * Remove the given grammar from this registry. + * @param grammar The grammar to remove. This should be a grammar previously + * added to the registry from ::addGrammar. + */ + removeGrammar(grammar: Grammar): void; + + /** + * Remove the grammar with the given scope name. + * @param scopeName A string such as `source.js`. + * @return Returns the removed Grammar or undefined. + */ + removeGrammarForScopeName(scopeName: string): Grammar|undefined; + + /** + * Read a grammar synchronously but don't add it to the registry. + * @param grammarPath The absolute file path to a grammar. + * @return The newly loaded Grammar. + */ + readGrammarSync(grammarPath: string): Grammar; + + /** + * Read a grammar asynchronously but don't add it to the registry. + * @param grammarPath The absolute file path to the grammar. + * @param callback The function to be invoked once the Grammar has been read in. + */ + readGrammar(grammarPath: string, callback: (error: Error|null, grammar?: Grammar) => + void): void; + + /** + * Read a grammar synchronously and add it to this registry. + * @param grammarPath The absolute file path to the grammar. + * @return The newly loaded Grammar. + */ + loadGrammarSync(grammarPath: string): Grammar; + + /** + * Read a grammar asynchronously and add it to the registry. + * @param grammarPath The absolute file path to the grammar. + * @param callback The function to be invoked once the Grammar has been read in + * and added to the registry. + */ + loadGrammar(grammarPath: string, callback: (error: Error|null, grammar?: Grammar) => + void): void; + + /** + * Convert compact tags representation into convenient, space-inefficient tokens. + * @param lineText The text of the tokenized line. + * @param tags The tags returned from a call to Grammar::tokenizeLine(). + * @return An array of Token instances decoded from the given tags. + */ + decodeTokens(lineText: string, tags: Array): GrammarToken[]; +} + +export class ScopeSelector { + /** + * Create a new scope selector. + * @param source The string to parse as a scope selector. + * @return A newly constructed ScopeSelector. + */ + constructor(source: string); + + /** + * Check if this scope selector matches the scopes. + * @param scopes A single scope or an array of them to be compared against. + * @return A boolean indicating whether or not this ScopeSelector matched. + */ + matches(scopes: string|ReadonlyArray): boolean; + + /** + * Gets the prefix of this scope selector. + * @param scopes The scopes to match a prefix against. + * @return The matching prefix, if there is one. + */ + getPrefix(scopes: string|ReadonlyArray): string|undefined; + + /** + * Convert this TextMate scope selector to a CSS selector. + * @return A string with the CSSSelector representation of this ScopeSelector. + */ + toCssSelector(): string; + + /** + * Convert this TextMate scope selector to a CSS selector, prefixing scopes + * with `syntax--`. + * @return A string with the syntax-specific CSSSelector representation of this + * ScopeSelector. + */ + toCssSyntaxSelector(): string; +} + +// Options ==================================================================== +// The option objects that the user is expected to fill out and provide to +// specific API calls. + +export interface GrammarOptions { + name?: string; + fileTypes?: ReadonlyArray; + scopeName?: string; + foldingStopMarker?: string; + maxTokensPerLine?: number; + maxLineLength?: number; + + injections?: object; + injectionSelector?: ScopeSelector; + patterns?: ReadonlyArray; + repository?: object; + firstLineMatch?: boolean; +} + +// Structures ================================================================= +// The structures that are passed to the user by Atom following specific API calls. + +export interface GrammarToken { + value: string; + scopes: string[]; +} + +/** Result returned by `Grammar.tokenizeLine`. */ +export interface TokenizeLineResult { + /** The string of text that was tokenized. */ + line: string; + + /** + * An array of integer scope ids and strings. Positive ids indicate the + * beginning of a scope, and negative tags indicate the end. To resolve ids + * to scope names, call GrammarRegistry::scopeForId with the absolute + * value of the id. + */ + tags: Array; + + /** + * This is a dynamic property. Invoking it will incur additional overhead, + * but will automatically translate the `tags` into token objects with `value` + * and `scopes` properties. + */ + tokens: GrammarToken[]; + + /** + * An array of rules representing the tokenized state at the end of the line. + * These should be passed back into this method when tokenizing the next line + * in the file. + */ + ruleStack: GrammarRule[]; +} + +export interface GrammarRule { + // https://github.com/atom/first-mate/blob/v7.0.7/src/rule.coffee + // This is private. Don't go down the rabbit hole. + rule: object; + scopeName: string; + contentScopeName: string; +} diff --git a/types/first-mate/tsconfig.json b/types/first-mate/tsconfig.json index 3d6aadabec..3c11f8dbb2 100644 --- a/types/first-mate/tsconfig.json +++ b/types/first-mate/tsconfig.json @@ -8,7 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -21,4 +21,4 @@ "index.d.ts", "first-mate-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/first-mate/tslint.json b/types/first-mate/tslint.json index 22fcf73c1c..e0508241c7 100644 --- a/types/first-mate/tslint.json +++ b/types/first-mate/tslint.json @@ -1,39 +1,8 @@ { "extends": "dtslint/dt.json", "rules": { - // Custom rules. - "class-name": true, - "indent": [true, "tabs"], - "jsdoc-format": true, - "linebreak-style": [true, "LF"], + "indent": [true, "spaces", 4], "max-line-length": [true, 100], - "quotemark": [true, "double", "avoid-escape"], - "trailing-comma": [true, { - "multiline": { "objects": "always", "arrays": "always", "functions": "never" }, - "singleline": { "objects": "never", "arrays": "never", "functions": "never" } - }], - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-module", - "check-separator", - "check-type", - "check-typecast", - "check-rest-spread", - "check-preblock" - ], - // TODO - "no-any": false, - // Soon to be defaults. - "arrow-return-shorthand": [true, "multiline"], - "no-floating-promises": true, - "no-unbound-method": true, - "no-unsafe-any": true, - "number-literal-format": true, - "restrict-plus-operands": true, - "return-undefined": true, - "switch-final-break": true + "no-any": true } } diff --git a/types/first-mate/v4/.editorconfig b/types/first-mate/v4/.editorconfig deleted file mode 100644 index 570211f898..0000000000 --- a/types/first-mate/v4/.editorconfig +++ /dev/null @@ -1,3 +0,0 @@ -[*.ts] -indent_style = tab -indent_size = 4 diff --git a/types/first-mate/v4/first-mate-tests.ts b/types/first-mate/v4/first-mate-tests.ts deleted file mode 100644 index 1f7fe0fc76..0000000000 --- a/types/first-mate/v4/first-mate-tests.ts +++ /dev/null @@ -1,10 +0,0 @@ - - -import { GrammarRegistry, Grammar, IToken } from "first-mate"; - -var registry = new GrammarRegistry({ maxTokensPerLine: 100 }); -var grammar = registry.loadGrammarSync('javascript.json'); -var result = grammar.tokenizeLine('var text = "hello world";'); -result.tokens.forEach((token) => { - console.log("Token text: '" + token.value + "' with scopes: " + token.scopes); -}); diff --git a/types/first-mate/v4/index.d.ts b/types/first-mate/v4/index.d.ts deleted file mode 100644 index 81b7d96c04..0000000000 --- a/types/first-mate/v4/index.d.ts +++ /dev/null @@ -1,105 +0,0 @@ -// Type definitions for first-mate v4.1.7 -// Project: https://github.com/atom/first-mate/ -// Definitions by: Vadim Macagon -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import * as AtomEventKit from "event-kit"; -export = AtomFirstMate; - -declare namespace AtomFirstMate { - type Disposable = AtomEventKit.Disposable; - - interface IToken { - value: string; - scopes: string[]; - } - - /** Result returned by `Grammar.tokenizeLine`. */ - interface TokenizeLineResult { - /** Text that was tokenized. */ - line: string; - tags: any[]; - /** - * This is a dynamic property that will only be available if `Grammar.tokenizeLine` was called - * with `compatibilityMode` set to `true` (the default). - */ - tokens?: IToken[]; - /** - * The tokenized state at the end of the line. This should be passed back into `tokenizeLine` - * when tokenizing the next line in the file/buffer. - */ - ruleStack: Rule[] - } - - /** Instance side of Rule class. */ - interface Rule { - } - - /** Static side of Grammar class. */ - interface GrammarStatic { - prototype: Grammar; - new (registry: GrammarRegistry, options?: any): Grammar; - } - - /** Instance side of Grammar class. */ - interface Grammar { - constructor: GrammarStatic; - onDidUpdate(callback: Function): Disposable; - /** - * Tokenizes all lines in a string. - * - * @param text A string containing one or more lines. - * @return An array of token arrays, one token array per line. - */ - tokenizeLines(text: string): Array>; - /** - * Tokenizes a line of text. - * - * @param line Text to be tokenized. - * @param firstLine Indicates whether `line` is the first line in the file/buffer, - * defaults to `false`. - * @param compatibilityMode `true` by default. - * @return An object containing tokens for the given line. - */ - tokenizeLine( - line: string, ruleStack?: Rule[], firstLine?: boolean, compatibilityMode?: boolean - ): TokenizeLineResult; - } - - /** Grammar that tokenizes lines of text. */ - var Grammar: GrammarStatic; - - /** Static side of GrammarRegistry class. */ - interface GrammarRegistryStatic { - prototype: GrammarRegistry; - new (options?: { maxTokensPerLine: number }): GrammarRegistry; - } - - /** Instance side of GrammarRegistry class. */ - interface GrammarRegistry { - constructor: GrammarRegistryStatic; - - // Event Subscription - - onDidAddGrammar(callback: (grammar: Grammar) => void): Disposable; - onDidUpdateGrammar(callback: (grammar: Grammar) => void): Disposable; - - // Managing Grammars - - getGrammars(): Grammar[]; - grammarForScopeName(scopeName: string): Grammar; - addGrammar(grammar: Grammar): Disposable; - removeGrammarForScopeName(scopeName: string): Grammar; - readGrammarSync(grammarPath: string): Grammar; - readGrammar(grammarPath: string, callback: (error: Error, grammar: Grammar) => void): void; - loadGrammarSync(grammarPath: string): Grammar; - loadGrammar(grammarPath: string, callback: (error: Error, grammar: Grammar) => void): void; - grammarOverrideForPath(filePath: string): Grammar; - setGrammarOverrideForPath(filePath: string, scopeName: string): Grammar; - clearGrammarOverrides(): void; - selectGrammar(filePath: string, fileContents: string): Grammar; - } - - /** Registry containing one or more grammars. */ - var GrammarRegistry: GrammarRegistryStatic; -} diff --git a/types/first-mate/v4/tsconfig.json b/types/first-mate/v4/tsconfig.json deleted file mode 100644 index 59868ddb2c..0000000000 --- a/types/first-mate/v4/tsconfig.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": false, - "baseUrl": "../../", - "typeRoots": [ - "../../" - ], - "paths": { - "event-kit": [ - "event-kit/v1" - ], - "first-mate": [ - "first-mate/v4" - ] - }, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "first-mate-tests.ts" - ] -} \ No newline at end of file diff --git a/types/fixed-data-table/fixed-data-table-tests.tsx b/types/fixed-data-table/fixed-data-table-tests.tsx index cdbd46eb6c..bb09fedcaf 100644 --- a/types/fixed-data-table/fixed-data-table-tests.tsx +++ b/types/fixed-data-table/fixed-data-table-tests.tsx @@ -36,7 +36,7 @@ class MyTable2 extends React.Component { // provide Custom Data interface MyTable3State { - myTableData: [{name: string}]; + myTableData: {name: string}[]; } class MyTable3 extends React.Component<{}, MyTable3State> { diff --git a/types/fixed-data-table/tslint.json b/types/fixed-data-table/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/fixed-data-table/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/flake-idgen/tslint.json b/types/flake-idgen/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/flake-idgen/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/flat/tslint.json b/types/flat/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/flat/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/flatbuffers/index.d.ts b/types/flatbuffers/index.d.ts index 44455a1ee0..b95741200b 100644 --- a/types/flatbuffers/index.d.ts +++ b/types/flatbuffers/index.d.ts @@ -7,122 +7,39 @@ export { flatbuffers }; declare global { namespace flatbuffers { - /** - * @typedef {number} - */ type Offset = number; - /** - * @typedef {{ - * bb: flatbuffers.ByteBuffer, - * bb_pos: number - * }} - */ interface Table { bb: ByteBuffer; bb_pos: number; } - /** - * @type {number} - * @const - */ const SIZEOF_SHORT: number; - - /** - * @type {number} - * @const - */ const SIZEOF_INT: number; - - /** - * @type {number} - * @const - */ const FILE_IDENTIFIER_LENGTH: number; - /** - * @enum {number} - */ enum Encoding { UTF8_BYTES, UTF16_STRING } - /** - * @type {Int32Array} - * @const - */ const int32: Int32Array; - - /** - * @type {Float32Array} - * @const - */ const float32: Float32Array; - - /** - * @type {Float64Array} - * @const - */ const float64: Float64Array; - - /** - * @type {boolean} - * @const - */ const isLittleEndian: boolean; //////////////////////////////////////////////////////////////////////////////// class Long { - /** - * @type {number} - * @const - */ low: number; - - /** - * @type {number} - * @const - */ high: number; - - /** - * @type {flatbuffers.Long} - * @const - */ static ZERO: Long; - - /** - * @constructor - * @param {number} high - * @param {number} low - */ constructor(low: number, high: number); - - /** - * @returns {number} - */ toFloat64(): number; - - /** - * @param {flatbuffers.Long} other - * @returns {boolean} - */ equals(other: any): boolean; - - /** - * @param {number} low - * @param {number} high - */ static create(low: number, high: number): Long; } //////////////////////////////////////////////////////////////////////////////// class Builder { - /** - * @constructor - * @param {number=} initial_size - */ constructor(initial_size?: number); /** @@ -130,7 +47,7 @@ declare global { * don't get serialized into the buffer. Forcing defaults provides a * way to manually disable this optimization. * - * @param {boolean} forceDefaults true always serializes default values + * @param forceDefaults true always serializes default values */ forceDefaults(forceDefaults: boolean): void; @@ -138,8 +55,6 @@ declare global { * Get the ByteBuffer representing the FlatBuffer. Only call this after you've * called finish(). The actual data starts at the ByteBuffer's current position, * not necessarily at 0. - * - * @returns {flatbuffers.ByteBuffer} */ dataBuffer(): ByteBuffer; @@ -147,8 +62,6 @@ declare global { * Get the ByteBuffer representing the FlatBuffer. Only call this after you've * called finish(). The actual data starts at the ByteBuffer's current position, * not necessarily at 0. - * - * @returns {Uint8Array} */ asUint8Array(): Uint8Array; @@ -158,131 +71,37 @@ declare global { * field is aligned to 4 bytes, and the string data follows it directly. If all * you need to do is alignment, `additional_bytes` will be 0. * - * @param {number} size This is the of the new element to write - * @param {number} additional_bytes The padding size + * @param size This is the of the new element to write + * @param additional_bytes The padding size */ prep(size: number, additional_bytes: number): void; - /** - * @param {number} byte_size - */ pad(byte_size: number): void; - /** - * @param {number} value - */ writeInt8(value: number): void; - - /** - * @param {number} value - */ writeInt16(value: number): void; - - /** - * @param {number} value - */ writeInt32(value: number): void; - - /** - * @param {flatbuffers.Long} value - */ writeInt64(value: Long): void; - - /** - * @param {number} value - */ writeFloat32(value: number): void; - - /** - * @param {number} value - */ writeFloat64(value: number): void; - /** - * @param {number} value - */ addInt8(value: number): void; - - /** - * @param {number} value - */ addInt16(value: number): void; - - /** - * @param {number} value - */ addInt32(value: number): void; - - /** - * @param {flatbuffers.Long} value - */ addInt64(value: Long): void; - - /** - * @param {number} value - */ addFloat32(value: number): void; - - /** - * @param {number} value - */ addFloat64(value: number): void; - - /** - * @param {number} voffset - * @param {number} value - * @param {number} defaultValue - */ addFieldInt8(voffset: number, value: number, defaultValue: number): void; - - /** - * @param {number} voffset - * @param {number} value - * @param {number} defaultValue - */ addFieldInt16(voffset: number, value: number, defaultValue: number): void; - - /** - * @param {number} voffset - * @param {number} value - * @param {number} defaultValue - */ addFieldInt32(voffset: number, value: number, defaultValue: number): void; - - /** - * @param {number} voffset - * @param {flatbuffers.Long} value - * @param {flatbuffers.Long} defaultValue - */ addFieldInt64(voffset: number, value: Long, defaultValue: Long): void; - - /** - * @param {number} voffset - * @param {number} value - * @param {number} defaultValue - */ addFieldFloat32(voffset: number, value: number, defaultValue: number): void; - - /** - * @param {number} voffset - * @param {number} value - * @param {number} defaultValue - */ addFieldFloat64(voffset: number, value: number, defaultValue: number): void; - /** - * @param {number} voffset - * @param {flatbuffers.Offset} value - * @param {flatbuffers.Offset} defaultValue - */ addFieldOffset(voffset: number, value: Offset, defaultValue: Offset): void; /** * Structs are stored inline, so nothing additional is being added. `d` is always 0. - * - * @param {number} voffset - * @param {flatbuffers.Offset} value - * @param {flatbuffers.Offset} defaultValue */ addFieldStruct(voffset: number, value: Offset, defaultValue: Offset): void; @@ -291,7 +110,7 @@ declare global { * where they're used. You'll get this assertion failure if you * created it elsewhere. * - * @param {flatbuffers.Offset} obj The offset of the created object + * @param obj The offset of the created object */ nested(obj: Offset): void; @@ -303,13 +122,11 @@ declare global { /** * Set the current vtable at `voffset` to the current location in the buffer. - * - * @param {number} voffset */ slot(voffset: number): void; /** - * @returns {flatbuffers.Offset} Offset relative to the end of the buffer. + * @returns Offset relative to the end of the buffer. */ offset(): Offset; @@ -317,8 +134,8 @@ declare global { * Doubles the size of the backing ByteBuffer and copies the old data towards * the end of the new buffer (since we build the buffer backwards). * - * @param {flatbuffers.ByteBuffer} bb The current buffer with the existing data - * @returns {flatbuffers.ByteBuffer} A new byte buffer with the old data copied + * @param bb The current buffer with the existing data + * @returns A new byte buffer with the old data copied * to it. The data is located at the end of the buffer. */ static growByteBuffer(bb: ByteBuffer): ByteBuffer; @@ -326,7 +143,7 @@ declare global { /** * Adds on offset, relative to where it will be written. * - * @param {flatbuffers.Offset} offset The offset to add + * @param offset The offset to add */ addOffset(offset: Offset): void; @@ -334,30 +151,21 @@ declare global { * Start encoding a new object in the buffer. Users will not usually need to * call this directly. The FlatBuffers compiler will generate helper methods * that call this method internally. - * - * @param {number} numfields */ startObject(numfields: number): void; /** * Finish off writing the object that is under construction. * - * @returns {flatbuffers.Offset} The offset to the object inside `dataBuffer` + * @returns The offset to the object inside `dataBuffer` */ endObject(): Offset; - /** - * @param {flatbuffers.Offset} root_table - * @param {string=} file_identifier - */ finish(root_table: Offset, file_identifier?: string): void; /** * This checks a required field has been set in a given table that has * just been constructed. - * - * @param {flatbuffers.Offset} table - * @param {number} field */ requiredField(table: Offset, field: number): void; @@ -366,9 +174,9 @@ declare global { * this directly. The FlatBuffers compiler will create a start/end * method for vector types in generated code. * - * @param {number} elem_size The size of each element in the array - * @param {number} num_elems The number of elements in the array - * @param {number} alignment The alignment of the array + * @param elem_size The size of each element in the array + * @param num_elems The number of elements in the array + * @param alignment The alignment of the array */ startVector(elem_size: number, num_elems: number, alignment: number): void; @@ -376,7 +184,7 @@ declare global { * Finish off the creation of an array and all its elements. The array must be * created with `startVector`. * - * @returns {flatbuffers.Offset} The offset at which the newly created array + * @returns The offset at which the newly created array * starts. */ endVector(): Offset; @@ -385,17 +193,13 @@ declare global { * Encode the string `s` in the buffer using UTF-8. If a Uint8Array is passed * instead of a string, it is assumed to contain valid UTF-8 encoded data. * - * @param {string|Uint8Array} s The string to encode - * @return {flatbuffers.Offset} The offset in the buffer where the encoded string starts + * @param s The string to encode + * @return The offset in the buffer where the encoded string starts */ createString(s: string|Uint8Array): Offset; /** * Conveniance function for creating Long objects. - * - * @param {number} low - * @param {number} high - * @returns {Long} */ createLong(low: number, high: number): Long; } @@ -403,174 +207,48 @@ declare global { //////////////////////////////////////////////////////////////////////////////// class ByteBuffer { - /** - * @constructor - * @param {Uint8Array} bytes - */ constructor(bytes: Uint8Array); - /** - * @param {number} byte_size - * @returns {flatbuffers.ByteBuffer} - */ static allocate(byte_size: number): ByteBuffer; - /** - * @returns {Uint8Array} - */ bytes(): Uint8Array; - /** - * @returns {number} - */ position(): number; - /** - * @param {number} position - */ setPosition(position: number): void; - /** - * @returns {number} - */ capacity(): number; - /** - * @param {number} offset - * @returns {number} - */ readInt8(offset: number): number; - - /** - * @param {number} offset - * @returns {number} - */ readUint8(offset: number): number; - - /** - * @param {number} offset - * @returns {number} - */ readInt16(offset: number): number; - - /** - * @param {number} offset - * @returns {number} - */ readUint16(offset: number): number; - - /** - * @param {number} offset - * @returns {number} - */ readInt32(offset: number): number; - - /** - * @param {number} offset - * @returns {number} - */ readUint32(offset: number): number; - - /** - * @param {number} offset - * @returns {flatbuffers.Long} - */ readInt64(offset: number): Long; - - /** - * @param {number} offset - * @returns {flatbuffers.Long} - */ readUint64(offset: number): Long; - - /** - * @param {number} offset - * @returns {number} - */ readFloat32(offset: number): number; - - /** - * @param {number} offset - * @returns {number} - */ readFloat64(offset: number): number; - /** - * @param {number} offset - * @param {number} value - */ writeInt8(offset: number, value: number): void; - - /** - * @param {number} offset - * @param {number} value - */ writeUint8(offset: number, value: number): void; - - /** - * @param {number} offset - * @param {number} value - */ writeInt16(offset: number, value: number): void; - - /** - * @param {number} offset - * @param {number} value - */ writeUint16(offset: number, value: number): void; - - /** - * @param {number} offset - * @param {number} value - */ writeInt32(offset: number, value: number): void; - - /** - * @param {number} offset - * @param {number} value - */ writeUint32(offset: number, value: number): void; - - /** - * @param {number} offset - * @param {flatbuffers.Long} value - */ writeInt64(offset: number, value: Long): void; - - /** - * @param {number} offset - * @param {flatbuffers.Long} value - */ writeUint64(offset: number, value: Long): void; - - /** - * @param {number} offset - * @param {number} value - */ writeFloat32(offset: number, value: number): void; - - /** - * @param {number} offset - * @param {number} value - */ writeFloat64(offset: number, value: number): void; /** * Look up a field in the vtable, return an offset into the object, or 0 if the * field is not present. - * - * @param {number} bb_pos - * @param {number} vtable_offset - * @returns {number} */ __offset(bb_pos: number, vtable_offset: number): number; /** * Initialize any Table-derived type to point to the union at the given offset. - * - * @param {flatbuffers.Table} t - * @param {number} offset - * @returns {flatbuffers.Table} */ __union(t: T, offset: number): T; @@ -583,47 +261,29 @@ declare global { * and from UTF-16 when the data will just be packaged back up in another * FlatBuffer later on. * - * @param {number} offset - * @param {flatbuffers.Encoding=} optionalEncoding Defaults to UTF16_STRING - * @returns {string|Uint8Array} + * @param optionalEncoding Defaults to UTF16_STRING */ __string(offset: number, optionalEncoding?: Encoding): string|Uint8Array; /** * Retrieve the relative offset stored at "offset" - * @param {number} offset - * @returns {number} */ __indirect(offset: number): number; /** * Get the start of data of a vector whose offset is stored at "offset" in this object. - * - * @param {number} offset - * @returns {number} */ __vector(offset: number): number; /** * Get the length of a vector whose offset is stored at "offset" in this object. - * - * @param {number} offset - * @returns {number} */ __vector_len(offset: number): number; - /** - * @param {string} ident - * @returns {boolean} - */ __has_identifier(ident: string): boolean; /** * Conveniance function for creating Long objects. - * - * @param {number} low - * @param {number} high - * @returns {Long} */ createLong(low: number, high: number): Long; } diff --git a/types/flatpickr/flatpickr-tests.ts b/types/flatpickr/flatpickr-tests.ts deleted file mode 100644 index f6800e38b7..0000000000 --- a/types/flatpickr/flatpickr-tests.ts +++ /dev/null @@ -1,14 +0,0 @@ -import * as Flatpickr from 'flatpickr'; - -const picker1 = new Flatpickr('input'); - -const input = document.querySelector('input'); -if (input != null) { - const picker2 = new Flatpickr(input, { - mode: 'range', - onChange: dates => null - }); - picker2.setDate(['2016-11-15T00:00:00.000Z', new Date()]); -} - -picker1.destroy(); diff --git a/types/flatpickr/index.d.ts b/types/flatpickr/index.d.ts deleted file mode 100644 index eb29ddfa14..0000000000 --- a/types/flatpickr/index.d.ts +++ /dev/null @@ -1,105 +0,0 @@ -// Type definitions for flatpickr 3.0 -// Project: https://github.com/chmln/flatpickr -// Definitions by: James Birtles -// Rowell Heria -// Michael Wagner -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare function flatpickr(element: string | Element | HTMLElement, options?: Flatpickr.Options): Flatpickr; - -declare class Flatpickr { - constructor(element: string | Element | HTMLElement, options?: Flatpickr.Options); - - changeMonth(month: number, isOffset?: boolean): void; - clear(): void; - close(): void; - destroy(): void; - formatDate(date: Date, format: string): string; - jumpToDate(date?: Flatpickr.DateString): void; - open(): void; - parseDate(date: string, format: string): Date; - redraw(): void; - set(option: string, value: any): void; - setDate(date: Flatpickr.DateString | Flatpickr.DateString[], triggerChange?: boolean, dateFormat?: string): void; - toggle(): void; - - static localize(locale: string | Flatpickr.Locale): void; - static l10ns: { - default: Flatpickr.Locale; - }; -} - -declare namespace Flatpickr { - interface Options { - altFormat?: string; - altInput?: boolean; - altInputClass?: string; - allowInput?: boolean; - clickOpens?: boolean; - dateFormat?: string | null; - defaultDate?: DateString | DateString[]; - defaultHour?: number; - defaultMinute?: number; - disable?: DateRange[]; - disableMobile?: boolean; - enable?: DateRange[]; - enableTime?: boolean; - enableSeconds?: boolean; - hourIncrement?: number; - inline?: boolean; - maxDate?: DateString; - minDate?: DateString; - minuteIncrement?: number; - mode?: Mode; - nextArrow?: string; - noCalendar?: boolean; - onChange?: EventCallback | EventCallback[]; - onClose?: EventCallback | EventCallback[]; - onOpen?: EventCallback | EventCallback[]; - onReady?: EventCallback | EventCallback[]; - onMonthChange?: EventCallback | EventCallback[]; - onYearChange?: EventCallback | EventCallback[]; - onValueUpdate?: EventCallback | EventCallback[]; - onDayCreate?: EventCallback | EventCallback[]; - parseDate?(date: string): Date; - prevArrow?: string; - shorthandCurrentMonth?: boolean; - static?: boolean; - time_24hr?: boolean; - utc?: boolean; - weekNumbers?: boolean; - wrap?: boolean; - locale?: string | Locale; - plugins?: any[]; - } - - interface Locale { - weekdays?: { - shorthand?: string[]; - longhand?: string[]; - }; - - months?: { - shorthand?: string[]; - longhand?: string[]; - }; - - firstDayOfWeek?: number; - weekAbbreviation?: string; - rangeSeparator?: string; - am?: string; - pm?: string; - - ordinal?: ((nth: number) => string) | string; - - scrollTitle?: string; - toggleTitle?: string; - } - - type DateString = Date | string; - type DateRange = DateString | { from: DateString, to: DateString } | ((date: Date) => boolean); - type Mode = 'single' | 'multiple' | 'range'; - type EventCallback = (selectedDates: Date[], dateStr: string, instance: Flatpickr, elem: HTMLElement) => void; -} - -export = Flatpickr; diff --git a/types/flatpickr/v2/flatpickr-tests.ts b/types/flatpickr/v2/flatpickr-tests.ts deleted file mode 100644 index f6800e38b7..0000000000 --- a/types/flatpickr/v2/flatpickr-tests.ts +++ /dev/null @@ -1,14 +0,0 @@ -import * as Flatpickr from 'flatpickr'; - -const picker1 = new Flatpickr('input'); - -const input = document.querySelector('input'); -if (input != null) { - const picker2 = new Flatpickr(input, { - mode: 'range', - onChange: dates => null - }); - picker2.setDate(['2016-11-15T00:00:00.000Z', new Date()]); -} - -picker1.destroy(); diff --git a/types/flatpickr/v2/index.d.ts b/types/flatpickr/v2/index.d.ts deleted file mode 100644 index 9a98beabaa..0000000000 --- a/types/flatpickr/v2/index.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -// Type definitions for flatpickr 2.2 -// Project: https://github.com/chmln/flatpickr -// Definitions by: James Birtles -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare class Flatpickr { - constructor(element: string | Element, options?: Flatpickr.Options); - - changeMonth(month: number, isOffset: boolean): void; - clear(): void; - close(): void; - destroy(): void; - formatDate(format: string, date: Date): string; - jumpToDate(date?: Flatpickr.DateString): void; - open(): void; - parseDate(date: string): Date; - redraw(): void; - set(option: string, value: any): void; - setDate(date: Flatpickr.DateString | Flatpickr.DateString[]): void; - toggle(): void; -} - -declare namespace Flatpickr { - interface Options { - altFormat?: string; - altInput?: boolean; - altInputClass?: string; - allowInput?: boolean; - clickOpens?: boolean; - dateFormat?: string | null; - defaultDate?: DateString | DateString[]; - disable?: DateRange[]; - enable?: DateRange[]; - enableTime?: boolean; - enableSeconds?: boolean; - hourIncrement?: number; - inline?: boolean; - maxDate?: DateString; - minDate?: DateString; - minuteIncrement?: number; - mode?: Mode; - nextArrow?: string; - noCalendar?: boolean; - onChange?: EventCallback | EventCallback[]; - onClose?: EventCallback | EventCallback[]; - onOpen?: EventCallback | EventCallback[]; - onReady?: EventCallback | EventCallback[]; - onMonthChange?: EventCallback | EventCallback[]; - onYearChange?: EventCallback | EventCallback[]; - onValueUpdate?: EventCallback | EventCallback[]; - onDayCreate?: EventCallback | EventCallback[]; - parseDate?(date: string): Date; - prevArrow?: string; - shorthandCurrentMonth?: boolean; - static?: boolean; - time_24hr?: boolean; - utc?: boolean; - weekNumbers?: boolean; - wrap?: boolean; - } - - type DateString = Date | string; - type DateRange = DateString | { from: DateString, to: DateString } | ((date: Date) => boolean); - type Mode = 'single' | 'multiple' | 'range'; - type EventCallback = (selectedDates: Date[], dateStr: string, instance: Flatpickr, elem: HTMLElement) => void; -} - -export = Flatpickr; diff --git a/types/flexslider/tslint.json b/types/flexslider/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/flexslider/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/flickity/index.d.ts b/types/flickity/index.d.ts index fda440b1fe..ae5dc46cb7 100644 --- a/types/flickity/index.d.ts +++ b/types/flickity/index.d.ts @@ -80,19 +80,16 @@ declare class Flickity { // properties /** - * @type integer * The selected cell index. */ selectedIndex: number; /** - * @type Element * The selected cell element. */ selectedElement: Element; /** - * @type Element[] * The array of cells. Use cells.length for the total number of cells. */ cells: Element[]; @@ -144,10 +141,9 @@ declare class Flickity { /** * Select a slide of a cell. Useful for groupCells. * - * @param {number | string} index Zero-based index OR selector string of the cell to select. - * @param {boolean} [isWrapped] Optional. If true, the last slide will be selected if at the first slide. - * @param {boolean} [isInstant] If true, immediately view the selected slide without animation. - * @memberof Flickity + * @param index Zero-based index OR selector string of the cell to select. + * @param isWrapped If true, the last slide will be selected if at the first slide. + * @param isInstant If true, immediately view the selected slide without animation. */ selectCell(index: number | string, isWrapped?: boolean, isInstant?: boolean): void; diff --git a/types/flight/tslint.json b/types/flight/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/flight/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/flightplan/tslint.json b/types/flightplan/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/flightplan/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/flipsnap/tslint.json b/types/flipsnap/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/flipsnap/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/flot/tslint.json b/types/flot/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/flot/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/flowjs/tslint.json b/types/flowjs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/flowjs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fluent-ffmpeg/fluent-ffmpeg-tests.ts b/types/fluent-ffmpeg/fluent-ffmpeg-tests.ts index e45f8ff855..53b095a8b2 100644 --- a/types/fluent-ffmpeg/fluent-ffmpeg-tests.ts +++ b/types/fluent-ffmpeg/fluent-ffmpeg-tests.ts @@ -50,3 +50,7 @@ command.clone() // Save a converted version with the original size command.save('/path/to/output-original-size.mp4'); + +ffmpeg.ffprobe('/path/to/file.avi', (err, metadata) => { + console.dir(metadata); +}); diff --git a/types/fluent-ffmpeg/index.d.ts b/types/fluent-ffmpeg/index.d.ts index 65bacff53e..79d91cf7ed 100644 --- a/types/fluent-ffmpeg/index.d.ts +++ b/types/fluent-ffmpeg/index.d.ts @@ -282,10 +282,10 @@ declare namespace Ffmpeg { // ffprobe /* tslint:disable:unified-signatures */ - ffprobe(callback: (err: any, data: FfprobeData) => void): (err: any, data: FfprobeData) => void; - ffprobe(index: number, callback: (err: any, data: FfprobeData) => void): (err: any, data: FfprobeData) => void; - ffprobe(options: string[], callback: (err: any, data: FfprobeData) => void): (err: any, data: FfprobeData) => void; - ffprobe(index: number, options: string[], callback: (err: any, data: FfprobeData) => void): (err: any, data: FfprobeData) => void; + ffprobe(callback: (err: any, data: FfprobeData) => void): void; + ffprobe(index: number, callback: (err: any, data: FfprobeData) => void): void; + ffprobe(options: string[], callback: (err: any, data: FfprobeData) => void): void; + ffprobe(index: number, options: string[], callback: (err: any, data: FfprobeData) => void): void; /* tslint:enable:unified-signatures */ // recipes @@ -305,6 +305,13 @@ declare namespace Ffmpeg { clone(): FfmpegCommand; run(): void; } + + /* tslint:disable:unified-signatures */ + function ffprobe(file: string, callback: (err: any, data: FfprobeData) => void): void; + function ffprobe(file: string, index: number, callback: (err: any, data: FfprobeData) => void): void; + function ffprobe(file: string, options: string[], callback: (err: any, data: FfprobeData) => void): void; + function ffprobe(file: string, index: number, options: string[], callback: (err: any, data: FfprobeData) => void): void; + /* tslint:enable:unified-signatures */ } declare function Ffmpeg(options?: Ffmpeg.FfmpegCommandOptions): Ffmpeg.FfmpegCommand; declare function Ffmpeg(input?: string | stream.Readable, options?: Ffmpeg.FfmpegCommandOptions): Ffmpeg.FfmpegCommand; diff --git a/types/flux-standard-action/tslint.json b/types/flux-standard-action/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/flux-standard-action/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/flux/lib/FluxContainer.d.ts b/types/flux/lib/FluxContainer.d.ts index 4d49293fa6..e4cdadf555 100644 --- a/types/flux/lib/FluxContainer.d.ts +++ b/types/flux/lib/FluxContainer.d.ts @@ -9,29 +9,14 @@ import * as React from "react"; * The component receives information from the stores via state. The state * is generated using a static `calculateState()` method that each container must implement. */ -/** - * Default options to create a Container. - * - * @interface RealOptions - */ + +/** Default options to create a Container. */ export interface RealOptions { - /** - * Default value: true - * - * @type {boolean} - */ + /** @default true */ pure?: boolean; - /** - * Default value: false - * - * @type {boolean} - */ + /** @default false */ withProps?: boolean; - /** - * Default value: false - * - * @type {boolean} - */ + /** @default false */ withContext?: boolean; } diff --git a/types/fluxxor/package.json b/types/fluxxor/package.json index 26741e77bf..5e33d02c41 100644 --- a/types/fluxxor/package.json +++ b/types/fluxxor/package.json @@ -3,4 +3,4 @@ "dependencies": { "eventemitter3": "^2.0.3" } -} \ No newline at end of file +} diff --git a/types/fluxxor/tslint.json b/types/fluxxor/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/fluxxor/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fm-websync/index.d.ts b/types/fm-websync/index.d.ts index ef5d51d64b..997c4666d1 100644 --- a/types/fm-websync/index.d.ts +++ b/types/fm-websync/index.d.ts @@ -469,8 +469,6 @@ declare namespace fm { * While this method will typically run asychronously, the WebSync client is designed to be used without (much) consideration for its asynchronous nature. * To that end, any calls to methods that require an active connection, like bind, subscribe and publish, will be queued automatically and executed once this * method has completed successfully. - * - * @param connectConfig */ connect(config: connectConfig): client; @@ -506,7 +504,6 @@ declare namespace fm { * Unsubscribes the client from receiving messages on one or more channels. * When the unsubscribe completes successfully, the callback specified by onSuccess will be invoked, passing in the unsubscribed channel(s), * including any modifications made on the server. - * @param config */ unsubscribe(config: unsubscribeConfig): client; } diff --git a/types/fontfaceobserver/index.d.ts b/types/fontfaceobserver/index.d.ts index 8f461dbd4f..a10214a57d 100644 --- a/types/fontfaceobserver/index.d.ts +++ b/types/fontfaceobserver/index.d.ts @@ -25,7 +25,7 @@ declare class FontFaceObserver { * @param testString If your font doesn't contain latin characters you can pass a custom test string. * @param timeout The default timeout for giving up on font loading is 3 seconds. You can increase or decrease this by passing a number of milliseconds. */ - load(testString?: string, timeout?: number): Promise; + load(testString?: string | null, timeout?: number): Promise; } declare module "fontfaceobserver" { diff --git a/types/fontfaceobserver/tslint.json b/types/fontfaceobserver/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/fontfaceobserver/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fontoxml/tslint.json b/types/fontoxml/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/fontoxml/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/forge-di/tslint.json b/types/forge-di/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/forge-di/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/form-data/index.d.ts b/types/form-data/index.d.ts index 9b102b287f..24e46b3bb8 100644 --- a/types/form-data/index.d.ts +++ b/types/form-data/index.d.ts @@ -4,6 +4,7 @@ // Leon Yu // BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 // Imported from: https://github.com/soywiz/typescript-node-definitions/form-data.d.ts diff --git a/types/form-serializer/tslint.json b/types/form-serializer/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/form-serializer/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/format-io/format-io-tests.ts b/types/format-io/format-io-tests.ts new file mode 100644 index 0000000000..bb551740d0 --- /dev/null +++ b/types/format-io/format-io-tests.ts @@ -0,0 +1,6 @@ +import * as format from 'format-io'; + +format.addSlashToEnd('a/s/d'); // $ExpectType string +format.size(1024 * 1024); // $ExpectType string +format.permissions.symbolic('00777'); // $ExpectType string +format.permissions.numeric('rwx rwx rwx'); // $ExpectType string diff --git a/types/format-io/index.d.ts b/types/format-io/index.d.ts new file mode 100644 index 0000000000..67e86188d6 --- /dev/null +++ b/types/format-io/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for format-io 0.9 +// Project: http://github.com/coderaiser/format-io +// Definitions by: Amit Beckenstein +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Appends a '/' to the end of the path unless it exists. + * @param path A path. + * @returns The path with a '/' appended to it. + */ +export function addSlashToEnd(path: string): string; + +/** + * Returns a short string representing the size of bytes in unit symbols up to petabytes. + * @param size Size in bytes. + * @returns A string representing the size in the matching unit symbol. + */ +export function size(size: number): string; + +/** + * Contains functions to format permissions. + */ +export namespace permissions { + /** + * Converts Unix-like permissions from numeric to symbolic notation. + * @param perm A string of Unix-like permission in numeric notation. + * @returns A representation of the permissions in symbolic notation. + */ + function symbolic(perm: string): string; + + /** + * Converts Unix-like permissions from symbolic to numeric notation. + * @param perm A string of Unix-like permission in symbolic notation. + * @returns A representation of the permissions in numeric notation. + */ + function numeric(perm: string): string; +} diff --git a/types/format-io/tsconfig.json b/types/format-io/tsconfig.json new file mode 100644 index 0000000000..29333d35cf --- /dev/null +++ b/types/format-io/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", + "format-io-tests.ts" + ] +} diff --git a/types/format-io/tslint.json b/types/format-io/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/format-io/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/formidable/tslint.json b/types/formidable/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/formidable/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fossil-delta/index.d.ts b/types/fossil-delta/index.d.ts index 98ab4cc600..3b79af9cc4 100644 --- a/types/fossil-delta/index.d.ts +++ b/types/fossil-delta/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for fossil-delta 0.2.5 +// Type definitions for fossil-delta 1.0.0 // Project: https://github.com/dchest/fossil-delta-js // Definitions by: Endel Dreyer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -8,5 +8,5 @@ type ByteArray = Array | Uint8Array | Buffer; export function create(origin: ByteArray, target: ByteArray): Array; -export function apply(origin: ByteArray, delta: Array): Array; +export function apply(origin: ByteArray, delta: Array, ops?: { verifyChecksum: boolean }): Array; export function outputSize(delta: Array): number; diff --git a/types/fossil-delta/tslint.json b/types/fossil-delta/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/fossil-delta/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/foundation-sites/tslint.json b/types/foundation-sites/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/foundation-sites/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/foundation/tslint.json b/types/foundation/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/foundation/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fpsmeter/tslint.json b/types/fpsmeter/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/fpsmeter/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/framebus/framebus-tests.ts b/types/framebus/framebus-tests.ts index e37186d168..571f9488b1 100644 --- a/types/framebus/framebus-tests.ts +++ b/types/framebus/framebus-tests.ts @@ -1,6 +1,7 @@ import * as framebus from "framebus"; -const popup = window.open('https://example.com'); +// tslint:disable-next-line no-unnecessary-type-assertion (in older TS versions `window.open` is not nullable) +const popup = window.open('https://example.com')!; framebus.include(popup); framebus.emit('hello popup and friends!'); diff --git a/types/framebus/index.d.ts b/types/framebus/index.d.ts index 25286a495b..4879dfceef 100644 --- a/types/framebus/index.d.ts +++ b/types/framebus/index.d.ts @@ -21,19 +21,16 @@ export interface FrameBus { unsub(event: string, fn: (...args: any[]) => any): boolean; off(event: string, fn: (...args: any[]) => any): boolean; } -/*~ If this module has methods, declare them as functions like so. - */ + /** * let popup = window.open('https://example.com'); * framebus.include(popup); * framebus.emit('hello popup and friends!'); - * @param popup */ export function include(popup: Window): boolean; /** * framebus.target('https://example.com').on('my cool event', function () {}); * // will ignore all incoming 'my cool event' NOT from 'https://example.com' - * @param origin {string} */ export function target(origin: string): FrameBus; @@ -42,64 +39,64 @@ export function target(origin: string): FrameBus; * console.log('Got back %s as a reply!', data) * } * framebus.publish('Marco!', callback, 'http://listener.example.com'); - * @param event {string} The name of the event - * @param args {...any[]} The data to give to subscribers - * // @param last{callback(data)} Give subscribers a function for easy, direct replies + * @param event The name of the event + * @param args The data to give to subscribers + * @param last Give subscribers a function for easy, direct replies */ export function publish(event: string, ...args: any[]/* fn: callback(data:)*/): boolean; /** * publish = pub = trigger = emit * framebus.publish('Marco!', callback, 'http://listener.example.com'); - * @param event {string} The name of the event - * @param args {...any[]} The data to give to subscribers - * // @param last{callback(data)} Give subscribers a function for easy, direct replies + * @param event The name of the event + * @param args The data to give to subscribers + * @param last Give subscribers a function for easy, direct replies */ export function pub(event: string, ...args: any[]): boolean; /** * publish = pub = trigger = emit - * @param event {string} The name of the event - * @param args {...any[]} The data to give to subscribers - * // @param last{callback(data)} Give subscribers a function for easy, direct replies + * @param event The name of the event + * @param args The data to give to subscribers + * @param last Give subscribers a function for easy, direct replies */ export function trigger(event: string, ...args: any[]): boolean; /** * publish = pub = trigger = emit - * @param event {string} The name of the event - * @param args {...any[]} The data to give to subscribers - * // @param last{callback(data)} Give subscribers a function for easy, direct replies + * @param event The name of the event + * @param args The data to give to subscribers + * @param last Give subscribers a function for easy, direct replies */ export function emit(event: string, ...args: any[]): boolean; /** * **this** scope is the MessageEvent object from the underlying postMessage - * @param event {string} The name of the event - * @param fn {Callback} ([arg...] [, callback]) Event handler. Arguments are from the publish invocation + * @param event The name of the event + * @param fn ([arg...] [, callback]) Event handler. Arguments are from the publish invocation */ export function subscribe(event: string, fn: (...args: any[]) => any): boolean; /** * **this** scope is the MessageEvent object from the underlying postMessage - * @param event {string} The name of the event - * @param fn {Callback} ([arg...] [, callback]) Event handler. Arguments are from the publish invocation + * @param event The name of the event + * @param fn ([arg...] [, callback]) Event handler. Arguments are from the publish invocation */ export function sub(event: string, fn: (...args: any[]) => any): boolean; /** * **this** scope is the MessageEvent object from the underlying postMessage - * @param event {string} The name of the event - * @param fn {Callback} ([arg...] [, callback]) Event handler. Arguments are from the publish invocation + * @param event The name of the event + * @param fn ([arg...] [, callback]) Event handler. Arguments are from the publish invocation */ export function on(event: string, fn: (...args: any[]) => any): boolean; /** - * @param event {string} The name of the event - * @param fn {Callback} The function that was subscribed + * @param event The name of the event + * @param fn The function that was subscribed */ export function unsubscribe(event: string, fn: (...args: any[]) => any): boolean; /** - * @param event {string} The name of the event - * @param fn {Callback} The function that was subscribed + * @param event The name of the event + * @param fn The function that was subscribed */ export function unsub(event: string, fn: (...args: any[]) => any): boolean; /** - * @param event {string} The name of the event - * @param fn {Callback} The function that was subscribed + * @param event The name of the event + * @param fn The function that was subscribed */ export function off(event: string, fn: (...args: any[]) => any): boolean; diff --git a/types/freedom/tslint.json b/types/freedom/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/freedom/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/frisby/tslint.json b/types/frisby/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/frisby/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/from/tslint.json b/types/from/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/from/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fromjs/tslint.json b/types/fromjs/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/fromjs/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fromnow/tslint.json b/types/fromnow/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/fromnow/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fs-cson/fs-cson-tests.ts b/types/fs-cson/fs-cson-tests.ts new file mode 100644 index 0000000000..1d23580cad --- /dev/null +++ b/types/fs-cson/fs-cson-tests.ts @@ -0,0 +1,39 @@ +import * as fsCson from 'fs-cson'; + +fsCson.register(); + +fsCson.readFile('sample.cson', (err, data) => { + if (!err) { + console.log(data); + } +}); + +const data = fsCson.readFileSync('sample.cson'); + +function updater(data: any) { + const result: any = {}; + for (const key in data) { + const value = data[key]; + result[key] = value * 2; + } + result.c = 6; + return result; +} + +fsCson.updateFile('sample.cson', updater, (err) => { + if (err) console.error(err); +}); + +fsCson.updateFileSync('sample.cson', updater); + +fsCson.writeFile('sample.cson', { a: 1, b: 2 }, (err) => { + if (err) console.error(err); +}); + +fsCson.writeFileSync('sample.cson', { a: 1, b: 2 }); + +fsCson.writeFileSafe('sample.cson', { a: 1, b: 2 }, (err) => { + if (err) console.error(err); +}); + +fsCson.writeFileSafeSync('sample.cson', { a: 1, b: 2 }); diff --git a/types/fs-cson/index.d.ts b/types/fs-cson/index.d.ts new file mode 100644 index 0000000000..86d37c0634 --- /dev/null +++ b/types/fs-cson/index.d.ts @@ -0,0 +1,16 @@ +// Type definitions for fs-cson 0.3 +// Project: https://github.com/charlierudolph/fs-cson +// Definitions by: Piotr Roszatycki +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export function readFile(filePath: string, done: (err: Error | null, result: any) => void): void; +export function readFileSync(filePath: string): any; +export function register(): void; +export function updateFile(filePath: string, updater: (data: any) => any, done: (err: NodeJS.ErrnoException) => void): void; +export function updateFileSync(filePath: string, updater: (data: any) => any): void; +export function writeFile(filePath: string, data: any, done: (err: NodeJS.ErrnoException) => void): void; +export function writeFileSync(filePath: string, data: any): void; +export function writeFileSafe(filePath: string, data: any, done: (err: NodeJS.ErrnoException) => void): void; +export function writeFileSafeSync(filePath: string, data: any): void; diff --git a/types/fs-cson/tsconfig.json b/types/fs-cson/tsconfig.json new file mode 100644 index 0000000000..fcd9242b1d --- /dev/null +++ b/types/fs-cson/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", + "fs-cson-tests.ts" + ] +} diff --git a/types/fs-cson/tslint.json b/types/fs-cson/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/fs-cson/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/fs-ext/tslint.json b/types/fs-ext/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/fs-ext/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fs-extra-promise-es6/index.d.ts b/types/fs-extra-promise-es6/index.d.ts index f5847dd6f0..0f52b5c02e 100644 --- a/types/fs-extra-promise-es6/index.d.ts +++ b/types/fs-extra-promise-es6/index.d.ts @@ -117,64 +117,15 @@ export function write(fd: number, buffer: NodeBuffer, offset: number, length: nu export function writeSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number; export function read(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, bytesRead: number, buffer: NodeBuffer) => void): void; export function readSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number; -/** - * readFile - * @param filename - * @param options - * string: encoding - * OpenOptions: options - * @param callback - */ export function readFile(filename: string, options: OpenOptions | string, callback: (err: Error, data: string) => void): void; export function readFile(filename: string, callback: (err: Error, data: NodeBuffer) => void): void; export function readFileSync(filename: string): NodeBuffer; -/** - * readFileSync - * @param filename - * @param options - * string: encoding - * OpenOptions: options - */ export function readFileSync(filename: string, options: OpenOptions | string): string; -/** - * writeFile - * @param filename - * @param data - * @param options - * string: encoding - * OpenOptions: options - * @param callback - */ export function writeFile(filename: string, data: any, callback?: (err: Error) => void): void; export function writeFile(filename: string, data: any, options: OpenOptions | string, callback?: (err: Error) => void): void; -/** - * writeFileSync - * @param filename - * @param data - * @param option - * string: encoding - * OpenOptions: options - */ export function writeFileSync(filename: string, data: any, option?: OpenOptions | string): void; -/** - * appendFile - * @param filename - * @param data - * @param option: - * string: encoding - * OpenOptions: options - * @param callback - */ export function appendFile(filename: string, data: any, callback?: (err: Error) => void): void; export function appendFile(filename: string, data: any, option: OpenOptions | string, callback?: (err: Error) => void): void; -/** - * appendFileSync - * @param filename - * @param data - * @param option - * string: encoding - * OpenOptions: options - */ export function appendFileSync(filename: string, data: any, option?: OpenOptions | string): void; export function watchFile(filename: string, listener: { curr: Stats; prev: Stats; }): void; export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: { curr: Stats; prev: Stats; }): void; @@ -252,32 +203,9 @@ export function futimesAsync(fd: number, atime: number, mtime: number): Promise< export function fsyncAsync(fd: number): Promise; export function writeAsync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): Promise<[number, NodeBuffer]>; export function readAsync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): Promise<[number, NodeBuffer]>; -/** - * readFileAsync - * @param filename - * @param options: - * string: encoding - * OpenOptions: options - */ export function readFileAsync(filename: string, options: OpenOptions | string): Promise; export function readFileAsync(filename: string): Promise; -/** - * writeFileAsync - * @param filename - * @param data - * @param options: - * string: encoding - * OpenOptions: options - */ export function writeFileAsync(filename: string, data: any, options?: OpenOptions | string): Promise; -/** - * appendFileAsync - * @param filename - * @param data - * @param option: - * string: encoding - * OpenOptions: option - */ export function appendFileAsync(filename: string, data: any, option?: OpenOptions | string): Promise; export function existsAsync(path: string): Promise; diff --git a/types/fs-extra-promise/index.d.ts b/types/fs-extra-promise/index.d.ts index 9d174f791f..de47c81a1e 100644 --- a/types/fs-extra-promise/index.d.ts +++ b/types/fs-extra-promise/index.d.ts @@ -19,14 +19,6 @@ export interface MkdirOptions { } // promisified versions -/** - * copyAsync - * @param src - * @param dest - * @param options - * CopyFilter: filter - * CopyOptions: options - */ export function copyAsync(src: string, dest: string, options?: CopyFilter | CopyOptions): Promise; export function createFileAsync(file: string): Promise; @@ -75,32 +67,9 @@ export function futimesAsync(fd: number, atime: number, mtime: number): Promise< export function fsyncAsync(fd: number): Promise; export function writeAsync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): Promise<[number, NodeBuffer]>; export function readAsync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): Promise<[number, NodeBuffer]>; -/** - * readFileAsync - * @param filename - * @param options: - * string: encoding - * ReadOptions: options - */ export function readFileAsync(filename: string, options: string | ReadOptions): Promise; export function readFileAsync(filename: string): Promise; -/** - * writeFileAsync - * @param filename - * @param data - * @param options: - * string: encoding - * WriteOptions: options - */ export function writeFileAsync(filename: string, data: any, options?: string | WriteOptions): Promise; -/** - * appendFileAsync - * @param filename - * @param data - * @param options: - * string: encoding - * WriteOptions: options - */ export function appendFileAsync(filename: string, data: any, option?: string | WriteOptions): Promise; export function existsAsync(path: string): Promise; diff --git a/types/fs-extra/fs-extra-tests.ts b/types/fs-extra/fs-extra-tests.ts index f405486adb..1af094260d 100644 --- a/types/fs-extra/fs-extra-tests.ts +++ b/types/fs-extra/fs-extra-tests.ts @@ -14,7 +14,7 @@ const fd = 0; const modeNum = 0; const modeStr = ""; const object = {}; -const errorCallback = (err: Error | null) => { }; +const errorCallback = (err: Error) => { }; const readOptions: fs.ReadOptions = { reviver: {} }; diff --git a/types/fs-extra/index.d.ts b/types/fs-extra/index.d.ts index 60c112c68b..82bd401c39 100644 --- a/types/fs-extra/index.d.ts +++ b/types/fs-extra/index.d.ts @@ -14,242 +14,236 @@ import { Stats } from "fs"; export * from "fs"; export function copy(src: string, dest: string, options?: CopyOptions): Promise; -export function copy(src: string, dest: string, callback: (err: Error | null) => void): void; -export function copy(src: string, dest: string, options: CopyOptions, callback: (err: Error | null) => void): void; +export function copy(src: string, dest: string, callback: (err: Error) => void): void; +export function copy(src: string, dest: string, options: CopyOptions, callback: (err: Error) => void): void; export function copySync(src: string, dest: string, options?: CopyOptions): void; export function move(src: string, dest: string, options?: MoveOptions): Promise; -export function move(src: string, dest: string, callback: (err: Error | null) => void): void; -export function move(src: string, dest: string, options: MoveOptions, callback: (err: Error | null) => void): void; +export function move(src: string, dest: string, callback: (err: Error) => void): void; +export function move(src: string, dest: string, options: MoveOptions, callback: (err: Error) => void): void; export function moveSync(src: string, dest: string, options?: MoveOptions): void; export function createFile(file: string): Promise; -export function createFile(file: string, callback: (err: Error | null) => void): void; +export function createFile(file: string, callback: (err: Error) => void): void; export function createFileSync(file: string): void; export function ensureDir(path: string): Promise; -export function ensureDir(path: string, callback: (err: Error | null) => void): void; +export function ensureDir(path: string, callback: (err: Error) => void): void; export function ensureDirSync(path: string): void; export function mkdirs(dir: string): Promise; -export function mkdirs(dir: string, callback: (err: Error | null) => void): void; +export function mkdirs(dir: string, callback: (err: Error) => void): void; export function mkdirp(dir: string): Promise; -export function mkdirp(dir: string, callback: (err: Error | null) => void): void; +export function mkdirp(dir: string, callback: (err: Error) => void): void; export function mkdirsSync(dir: string): void; export function mkdirpSync(dir: string): void; -export function outputFile(file: string, data: any): Promise; -export function outputFile(file: string, data: any, callback: (err: Error | null) => void): void; -export function outputFileSync(file: string, data: any): void; +export function outputFile(file: string, data: any, options?: WriteFileOptions | string): Promise; +export function outputFile(file: string, data: any, callback: (err: Error) => void): void; +export function outputFile(file: string, data: any, options: WriteFileOptions | string, callback: (err: Error) => void): void; +export function outputFileSync(file: string, data: any, options?: WriteFileOptions | string): void; export function readJson(file: string, options?: ReadOptions): Promise; -export function readJson(file: string, callback: (err: Error | null, jsonObject: any) => void): void; -export function readJson(file: string, options: ReadOptions, callback: (err: Error | null, jsonObject: any) => void): void; +export function readJson(file: string, callback: (err: Error, jsonObject: any) => void): void; +export function readJson(file: string, options: ReadOptions, callback: (err: Error, jsonObject: any) => void): void; export function readJSON(file: string, options?: ReadOptions): Promise; -export function readJSON(file: string, callback: (err: Error | null, jsonObject: any) => void): void; -export function readJSON(file: string, options: ReadOptions, callback: (err: Error | null, jsonObject: any) => void): void; +export function readJSON(file: string, callback: (err: Error, jsonObject: any) => void): void; +export function readJSON(file: string, options: ReadOptions, callback: (err: Error, jsonObject: any) => void): void; export function readJsonSync(file: string, options?: ReadOptions): any; export function readJSONSync(file: string, options?: ReadOptions): any; export function remove(dir: string): Promise; -export function remove(dir: string, callback: (err: Error | null) => void): void; +export function remove(dir: string, callback: (err: Error) => void): void; export function removeSync(dir: string): void; export function outputJSON(file: string, data: any, options?: WriteOptions): Promise; -export function outputJSON(file: string, data: any, options: WriteOptions, callback: (err: Error | null) => void): void; -export function outputJSON(file: string, data: any, callback: (err: Error | null) => void): void; +export function outputJSON(file: string, data: any, options: WriteOptions, callback: (err: Error) => void): void; +export function outputJSON(file: string, data: any, callback: (err: Error) => void): void; export function outputJson(file: string, data: any, options?: WriteOptions): Promise; -export function outputJson(file: string, data: any, options: WriteOptions, callback: (err: Error | null) => void): void; -export function outputJson(file: string, data: any, callback: (err: Error | null) => void): void; +export function outputJson(file: string, data: any, options: WriteOptions, callback: (err: Error) => void): void; +export function outputJson(file: string, data: any, callback: (err: Error) => void): void; export function outputJsonSync(file: string, data: any, options?: WriteOptions): void; export function outputJSONSync(file: string, data: any, options?: WriteOptions): void; export function writeJSON(file: string, object: any, options?: WriteOptions): Promise; -export function writeJSON(file: string, object: any, callback: (err: Error | null) => void): void; -export function writeJSON(file: string, object: any, options: WriteOptions, callback: (err: Error | null) => void): void; +export function writeJSON(file: string, object: any, callback: (err: Error) => void): void; +export function writeJSON(file: string, object: any, options: WriteOptions, callback: (err: Error) => void): void; export function writeJson(file: string, object: any, options?: WriteOptions): Promise; -export function writeJson(file: string, object: any, callback: (err: Error | null) => void): void; -export function writeJson(file: string, object: any, options: WriteOptions, callback: (err: Error | null) => void): void; +export function writeJson(file: string, object: any, callback: (err: Error) => void): void; +export function writeJson(file: string, object: any, options: WriteOptions, callback: (err: Error) => void): void; export function writeJsonSync(file: string, object: any, options?: WriteOptions): void; export function writeJSONSync(file: string, object: any, options?: WriteOptions): void; export function ensureFile(path: string): Promise; -export function ensureFile(path: string, callback: (err: Error | null) => void): void; +export function ensureFile(path: string, callback: (err: Error) => void): void; export function ensureFileSync(path: string): void; export function ensureLink(src: string, dest: string): Promise; -export function ensureLink(src: string, dest: string, callback: (err: Error | null) => void): void; +export function ensureLink(src: string, dest: string, callback: (err: Error) => void): void; export function ensureLinkSync(src: string, dest: string): void; export function ensureSymlink(src: string, dest: string, type?: SymlinkType): Promise; -export function ensureSymlink(src: string, dest: string, type: SymlinkType, callback: (err: Error | null) => void): void; -export function ensureSymlink(src: string, dest: string, callback: (err: Error | null) => void): void; +export function ensureSymlink(src: string, dest: string, type: SymlinkType, callback: (err: Error) => void): void; +export function ensureSymlink(src: string, dest: string, callback: (err: Error) => void): void; export function ensureSymlinkSync(src: string, dest: string, type?: SymlinkType): void; export function emptyDir(path: string): Promise; -export function emptyDir(path: string, callback: (err: Error | null) => void): void; +export function emptyDir(path: string, callback: (err: Error) => void): void; export function emptyDirSync(path: string): void; export function pathExists(path: string): Promise; -export function pathExists(path: string, callback: (err: Error | null, exists: boolean) => void): void; +export function pathExists(path: string, callback: (err: Error, exists: boolean) => void): void; export function pathExistsSync(path: string): boolean; // fs async methods // copied from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/v6/index.d.ts -/** Tests a user's permissions for the file specified by path. */ -export function access(path: string | Buffer, callback: (err: NodeJS.ErrnoException | null) => void): void; -export function access(path: string | Buffer, mode: number, callback: (err: NodeJS.ErrnoException | null) => void): void; +export function access(path: string | Buffer, callback: (err: NodeJS.ErrnoException) => void): void; +export function access(path: string | Buffer, mode: number, callback: (err: NodeJS.ErrnoException) => void): void; export function access(path: string | Buffer, mode?: number): Promise; export function appendFile(file: string | Buffer | number, data: any, options: { encoding?: string; mode?: number | string; flag?: string; }, - callback: (err: NodeJS.ErrnoException | null) => void): void; -export function appendFile(file: string | Buffer | number, data: any, callback: (err: NodeJS.ErrnoException | null) => void): void; + callback: (err: NodeJS.ErrnoException) => void): void; +export function appendFile(file: string | Buffer | number, data: any, callback: (err: NodeJS.ErrnoException) => void): void; export function appendFile(file: string | Buffer | number, data: any, options?: { encoding?: string; mode?: number | string; flag?: string; }): Promise; -export function chmod(path: string | Buffer, mode: string | number, callback: (err?: NodeJS.ErrnoException | null) => void): void; +export function chmod(path: string | Buffer, mode: string | number, callback: (err: NodeJS.ErrnoException) => void): void; export function chmod(path: string | Buffer, mode: string | number): Promise; export function chown(path: string | Buffer, uid: number, gid: number): Promise; -export function chown(path: string | Buffer, uid: number, gid: number, callback: (err?: NodeJS.ErrnoException | null) => void): void; +export function chown(path: string | Buffer, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void; -export function close(fd: number, callback: (err?: NodeJS.ErrnoException | null) => void): void; +export function close(fd: number, callback: (err: NodeJS.ErrnoException) => void): void; export function close(fd: number): Promise; -export function fchmod(fd: number, mode: string | number, callback: (err?: NodeJS.ErrnoException | null) => void): void; +export function fchmod(fd: number, mode: string | number, callback: (err: NodeJS.ErrnoException) => void): void; export function fchmod(fd: number, mode: string | number): Promise; -export function fchown(fd: number, uid: number, gid: number, callback: (err?: NodeJS.ErrnoException | null) => void): void; +export function fchown(fd: number, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void; export function fchown(fd: number, uid: number, gid: number): Promise; export function fdatasync(fd: number, callback: () => void): void; export function fdatasync(fd: number): Promise; -export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => any): void; +export function fstat(fd: number, callback: (err: NodeJS.ErrnoException, stats: Stats) => any): void; export function fstat(fd: number): Promise; -export function fsync(fd: number, callback: (err?: NodeJS.ErrnoException | null) => void): void; +export function fsync(fd: number, callback: (err: NodeJS.ErrnoException) => void): void; export function fsync(fd: number): Promise; -export function ftruncate(fd: number, callback: (err?: NodeJS.ErrnoException | null) => void): void; -export function ftruncate(fd: number, len: number, callback: (err?: NodeJS.ErrnoException | null) => void): void; +export function ftruncate(fd: number, callback: (err: NodeJS.ErrnoException) => void): void; +export function ftruncate(fd: number, len: number, callback: (err: NodeJS.ErrnoException) => void): void; export function ftruncate(fd: number, len?: number): Promise; -export function futimes(fd: number, atime: number, mtime: number, callback: (err?: NodeJS.ErrnoException | null) => void): void; -export function futimes(fd: number, atime: Date, mtime: Date, callback: (err?: NodeJS.ErrnoException | null) => void): void; +export function futimes(fd: number, atime: number, mtime: number, callback: (err: NodeJS.ErrnoException) => void): void; +export function futimes(fd: number, atime: Date, mtime: Date, callback: (err: NodeJS.ErrnoException) => void): void; export function futimes(fd: number, atime: number, mtime: number): Promise; export function futimes(fd: number, atime: Date, mtime: Date): Promise; -export function lchown(path: string | Buffer, uid: number, gid: number, callback: (err?: NodeJS.ErrnoException | null) => void): void; +export function lchown(path: string | Buffer, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void; export function lchown(path: string | Buffer, uid: number, gid: number): Promise; -export function link(srcpath: string | Buffer, dstpath: string | Buffer, callback: (err?: NodeJS.ErrnoException | null) => void): void; +export function link(srcpath: string | Buffer, dstpath: string | Buffer, callback: (err: NodeJS.ErrnoException) => void): void; export function link(srcpath: string | Buffer, dstpath: string | Buffer): Promise; -export function lstat(path: string | Buffer, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => any): void; +export function lstat(path: string | Buffer, callback: (err: NodeJS.ErrnoException, stats: Stats) => any): void; export function lstat(path: string | Buffer): Promise; /** * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. * - * @param path * @param callback No arguments other than a possible exception are given to the completion callback. */ -export function mkdir(path: string | Buffer, callback: (err?: NodeJS.ErrnoException | null) => void): void; +export function mkdir(path: string | Buffer, callback: (err: NodeJS.ErrnoException) => void): void; /** * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. * - * @param path - * @param mode * @param callback No arguments other than a possible exception are given to the completion callback. */ -export function mkdir(path: string | Buffer, mode: number | string, callback: (err?: NodeJS.ErrnoException | null) => void): void; +export function mkdir(path: string | Buffer, mode: number | string, callback: (err: NodeJS.ErrnoException) => void): void; export function mkdir(path: string | Buffer): Promise; -export function open(path: string | Buffer, flags: string | number, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; -export function open(path: string | Buffer, flags: string | number, mode: number, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; +export function open(path: string | Buffer, flags: string | number, callback: (err: NodeJS.ErrnoException, fd: number) => void): void; +export function open(path: string | Buffer, flags: string | number, mode: number, callback: (err: NodeJS.ErrnoException, fd: number) => void): void; export function open(path: string | Buffer, flags: string | number, mode?: number): Promise; export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number | null, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: Buffer) => void): void; + callback: (err: NodeJS.ErrnoException, bytesRead: number, buffer: Buffer) => void): void; export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number | null): Promise; -export function readFile(file: string | Buffer | number, callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void): void; -export function readFile(file: string | Buffer | number, encoding: string, callback: (err: NodeJS.ErrnoException | null, data: string) => void): void; +export function readFile(file: string | Buffer | number, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; +export function readFile(file: string | Buffer | number, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void; export function readFile(file: string | Buffer | number, options: { flag?: string; } | { encoding: string; flag?: string; }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; export function readFile(file: string | Buffer | number, options: { flag?: string; } | { encoding: string; flag?: string; }): Promise; // tslint:disable-next-line:unified-signatures export function readFile(file: string | Buffer | number, encoding: string): Promise; export function readFile(file: string | Buffer | number): Promise; -export function readdir(path: string | Buffer, callback: (err: NodeJS.ErrnoException | null, files: string[]) => void): void; +export function readdir(path: string | Buffer, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void; export function readdir(path: string | Buffer): Promise; -export function readlink(path: string | Buffer, callback: (err: NodeJS.ErrnoException | null, linkString: string) => any): void; +export function readlink(path: string | Buffer, callback: (err: NodeJS.ErrnoException, linkString: string) => any): void; export function readlink(path: string | Buffer): Promise; -export function realpath(path: string | Buffer, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => any): void; -export function realpath(path: string | Buffer, cache: { [path: string]: string }, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => any): void; +export function realpath(path: string | Buffer, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void; +export function realpath(path: string | Buffer, cache: { [path: string]: string }, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void; export function realpath(path: string | Buffer, cache?: { [path: string]: string }): Promise; -export function rename(oldPath: string, newPath: string, callback: (err?: NodeJS.ErrnoException | null) => void): void; +export function rename(oldPath: string, newPath: string, callback: (err: NodeJS.ErrnoException) => void): void; export function rename(oldPath: string, newPath: string): Promise; /** * Asynchronous rmdir - removes the directory specified in {path} * - * @param path * @param callback No arguments other than a possible exception are given to the completion callback. */ -export function rmdir(path: string | Buffer, callback: (err?: NodeJS.ErrnoException | null) => void): void; +export function rmdir(path: string | Buffer, callback: (err: NodeJS.ErrnoException) => void): void; export function rmdir(path: string | Buffer): Promise; -export function stat(path: string | Buffer, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => any): void; +export function stat(path: string | Buffer, callback: (err: NodeJS.ErrnoException, stats: Stats) => any): void; export function stat(path: string | Buffer): Promise; -export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type: string, callback: (err?: NodeJS.ErrnoException | null) => void): void; +export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type: string, callback: (err: NodeJS.ErrnoException) => void): void; export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type?: string): Promise; -export function truncate(path: string | Buffer, callback: (err?: NodeJS.ErrnoException | null) => void): void; -export function truncate(path: string | Buffer, len: number, callback: (err?: NodeJS.ErrnoException | null) => void): void; +export function truncate(path: string | Buffer, callback: (err: NodeJS.ErrnoException) => void): void; +export function truncate(path: string | Buffer, len: number, callback: (err: NodeJS.ErrnoException) => void): void; export function truncate(path: string | Buffer, len?: number): Promise; /** * Asynchronous unlink - deletes the file specified in {path} * - * @param path * @param callback No arguments other than a possible exception are given to the completion callback. */ -export function unlink(path: string | Buffer, callback: (err?: NodeJS.ErrnoException | null) => void): void; +export function unlink(path: string | Buffer, callback: (err: NodeJS.ErrnoException) => void): void; export function unlink(path: string | Buffer): Promise; -export function utimes(path: string | Buffer, atime: number, mtime: number, callback: (err?: NodeJS.ErrnoException) => void): void; -export function utimes(path: string | Buffer, atime: Date, mtime: Date, callback: (err?: NodeJS.ErrnoException | null) => void): void; +export function utimes(path: string | Buffer, atime: number, mtime: number, callback: (err: NodeJS.ErrnoException) => void): void; +export function utimes(path: string | Buffer, atime: Date, mtime: Date, callback: (err: NodeJS.ErrnoException) => void): void; export function utimes(path: string | Buffer, atime: number, mtime: number): Promise; export function utimes(path: string | Buffer, atime: Date, mtime: Date): Promise; export function write(fd: number, buffer: Buffer, offset: number, length: number, position: number | null, callback: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void; -export function write(fd: number, buffer: Buffer, offset: number, length: number, callback: (err: NodeJS.ErrnoException | null, written: number, buffer: Buffer) => void): void; -export function write(fd: number, data: any, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void; -export function write(fd: number, data: any, offset: number, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void; -export function write(fd: number, data: any, offset: number, encoding: string, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void; +export function write(fd: number, buffer: Buffer, offset: number, length: number, callback: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void; +export function write(fd: number, data: any, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; +export function write(fd: number, data: any, offset: number, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; +export function write(fd: number, data: any, offset: number, encoding: string, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; export function write(fd: number, buffer: Buffer, offset: number, length: number, position?: number | null): Promise; export function write(fd: number, data: any, offset: number, encoding?: string): Promise; -export function writeFile(file: string | Buffer | number, data: any, callback: (err: NodeJS.ErrnoException | null) => void): void; -export function writeFile(file: string | Buffer | number, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): Promise; -export function writeFile(file: string | Buffer | number, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback: (err: NodeJS.ErrnoException | null) => void): void; +export function writeFile(file: string | Buffer | number, data: any, callback: (err: NodeJS.ErrnoException) => void): void; +export function writeFile(file: string | Buffer | number, data: any, options?: WriteFileOptions | string): Promise; +export function writeFile(file: string | Buffer | number, data: any, options: WriteFileOptions | string, callback: (err: NodeJS.ErrnoException) => void): void; /** * Asynchronous mkdtemp - Creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory. * - * @param prefix * @param callback The created folder path is passed as a string to the callback's second parameter. */ export function mkdtemp(prefix: string): Promise; -export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void; +export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException, folder: string) => void): void; export interface PathEntry { path: string; @@ -286,15 +280,18 @@ export interface ReadOptions { flag?: string; } -export interface WriteOptions { - fs?: object; - replacer?: any; - spaces?: number; +export interface WriteFileOptions { encoding?: string; flag?: string; mode?: number; } +export interface WriteOptions extends WriteFileOptions { + fs?: object; + replacer?: any; + spaces?: number; +} + export interface ReadResult { bytesRead: number; buffer: Buffer; diff --git a/types/fs-finder/tslint.json b/types/fs-finder/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/fs-finder/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fs-mock/tslint.json b/types/fs-mock/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/fs-mock/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/ftdomdelegate/tslint.json b/types/ftdomdelegate/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/ftdomdelegate/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/ftp/tslint.json b/types/ftp/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/ftp/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/ftpd/tslint.json b/types/ftpd/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/ftpd/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fullcalendar/package.json b/types/fullcalendar/package.json index fce08a048d..19e5fb0d14 100644 --- a/types/fullcalendar/package.json +++ b/types/fullcalendar/package.json @@ -3,4 +3,4 @@ "dependencies": { "moment": ">=2.14.0" } -} \ No newline at end of file +} diff --git a/types/fullcalendar/v1/package.json b/types/fullcalendar/v1/package.json index fce08a048d..19e5fb0d14 100644 --- a/types/fullcalendar/v1/package.json +++ b/types/fullcalendar/v1/package.json @@ -3,4 +3,4 @@ "dependencies": { "moment": ">=2.14.0" } -} \ No newline at end of file +} diff --git a/types/fullname/tslint.json b/types/fullname/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/fullname/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fullpage.js/tslint.json b/types/fullpage.js/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/fullpage.js/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fuse/tslint.json b/types/fuse/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/fuse/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fuzzaldrin-plus/tslint.json b/types/fuzzaldrin-plus/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/fuzzaldrin-plus/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/fxn/tslint.json b/types/fxn/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/fxn/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/gae.channel.api/tslint.json b/types/gae.channel.api/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/gae.channel.api/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/gamepad/tslint.json b/types/gamepad/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/gamepad/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/gamequery/tslint.json b/types/gamequery/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/gamequery/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/gandi-livedns/tslint.json b/types/gandi-livedns/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/gandi-livedns/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/gapi.analytics/tslint.json b/types/gapi.analytics/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/gapi.analytics/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/gapi.calendar/tslint.json b/types/gapi.calendar/tslint.json new file mode 100644 index 0000000000..a41bf5d19a --- /dev/null +++ b/types/gapi.calendar/tslint.json @@ -0,0 +1,79 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "adjacent-overload-signatures": false, + "array-type": false, + "arrow-return-shorthand": false, + "ban-types": false, + "callable-types": false, + "comment-format": false, + "dt-header": false, + "eofline": false, + "export-just-namespace": false, + "import-spacing": false, + "interface-name": false, + "interface-over-type-literal": false, + "jsdoc-format": false, + "max-line-length": false, + "member-access": false, + "new-parens": false, + "no-any-union": false, + "no-boolean-literal-compare": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": false, + "no-construct": false, + "no-declare-current-package": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-for-in-array": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-irregular-whitespace": false, + "no-mergeable-namespace": false, + "no-misused-new": false, + "no-namespace": false, + "no-object-literal-type-assertion": false, + "no-padding": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-redundant-undefined": false, + "no-reference-import": false, + "no-relative-import-in-test": false, + "no-self-import": false, + "no-single-declare-module": false, + "no-string-throw": false, + "no-unnecessary-callback-wrapper": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-unnecessary-type-assertion": false, + "no-useless-files": false, + "no-var-keyword": false, + "no-var-requires": false, + "no-void-expression": false, + "no-trailing-whitespace": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "one-line": false, + "one-variable-per-declaration": false, + "only-arrow-functions": false, + "prefer-conditional-expression": false, + "prefer-const": false, + "prefer-declare-function": false, + "prefer-for-of": false, + "prefer-method-signature": false, + "prefer-template": false, + "radix": false, + "semicolon": false, + "space-before-function-paren": false, + "space-within-parens": false, + "strict-export-declare-modifiers": false, + "trim-file": false, + "triple-equals": false, + "typedef-whitespace": false, + "unified-signatures": false, + "void-return": false, + "whitespace": false + } +} diff --git a/types/gapi.client.acceleratedmobilepageurl/gapi.client.acceleratedmobilepageurl-tests.ts b/types/gapi.client.acceleratedmobilepageurl/gapi.client.acceleratedmobilepageurl-tests.ts new file mode 100644 index 0000000000..f5bce33566 --- /dev/null +++ b/types/gapi.client.acceleratedmobilepageurl/gapi.client.acceleratedmobilepageurl-tests.ts @@ -0,0 +1,22 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('acceleratedmobilepageurl', 'v1', () => { + /** now we can use gapi.client.acceleratedmobilepageurl */ + + run(); + }); + + async function run() { + /** + * Returns AMP URL(s) and equivalent + * [AMP Cache URL(s)](/amp/cache/overview#amp-cache-url-format). + */ + await gapi.client.ampUrls.batchGet({ + }); + } +}); diff --git a/types/gapi.client.acceleratedmobilepageurl/index.d.ts b/types/gapi.client.acceleratedmobilepageurl/index.d.ts new file mode 100644 index 0000000000..1c2c968f53 --- /dev/null +++ b/types/gapi.client.acceleratedmobilepageurl/index.d.ts @@ -0,0 +1,97 @@ +// Type definitions for Google Accelerated Mobile Pages (AMP) URL API v1 1.0 +// Project: https://developers.google.com/amp/cache/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://acceleratedmobilepageurl.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Accelerated Mobile Pages (AMP) URL API v1 */ + function load(name: "acceleratedmobilepageurl", version: "v1"): PromiseLike; + function load(name: "acceleratedmobilepageurl", version: "v1", callback: () => any): void; + + const ampUrls: acceleratedmobilepageurl.AmpUrlsResource; + + namespace acceleratedmobilepageurl { + interface AmpUrl { + /** The AMP URL pointing to the publisher's web server. */ + ampUrl?: string; + /** + * The [AMP Cache URL](/amp/cache/overview#amp-cache-url-format) pointing to + * the cached document in the Google AMP Cache. + */ + cdnAmpUrl?: string; + /** The original non-AMP URL. */ + originalUrl?: string; + } + interface AmpUrlError { + /** The error code of an API call. */ + errorCode?: string; + /** An optional descriptive error message. */ + errorMessage?: string; + /** The original non-AMP URL. */ + originalUrl?: string; + } + interface BatchGetAmpUrlsRequest { + /** The lookup_strategy being requested. */ + lookupStrategy?: string; + /** + * List of URLs to look up for the paired AMP URLs. + * The URLs are case-sensitive. Up to 50 URLs per lookup + * (see [Usage Limits](/amp/cache/reference/limits)). + */ + urls?: string[]; + } + interface BatchGetAmpUrlsResponse { + /** + * For each URL in BatchAmpUrlsRequest, the URL response. The response might + * not be in the same order as URLs in the batch request. + * If BatchAmpUrlsRequest contains duplicate URLs, AmpUrl is generated + * only once. + */ + ampUrls?: AmpUrl[]; + /** The errors for requested URLs that have no AMP URL. */ + urlErrors?: AmpUrlError[]; + } + interface AmpUrlsResource { + /** + * Returns AMP URL(s) and equivalent + * [AMP Cache URL(s)](/amp/cache/overview#amp-cache-url-format). + */ + batchGet(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.acceleratedmobilepageurl/readme.md b/types/gapi.client.acceleratedmobilepageurl/readme.md new file mode 100644 index 0000000000..788f3882c0 --- /dev/null +++ b/types/gapi.client.acceleratedmobilepageurl/readme.md @@ -0,0 +1,42 @@ +# TypeScript typings for Accelerated Mobile Pages (AMP) URL API v1 +Retrieves the list of AMP URLs (and equivalent AMP Cache URLs) for a given list of public URL(s). + +For detailed description please check [documentation](https://developers.google.com/amp/cache/). + +## Installing + +Install typings for Accelerated Mobile Pages (AMP) URL API: +``` +npm install @types/gapi.client.acceleratedmobilepageurl@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('acceleratedmobilepageurl', 'v1', () => { + // now we can use gapi.client.acceleratedmobilepageurl + // ... +}); +``` + + + +After that you can use Accelerated Mobile Pages (AMP) URL API resources: + +```typescript + +/* +Returns AMP URL(s) and equivalent +[AMP Cache URL(s)](/amp/cache/overview#amp-cache-url-format). +*/ +await gapi.client.ampUrls.batchGet({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.acceleratedmobilepageurl/tsconfig.json b/types/gapi.client.acceleratedmobilepageurl/tsconfig.json new file mode 100644 index 0000000000..60d81925fe --- /dev/null +++ b/types/gapi.client.acceleratedmobilepageurl/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.acceleratedmobilepageurl-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.acceleratedmobilepageurl/tslint.json b/types/gapi.client.acceleratedmobilepageurl/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.acceleratedmobilepageurl/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.adexchangebuyer/gapi.client.adexchangebuyer-tests.ts b/types/gapi.client.adexchangebuyer/gapi.client.adexchangebuyer-tests.ts new file mode 100644 index 0000000000..b180610519 --- /dev/null +++ b/types/gapi.client.adexchangebuyer/gapi.client.adexchangebuyer-tests.ts @@ -0,0 +1,213 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('adexchangebuyer', 'v1.4', () => { + /** now we can use gapi.client.adexchangebuyer */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** Manage your Ad Exchange buyer account configuration */ + 'https://www.googleapis.com/auth/adexchange.buyer', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Gets one account by ID. */ + await gapi.client.accounts.get({ + id: 1, + }); + /** Retrieves the authenticated user's list of accounts. */ + await gapi.client.accounts.list({ + }); + /** Updates an existing account. This method supports patch semantics. */ + await gapi.client.accounts.patch({ + confirmUnsafeAccountChange: true, + id: 2, + }); + /** Updates an existing account. */ + await gapi.client.accounts.update({ + confirmUnsafeAccountChange: true, + id: 2, + }); + /** Returns the billing information for one account specified by account ID. */ + await gapi.client.billingInfo.get({ + accountId: 1, + }); + /** Retrieves a list of billing information for all accounts of the authenticated user. */ + await gapi.client.billingInfo.list({ + }); + /** Returns the budget information for the adgroup specified by the accountId and billingId. */ + await gapi.client.budget.get({ + accountId: "accountId", + billingId: "billingId", + }); + /** + * Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request. This method + * supports patch semantics. + */ + await gapi.client.budget.patch({ + accountId: "accountId", + billingId: "billingId", + }); + /** Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request. */ + await gapi.client.budget.update({ + accountId: "accountId", + billingId: "billingId", + }); + /** Add a deal id association for the creative. */ + await gapi.client.creatives.addDeal({ + accountId: 1, + buyerCreativeId: "buyerCreativeId", + dealId: "dealId", + }); + /** Gets the status for a single creative. A creative will be available 30-40 minutes after submission. */ + await gapi.client.creatives.get({ + accountId: 1, + buyerCreativeId: "buyerCreativeId", + }); + /** Submit a new creative. */ + await gapi.client.creatives.insert({ + }); + /** Retrieves a list of the authenticated user's active creatives. A creative will be available 30-40 minutes after submission. */ + await gapi.client.creatives.list({ + accountId: 1, + buyerCreativeId: "buyerCreativeId", + dealsStatusFilter: "dealsStatusFilter", + maxResults: 4, + openAuctionStatusFilter: "openAuctionStatusFilter", + pageToken: "pageToken", + }); + /** Lists the external deal ids associated with the creative. */ + await gapi.client.creatives.listDeals({ + accountId: 1, + buyerCreativeId: "buyerCreativeId", + }); + /** Remove a deal id associated with the creative. */ + await gapi.client.creatives.removeDeal({ + accountId: 1, + buyerCreativeId: "buyerCreativeId", + dealId: "dealId", + }); + /** Delete the specified deals from the proposal */ + await gapi.client.marketplacedeals.delete({ + proposalId: "proposalId", + }); + /** Add new deals for the specified proposal */ + await gapi.client.marketplacedeals.insert({ + proposalId: "proposalId", + }); + /** List all the deals for a given proposal */ + await gapi.client.marketplacedeals.list({ + pqlQuery: "pqlQuery", + proposalId: "proposalId", + }); + /** Replaces all the deals in the proposal with the passed in deals */ + await gapi.client.marketplacedeals.update({ + proposalId: "proposalId", + }); + /** Add notes to the proposal */ + await gapi.client.marketplacenotes.insert({ + proposalId: "proposalId", + }); + /** Get all the notes associated with a proposal */ + await gapi.client.marketplacenotes.list({ + pqlQuery: "pqlQuery", + proposalId: "proposalId", + }); + /** Update a given private auction proposal */ + await gapi.client.marketplaceprivateauction.updateproposal({ + privateAuctionId: "privateAuctionId", + }); + /** Retrieves the authenticated user's list of performance metrics. */ + await gapi.client.performanceReport.list({ + accountId: "accountId", + endDateTime: "endDateTime", + maxResults: 3, + pageToken: "pageToken", + startDateTime: "startDateTime", + }); + /** Deletes an existing pretargeting config. */ + await gapi.client.pretargetingConfig.delete({ + accountId: "accountId", + configId: "configId", + }); + /** Gets a specific pretargeting configuration */ + await gapi.client.pretargetingConfig.get({ + accountId: "accountId", + configId: "configId", + }); + /** Inserts a new pretargeting configuration. */ + await gapi.client.pretargetingConfig.insert({ + accountId: "accountId", + }); + /** Retrieves a list of the authenticated user's pretargeting configurations. */ + await gapi.client.pretargetingConfig.list({ + accountId: "accountId", + }); + /** Updates an existing pretargeting config. This method supports patch semantics. */ + await gapi.client.pretargetingConfig.patch({ + accountId: "accountId", + configId: "configId", + }); + /** Updates an existing pretargeting config. */ + await gapi.client.pretargetingConfig.update({ + accountId: "accountId", + configId: "configId", + }); + /** Gets the requested product by id. */ + await gapi.client.products.get({ + productId: "productId", + }); + /** Gets the requested product. */ + await gapi.client.products.search({ + pqlQuery: "pqlQuery", + }); + /** Get a proposal given its id */ + await gapi.client.proposals.get({ + proposalId: "proposalId", + }); + /** Create the given list of proposals */ + await gapi.client.proposals.insert({ + }); + /** Update the given proposal. This method supports patch semantics. */ + await gapi.client.proposals.patch({ + proposalId: "proposalId", + revisionNumber: "revisionNumber", + updateAction: "updateAction", + }); + /** Search for proposals using pql query */ + await gapi.client.proposals.search({ + pqlQuery: "pqlQuery", + }); + /** Update the given proposal to indicate that setup has been completed. */ + await gapi.client.proposals.setupcomplete({ + proposalId: "proposalId", + }); + /** Update the given proposal */ + await gapi.client.proposals.update({ + proposalId: "proposalId", + revisionNumber: "revisionNumber", + updateAction: "updateAction", + }); + /** Gets the requested publisher profile(s) by publisher accountId. */ + await gapi.client.pubprofiles.list({ + accountId: 1, + }); + } +}); diff --git a/types/gapi.client.adexchangebuyer/index.d.ts b/types/gapi.client.adexchangebuyer/index.d.ts new file mode 100644 index 0000000000..b6ee95d192 --- /dev/null +++ b/types/gapi.client.adexchangebuyer/index.d.ts @@ -0,0 +1,1989 @@ +// Type definitions for Google Ad Exchange Buyer API v1.4 1.4 +// Project: https://developers.google.com/ad-exchange/buyer-rest +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/adexchangebuyer/v1.4/rest + +/// + +declare namespace gapi.client { + /** Load Ad Exchange Buyer API v1.4 */ + function load(name: "adexchangebuyer", version: "v1.4"): PromiseLike; + function load(name: "adexchangebuyer", version: "v1.4", callback: () => any): void; + + const accounts: adexchangebuyer.AccountsResource; + + const billingInfo: adexchangebuyer.BillingInfoResource; + + const budget: adexchangebuyer.BudgetResource; + + const creatives: adexchangebuyer.CreativesResource; + + const marketplacedeals: adexchangebuyer.MarketplacedealsResource; + + const marketplacenotes: adexchangebuyer.MarketplacenotesResource; + + const marketplaceprivateauction: adexchangebuyer.MarketplaceprivateauctionResource; + + const performanceReport: adexchangebuyer.PerformanceReportResource; + + const pretargetingConfig: adexchangebuyer.PretargetingConfigResource; + + const products: adexchangebuyer.ProductsResource; + + const proposals: adexchangebuyer.ProposalsResource; + + const pubprofiles: adexchangebuyer.PubprofilesResource; + + namespace adexchangebuyer { + interface Account { + /** Your bidder locations that have distinct URLs. */ + bidderLocation?: Array<{ + /** + * The protocol that the bidder endpoint is using. OpenRTB protocols with prefix PROTOCOL_OPENRTB_PROTOBUF use proto buffer, otherwise use JSON. Allowed + * values: + * - PROTOCOL_ADX + * - PROTOCOL_OPENRTB_2_2 + * - PROTOCOL_OPENRTB_2_3 + * - PROTOCOL_OPENRTB_2_4 + * - PROTOCOL_OPENRTB_2_5 + * - PROTOCOL_OPENRTB_PROTOBUF_2_3 + * - PROTOCOL_OPENRTB_PROTOBUF_2_4 + * - PROTOCOL_OPENRTB_PROTOBUF_2_5 + */ + bidProtocol?: string; + /** The maximum queries per second the Ad Exchange will send. */ + maximumQps?: number; + /** + * The geographical region the Ad Exchange should send requests from. Only used by some quota systems, but always setting the value is recommended. + * Allowed values: + * - ASIA + * - EUROPE + * - US_EAST + * - US_WEST + */ + region?: string; + /** The URL to which the Ad Exchange will send bid requests. */ + url?: string; + }>; + /** The nid parameter value used in cookie match requests. Please contact your technical account manager if you need to change this. */ + cookieMatchingNid?: string; + /** The base URL used in cookie match requests. */ + cookieMatchingUrl?: string; + /** Account id. */ + id?: number; + /** Resource type. */ + kind?: string; + /** + * The maximum number of active creatives that an account can have, where a creative is active if it was inserted or bid with in the last 30 days. Please + * contact your technical account manager if you need to change this. + */ + maximumActiveCreatives?: number; + /** The sum of all bidderLocation.maximumQps values cannot exceed this. Please contact your technical account manager if you need to change this. */ + maximumTotalQps?: number; + /** The number of creatives that this account inserted or bid with in the last 30 days. */ + numberActiveCreatives?: number; + } + interface AccountsList { + /** A list of accounts. */ + items?: Account[]; + /** Resource type. */ + kind?: string; + } + interface AddOrderDealsRequest { + /** The list of deals to add */ + deals?: MarketplaceDeal[]; + /** The last known proposal revision number. */ + proposalRevisionNumber?: string; + /** Indicates an optional action to take on the proposal */ + updateAction?: string; + } + interface AddOrderDealsResponse { + /** List of deals added (in the same proposal as passed in the request) */ + deals?: MarketplaceDeal[]; + /** The updated revision number for the proposal. */ + proposalRevisionNumber?: string; + } + interface AddOrderNotesRequest { + /** The list of notes to add. */ + notes?: MarketplaceNote[]; + } + interface AddOrderNotesResponse { + notes?: MarketplaceNote[]; + } + interface BillingInfo { + /** Account id. */ + accountId?: number; + /** Account name. */ + accountName?: string; + /** + * A list of adgroup IDs associated with this particular account. These IDs may show up as part of a realtime bidding BidRequest, which indicates a bid + * request for this account. + */ + billingId?: string[]; + /** Resource type. */ + kind?: string; + } + interface BillingInfoList { + /** A list of billing info relevant for your account. */ + items?: BillingInfo[]; + /** Resource type. */ + kind?: string; + } + interface Budget { + /** The id of the account. This is required for get and update requests. */ + accountId?: string; + /** The billing id to determine which adgroup to provide budget information for. This is required for get and update requests. */ + billingId?: string; + /** The daily budget amount in unit amount of the account currency to apply for the billingId provided. This is required for update requests. */ + budgetAmount?: string; + /** The currency code for the buyer. This cannot be altered here. */ + currencyCode?: string; + /** The unique id that describes this item. */ + id?: string; + /** The kind of the resource, i.e. "adexchangebuyer#budget". */ + kind?: string; + } + interface Buyer { + /** Adx account id of the buyer. */ + accountId?: string; + } + interface ContactInformation { + /** Email address of the contact. */ + email?: string; + /** The name of the contact. */ + name?: string; + } + interface CreateOrdersRequest { + /** The list of proposals to create. */ + proposals?: Proposal[]; + /** Web property id of the seller creating these orders */ + webPropertyCode?: string; + } + interface CreateOrdersResponse { + /** The list of proposals successfully created. */ + proposals?: Proposal[]; + } + interface Creative { + /** The HTML snippet that displays the ad when inserted in the web page. If set, videoURL should not be set. */ + HTMLSnippet?: string; + /** Account id. */ + accountId?: number; + /** The link to the Ad Preferences page. This is only supported for native ads. */ + adChoicesDestinationUrl?: string; + /** Detected advertiser id, if any. Read-only. This field should not be set in requests. */ + advertiserId?: string[]; + /** The name of the company being advertised in the creative. The value provided must exist in the advertisers.txt file. */ + advertiserName?: string; + /** The agency id for this creative. */ + agencyId?: string; + /** + * The last upload timestamp of this creative if it was uploaded via API. Read-only. The value of this field is generated, and will be ignored for + * uploads. (formatted RFC 3339 timestamp). + */ + apiUploadTimestamp?: string; + /** + * List of buyer selectable attributes for the ads that may be shown from this snippet. Each attribute is represented by an integer as defined in + * buyer-declarable-creative-attributes.txt. + */ + attribute?: number[]; + /** A buyer-specific id identifying the creative in this ad. */ + buyerCreativeId?: string; + /** The set of destination urls for the snippet. */ + clickThroughUrl?: string[]; + /** Shows any corrections that were applied to this creative. Read-only. This field should not be set in requests. */ + corrections?: Array<{ + /** All known serving contexts containing serving status information. */ + contexts?: Array<{ + /** Only set when contextType=AUCTION_TYPE. Represents the auction types this correction applies to. */ + auctionType?: string[]; + /** The type of context (e.g., location, platform, auction type, SSL-ness). */ + contextType?: string; + /** Only set when contextType=LOCATION. Represents the geo criterias this correction applies to. */ + geoCriteriaId?: number[]; + /** Only set when contextType=PLATFORM. Represents the platforms this correction applies to. */ + platform?: string[]; + }>; + /** Additional details about the correction. */ + details?: string[]; + /** The type of correction that was applied to the creative. */ + reason?: string; + }>; + /** + * Top-level deals status. Read-only. This field should not be set in requests. If disapproved, an entry for auctionType=DIRECT_DEALS (or ALL) in + * servingRestrictions will also exist. Note that this may be nuanced with other contextual restrictions, in which case it may be preferable to read from + * servingRestrictions directly. + */ + dealsStatus?: string; + /** Detected domains for this creative. Read-only. This field should not be set in requests. */ + detectedDomains?: string[]; + /** The filtering reasons for the creative. Read-only. This field should not be set in requests. */ + filteringReasons?: { + /** The date in ISO 8601 format for the data. The data is collected from 00:00:00 to 23:59:59 in PST. */ + date?: string; + /** The filtering reasons. */ + reasons?: Array<{ + /** The number of times the creative was filtered for the status. The count is aggregated across all publishers on the exchange. */ + filteringCount?: string; + /** The filtering status code as defined in creative-status-codes.txt. */ + filteringStatus?: number; + }>; + }; + /** Ad height. */ + height?: number; + /** The set of urls to be called to record an impression. */ + impressionTrackingUrl?: string[]; + /** Resource type. */ + kind?: string; + /** Detected languages for this creative. Read-only. This field should not be set in requests. */ + languages?: string[]; + /** If nativeAd is set, HTMLSnippet and the videoURL outside of nativeAd should not be set. (The videoURL inside nativeAd can be set.) */ + nativeAd?: { + advertiser?: string; + /** The app icon, for app download ads. */ + appIcon?: { + height?: number; + url?: string; + width?: number; + }; + /** A long description of the ad. */ + body?: string; + /** A label for the button that the user is supposed to click. */ + callToAction?: string; + /** The URL that the browser/SDK will load when the user clicks the ad. */ + clickLinkUrl?: string; + /** The URL to use for click tracking. */ + clickTrackingUrl?: string; + /** A short title for the ad. */ + headline?: string; + /** A large image. */ + image?: { + height?: number; + url?: string; + width?: number; + }; + /** The URLs are called when the impression is rendered. */ + impressionTrackingUrl?: string[]; + /** A smaller image, for the advertiser logo. */ + logo?: { + height?: number; + url?: string; + width?: number; + }; + /** The price of the promoted app including the currency info. */ + price?: string; + /** The app rating in the app store. Must be in the range [0-5]. */ + starRating?: number; + /** The URL to the app store to purchase/download the promoted app. */ + store?: string; + /** The URL of the XML VAST for a native ad. Note this is a separate field from resource.video_url. */ + videoURL?: string; + }; + /** + * Top-level open auction status. Read-only. This field should not be set in requests. If disapproved, an entry for auctionType=OPEN_AUCTION (or ALL) in + * servingRestrictions will also exist. Note that this may be nuanced with other contextual restrictions, in which case it may be preferable to read from + * ServingRestrictions directly. + */ + openAuctionStatus?: string; + /** + * Detected product categories, if any. Each category is represented by an integer as defined in ad-product-categories.txt. Read-only. This field should + * not be set in requests. + */ + productCategories?: number[]; + /** + * All restricted categories for the ads that may be shown from this snippet. Each category is represented by an integer as defined in the + * ad-restricted-categories.txt. + */ + restrictedCategories?: number[]; + /** + * Detected sensitive categories, if any. Each category is represented by an integer as defined in ad-sensitive-categories.txt. Read-only. This field + * should not be set in requests. + */ + sensitiveCategories?: number[]; + /** + * The granular status of this ad in specific contexts. A context here relates to where something ultimately serves (for example, a physical location, a + * platform, an HTTPS vs HTTP request, or the type of auction). Read-only. This field should not be set in requests. See the examples in the Creatives + * guide for more details. + */ + servingRestrictions?: Array<{ + /** All known contexts/restrictions. */ + contexts?: Array<{ + /** Only set when contextType=AUCTION_TYPE. Represents the auction types this restriction applies to. */ + auctionType?: string[]; + /** The type of context (e.g., location, platform, auction type, SSL-ness). */ + contextType?: string; + /** + * Only set when contextType=LOCATION. Represents the geo criterias this restriction applies to. Impressions are considered to match a context if either + * the user location or publisher location matches a given geoCriteriaId. + */ + geoCriteriaId?: number[]; + /** Only set when contextType=PLATFORM. Represents the platforms this restriction applies to. */ + platform?: string[]; + }>; + /** + * The reasons for disapproval within this restriction, if any. Note that not all disapproval reasons may be categorized, so it is possible for the + * creative to have a status of DISAPPROVED or CONDITIONALLY_APPROVED with an empty list for disapproval_reasons. In this case, please reach out to your + * TAM to help debug the issue. + */ + disapprovalReasons?: Array<{ + /** Additional details about the reason for disapproval. */ + details?: string[]; + /** The categorized reason for disapproval. */ + reason?: string; + }>; + /** Why the creative is ineligible to serve in this context (e.g., it has been explicitly disapproved or is pending review). */ + reason?: string; + }>; + /** List of vendor types for the ads that may be shown from this snippet. Each vendor type is represented by an integer as defined in vendors.txt. */ + vendorType?: number[]; + /** The version for this creative. Read-only. This field should not be set in requests. */ + version?: number; + /** The URL to fetch a video ad. If set, HTMLSnippet and the nativeAd should not be set. Note, this is different from resource.native_ad.video_url above. */ + videoURL?: string; + /** Ad width. */ + width?: number; + } + interface CreativeDealIds { + /** A list of external deal ids and ARC approval status. */ + dealStatuses?: Array<{ + /** ARC approval status. */ + arcStatus?: string; + /** External deal ID. */ + dealId?: string; + /** Publisher ID. */ + webPropertyId?: number; + }>; + /** Resource type. */ + kind?: string; + } + interface CreativesList { + /** A list of creatives. */ + items?: Creative[]; + /** Resource type. */ + kind?: string; + /** Continuation token used to page through creatives. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface DealServingMetadata { + /** + * True if alcohol ads are allowed for this deal (read-only). This field is only populated when querying for finalized orders using the method + * GetFinalizedOrderDeals + */ + alcoholAdsAllowed?: boolean; + /** Tracks which parties (if any) have paused a deal. (readonly, except via PauseResumeOrderDeals action) */ + dealPauseStatus?: DealServingMetadataDealPauseStatus; + } + interface DealServingMetadataDealPauseStatus { + buyerPauseReason?: string; + /** If the deal is paused, records which party paused the deal first. */ + firstPausedBy?: string; + hasBuyerPaused?: boolean; + hasSellerPaused?: boolean; + sellerPauseReason?: string; + } + interface DealTerms { + /** Visibilty of the URL in bid requests. */ + brandingType?: string; + /** + * Indicates that this ExternalDealId exists under at least two different AdxInventoryDeals. Currently, the only case that the same ExternalDealId will + * exist is programmatic cross sell case. + */ + crossListedExternalDealIdType?: string; + /** Description for the proposed terms of the deal. */ + description?: string; + /** Non-binding estimate of the estimated gross spend for this deal Can be set by buyer or seller. */ + estimatedGrossSpend?: Price; + /** Non-binding estimate of the impressions served per day Can be set by buyer or seller. */ + estimatedImpressionsPerDay?: string; + /** The terms for guaranteed fixed price deals. */ + guaranteedFixedPriceTerms?: DealTermsGuaranteedFixedPriceTerms; + /** The terms for non-guaranteed auction deals. */ + nonGuaranteedAuctionTerms?: DealTermsNonGuaranteedAuctionTerms; + /** The terms for non-guaranteed fixed price deals. */ + nonGuaranteedFixedPriceTerms?: DealTermsNonGuaranteedFixedPriceTerms; + /** The terms for rubicon non-guaranteed deals. */ + rubiconNonGuaranteedTerms?: DealTermsRubiconNonGuaranteedTerms; + /** For deals with Cost Per Day billing, defines the timezone used to mark the boundaries of a day (buyer-readonly) */ + sellerTimeZone?: string; + } + interface DealTermsGuaranteedFixedPriceTerms { + /** External billing info for this Deal. This field is relevant when external billing info such as price has a different currency code than DFP/AdX. */ + billingInfo?: DealTermsGuaranteedFixedPriceTermsBillingInfo; + /** Fixed price for the specified buyer. */ + fixedPrices?: PricePerBuyer[]; + /** Guaranteed impressions as a percentage. This is the percentage of guaranteed looks that the buyer is guaranteeing to buy. */ + guaranteedImpressions?: string; + /** Count of guaranteed looks. Required for deal, optional for product. For CPD deals, buyer changes to guaranteed_looks will be ignored. */ + guaranteedLooks?: string; + /** Count of minimum daily looks for a CPD deal. For CPD deals, buyer should negotiate on this field instead of guaranteed_looks. */ + minimumDailyLooks?: string; + } + interface DealTermsGuaranteedFixedPriceTermsBillingInfo { + /** + * The timestamp (in ms since epoch) when the original reservation price for the deal was first converted to DFP currency. This is used to convert the + * contracted price into buyer's currency without discrepancy. + */ + currencyConversionTimeMs?: string; + /** The DFP line item id associated with this deal. For features like CPD, buyers can retrieve the DFP line item for billing reconciliation. */ + dfpLineItemId?: string; + /** + * The original contracted quantity (# impressions) for this deal. To ensure delivery, sometimes the publisher will book the deal with a impression + * buffer, such that guaranteed_looks is greater than the contracted quantity. However clients are billed using the original contracted quantity. + */ + originalContractedQuantity?: string; + /** The original reservation price for the deal, if the currency code is different from the one used in negotiation. */ + price?: Price; + } + interface DealTermsNonGuaranteedAuctionTerms { + /** True if open auction buyers are allowed to compete with invited buyers in this private auction (buyer-readonly). */ + autoOptimizePrivateAuction?: boolean; + /** Reserve price for the specified buyer. */ + reservePricePerBuyers?: PricePerBuyer[]; + } + interface DealTermsNonGuaranteedFixedPriceTerms { + /** Fixed price for the specified buyer. */ + fixedPrices?: PricePerBuyer[]; + } + interface DealTermsRubiconNonGuaranteedTerms { + /** Optional price for Rubicon priority access in the auction. */ + priorityPrice?: Price; + /** Optional price for Rubicon standard access in the auction. */ + standardPrice?: Price; + } + interface DeleteOrderDealsRequest { + /** List of deals to delete for a given proposal */ + dealIds?: string[]; + /** The last known proposal revision number. */ + proposalRevisionNumber?: string; + /** Indicates an optional action to take on the proposal */ + updateAction?: string; + } + interface DeleteOrderDealsResponse { + /** List of deals deleted (in the same proposal as passed in the request) */ + deals?: MarketplaceDeal[]; + /** The updated revision number for the proposal. */ + proposalRevisionNumber?: string; + } + interface DeliveryControl { + creativeBlockingLevel?: string; + deliveryRateType?: string; + frequencyCaps?: DeliveryControlFrequencyCap[]; + } + interface DeliveryControlFrequencyCap { + maxImpressions?: number; + numTimeUnits?: number; + timeUnitType?: string; + } + interface Dimension { + dimensionType?: string; + dimensionValues?: DimensionDimensionValue[]; + } + interface DimensionDimensionValue { + /** Id of the dimension. */ + id?: number; + /** Name of the dimension mainly for debugging purposes, except for the case of CREATIVE_SIZE. For CREATIVE_SIZE, strings are used instead of ids. */ + name?: string; + /** + * Percent of total impressions for a dimension type. e.g. {dimension_type: 'GENDER', [{dimension_value: {id: 1, name: 'MALE', percentage: 60}}]} Gender + * MALE is 60% of all impressions which have gender. + */ + percentage?: number; + } + interface EditAllOrderDealsRequest { + /** + * List of deals to edit. Service may perform 3 different operations based on comparison of deals in this list vs deals already persisted in database: 1. + * Add new deal to proposal If a deal in this list does not exist in the proposal, the service will create a new deal and add it to the proposal. + * Validation will follow AddOrderDealsRequest. 2. Update existing deal in the proposal If a deal in this list already exist in the proposal, the service + * will update that existing deal to this new deal in the request. Validation will follow UpdateOrderDealsRequest. 3. Delete deals from the proposal (just + * need the id) If a existing deal in the proposal is not present in this list, the service will delete that deal from the proposal. Validation will + * follow DeleteOrderDealsRequest. + */ + deals?: MarketplaceDeal[]; + /** If specified, also updates the proposal in the batch transaction. This is useful when the proposal and the deals need to be updated in one transaction. */ + proposal?: Proposal; + /** The last known revision number for the proposal. */ + proposalRevisionNumber?: string; + /** Indicates an optional action to take on the proposal */ + updateAction?: string; + } + interface EditAllOrderDealsResponse { + /** List of all deals in the proposal after edit. */ + deals?: MarketplaceDeal[]; + /** The latest revision number after the update has been applied. */ + orderRevisionNumber?: string; + } + interface GetOffersResponse { + /** The returned list of products. */ + products?: Product[]; + } + interface GetOrderDealsResponse { + /** List of deals for the proposal */ + deals?: MarketplaceDeal[]; + } + interface GetOrderNotesResponse { + /** + * The list of matching notes. The notes for a proposal are ordered from oldest to newest. If the notes span multiple proposals, they will be grouped by + * proposal, with the notes for the most recently modified proposal appearing first. + */ + notes?: MarketplaceNote[]; + } + interface GetOrdersResponse { + /** The list of matching proposals. */ + proposals?: Proposal[]; + } + interface GetPublisherProfilesByAccountIdResponse { + /** Profiles for the requested publisher */ + profiles?: PublisherProfileApiProto[]; + } + interface MarketplaceDeal { + /** Buyer private data (hidden from seller). */ + buyerPrivateData?: PrivateData; + /** The time (ms since epoch) of the deal creation. (readonly) */ + creationTimeMs?: string; + /** Specifies the creative pre-approval policy (buyer-readonly) */ + creativePreApprovalPolicy?: string; + /** Specifies whether the creative is safeFrame compatible (buyer-readonly) */ + creativeSafeFrameCompatibility?: string; + /** A unique deal-id for the deal (readonly). */ + dealId?: string; + /** Metadata about the serving status of this deal (readonly, writes via custom actions) */ + dealServingMetadata?: DealServingMetadata; + /** + * The set of fields around delivery control that are interesting for a buyer to see but are non-negotiable. These are set by the publisher. This message + * is assigned an id of 100 since some day we would want to model this as a protobuf extension. + */ + deliveryControl?: DeliveryControl; + /** The external deal id assigned to this deal once the deal is finalized. This is the deal-id that shows up in serving/reporting etc. (readonly) */ + externalDealId?: string; + /** Proposed flight end time of the deal (ms since epoch) This will generally be stored in a granularity of a second. (updatable) */ + flightEndTimeMs?: string; + /** Proposed flight start time of the deal (ms since epoch) This will generally be stored in a granularity of a second. (updatable) */ + flightStartTimeMs?: string; + /** Description for the deal terms. (buyer-readonly) */ + inventoryDescription?: string; + /** Indicates whether the current deal is a RFP template. RFP template is created by buyer and not based on seller created products. */ + isRfpTemplate?: boolean; + /** True, if the buyside inventory setup is complete for this deal. (readonly, except via OrderSetupCompleted action) */ + isSetupComplete?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "adexchangebuyer#marketplaceDeal". */ + kind?: string; + /** The time (ms since epoch) when the deal was last updated. (readonly) */ + lastUpdateTimeMs?: string; + /** The name of the deal. (updatable) */ + name?: string; + /** The product-id from which this deal was created. (readonly, except on create) */ + productId?: string; + /** The revision number of the product that the deal was created from (readonly, except on create) */ + productRevisionNumber?: string; + /** + * Specifies the creative source for programmatic deals, PUBLISHER means creative is provided by seller and ADVERTISR means creative is provided by buyer. + * (buyer-readonly) + */ + programmaticCreativeSource?: string; + proposalId?: string; + /** Optional Seller contact information for the deal (buyer-readonly) */ + sellerContacts?: ContactInformation[]; + /** The shared targeting visible to buyers and sellers. Each shared targeting entity is AND'd together. (updatable) */ + sharedTargetings?: SharedTargeting[]; + /** The syndication product associated with the deal. (readonly, except on create) */ + syndicationProduct?: string; + /** The negotiable terms of the deal. (updatable) */ + terms?: DealTerms; + webPropertyCode?: string; + } + interface MarketplaceDealParty { + /** The buyer/seller associated with the deal. One of buyer/seller is specified for a deal-party. */ + buyer?: Buyer; + /** The buyer/seller associated with the deal. One of buyer/seller is specified for a deal party. */ + seller?: Seller; + } + interface MarketplaceLabel { + /** The accountId of the party that created the label. */ + accountId?: string; + /** The creation time (in ms since epoch) for the label. */ + createTimeMs?: string; + /** Information about the party that created the label. */ + deprecatedMarketplaceDealParty?: MarketplaceDealParty; + /** The label to use. */ + label?: string; + } + interface MarketplaceNote { + /** The role of the person (buyer/seller) creating the note. (readonly) */ + creatorRole?: string; + /** Notes can optionally be associated with a deal. (readonly, except on create) */ + dealId?: string; + /** Identifies what kind of resource this is. Value: the fixed string "adexchangebuyer#marketplaceNote". */ + kind?: string; + /** The actual note to attach. (readonly, except on create) */ + note?: string; + /** The unique id for the note. (readonly) */ + noteId?: string; + /** The proposalId that a note is attached to. (readonly) */ + proposalId?: string; + /** If the note is associated with a proposal revision number, then store that here. (readonly, except on create) */ + proposalRevisionNumber?: string; + /** The timestamp (ms since epoch) that this note was created. (readonly) */ + timestampMs?: string; + } + interface PerformanceReport { + /** The number of bid responses with an ad. */ + bidRate?: number; + /** The number of bid requests sent to your bidder. */ + bidRequestRate?: number; + /** Rate of various prefiltering statuses per match. Please refer to the callout-status-codes.txt file for different statuses. */ + calloutStatusRate?: any[]; + /** Average QPS for cookie matcher operations. */ + cookieMatcherStatusRate?: any[]; + /** Rate of ads with a given status. Please refer to the creative-status-codes.txt file for different statuses. */ + creativeStatusRate?: any[]; + /** The number of bid responses that were filtered due to a policy violation or other errors. */ + filteredBidRate?: number; + /** Average QPS for hosted match operations. */ + hostedMatchStatusRate?: any[]; + /** The number of potential queries based on your pretargeting settings. */ + inventoryMatchRate?: number; + /** Resource type. */ + kind?: string; + /** The 50th percentile round trip latency(ms) as perceived from Google servers for the duration period covered by the report. */ + latency50thPercentile?: number; + /** The 85th percentile round trip latency(ms) as perceived from Google servers for the duration period covered by the report. */ + latency85thPercentile?: number; + /** The 95th percentile round trip latency(ms) as perceived from Google servers for the duration period covered by the report. */ + latency95thPercentile?: number; + /** Rate of various quota account statuses per quota check. */ + noQuotaInRegion?: number; + /** Rate of various quota account statuses per quota check. */ + outOfQuota?: number; + /** Average QPS for pixel match requests from clients. */ + pixelMatchRequests?: number; + /** Average QPS for pixel match responses from clients. */ + pixelMatchResponses?: number; + /** The configured quota limits for this account. */ + quotaConfiguredLimit?: number; + /** The throttled quota limits for this account. */ + quotaThrottledLimit?: number; + /** The trading location of this data. */ + region?: string; + /** The number of properly formed bid responses received by our servers within the deadline. */ + successfulRequestRate?: number; + /** The unix timestamp of the starting time of this performance data. */ + timestamp?: string; + /** The number of bid responses that were unsuccessful due to timeouts, incorrect formatting, etc. */ + unsuccessfulRequestRate?: number; + } + interface PerformanceReportList { + /** Resource type. */ + kind?: string; + /** A list of performance reports relevant for the account. */ + performanceReport?: PerformanceReport[]; + } + interface PretargetingConfig { + /** The id for billing purposes, provided for reference. Leave this field blank for insert requests; the id will be generated automatically. */ + billingId?: string; + /** The config id; generated automatically. Leave this field blank for insert requests. */ + configId?: string; + /** The name of the config. Must be unique. Required for all requests. */ + configName?: string; + /** List must contain exactly one of PRETARGETING_CREATIVE_TYPE_HTML or PRETARGETING_CREATIVE_TYPE_VIDEO. */ + creativeType?: string[]; + /** Requests which allow one of these (width, height) pairs will match. All pairs must be supported ad dimensions. */ + dimensions?: Array<{ + /** Height in pixels. */ + height?: string; + /** Width in pixels. */ + width?: string; + }>; + /** Requests with any of these content labels will not match. Values are from content-labels.txt in the downloadable files section. */ + excludedContentLabels?: string[]; + /** Requests containing any of these geo criteria ids will not match. */ + excludedGeoCriteriaIds?: string[]; + /** Requests containing any of these placements will not match. */ + excludedPlacements?: Array<{ + /** + * The value of the placement. Interpretation depends on the placement type, e.g. URL for a site placement, channel name for a channel placement, app id + * for a mobile app placement. + */ + token?: string; + /** The type of the placement. */ + type?: string; + }>; + /** Requests containing any of these users list ids will not match. */ + excludedUserLists?: string[]; + /** Requests containing any of these vertical ids will not match. Values are from the publisher-verticals.txt file in the downloadable files section. */ + excludedVerticals?: string[]; + /** Requests containing any of these geo criteria ids will match. */ + geoCriteriaIds?: string[]; + /** Whether this config is active. Required for all requests. */ + isActive?: boolean; + /** The kind of the resource, i.e. "adexchangebuyer#pretargetingConfig". */ + kind?: string; + /** Request containing any of these language codes will match. */ + languages?: string[]; + /** + * Requests where the predicted viewability is below the specified decile will not match. E.g. if the buyer sets this value to 5, requests from slots + * where the predicted viewability is below 50% will not match. If the predicted viewability is unknown this field will be ignored. + */ + minimumViewabilityDecile?: number; + /** Requests containing any of these mobile carrier ids will match. Values are from mobile-carriers.csv in the downloadable files section. */ + mobileCarriers?: string[]; + /** Requests containing any of these mobile device ids will match. Values are from mobile-devices.csv in the downloadable files section. */ + mobileDevices?: string[]; + /** Requests containing any of these mobile operating system version ids will match. Values are from mobile-os.csv in the downloadable files section. */ + mobileOperatingSystemVersions?: string[]; + /** Requests containing any of these placements will match. */ + placements?: Array<{ + /** + * The value of the placement. Interpretation depends on the placement type, e.g. URL for a site placement, channel name for a channel placement, app id + * for a mobile app placement. + */ + token?: string; + /** The type of the placement. */ + type?: string; + }>; + /** + * Requests matching any of these platforms will match. Possible values are PRETARGETING_PLATFORM_MOBILE, PRETARGETING_PLATFORM_DESKTOP, and + * PRETARGETING_PLATFORM_TABLET. + */ + platforms?: string[]; + /** + * Creative attributes should be declared here if all creatives corresponding to this pretargeting configuration have that creative attribute. Values are + * from pretargetable-creative-attributes.txt in the downloadable files section. + */ + supportedCreativeAttributes?: string[]; + /** + * Requests containing the specified type of user data will match. Possible values are HOSTED_MATCH_DATA, which means the request is cookie-targetable and + * has a match in the buyer's hosted match table, and COOKIE_OR_IDFA, which means the request has either a targetable cookie or an iOS IDFA. + */ + userIdentifierDataRequired?: string[]; + /** Requests containing any of these user list ids will match. */ + userLists?: string[]; + /** Requests that allow any of these vendor ids will match. Values are from vendors.txt in the downloadable files section. */ + vendorTypes?: string[]; + /** Requests containing any of these vertical ids will match. */ + verticals?: string[]; + /** Video requests satisfying any of these player size constraints will match. */ + videoPlayerSizes?: Array<{ + /** The type of aspect ratio. Leave this field blank to match all aspect ratios. */ + aspectRatio?: string; + /** The minimum player height in pixels. Leave this field blank to match any player height. */ + minHeight?: string; + /** The minimum player width in pixels. Leave this field blank to match any player width. */ + minWidth?: string; + }>; + } + interface PretargetingConfigList { + /** A list of pretargeting configs */ + items?: PretargetingConfig[]; + /** Resource type. */ + kind?: string; + } + interface Price { + /** The price value in micros. */ + amountMicros?: number; + /** The currency code for the price. */ + currencyCode?: string; + /** In case of CPD deals, the expected CPM in micros. */ + expectedCpmMicros?: number; + /** The pricing type for the deal/product. */ + pricingType?: string; + } + interface PricePerBuyer { + /** Optional access type for this buyer. */ + auctionTier?: string; + /** Reference to the buyer that will get billed. */ + billedBuyer?: Buyer; + /** + * The buyer who will pay this price. If unset, all buyers can pay this price (if the advertisers match, and there's no more specific rule matching the + * buyer). + */ + buyer?: Buyer; + /** The specified price */ + price?: Price; + } + interface PrivateData { + referenceId?: string; + referencePayload?: string; + } + interface Product { + /** The billed buyer corresponding to the buyer that created the offer. (readonly, except on create) */ + billedBuyer?: Buyer; + /** The buyer that created the offer if this is a buyer initiated offer (readonly, except on create) */ + buyer?: Buyer; + /** Creation time in ms. since epoch (readonly) */ + creationTimeMs?: string; + /** Optional contact information for the creator of this product. (buyer-readonly) */ + creatorContacts?: ContactInformation[]; + /** The role that created the offer. Set to BUYER for buyer initiated offers. */ + creatorRole?: string; + /** + * The set of fields around delivery control that are interesting for a buyer to see but are non-negotiable. These are set by the publisher. This message + * is assigned an id of 100 since some day we would want to model this as a protobuf extension. + */ + deliveryControl?: DeliveryControl; + /** The proposed end time for the deal (ms since epoch) (buyer-readonly) */ + flightEndTimeMs?: string; + /** Inventory availability dates. (times are in ms since epoch) The granularity is generally in the order of seconds. (buyer-readonly) */ + flightStartTimeMs?: string; + /** + * If the creator has already signed off on the product, then the buyer can finalize the deal by accepting the product as is. When copying to a proposal, + * if any of the terms are changed, then auto_finalize is automatically set to false. + */ + hasCreatorSignedOff?: boolean; + /** What exchange will provide this inventory (readonly, except on create). */ + inventorySource?: string; + /** Identifies what kind of resource this is. Value: the fixed string "adexchangebuyer#product". */ + kind?: string; + /** Optional List of labels for the product (optional, buyer-readonly). */ + labels?: MarketplaceLabel[]; + /** Time of last update in ms. since epoch (readonly) */ + lastUpdateTimeMs?: string; + /** Optional legacy offer id if this offer is a preferred deal offer. */ + legacyOfferId?: string; + /** + * Marketplace publisher profile Id. This Id differs from the regular publisher_profile_id in that 1. This is a new id, the old Id will be deprecated in + * 2017. 2. This id uniquely identifies a publisher profile by itself. + */ + marketplacePublisherProfileId?: string; + /** The name for this product as set by the seller. (buyer-readonly) */ + name?: string; + /** Optional private auction id if this offer is a private auction offer. */ + privateAuctionId?: string; + /** The unique id for the product (readonly) */ + productId?: string; + /** + * Id of the publisher profile for a given seller. A (seller.account_id, publisher_profile_id) pair uniquely identifies a publisher profile. Buyers can + * call the PublisherProfiles::List endpoint to get a list of publisher profiles for a given seller. + */ + publisherProfileId?: string; + /** Publisher self-provided forecast information. */ + publisherProvidedForecast?: PublisherProvidedForecast; + /** The revision number of the product. (readonly) */ + revisionNumber?: string; + /** Information about the seller that created this product (readonly, except on create) */ + seller?: Seller; + /** + * Targeting that is shared between the buyer and the seller. Each targeting criteria has a specified key and for each key there is a list of inclusion + * value or exclusion values. (buyer-readonly) + */ + sharedTargetings?: SharedTargeting[]; + /** The state of the product. (buyer-readonly) */ + state?: string; + /** The syndication product associated with the deal. (readonly, except on create) */ + syndicationProduct?: string; + /** The negotiable terms of the deal (buyer-readonly) */ + terms?: DealTerms; + /** The web property code for the seller. This field is meant to be copied over as is when creating deals. */ + webPropertyCode?: string; + } + interface Proposal { + /** Reference to the buyer that will get billed for this proposal. (readonly) */ + billedBuyer?: Buyer; + /** Reference to the buyer on the proposal. (readonly, except on create) */ + buyer?: Buyer; + /** Optional contact information of the buyer. (seller-readonly) */ + buyerContacts?: ContactInformation[]; + /** Private data for buyer. (hidden from seller). */ + buyerPrivateData?: PrivateData; + /** IDs of DBM advertisers permission to this proposal. */ + dbmAdvertiserIds?: string[]; + /** + * When an proposal is in an accepted state, indicates whether the buyer has signed off. Once both sides have signed off on a deal, the proposal can be + * finalized by the seller. (seller-readonly) + */ + hasBuyerSignedOff?: boolean; + /** + * When an proposal is in an accepted state, indicates whether the buyer has signed off Once both sides have signed off on a deal, the proposal can be + * finalized by the seller. (buyer-readonly) + */ + hasSellerSignedOff?: boolean; + /** What exchange will provide this inventory (readonly, except on create). */ + inventorySource?: string; + /** True if the proposal is being renegotiated (readonly). */ + isRenegotiating?: boolean; + /** + * True, if the buyside inventory setup is complete for this proposal. (readonly, except via OrderSetupCompleted action) Deprecated in favor of deal level + * setup complete flag. + */ + isSetupComplete?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "adexchangebuyer#proposal". */ + kind?: string; + /** List of labels associated with the proposal. (readonly) */ + labels?: MarketplaceLabel[]; + /** The role of the last user that either updated the proposal or left a comment. (readonly) */ + lastUpdaterOrCommentorRole?: string; + /** The name for the proposal (updatable) */ + name?: string; + /** Optional negotiation id if this proposal is a preferred deal proposal. */ + negotiationId?: string; + /** Indicates whether the buyer/seller created the proposal.(readonly) */ + originatorRole?: string; + /** Optional private auction id if this proposal is a private auction proposal. */ + privateAuctionId?: string; + /** The unique id of the proposal. (readonly). */ + proposalId?: string; + /** The current state of the proposal. (readonly) */ + proposalState?: string; + /** The revision number for the proposal (readonly). */ + revisionNumber?: string; + /** The time (ms since epoch) when the proposal was last revised (readonly). */ + revisionTimeMs?: string; + /** Reference to the seller on the proposal. (readonly, except on create) */ + seller?: Seller; + /** Optional contact information of the seller (buyer-readonly). */ + sellerContacts?: ContactInformation[]; + } + interface PublisherProfileApiProto { + /** Deprecated: use the seller.account_id. The account id of the seller. */ + accountId?: string; + /** Publisher provided info on its audience. */ + audience?: string; + /** A pitch statement for the buyer */ + buyerPitchStatement?: string; + /** Direct contact for the publisher profile. */ + directContact?: string; + /** Exchange where this publisher profile is from. E.g. AdX, Rubicon etc... */ + exchange?: string; + /** Link to publisher's Google+ page. */ + googlePlusLink?: string; + /** True, if this is the parent profile, which represents all domains owned by the publisher. */ + isParent?: boolean; + /** True, if this profile is published. Deprecated for state. */ + isPublished?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "adexchangebuyer#publisherProfileApiProto". */ + kind?: string; + /** The url to the logo for the publisher. */ + logoUrl?: string; + /** The url for additional marketing and sales materials. */ + mediaKitLink?: string; + name?: string; + /** Publisher provided overview. */ + overview?: string; + /** The pair of (seller.account_id, profile_id) uniquely identifies a publisher profile for a given publisher. */ + profileId?: number; + /** Programmatic contact for the publisher profile. */ + programmaticContact?: string; + /** The list of domains represented in this publisher profile. Empty if this is a parent profile. */ + publisherDomains?: string[]; + /** Unique Id for publisher profile. */ + publisherProfileId?: string; + /** Publisher provided forecasting information. */ + publisherProvidedForecast?: PublisherProvidedForecast; + /** Link to publisher rate card */ + rateCardInfoLink?: string; + /** Link for a sample content page. */ + samplePageLink?: string; + /** Seller of the publisher profile. */ + seller?: Seller; + /** State of the publisher profile. */ + state?: string; + /** Publisher provided key metrics and rankings. */ + topHeadlines?: string[]; + } + interface PublisherProvidedForecast { + /** Publisher provided dimensions. E.g. geo, sizes etc... */ + dimensions?: Dimension[]; + /** Publisher provided weekly impressions. */ + weeklyImpressions?: string; + /** Publisher provided weekly uniques. */ + weeklyUniques?: string; + } + interface Seller { + /** The unique id for the seller. The seller fills in this field. The seller account id is then available to buyer in the product. */ + accountId?: string; + /** Optional sub-account id for the seller. */ + subAccountId?: string; + } + interface SharedTargeting { + /** The list of values to exclude from targeting. Each value is AND'd together. */ + exclusions?: TargetingValue[]; + /** The list of value to include as part of the targeting. Each value is OR'd together. */ + inclusions?: TargetingValue[]; + /** The key representing the shared targeting criterion. */ + key?: string; + } + interface TargetingValue { + /** The creative size value to exclude/include. */ + creativeSizeValue?: TargetingValueCreativeSize; + /** The daypart targeting to include / exclude. Filled in when the key is GOOG_DAYPART_TARGETING. */ + dayPartTargetingValue?: TargetingValueDayPartTargeting; + /** The long value to exclude/include. */ + longValue?: string; + /** The string value to exclude/include. */ + stringValue?: string; + } + interface TargetingValueCreativeSize { + /** For video size type, the list of companion sizes. */ + companionSizes?: TargetingValueSize[]; + /** The Creative size type. */ + creativeSizeType?: string; + /** The native template for native ad. */ + nativeTemplate?: string; + /** For regular or video creative size type, specifies the size of the creative. */ + size?: TargetingValueSize; + /** The skippable ad type for video size. */ + skippableAdType?: string; + } + interface TargetingValueDayPartTargeting { + dayParts?: TargetingValueDayPartTargetingDayPart[]; + timeZoneType?: string; + } + interface TargetingValueDayPartTargetingDayPart { + dayOfWeek?: string; + endHour?: number; + endMinute?: number; + startHour?: number; + startMinute?: number; + } + interface TargetingValueSize { + /** The height of the creative. */ + height?: number; + /** The width of the creative. */ + width?: number; + } + interface UpdatePrivateAuctionProposalRequest { + /** The externalDealId of the deal to be updated. */ + externalDealId?: string; + /** Optional note to be added. */ + note?: MarketplaceNote; + /** The current revision number of the proposal to be updated. */ + proposalRevisionNumber?: string; + /** The proposed action on the private auction proposal. */ + updateAction?: string; + } + interface AccountsResource { + /** Gets one account by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The account id */ + id: number; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the authenticated user's list of accounts. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing account. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Confirmation for erasing bidder and cookie matching urls. */ + confirmUnsafeAccountChange?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The account id */ + id: number; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing account. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Confirmation for erasing bidder and cookie matching urls. */ + confirmUnsafeAccountChange?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The account id */ + id: number; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface BillingInfoResource { + /** Returns the billing information for one account specified by account ID. */ + get(request: { + /** The account id. */ + accountId: number; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of billing information for all accounts of the authenticated user. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface BudgetResource { + /** Returns the budget information for the adgroup specified by the accountId and billingId. */ + get(request: { + /** The account id to get the budget information for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** The billing id to get the budget information for. */ + billingId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request. This method + * supports patch semantics. + */ + patch(request: { + /** The account id associated with the budget being updated. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** The billing id associated with the budget being updated. */ + billingId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request. */ + update(request: { + /** The account id associated with the budget being updated. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** The billing id associated with the budget being updated. */ + billingId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CreativesResource { + /** Add a deal id association for the creative. */ + addDeal(request: { + /** The id for the account that will serve this creative. */ + accountId: number; + /** Data format for the response. */ + alt?: string; + /** The buyer-specific id for this creative. */ + buyerCreativeId: string; + /** The id of the deal id to associate with this creative. */ + dealId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets the status for a single creative. A creative will be available 30-40 minutes after submission. */ + get(request: { + /** The id for the account that will serve this creative. */ + accountId: number; + /** Data format for the response. */ + alt?: string; + /** The buyer-specific id for this creative. */ + buyerCreativeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Submit a new creative. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of the authenticated user's active creatives. A creative will be available 30-40 minutes after submission. */ + list(request: { + /** When specified, only creatives for the given account ids are returned. */ + accountId?: number; + /** Data format for the response. */ + alt?: string; + /** When specified, only creatives for the given buyer creative ids are returned. */ + buyerCreativeId?: string; + /** When specified, only creatives having the given deals status are returned. */ + dealsStatusFilter?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of entries returned on one result page. If not set, the default is 100. Optional. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** When specified, only creatives having the given open auction status are returned. */ + openAuctionStatusFilter?: string; + /** + * A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. Optional. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the external deal ids associated with the creative. */ + listDeals(request: { + /** The id for the account that will serve this creative. */ + accountId: number; + /** Data format for the response. */ + alt?: string; + /** The buyer-specific id for this creative. */ + buyerCreativeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Remove a deal id associated with the creative. */ + removeDeal(request: { + /** The id for the account that will serve this creative. */ + accountId: number; + /** Data format for the response. */ + alt?: string; + /** The buyer-specific id for this creative. */ + buyerCreativeId: string; + /** The id of the deal id to disassociate with this creative. */ + dealId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface MarketplacedealsResource { + /** Delete the specified deals from the proposal */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The proposalId to delete deals from. */ + proposalId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Add new deals for the specified proposal */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** proposalId for which deals need to be added. */ + proposalId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all the deals for a given proposal */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Query string to retrieve specific deals. */ + pqlQuery?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The proposalId to get deals for. To search across all proposals specify order_id = '-' as part of the URL. */ + proposalId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Replaces all the deals in the proposal with the passed in deals */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The proposalId to edit deals on. */ + proposalId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface MarketplacenotesResource { + /** Add notes to the proposal */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The proposalId to add notes for. */ + proposalId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Get all the notes associated with a proposal */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Query string to retrieve specific notes. To search the text contents of notes, please use syntax like "WHERE note.note = "foo" or "WHERE note.note LIKE + * "%bar%" + */ + pqlQuery?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The proposalId to get notes for. To search across all proposals specify order_id = '-' as part of the URL. */ + proposalId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface MarketplaceprivateauctionResource { + /** Update a given private auction proposal */ + updateproposal(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The private auction id to be updated. */ + privateAuctionId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PerformanceReportResource { + /** Retrieves the authenticated user's list of performance metrics. */ + list(request: { + /** The account id to get the reports. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** The end time of the report in ISO 8601 timestamp format using UTC. */ + endDateTime: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of entries returned on one result page. If not set, the default is 100. Optional. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through performance reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. Optional. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The start time of the report in ISO 8601 timestamp format using UTC. */ + startDateTime: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PretargetingConfigResource { + /** Deletes an existing pretargeting config. */ + delete(request: { + /** The account id to delete the pretargeting config for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** The specific id of the configuration to delete. */ + configId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets a specific pretargeting configuration */ + get(request: { + /** The account id to get the pretargeting config for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** The specific id of the configuration to retrieve. */ + configId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new pretargeting configuration. */ + insert(request: { + /** The account id to insert the pretargeting config for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of the authenticated user's pretargeting configurations. */ + list(request: { + /** The account id to get the pretargeting configs for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing pretargeting config. This method supports patch semantics. */ + patch(request: { + /** The account id to update the pretargeting config for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** The specific id of the configuration to update. */ + configId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing pretargeting config. */ + update(request: { + /** The account id to update the pretargeting config for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** The specific id of the configuration to update. */ + configId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ProductsResource { + /** Gets the requested product by id. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The id for the product to get the head revision for. */ + productId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets the requested product. */ + search(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The pql query used to query for products. */ + pqlQuery?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ProposalsResource { + /** Get a proposal given its id */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Id of the proposal to retrieve. */ + proposalId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Create the given list of proposals */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Update the given proposal. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The proposal id to update. */ + proposalId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * The last known revision number to update. If the head revision in the marketplace database has since changed, an error will be thrown. The caller + * should then fetch the latest proposal at head revision and retry the update at that revision. + */ + revisionNumber: string; + /** The proposed action to take on the proposal. This field is required and it must be set when updating a proposal. */ + updateAction: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Search for proposals using pql query */ + search(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Query string to retrieve specific proposals. */ + pqlQuery?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Update the given proposal to indicate that setup has been completed. */ + setupcomplete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The proposal id for which the setup is complete */ + proposalId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Update the given proposal */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The proposal id to update. */ + proposalId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * The last known revision number to update. If the head revision in the marketplace database has since changed, an error will be thrown. The caller + * should then fetch the latest proposal at head revision and retry the update at that revision. + */ + revisionNumber: string; + /** The proposed action to take on the proposal. This field is required and it must be set when updating a proposal. */ + updateAction: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PubprofilesResource { + /** Gets the requested publisher profile(s) by publisher accountId. */ + list(request: { + /** The accountId of the publisher to get profiles for. */ + accountId: number; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.adexchangebuyer/readme.md b/types/gapi.client.adexchangebuyer/readme.md new file mode 100644 index 0000000000..ab46fb564c --- /dev/null +++ b/types/gapi.client.adexchangebuyer/readme.md @@ -0,0 +1,244 @@ +# TypeScript typings for Ad Exchange Buyer API v1.4 +Accesses your bidding-account information, submits creatives for validation, finds available direct deals, and retrieves performance reports. +For detailed description please check [documentation](https://developers.google.com/ad-exchange/buyer-rest). + +## Installing + +Install typings for Ad Exchange Buyer API: +``` +npm install @types/gapi.client.adexchangebuyer@v1.4 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('adexchangebuyer', 'v1.4', () => { + // now we can use gapi.client.adexchangebuyer + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // Manage your Ad Exchange buyer account configuration + 'https://www.googleapis.com/auth/adexchange.buyer', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Ad Exchange Buyer API resources: + +```typescript + +/* +Gets one account by ID. +*/ +await gapi.client.accounts.get({ id: 1, }); + +/* +Retrieves the authenticated user's list of accounts. +*/ +await gapi.client.accounts.list({ }); + +/* +Updates an existing account. This method supports patch semantics. +*/ +await gapi.client.accounts.patch({ id: 1, }); + +/* +Updates an existing account. +*/ +await gapi.client.accounts.update({ id: 1, }); + +/* +Returns the billing information for one account specified by account ID. +*/ +await gapi.client.billingInfo.get({ accountId: 1, }); + +/* +Retrieves a list of billing information for all accounts of the authenticated user. +*/ +await gapi.client.billingInfo.list({ }); + +/* +Returns the budget information for the adgroup specified by the accountId and billingId. +*/ +await gapi.client.budget.get({ accountId: "accountId", billingId: "billingId", }); + +/* +Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request. This method supports patch semantics. +*/ +await gapi.client.budget.patch({ accountId: "accountId", billingId: "billingId", }); + +/* +Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request. +*/ +await gapi.client.budget.update({ accountId: "accountId", billingId: "billingId", }); + +/* +Add a deal id association for the creative. +*/ +await gapi.client.creatives.addDeal({ accountId: 1, buyerCreativeId: "buyerCreativeId", dealId: "dealId", }); + +/* +Gets the status for a single creative. A creative will be available 30-40 minutes after submission. +*/ +await gapi.client.creatives.get({ accountId: 1, buyerCreativeId: "buyerCreativeId", }); + +/* +Submit a new creative. +*/ +await gapi.client.creatives.insert({ }); + +/* +Retrieves a list of the authenticated user's active creatives. A creative will be available 30-40 minutes after submission. +*/ +await gapi.client.creatives.list({ }); + +/* +Lists the external deal ids associated with the creative. +*/ +await gapi.client.creatives.listDeals({ accountId: 1, buyerCreativeId: "buyerCreativeId", }); + +/* +Remove a deal id associated with the creative. +*/ +await gapi.client.creatives.removeDeal({ accountId: 1, buyerCreativeId: "buyerCreativeId", dealId: "dealId", }); + +/* +Delete the specified deals from the proposal +*/ +await gapi.client.marketplacedeals.delete({ proposalId: "proposalId", }); + +/* +Add new deals for the specified proposal +*/ +await gapi.client.marketplacedeals.insert({ proposalId: "proposalId", }); + +/* +List all the deals for a given proposal +*/ +await gapi.client.marketplacedeals.list({ proposalId: "proposalId", }); + +/* +Replaces all the deals in the proposal with the passed in deals +*/ +await gapi.client.marketplacedeals.update({ proposalId: "proposalId", }); + +/* +Add notes to the proposal +*/ +await gapi.client.marketplacenotes.insert({ proposalId: "proposalId", }); + +/* +Get all the notes associated with a proposal +*/ +await gapi.client.marketplacenotes.list({ proposalId: "proposalId", }); + +/* +Update a given private auction proposal +*/ +await gapi.client.marketplaceprivateauction.updateproposal({ privateAuctionId: "privateAuctionId", }); + +/* +Retrieves the authenticated user's list of performance metrics. +*/ +await gapi.client.performanceReport.list({ accountId: "accountId", endDateTime: "endDateTime", startDateTime: "startDateTime", }); + +/* +Deletes an existing pretargeting config. +*/ +await gapi.client.pretargetingConfig.delete({ accountId: "accountId", configId: "configId", }); + +/* +Gets a specific pretargeting configuration +*/ +await gapi.client.pretargetingConfig.get({ accountId: "accountId", configId: "configId", }); + +/* +Inserts a new pretargeting configuration. +*/ +await gapi.client.pretargetingConfig.insert({ accountId: "accountId", }); + +/* +Retrieves a list of the authenticated user's pretargeting configurations. +*/ +await gapi.client.pretargetingConfig.list({ accountId: "accountId", }); + +/* +Updates an existing pretargeting config. This method supports patch semantics. +*/ +await gapi.client.pretargetingConfig.patch({ accountId: "accountId", configId: "configId", }); + +/* +Updates an existing pretargeting config. +*/ +await gapi.client.pretargetingConfig.update({ accountId: "accountId", configId: "configId", }); + +/* +Gets the requested product by id. +*/ +await gapi.client.products.get({ productId: "productId", }); + +/* +Gets the requested product. +*/ +await gapi.client.products.search({ }); + +/* +Get a proposal given its id +*/ +await gapi.client.proposals.get({ proposalId: "proposalId", }); + +/* +Create the given list of proposals +*/ +await gapi.client.proposals.insert({ }); + +/* +Update the given proposal. This method supports patch semantics. +*/ +await gapi.client.proposals.patch({ proposalId: "proposalId", revisionNumber: "revisionNumber", updateAction: "updateAction", }); + +/* +Search for proposals using pql query +*/ +await gapi.client.proposals.search({ }); + +/* +Update the given proposal to indicate that setup has been completed. +*/ +await gapi.client.proposals.setupcomplete({ proposalId: "proposalId", }); + +/* +Update the given proposal +*/ +await gapi.client.proposals.update({ proposalId: "proposalId", revisionNumber: "revisionNumber", updateAction: "updateAction", }); + +/* +Gets the requested publisher profile(s) by publisher accountId. +*/ +await gapi.client.pubprofiles.list({ accountId: 1, }); +``` \ No newline at end of file diff --git a/types/gapi.client.adexchangebuyer/tsconfig.json b/types/gapi.client.adexchangebuyer/tsconfig.json new file mode 100644 index 0000000000..a6ddc40ec7 --- /dev/null +++ b/types/gapi.client.adexchangebuyer/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.adexchangebuyer-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.adexchangebuyer/tslint.json b/types/gapi.client.adexchangebuyer/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.adexchangebuyer/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.adexchangebuyer2/gapi.client.adexchangebuyer2-tests.ts b/types/gapi.client.adexchangebuyer2/gapi.client.adexchangebuyer2-tests.ts new file mode 100644 index 0000000000..0e6ee50fe5 --- /dev/null +++ b/types/gapi.client.adexchangebuyer2/gapi.client.adexchangebuyer2-tests.ts @@ -0,0 +1,32 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('adexchangebuyer2', 'v2beta1', () => { + /** now we can use gapi.client.adexchangebuyer2 */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** Manage your Ad Exchange buyer account configuration */ + 'https://www.googleapis.com/auth/adexchange.buyer', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + } +}); diff --git a/types/gapi.client.adexchangebuyer2/index.d.ts b/types/gapi.client.adexchangebuyer2/index.d.ts new file mode 100644 index 0000000000..40ab26679b --- /dev/null +++ b/types/gapi.client.adexchangebuyer2/index.d.ts @@ -0,0 +1,2400 @@ +// Type definitions for Google Ad Exchange Buyer API II v2beta1 2.0 +// Project: https://developers.google.com/ad-exchange/buyer-rest/reference/rest/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://adexchangebuyer.googleapis.com/$discovery/rest?version=v2beta1 + +/// + +declare namespace gapi.client { + /** Load Ad Exchange Buyer API II v2beta1 */ + function load(name: "adexchangebuyer2", version: "v2beta1"): PromiseLike; + function load(name: "adexchangebuyer2", version: "v2beta1", callback: () => any): void; + + const accounts: adexchangebuyer2.AccountsResource; + + namespace adexchangebuyer2 { + interface AbsoluteDateRange { + /** + * The end date of the range (inclusive). + * Must be within the 30 days leading up to current date, and must be equal to + * or after start_date. + */ + endDate?: Date; + /** + * The start date of the range (inclusive). + * Must be within the 30 days leading up to current date, and must be equal to + * or before end_date. + */ + startDate?: Date; + } + interface AddDealAssociationRequest { + /** The association between a creative and a deal that should be added. */ + association?: CreativeDealAssociation; + } + interface AppContext { + /** The app types this restriction applies to. */ + appTypes?: string[]; + } + interface AuctionContext { + /** The auction types this restriction applies to. */ + auctionTypes?: string[]; + } + interface BidMetricsRow { + /** The number of bids that Ad Exchange received from the buyer. */ + bids?: MetricValue; + /** The number of bids that were permitted to compete in the auction. */ + bidsInAuction?: MetricValue; + /** The number of bids for which the buyer was billed. */ + billedImpressions?: MetricValue; + /** The number of bids that won an impression. */ + impressionsWon?: MetricValue; + /** + * The number of bids for which the corresponding impression was measurable + * for viewability (as defined by Active View). + */ + measurableImpressions?: MetricValue; + /** The values of all dimensions associated with metric values in this row. */ + rowDimensions?: RowDimensions; + /** + * The number of bids for which the corresponding impression was viewable (as + * defined by Active View). + */ + viewableImpressions?: MetricValue; + } + interface BidResponseWithoutBidsStatusRow { + /** + * The number of impressions for which there was a bid response with the + * specified status. + */ + impressionCount?: MetricValue; + /** The values of all dimensions associated with metric values in this row. */ + rowDimensions?: RowDimensions; + /** + * The status specifying why the bid responses were considered to have no + * applicable bids. + */ + status?: string; + } + interface CalloutStatusRow { + /** + * The ID of the callout status. + * See [callout-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/callout-status-codes). + */ + calloutStatusId?: number; + /** + * The number of impressions for which there was a bid request or bid response + * with the specified callout status. + */ + impressionCount?: MetricValue; + /** The values of all dimensions associated with metric values in this row. */ + rowDimensions?: RowDimensions; + } + interface Client { + /** + * The globally-unique numerical ID of the client. + * The value of this field is ignored in create and update operations. + */ + clientAccountId?: string; + /** + * Name used to represent this client to publishers. + * You may have multiple clients that map to the same entity, + * but for each client the combination of `clientName` and entity + * must be unique. + * You can specify this field as empty. + */ + clientName?: string; + /** + * Numerical identifier of the client entity. + * The entity can be an advertiser, a brand, or an agency. + * This identifier is unique among all the entities with the same type. + * + * A list of all known advertisers with their identifiers is available in the + * [advertisers.txt](https://storage.googleapis.com/adx-rtb-dictionaries/advertisers.txt) + * file. + * + * A list of all known brands with their identifiers is available in the + * [brands.txt](https://storage.googleapis.com/adx-rtb-dictionaries/brands.txt) + * file. + * + * A list of all known agencies with their identifiers is available in the + * [agencies.txt](https://storage.googleapis.com/adx-rtb-dictionaries/agencies.txt) + * file. + */ + entityId?: string; + /** + * The name of the entity. This field is automatically fetched based on + * the type and ID. + * The value of this field is ignored in create and update operations. + */ + entityName?: string; + /** The type of the client entity: `ADVERTISER`, `BRAND`, or `AGENCY`. */ + entityType?: string; + /** + * The role which is assigned to the client buyer. Each role implies a set of + * permissions granted to the client. Must be one of `CLIENT_DEAL_VIEWER`, + * `CLIENT_DEAL_NEGOTIATOR` or `CLIENT_DEAL_APPROVER`. + */ + role?: string; + /** The status of the client buyer. */ + status?: string; + /** Whether the client buyer will be visible to sellers. */ + visibleToSeller?: boolean; + } + interface ClientUser { + /** + * Numerical account ID of the client buyer + * with which the user is associated; the + * buyer must be a client of the current sponsor buyer. + * The value of this field is ignored in an update operation. + */ + clientAccountId?: string; + /** + * User's email address. The value of this field + * is ignored in an update operation. + */ + email?: string; + /** The status of the client user. */ + status?: string; + /** + * The unique numerical ID of the client user + * that has accepted an invitation. + * The value of this field is ignored in an update operation. + */ + userId?: string; + } + interface ClientUserInvitation { + /** + * Numerical account ID of the client buyer + * that the invited user is associated with. + * The value of this field is ignored in create operations. + */ + clientAccountId?: string; + /** + * The email address to which the invitation is sent. Email + * addresses should be unique among all client users under each sponsor + * buyer. + */ + email?: string; + /** + * The unique numerical ID of the invitation that is sent to the user. + * The value of this field is ignored in create operations. + */ + invitationId?: string; + } + interface Correction { + /** The contexts for the correction. */ + contexts?: ServingContext[]; + /** Additional details about what was corrected. */ + details?: string[]; + /** The type of correction that was applied to the creative. */ + type?: string; + } + interface Creative { + /** + * The account that this creative belongs to. + * Can be used to filter the response of the + * creatives.list + * method. + */ + accountId?: string; + /** The link to AdChoices destination page. */ + adChoicesDestinationUrl?: string; + /** The name of the company being advertised in the creative. */ + advertiserName?: string; + /** The agency ID for this creative. */ + agencyId?: string; + /** @OutputOnly The last update timestamp of the creative via API. */ + apiUpdateTime?: string; + /** + * All attributes for the ads that may be shown from this creative. + * Can be used to filter the response of the + * creatives.list + * method. + */ + attributes?: string[]; + /** The set of destination URLs for the creative. */ + clickThroughUrls?: string[]; + /** @OutputOnly Shows any corrections that were applied to this creative. */ + corrections?: Correction[]; + /** + * The buyer-defined creative ID of this creative. + * Can be used to filter the response of the + * creatives.list + * method. + */ + creativeId?: string; + /** + * @OutputOnly The top-level deals status of this creative. + * If disapproved, an entry for 'auctionType=DIRECT_DEALS' (or 'ALL') in + * serving_restrictions will also exist. Note + * that this may be nuanced with other contextual restrictions, in which case, + * it may be preferable to read from serving_restrictions directly. + * Can be used to filter the response of the + * creatives.list + * method. + */ + dealsStatus?: string; + /** @OutputOnly Detected advertiser IDs, if any. */ + detectedAdvertiserIds?: string[]; + /** + * @OutputOnly + * The detected domains for this creative. + */ + detectedDomains?: string[]; + /** + * @OutputOnly + * The detected languages for this creative. The order is arbitrary. The codes + * are 2 or 5 characters and are documented at + * https://developers.google.com/adwords/api/docs/appendix/languagecodes. + */ + detectedLanguages?: string[]; + /** + * @OutputOnly Detected product categories, if any. + * See the ad-product-categories.txt file in the technical documentation + * for a list of IDs. + */ + detectedProductCategories?: number[]; + /** + * @OutputOnly Detected sensitive categories, if any. + * See the ad-sensitive-categories.txt file in the technical documentation for + * a list of IDs. You should use these IDs along with the + * excluded-sensitive-category field in the bid request to filter your bids. + */ + detectedSensitiveCategories?: number[]; + /** @OutputOnly The filtering stats for this creative. */ + filteringStats?: FilteringStats; + /** An HTML creative. */ + html?: HtmlContent; + /** The set of URLs to be called to record an impression. */ + impressionTrackingUrls?: string[]; + /** A native creative. */ + native?: NativeContent; + /** + * @OutputOnly The top-level open auction status of this creative. + * If disapproved, an entry for 'auctionType = OPEN_AUCTION' (or 'ALL') in + * serving_restrictions will also exist. Note + * that this may be nuanced with other contextual restrictions, in which case, + * it may be preferable to read from serving_restrictions directly. + * Can be used to filter the response of the + * creatives.list + * method. + */ + openAuctionStatus?: string; + /** All restricted categories for the ads that may be shown from this creative. */ + restrictedCategories?: string[]; + /** + * @OutputOnly The granular status of this ad in specific contexts. + * A context here relates to where something ultimately serves (for example, + * a physical location, a platform, an HTTPS vs HTTP request, or the type + * of auction). + */ + servingRestrictions?: ServingRestriction[]; + /** + * All vendor IDs for the ads that may be shown from this creative. + * See https://storage.googleapis.com/adx-rtb-dictionaries/vendors.txt + * for possible values. + */ + vendorIds?: number[]; + /** @OutputOnly The version of this creative. */ + version?: number; + /** A video creative. */ + video?: VideoContent; + } + interface CreativeDealAssociation { + /** The account the creative belongs to. */ + accountId?: string; + /** The ID of the creative associated with the deal. */ + creativeId?: string; + /** The externalDealId for the deal associated with the creative. */ + dealsId?: string; + } + interface CreativeStatusRow { + /** The number of bids with the specified status. */ + bidCount?: MetricValue; + /** + * The ID of the creative status. + * See [creative-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/creative-status-codes). + */ + creativeStatusId?: number; + /** The values of all dimensions associated with metric values in this row. */ + rowDimensions?: RowDimensions; + } + interface Date { + /** + * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 + * if specifying a year/month where the day is not significant. + */ + day?: number; + /** Month of year. Must be from 1 to 12. */ + month?: number; + /** + * Year of date. Must be from 1 to 9999, or 0 if specifying a date without + * a year. + */ + year?: number; + } + interface Disapproval { + /** Additional details about the reason for disapproval. */ + details?: string[]; + /** The categorized reason for disapproval. */ + reason?: string; + } + interface FilterSet { + /** + * An absolute date range, defined by a start date and an end date. + * Interpreted relative to Pacific time zone. + */ + absoluteDateRange?: AbsoluteDateRange; + /** The ID of the buyer account on which to filter; optional. */ + buyerAccountId?: string; + /** The ID of the creative on which to filter; optional. */ + creativeId?: string; + /** The ID of the deal on which to filter; optional. */ + dealId?: string; + /** The environment on which to filter; optional. */ + environment?: string; + /** + * The ID of the filter set; unique within the account of the filter set + * owner. + * The value of this field is ignored in create operations. + */ + filterSetId?: string; + /** The format on which to filter; optional. */ + format?: string; + /** + * The account ID of the buyer who owns this filter set. + * The value of this field is ignored in create operations. + */ + ownerAccountId?: string; + /** + * The list of platforms on which to filter; may be empty. The filters + * represented by multiple platforms are ORed together (i.e. if non-empty, + * results must match any one of the platforms). + */ + platforms?: string[]; + /** + * An open-ended realtime time range, defined by the aggregation start + * timestamp. + */ + realtimeTimeRange?: RealtimeTimeRange; + /** + * A relative date range, defined by an offset from today and a duration. + * Interpreted relative to Pacific time zone. + */ + relativeDateRange?: RelativeDateRange; + /** + * The list of IDs of the seller (publisher) networks on which to filter; + * may be empty. The filters represented by multiple seller network IDs are + * ORed together (i.e. if non-empty, results must match any one of the + * publisher networks). + * See [seller-network-ids](https://developers.google.com/ad-exchange/rtb/downloads/seller-network-ids) + * file for the set of existing seller network IDs. + */ + sellerNetworkIds?: number[]; + /** + * The granularity of time intervals if a time series breakdown is desired; + * optional. + */ + timeSeriesGranularity?: string; + } + interface FilteredBidCreativeRow { + /** The number of bids with the specified creative. */ + bidCount?: MetricValue; + /** The ID of the creative. */ + creativeId?: string; + /** The values of all dimensions associated with metric values in this row. */ + rowDimensions?: RowDimensions; + } + interface FilteredBidDetailRow { + /** The number of bids with the specified detail. */ + bidCount?: MetricValue; + /** + * The ID of the detail. The associated value can be looked up in the + * dictionary file corresponding to the DetailType in the response message. + */ + detailId?: number; + /** The values of all dimensions associated with metric values in this row. */ + rowDimensions?: RowDimensions; + } + interface FilteringStats { + /** + * The day during which the data was collected. + * The data is collected from 00:00:00 to 23:59:59 PT. + * During switches from PST to PDT and back, the day may + * contain 23 or 25 hours of data instead of the usual 24. + */ + date?: Date; + /** The set of filtering reasons for this date. */ + reasons?: Reason[]; + } + interface HtmlContent { + /** The height of the HTML snippet in pixels. */ + height?: number; + /** The HTML snippet that displays the ad when inserted in the web page. */ + snippet?: string; + /** The width of the HTML snippet in pixels. */ + width?: number; + } + interface Image { + /** Image height in pixels. */ + height?: number; + /** The URL of the image. */ + url?: string; + /** Image width in pixels. */ + width?: number; + } + interface ImpressionMetricsRow { + /** + * The number of impressions available to the buyer on Ad Exchange. + * In some cases this value may be unavailable. + */ + availableImpressions?: MetricValue; + /** + * The number of impressions for which Ad Exchange sent the buyer a bid + * request. + */ + bidRequests?: MetricValue; + /** The number of impressions that match the buyer's inventory pretargeting. */ + inventoryMatches?: MetricValue; + /** + * The number of impressions for which Ad Exchange received a response from + * the buyer that contained at least one applicable bid. + */ + responsesWithBids?: MetricValue; + /** The values of all dimensions associated with metric values in this row. */ + rowDimensions?: RowDimensions; + /** + * The number of impressions for which the buyer successfully sent a response + * to Ad Exchange. + */ + successfulResponses?: MetricValue; + } + interface ListBidMetricsResponse { + /** List of rows, each containing a set of bid metrics. */ + bidMetricsRows?: BidMetricsRow[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListBidMetricsRequest.pageToken + * field in the subsequent call to the + * accounts.filterSets.bidMetrics.list + * method to retrieve the next page of results. + */ + nextPageToken?: string; + } + interface ListBidResponseErrorsResponse { + /** List of rows, with counts of bid responses aggregated by callout status. */ + calloutStatusRows?: CalloutStatusRow[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListBidResponseErrorsRequest.pageToken + * field in the subsequent call to the + * accounts.filterSets.bidResponseErrors.list + * method to retrieve the next page of results. + */ + nextPageToken?: string; + } + interface ListBidResponsesWithoutBidsResponse { + /** + * List of rows, with counts of bid responses without bids aggregated by + * status. + */ + bidResponseWithoutBidsStatusRows?: BidResponseWithoutBidsStatusRow[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListBidResponsesWithoutBidsRequest.pageToken + * field in the subsequent call to the + * accounts.filterSets.bidResponsesWithoutBids.list + * method to retrieve the next page of results. + */ + nextPageToken?: string; + } + interface ListClientUserInvitationsResponse { + /** The returned list of client users. */ + invitations?: ClientUserInvitation[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListClientUserInvitationsRequest.pageToken + * field in the subsequent call to the + * clients.invitations.list + * method to retrieve the next + * page of results. + */ + nextPageToken?: string; + } + interface ListClientUsersResponse { + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListClientUsersRequest.pageToken + * field in the subsequent call to the + * clients.invitations.list + * method to retrieve the next + * page of results. + */ + nextPageToken?: string; + /** The returned list of client users. */ + users?: ClientUser[]; + } + interface ListClientsResponse { + /** The returned list of clients. */ + clients?: Client[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListClientsRequest.pageToken + * field in the subsequent call to the + * accounts.clients.list method + * to retrieve the next page of results. + */ + nextPageToken?: string; + } + interface ListCreativeStatusBreakdownByCreativeResponse { + /** + * List of rows, with counts of bids with a given creative status aggregated + * by creative. + */ + filteredBidCreativeRows?: FilteredBidCreativeRow[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListCreativeStatusBreakdownByCreativeRequest.pageToken + * field in the subsequent call to the + * accounts.filterSets.filteredBids.creatives.list + * method to retrieve the next page of results. + */ + nextPageToken?: string; + } + interface ListCreativeStatusBreakdownByDetailResponse { + /** The type of detail that the detail IDs represent. */ + detailType?: string; + /** + * List of rows, with counts of bids with a given creative status aggregated + * by detail. + */ + filteredBidDetailRows?: FilteredBidDetailRow[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListCreativeStatusBreakdownByDetailRequest.pageToken + * field in the subsequent call to the + * accounts.filterSets.filteredBids.details.list + * method to retrieve the next page of results. + */ + nextPageToken?: string; + } + interface ListCreativesResponse { + /** The list of creatives. */ + creatives?: Creative[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListCreativesRequest.page_token + * field in the subsequent call to `ListCreatives` method to retrieve the next + * page of results. + */ + nextPageToken?: string; + } + interface ListDealAssociationsResponse { + /** The list of associations. */ + associations?: CreativeDealAssociation[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListDealAssociationsRequest.page_token + * field in the subsequent call to 'ListDealAssociation' method to retrieve + * the next page of results. + */ + nextPageToken?: string; + } + interface ListFilterSetsResponse { + /** The filter sets belonging to the buyer. */ + filterSets?: FilterSet[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListFilterSetsRequest.pageToken + * field in the subsequent call to the + * accounts.filterSets.list + * method to retrieve the next page of results. + */ + nextPageToken?: string; + } + interface ListFilteredBidRequestsResponse { + /** + * List of rows, with counts of filtered bid requests aggregated by callout + * status. + */ + calloutStatusRows?: CalloutStatusRow[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListFilteredBidRequestsRequest.pageToken + * field in the subsequent call to the + * accounts.filterSets.filteredBidRequests.list + * method to retrieve the next page of results. + */ + nextPageToken?: string; + } + interface ListFilteredBidsResponse { + /** + * List of rows, with counts of filtered bids aggregated by filtering reason + * (i.e. creative status). + */ + creativeStatusRows?: CreativeStatusRow[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListFilteredBidsRequest.pageToken + * field in the subsequent call to the + * accounts.filterSets.filteredBids.list + * method to retrieve the next page of results. + */ + nextPageToken?: string; + } + interface ListImpressionMetricsResponse { + /** List of rows, each containing a set of impression metrics. */ + impressionMetricsRows?: ImpressionMetricsRow[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListImpressionMetricsRequest.pageToken + * field in the subsequent call to the + * accounts.filterSets.impressionMetrics.list + * method to retrieve the next page of results. + */ + nextPageToken?: string; + } + interface ListLosingBidsResponse { + /** + * List of rows, with counts of losing bids aggregated by loss reason (i.e. + * creative status). + */ + creativeStatusRows?: CreativeStatusRow[]; + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListLosingBidsRequest.pageToken + * field in the subsequent call to the + * accounts.filterSets.losingBids.list + * method to retrieve the next page of results. + */ + nextPageToken?: string; + } + interface ListNonBillableWinningBidsResponse { + /** + * A token to retrieve the next page of results. + * Pass this value in the + * ListNonBillableWinningBidsRequest.pageToken + * field in the subsequent call to the + * accounts.filterSets.nonBillableWinningBids.list + * method to retrieve the next page of results. + */ + nextPageToken?: string; + /** List of rows, with counts of bids not billed aggregated by reason. */ + nonBillableWinningBidStatusRows?: NonBillableWinningBidStatusRow[]; + } + interface LocationContext { + /** + * IDs representing the geo location for this context. + * Please refer to the + * [geo-table.csv](https://storage.googleapis.com/adx-rtb-dictionaries/geo-table.csv) + * file for different geo criteria IDs. + */ + geoCriteriaIds?: number[]; + } + interface MetricValue { + /** The expected value of the metric. */ + value?: string; + /** + * The variance (i.e. square of the standard deviation) of the metric value. + * If value is exact, variance is 0. + * Can be used to calculate margin of error as a percentage of value, using + * the following formula, where Z is the standard constant that depends on the + * desired size of the confidence interval (e.g. for 90% confidence interval, + * use Z = 1.645): + * + * marginOfError = 100 * Z * sqrt(variance) / value + */ + variance?: string; + } + interface NativeContent { + /** The name of the advertiser or sponsor, to be displayed in the ad creative. */ + advertiserName?: string; + /** The app icon, for app download ads. */ + appIcon?: Image; + /** A long description of the ad. */ + body?: string; + /** A label for the button that the user is supposed to click. */ + callToAction?: string; + /** The URL that the browser/SDK will load when the user clicks the ad. */ + clickLinkUrl?: string; + /** The URL to use for click tracking. */ + clickTrackingUrl?: string; + /** A short title for the ad. */ + headline?: string; + /** A large image. */ + image?: Image; + /** A smaller image, for the advertiser's logo. */ + logo?: Image; + /** The price of the promoted app including currency info. */ + priceDisplayText?: string; + /** The app rating in the app store. Must be in the range [0-5]. */ + starRating?: number; + /** The URL to the app store to purchase/download the promoted app. */ + storeUrl?: string; + /** The URL to fetch a native video ad. */ + videoUrl?: string; + } + interface NonBillableWinningBidStatusRow { + /** The number of bids with the specified status. */ + bidCount?: MetricValue; + /** The values of all dimensions associated with metric values in this row. */ + rowDimensions?: RowDimensions; + /** The status specifying why the winning bids were not billed. */ + status?: string; + } + interface PlatformContext { + /** The platforms this restriction applies to. */ + platforms?: string[]; + } + interface RealtimeTimeRange { + /** The start timestamp of the real-time RTB metrics aggregation. */ + startTimestamp?: string; + } + interface Reason { + /** + * The number of times the creative was filtered for the status. The + * count is aggregated across all publishers on the exchange. + */ + count?: string; + /** + * The filtering status code. Please refer to the + * [creative-status-codes.txt](https://storage.googleapis.com/adx-rtb-dictionaries/creative-status-codes.txt) + * file for different statuses. + */ + status?: number; + } + interface RelativeDateRange { + /** + * The number of days in the requested date range. E.g. for a range spanning + * today, 1. For a range spanning the last 7 days, 7. + */ + durationDays?: number; + /** + * The end date of the filter set, specified as the number of days before + * today. E.g. for a range where the last date is today, 0. + */ + offsetDays?: number; + } + interface RemoveDealAssociationRequest { + /** The association between a creative and a deal that should be removed. */ + association?: CreativeDealAssociation; + } + interface RowDimensions { + /** The time interval that this row represents. */ + timeInterval?: TimeInterval; + } + interface SecurityContext { + /** The security types in this context. */ + securities?: string[]; + } + interface ServingContext { + /** Matches all contexts. */ + all?: string; + /** Matches impressions for a particular app type. */ + appType?: AppContext; + /** Matches impressions for a particular auction type. */ + auctionType?: AuctionContext; + /** + * Matches impressions coming from users *or* publishers in a specific + * location. + */ + location?: LocationContext; + /** Matches impressions coming from a particular platform. */ + platform?: PlatformContext; + /** Matches impressions for a particular security type. */ + securityType?: SecurityContext; + } + interface ServingRestriction { + /** The contexts for the restriction. */ + contexts?: ServingContext[]; + /** + * Any disapprovals bound to this restriction. + * Only present if status=DISAPPROVED. + * Can be used to filter the response of the + * creatives.list + * method. + */ + disapprovalReasons?: Disapproval[]; + /** + * The status of the creative in this context (for example, it has been + * explicitly disapproved or is pending review). + */ + status?: string; + } + interface TimeInterval { + /** + * The timestamp marking the end of the range (exclusive) for which data is + * included. + */ + endTime?: string; + /** + * The timestamp marking the start of the range (inclusive) for which data is + * included. + */ + startTime?: string; + } + interface VideoContent { + /** The URL to fetch a video ad. */ + videoUrl?: string; + } + interface WatchCreativeRequest { + /** + * The Pub/Sub topic to publish notifications to. + * This topic must already exist and must give permission to + * ad-exchange-buyside-reports@google.com to write to the topic. + * This should be the full resource name in + * "projects/{project_id}/topics/{topic_id}" format. + */ + topic?: string; + } + interface InvitationsResource { + /** + * Creates and sends out an email invitation to access + * an Ad Exchange client buyer account. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Numerical account ID of the client's sponsor buyer. (required) */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Numerical account ID of the client buyer that the user + * should be associated with. (required) + */ + clientAccountId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Retrieves an existing client user invitation. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Numerical account ID of the client's sponsor buyer. (required) */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Numerical account ID of the client buyer that the user invitation + * to be retrieved is associated with. (required) + */ + clientAccountId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Numerical identifier of the user invitation to retrieve. (required) */ + invitationId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists all the client users invitations for a client + * with a given account ID. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Numerical account ID of the client's sponsor buyer. (required) */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Numerical account ID of the client buyer to list invitations for. + * (required) + * You must either specify a string representation of a + * numerical account identifier or the `-` character + * to list all the invitations for all the clients + * of a given sponsor buyer. + */ + clientAccountId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. Server may return fewer clients than requested. + * If unspecified, server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListClientUserInvitationsResponse.nextPageToken + * returned from the previous call to the + * clients.invitations.list + * method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface UsersResource { + /** Retrieves an existing client user. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Numerical account ID of the client's sponsor buyer. (required) */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Numerical account ID of the client buyer + * that the user to be retrieved is associated with. (required) + */ + clientAccountId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Numerical identifier of the user to retrieve. (required) */ + userId: string; + }): Request; + /** + * Lists all the known client users for a specified + * sponsor buyer account ID. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** + * Numerical account ID of the sponsor buyer of the client to list users for. + * (required) + */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The account ID of the client buyer to list users for. (required) + * You must specify either a string representation of a + * numerical account identifier or the `-` character + * to list all the client users for all the clients + * of a given sponsor buyer. + */ + clientAccountId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer clients than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListClientUsersResponse.nextPageToken + * returned from the previous call to the + * accounts.clients.users.list method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates an existing client user. + * Only the user status can be changed on update. + */ + update(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Numerical account ID of the client's sponsor buyer. (required) */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Numerical account ID of the client buyer that the user to be retrieved + * is associated with. (required) + */ + clientAccountId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Numerical identifier of the user to retrieve. (required) */ + userId: string; + }): Request; + } + interface ClientsResource { + /** Creates a new client buyer. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** + * Unique numerical account ID for the buyer of which the client buyer + * is a customer; the sponsor buyer to create a client for. (required) + */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Gets a client buyer with a given client account ID. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Numerical account ID of the client's sponsor buyer. (required) */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Numerical account ID of the client buyer to retrieve. (required) */ + clientAccountId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists all the clients for the current sponsor buyer. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Unique numerical account ID of the sponsor buyer to list the clients for. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer clients than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListClientsResponse.nextPageToken + * returned from the previous call to the + * accounts.clients.list method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Updates an existing client buyer. */ + update(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** + * Unique numerical account ID for the buyer of which the client buyer + * is a customer; the sponsor buyer to update a client for. (required) + */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Unique numerical account ID of the client to update. (required) */ + clientAccountId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + invitations: InvitationsResource; + users: UsersResource; + } + interface DealAssociationsResource { + /** Associate an existing deal with a creative. */ + add(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** The account the creative belongs to. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The ID of the creative associated with the deal. */ + creativeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** List all creative-deal associations. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** + * The account to list the associations from. + * Specify "-" to list all creatives the current user has access to. + */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The creative ID to list the associations from. + * Specify "-" to list all creatives under the above account. + */ + creativeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. Server may return fewer associations than requested. + * If unspecified, server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListDealAssociationsResponse.next_page_token + * returned from the previous call to 'ListDealAssociations' method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * An optional query string to filter deal associations. If no filter is + * specified, all associations will be returned. + * Supported queries are: + *
      + *
    • accountId=account_id_string + *
    • creativeId=creative_id_string + *
    • dealsId=deals_id_string + *
    • dealsStatus:{approved, conditionally_approved, disapproved, + * not_checked} + *
    • openAuctionStatus:{approved, conditionally_approved, disapproved, + * not_checked} + *
    + * Example: 'dealsId=12345 AND dealsStatus:disapproved' + */ + query?: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Remove the association between a deal and a creative. */ + remove(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** The account the creative belongs to. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The ID of the creative associated with the deal. */ + creativeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + } + interface CreativesResource { + /** Creates a creative. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** + * The account that this creative belongs to. + * Can be used to filter the response of the + * creatives.list + * method. + */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Indicates if multiple creatives can share an ID or not. Default is + * NO_DUPLICATES (one ID per creative). + */ + duplicateIdMode?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Gets a creative. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** The account the creative belongs to. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The ID of the creative to retrieve. */ + creativeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists creatives. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** + * The account to list the creatives from. + * Specify "-" to list all creatives the current user has access to. + */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer creatives than requested + * (due to timeout constraint) even if more are available via another call. + * If unspecified, server will pick an appropriate default. + * Acceptable values are 1 to 1000, inclusive. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListCreativesResponse.next_page_token + * returned from the previous call to 'ListCreatives' method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * An optional query string to filter creatives. If no filter is specified, + * all active creatives will be returned. + * Supported queries are: + *
      + *
    • accountId=account_id_string + *
    • creativeId=creative_id_string + *
    • dealsStatus: {approved, conditionally_approved, disapproved, + * not_checked} + *
    • openAuctionStatus: {approved, conditionally_approved, disapproved, + * not_checked} + *
    • attribute: {a numeric attribute from the list of attributes} + *
    • disapprovalReason: {a reason from + * DisapprovalReason + *
    + * Example: 'accountId=12345 AND (dealsStatus:disapproved AND + * disapprovalReason:unacceptable_content) OR attribute:47' + */ + query?: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Stops watching a creative. Will stop push notifications being sent to the + * topics when the creative changes status. + */ + stopWatching(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** The account of the creative to stop notifications for. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The creative ID of the creative to stop notifications for. + * Specify "-" to specify stopping account level notifications. + */ + creativeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Updates a creative. */ + update(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** + * The account that this creative belongs to. + * Can be used to filter the response of the + * creatives.list + * method. + */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The buyer-defined creative ID of this creative. + * Can be used to filter the response of the + * creatives.list + * method. + */ + creativeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Watches a creative. Will result in push notifications being sent to the + * topic when the creative changes status. + */ + watch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** The account of the creative to watch. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The creative ID to watch for status changes. + * Specify "-" to watch all creatives under the above account. + * If both creative-level and account-level notifications are + * sent, only a single notification will be sent to the + * creative-level notification topic. + */ + creativeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + dealAssociations: DealAssociationsResource; + } + interface BidMetricsResource { + /** Lists all metrics that are measured in terms of number of bids. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the filter set to apply. */ + filterSetId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer results than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListBidMetricsResponse.nextPageToken + * returned from the previous call to the + * accounts.filterSets.bidMetrics.list + * method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface BidResponseErrorsResource { + /** + * List all errors that occurred in bid responses, with the number of bid + * responses affected for each reason. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the filter set to apply. */ + filterSetId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer results than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListBidResponseErrorsResponse.nextPageToken + * returned from the previous call to the + * accounts.filterSets.bidResponseErrors.list + * method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface BidResponsesWithoutBidsResource { + /** + * List all reasons for which bid responses were considered to have no + * applicable bids, with the number of bid responses affected for each reason. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the filter set to apply. */ + filterSetId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer results than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListBidResponsesWithoutBidsResponse.nextPageToken + * returned from the previous call to the + * accounts.filterSets.bidResponsesWithoutBids.list + * method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface FilteredBidRequestsResource { + /** + * List all reasons that caused a bid request not to be sent for an + * impression, with the number of bid requests not sent for each reason. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the filter set to apply. */ + filterSetId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer results than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListFilteredBidRequestsResponse.nextPageToken + * returned from the previous call to the + * accounts.filterSets.filteredBidRequests.list + * method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface CreativesResource { + /** + * List all creatives associated with a specific reason for which bids were + * filtered, with the number of bids filtered for each creative. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The ID of the creative status for which to retrieve a breakdown by + * creative. + * See + * [creative-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/creative-status-codes). + */ + creativeStatusId: number; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the filter set to apply. */ + filterSetId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer results than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListCreativeStatusBreakdownByCreativeResponse.nextPageToken + * returned from the previous call to the + * accounts.filterSets.filteredBids.creatives.list + * method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface DetailsResource { + /** + * List all details associated with a specific reason for which bids were + * filtered, with the number of bids filtered for each detail. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The ID of the creative status for which to retrieve a breakdown by detail. + * See + * [creative-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/creative-status-codes). + * Details are only available for statuses 10, 14, 15, 17, 18, 19, 86, and 87. + */ + creativeStatusId: number; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the filter set to apply. */ + filterSetId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer results than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListCreativeStatusBreakdownByDetailResponse.nextPageToken + * returned from the previous call to the + * accounts.filterSets.filteredBids.details.list + * method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface FilteredBidsResource { + /** + * List all reasons for which bids were filtered, with the number of bids + * filtered for each reason. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the filter set to apply. */ + filterSetId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer results than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListFilteredBidsResponse.nextPageToken + * returned from the previous call to the + * accounts.filterSets.filteredBids.list + * method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + creatives: CreativesResource; + details: DetailsResource; + } + interface ImpressionMetricsResource { + /** Lists all metrics that are measured in terms of number of impressions. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the filter set to apply. */ + filterSetId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer results than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListImpressionMetricsResponse.nextPageToken + * returned from the previous call to the + * accounts.filterSets.impressionMetrics.list + * method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface LosingBidsResource { + /** + * List all reasons for which bids lost in the auction, with the number of + * bids that lost for each reason. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the filter set to apply. */ + filterSetId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer results than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListLosingBidsResponse.nextPageToken + * returned from the previous call to the + * accounts.filterSets.losingBids.list + * method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface NonBillableWinningBidsResource { + /** + * List all reasons for which winning bids were not billable, with the number + * of bids not billed for each reason. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the filter set to apply. */ + filterSetId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer results than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListNonBillableWinningBidsResponse.nextPageToken + * returned from the previous call to the + * accounts.filterSets.nonBillableWinningBids.list + * method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface FilterSetsResource { + /** Creates the specified filter set for the account with the given account ID. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Whether the filter set is transient, or should be persisted indefinitely. + * By default, filter sets are not transient. + * If transient, it will be available for at least 1 hour after creation. + */ + isTransient?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes the requested filter set from the account with the given account + * ID. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the filter set to delete. */ + filterSetId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Retrieves the requested filter set for the account with the given account + * ID. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the filter set to get. */ + filterSetId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists all filter sets for the account with the given account ID. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Account ID of the buyer. */ + accountId: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The server may return fewer results than requested. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * A token identifying a page of results the server should return. + * Typically, this is the value of + * ListFilterSetsResponse.nextPageToken + * returned from the previous call to the + * accounts.filterSets.list + * method. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + bidMetrics: BidMetricsResource; + bidResponseErrors: BidResponseErrorsResource; + bidResponsesWithoutBids: BidResponsesWithoutBidsResource; + filteredBidRequests: FilteredBidRequestsResource; + filteredBids: FilteredBidsResource; + impressionMetrics: ImpressionMetricsResource; + losingBids: LosingBidsResource; + nonBillableWinningBids: NonBillableWinningBidsResource; + } + interface AccountsResource { + clients: ClientsResource; + creatives: CreativesResource; + filterSets: FilterSetsResource; + } + } +} diff --git a/types/gapi.client.adexchangebuyer2/readme.md b/types/gapi.client.adexchangebuyer2/readme.md new file mode 100644 index 0000000000..92b3f3fb30 --- /dev/null +++ b/types/gapi.client.adexchangebuyer2/readme.md @@ -0,0 +1,54 @@ +# TypeScript typings for Ad Exchange Buyer API II v2beta1 +Accesses the latest features for managing Ad Exchange accounts, Real-Time Bidding configurations and auction metrics, and Marketplace programmatic deals. +For detailed description please check [documentation](https://developers.google.com/ad-exchange/buyer-rest/reference/rest/). + +## Installing + +Install typings for Ad Exchange Buyer API II: +``` +npm install @types/gapi.client.adexchangebuyer2@v2beta1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('adexchangebuyer2', 'v2beta1', () => { + // now we can use gapi.client.adexchangebuyer2 + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // Manage your Ad Exchange buyer account configuration + 'https://www.googleapis.com/auth/adexchange.buyer', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Ad Exchange Buyer API II resources: + +```typescript +``` \ No newline at end of file diff --git a/types/gapi.client.adexchangebuyer2/tsconfig.json b/types/gapi.client.adexchangebuyer2/tsconfig.json new file mode 100644 index 0000000000..453ca167ee --- /dev/null +++ b/types/gapi.client.adexchangebuyer2/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.adexchangebuyer2-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.adexchangebuyer2/tslint.json b/types/gapi.client.adexchangebuyer2/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.adexchangebuyer2/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.adexchangeseller/gapi.client.adexchangeseller-tests.ts b/types/gapi.client.adexchangeseller/gapi.client.adexchangeseller-tests.ts new file mode 100644 index 0000000000..69d7e2feec --- /dev/null +++ b/types/gapi.client.adexchangeseller/gapi.client.adexchangeseller-tests.ts @@ -0,0 +1,43 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('adexchangeseller', 'v2.0', () => { + /** now we can use gapi.client.adexchangeseller */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your Ad Exchange data */ + 'https://www.googleapis.com/auth/adexchange.seller', + /** View your Ad Exchange data */ + 'https://www.googleapis.com/auth/adexchange.seller.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Get information about the selected Ad Exchange account. */ + await gapi.client.accounts.get({ + accountId: "accountId", + }); + /** List all accounts available to this Ad Exchange account. */ + await gapi.client.accounts.list({ + maxResults: 1, + pageToken: "pageToken", + }); + } +}); diff --git a/types/gapi.client.adexchangeseller/index.d.ts b/types/gapi.client.adexchangeseller/index.d.ts new file mode 100644 index 0000000000..dd327ed5ae --- /dev/null +++ b/types/gapi.client.adexchangeseller/index.d.ts @@ -0,0 +1,664 @@ +// Type definitions for Google Ad Exchange Seller API v2.0 2.0 +// Project: https://developers.google.com/ad-exchange/seller-rest/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/adexchangeseller/v2.0/rest + +/// + +declare namespace gapi.client { + /** Load Ad Exchange Seller API v2.0 */ + function load(name: "adexchangeseller", version: "v2.0"): PromiseLike; + function load(name: "adexchangeseller", version: "v2.0", callback: () => any): void; + + const accounts: adexchangeseller.AccountsResource; + + namespace adexchangeseller { + interface Account { + /** Unique identifier of this account. */ + id?: string; + /** Kind of resource this is, in this case adexchangeseller#account. */ + kind?: string; + /** Name of this account. */ + name?: string; + } + interface Accounts { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The accounts returned in this list response. */ + items?: Account[]; + /** Kind of list this is, in this case adexchangeseller#accounts. */ + kind?: string; + /** Continuation token used to page through accounts. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface AdClient { + /** Whether this ad client is opted in to ARC. */ + arcOptIn?: boolean; + /** Unique identifier of this ad client. */ + id?: string; + /** Kind of resource this is, in this case adexchangeseller#adClient. */ + kind?: string; + /** This ad client's product code, which corresponds to the PRODUCT_CODE report dimension. */ + productCode?: string; + /** Whether this ad client supports being reported on. */ + supportsReporting?: boolean; + } + interface AdClients { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The ad clients returned in this list response. */ + items?: AdClient[]; + /** Kind of list this is, in this case adexchangeseller#adClients. */ + kind?: string; + /** Continuation token used to page through ad clients. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface Alert { + /** Unique identifier of this alert. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */ + id?: string; + /** Kind of resource this is, in this case adexchangeseller#alert. */ + kind?: string; + /** The localized alert message. */ + message?: string; + /** Severity of this alert. Possible values: INFO, WARNING, SEVERE. */ + severity?: string; + /** + * Type of this alert. Possible values: SELF_HOLD, MIGRATED_TO_BILLING3, ADDRESS_PIN_VERIFICATION, PHONE_PIN_VERIFICATION, CORPORATE_ENTITY, + * GRAYLISTED_PUBLISHER, API_HOLD. + */ + type?: string; + } + interface Alerts { + /** The alerts returned in this list response. */ + items?: Alert[]; + /** Kind of list this is, in this case adexchangeseller#alerts. */ + kind?: string; + } + interface CustomChannel { + /** Code of this custom channel, not necessarily unique across ad clients. */ + code?: string; + /** Unique identifier of this custom channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */ + id?: string; + /** Kind of resource this is, in this case adexchangeseller#customChannel. */ + kind?: string; + /** Name of this custom channel. */ + name?: string; + /** The targeting information of this custom channel, if activated. */ + targetingInfo?: { + /** The name used to describe this channel externally. */ + adsAppearOn?: string; + /** The external description of the channel. */ + description?: string; + /** + * The locations in which ads appear. (Only valid for content and mobile content ads). Acceptable values for content ads are: TOP_LEFT, TOP_CENTER, + * TOP_RIGHT, MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, BOTTOM_RIGHT, MULTIPLE_LOCATIONS. Acceptable values for mobile content + * ads are: TOP, MIDDLE, BOTTOM, MULTIPLE_LOCATIONS. + */ + location?: string; + /** The language of the sites ads will be displayed on. */ + siteLanguage?: string; + }; + } + interface CustomChannels { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The custom channels returned in this list response. */ + items?: CustomChannel[]; + /** Kind of list this is, in this case adexchangeseller#customChannels. */ + kind?: string; + /** Continuation token used to page through custom channels. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface Metadata { + items?: ReportingMetadataEntry[]; + /** Kind of list this is, in this case adexchangeseller#metadata. */ + kind?: string; + } + interface PreferredDeal { + /** The name of the advertiser this deal is for. */ + advertiserName?: string; + /** The name of the buyer network this deal is for. */ + buyerNetworkName?: string; + /** The currency code that applies to the fixed_cpm value. If not set then assumed to be USD. */ + currencyCode?: string; + /** Time when this deal stops being active in seconds since the epoch (GMT). If not set then this deal is valid until manually disabled by the publisher. */ + endTime?: string; + /** + * The fixed price for this preferred deal. In cpm micros of currency according to currencyCode. If set, then this preferred deal is eligible for the + * fixed price tier of buying (highest priority, pay exactly the configured fixed price). + */ + fixedCpm?: string; + /** Unique identifier of this preferred deal. */ + id?: string; + /** Kind of resource this is, in this case adexchangeseller#preferredDeal. */ + kind?: string; + /** Time when this deal becomes active in seconds since the epoch (GMT). If not set then this deal is active immediately upon creation. */ + startTime?: string; + } + interface PreferredDeals { + /** The preferred deals returned in this list response. */ + items?: PreferredDeal[]; + /** Kind of list this is, in this case adexchangeseller#preferredDeals. */ + kind?: string; + } + interface Report { + /** The averages of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty. */ + averages?: string[]; + /** + * The header information of the columns requested in the report. This is a list of headers; one for each dimension in the request, followed by one for + * each metric in the request. + */ + headers?: Array<{ + /** The currency of this column. Only present if the header type is METRIC_CURRENCY. */ + currency?: string; + /** The name of the header. */ + name?: string; + /** The type of the header; one of DIMENSION, METRIC_TALLY, METRIC_RATIO, or METRIC_CURRENCY. */ + type?: string; + }>; + /** Kind this is, in this case adexchangeseller#report. */ + kind?: string; + /** + * The output rows of the report. Each row is a list of cells; one for each dimension in the request, followed by one for each metric in the request. The + * dimension cells contain strings, and the metric cells contain numbers. + */ + rows?: string[][]; + /** + * The total number of rows matched by the report request. Fewer rows may be returned in the response due to being limited by the row count requested or + * the report row limit. + */ + totalMatchedRows?: string; + /** The totals of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty. */ + totals?: string[]; + /** Any warnings associated with generation of the report. */ + warnings?: string[]; + } + interface ReportingMetadataEntry { + /** + * For metrics this is a list of dimension IDs which the metric is compatible with, for dimensions it is a list of compatibility groups the dimension + * belongs to. + */ + compatibleDimensions?: string[]; + /** The names of the metrics the dimension or metric this reporting metadata entry describes is compatible with. */ + compatibleMetrics?: string[]; + /** Unique identifier of this reporting metadata entry, corresponding to the name of the appropriate dimension or metric. */ + id?: string; + /** Kind of resource this is, in this case adexchangeseller#reportingMetadataEntry. */ + kind?: string; + /** + * The names of the dimensions which the dimension or metric this reporting metadata entry describes requires to also be present in order for the report + * to be valid. Omitting these will not cause an error or warning, but may result in data which cannot be correctly interpreted. + */ + requiredDimensions?: string[]; + /** + * The names of the metrics which the dimension or metric this reporting metadata entry describes requires to also be present in order for the report to + * be valid. Omitting these will not cause an error or warning, but may result in data which cannot be correctly interpreted. + */ + requiredMetrics?: string[]; + /** The codes of the projects supported by the dimension or metric this reporting metadata entry describes. */ + supportedProducts?: string[]; + } + interface SavedReport { + /** Unique identifier of this saved report. */ + id?: string; + /** Kind of resource this is, in this case adexchangeseller#savedReport. */ + kind?: string; + /** This saved report's name. */ + name?: string; + } + interface SavedReports { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The saved reports returned in this list response. */ + items?: SavedReport[]; + /** Kind of list this is, in this case adexchangeseller#savedReports. */ + kind?: string; + /** Continuation token used to page through saved reports. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface UrlChannel { + /** Unique identifier of this URL channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */ + id?: string; + /** Kind of resource this is, in this case adexchangeseller#urlChannel. */ + kind?: string; + /** URL Pattern of this URL channel. Does not include "http://" or "https://". Example: www.example.com/home */ + urlPattern?: string; + } + interface UrlChannels { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The URL channels returned in this list response. */ + items?: UrlChannel[]; + /** Kind of list this is, in this case adexchangeseller#urlChannels. */ + kind?: string; + /** Continuation token used to page through URL channels. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface AdclientsResource { + /** List all ad clients in this Ad Exchange account. */ + list(request: { + /** Account to which the ad client belongs. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of ad clients to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AlertsResource { + /** List the alerts for this Ad Exchange account. */ + list(request: { + /** Account owning the alerts. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used + * if the supplied locale is invalid or unsupported. + */ + locale?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CustomchannelsResource { + /** Get the specified custom channel from the specified ad client. */ + get(request: { + /** Account to which the ad client belongs. */ + accountId: string; + /** Ad client which contains the custom channel. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Custom channel to retrieve. */ + customChannelId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all custom channels in the specified ad client for this Ad Exchange account. */ + list(request: { + /** Account to which the ad client belongs. */ + accountId: string; + /** Ad client for which to list custom channels. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of custom channels to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DimensionsResource { + /** List the metadata for the dimensions available to this AdExchange account. */ + list(request: { + /** Account with visibility to the dimensions. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface MetricsResource { + /** List the metadata for the metrics available to this AdExchange account. */ + list(request: { + /** Account with visibility to the metrics. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface MetadataResource { + dimensions: DimensionsResource; + metrics: MetricsResource; + } + interface PreferreddealsResource { + /** Get information about the selected Ad Exchange Preferred Deal. */ + get(request: { + /** Account owning the deal. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Preferred deal to get information about. */ + dealId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List the preferred deals for this Ad Exchange account. */ + list(request: { + /** Account owning the deals. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SavedResource { + /** Generate an Ad Exchange report based on the saved report ID sent in the query parameters. */ + generate(request: { + /** Account owning the saved report. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. */ + locale?: string; + /** The maximum number of rows of report data to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The saved report to retrieve. */ + savedReportId: string; + /** Index of the first row of report data to return. */ + startIndex?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all saved reports in this Ad Exchange account. */ + list(request: { + /** Account owning the saved reports. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of saved reports to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ReportsResource { + /** + * Generate an Ad Exchange report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format + * specify "alt=csv" as a query parameter. + */ + generate(request: { + /** Account which owns the generated report. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Dimensions to base the report on. */ + dimension?: string; + /** End of the date range to report on in "YYYY-MM-DD" format, inclusive. */ + endDate: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Filters to be run on the report. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. */ + locale?: string; + /** The maximum number of rows of report data to return. */ + maxResults?: number; + /** Numeric columns to include in the report. */ + metric?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no + * prefix is specified, the column is sorted ascending. + */ + sort?: string; + /** Start of the date range to report on in "YYYY-MM-DD" format, inclusive. */ + startDate: string; + /** Index of the first row of report data to return. */ + startIndex?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + saved: SavedResource; + } + interface UrlchannelsResource { + /** List all URL channels in the specified ad client for this Ad Exchange account. */ + list(request: { + /** Account to which the ad client belongs. */ + accountId: string; + /** Ad client for which to list URL channels. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of URL channels to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AccountsResource { + /** Get information about the selected Ad Exchange account. */ + get(request: { + /** Account to get information about. Tip: 'myaccount' is a valid ID. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all accounts available to this Ad Exchange account. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of accounts to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through accounts. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + adclients: AdclientsResource; + alerts: AlertsResource; + customchannels: CustomchannelsResource; + metadata: MetadataResource; + preferreddeals: PreferreddealsResource; + reports: ReportsResource; + urlchannels: UrlchannelsResource; + } + } +} diff --git a/types/gapi.client.adexchangeseller/readme.md b/types/gapi.client.adexchangeseller/readme.md new file mode 100644 index 0000000000..5519aa798f --- /dev/null +++ b/types/gapi.client.adexchangeseller/readme.md @@ -0,0 +1,67 @@ +# TypeScript typings for Ad Exchange Seller API v2.0 +Accesses the inventory of Ad Exchange seller users and generates reports. +For detailed description please check [documentation](https://developers.google.com/ad-exchange/seller-rest/). + +## Installing + +Install typings for Ad Exchange Seller API: +``` +npm install @types/gapi.client.adexchangeseller@v2.0 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('adexchangeseller', 'v2.0', () => { + // now we can use gapi.client.adexchangeseller + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your Ad Exchange data + 'https://www.googleapis.com/auth/adexchange.seller', + + // View your Ad Exchange data + 'https://www.googleapis.com/auth/adexchange.seller.readonly', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Ad Exchange Seller API resources: + +```typescript + +/* +Get information about the selected Ad Exchange account. +*/ +await gapi.client.accounts.get({ accountId: "accountId", }); + +/* +List all accounts available to this Ad Exchange account. +*/ +await gapi.client.accounts.list({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.adexchangeseller/tsconfig.json b/types/gapi.client.adexchangeseller/tsconfig.json new file mode 100644 index 0000000000..a38d57f5b8 --- /dev/null +++ b/types/gapi.client.adexchangeseller/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.adexchangeseller-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.adexchangeseller/tslint.json b/types/gapi.client.adexchangeseller/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.adexchangeseller/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.adexperiencereport/gapi.client.adexperiencereport-tests.ts b/types/gapi.client.adexperiencereport/gapi.client.adexperiencereport-tests.ts new file mode 100644 index 0000000000..f621a79da0 --- /dev/null +++ b/types/gapi.client.adexperiencereport/gapi.client.adexperiencereport-tests.ts @@ -0,0 +1,39 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('adexperiencereport', 'v1', () => { + /** now we can use gapi.client.adexperiencereport */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** Test scope for access to the Zoo service */ + 'https://www.googleapis.com/auth/xapi.zoo', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Gets a summary of the ad experience rating of a site. */ + await gapi.client.sites.get({ + name: "name", + }); + /** Lists sites with Ad Experience Report statuses of "Failing" or "Warning". */ + await gapi.client.violatingSites.list({ + }); + } +}); diff --git a/types/gapi.client.adexperiencereport/index.d.ts b/types/gapi.client.adexperiencereport/index.d.ts new file mode 100644 index 0000000000..8258568b1d --- /dev/null +++ b/types/gapi.client.adexperiencereport/index.d.ts @@ -0,0 +1,125 @@ +// Type definitions for Google Google Ad Experience Report API v1 1.0 +// Project: https://developers.google.com/ad-experience-report/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://adexperiencereport.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Google Ad Experience Report API v1 */ + function load(name: "adexperiencereport", version: "v1"): PromiseLike; + function load(name: "adexperiencereport", version: "v1", callback: () => any): void; + + const sites: adexperiencereport.SitesResource; + + const violatingSites: adexperiencereport.ViolatingSitesResource; + + namespace adexperiencereport { + interface PlatformSummary { + /** The status of the site reviewed for the Better Ads Standards. */ + betterAdsStatus?: string; + /** The date on which ad filtering begins. */ + enforcementTime?: string; + /** The ad filtering status of the site. */ + filterStatus?: string; + /** The last time that the site changed status. */ + lastChangeTime?: string; + /** The assigned regions for the site and platform. */ + region?: string[]; + /** A link that leads to a full ad experience report. */ + reportUrl?: string; + /** Whether the site is currently under review. */ + underReview?: boolean; + } + interface SiteSummaryResponse { + /** Summary for the desktop review of the site. */ + desktopSummary?: PlatformSummary; + /** Summary for the mobile review of the site. */ + mobileSummary?: PlatformSummary; + /** The name of the site reviewed. */ + reviewedSite?: string; + } + interface ViolatingSitesResponse { + /** A list of summaries of violating sites. */ + violatingSites?: SiteSummaryResponse[]; + } + interface SitesResource { + /** Gets a summary of the ad experience rating of a site. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The required site name. It should be the site property whose ad experiences + * may have been reviewed, and it should be URL-encoded. For example, + * sites/https%3A%2F%2Fwww.google.com. The server will return an error of + * BAD_REQUEST if this field is not filled in. Note that if the site property + * is not yet verified in Search Console, the reportUrl field returned by the + * API will lead to the verification page, prompting the user to go through + * that process before they can gain access to the Ad Experience Report. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface ViolatingSitesResource { + /** Lists sites with Ad Experience Report statuses of "Failing" or "Warning". */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.adexperiencereport/readme.md b/types/gapi.client.adexperiencereport/readme.md new file mode 100644 index 0000000000..fff8e09ccf --- /dev/null +++ b/types/gapi.client.adexperiencereport/readme.md @@ -0,0 +1,64 @@ +# TypeScript typings for Google Ad Experience Report API v1 +View Ad Experience Report data, and get a list of sites that have a significant number of annoying ads. +For detailed description please check [documentation](https://developers.google.com/ad-experience-report/). + +## Installing + +Install typings for Google Ad Experience Report API: +``` +npm install @types/gapi.client.adexperiencereport@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('adexperiencereport', 'v1', () => { + // now we can use gapi.client.adexperiencereport + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // Test scope for access to the Zoo service + 'https://www.googleapis.com/auth/xapi.zoo', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Ad Experience Report API resources: + +```typescript + +/* +Gets a summary of the ad experience rating of a site. +*/ +await gapi.client.sites.get({ name: "name", }); + +/* +Lists sites with Ad Experience Report statuses of "Failing" or "Warning". +*/ +await gapi.client.violatingSites.list({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.adexperiencereport/tsconfig.json b/types/gapi.client.adexperiencereport/tsconfig.json new file mode 100644 index 0000000000..968c080cf9 --- /dev/null +++ b/types/gapi.client.adexperiencereport/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.adexperiencereport-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.adexperiencereport/tslint.json b/types/gapi.client.adexperiencereport/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.adexperiencereport/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.admin/gapi.client.admin-tests.ts b/types/gapi.client.admin/gapi.client.admin-tests.ts new file mode 100644 index 0000000000..698cf0d218 --- /dev/null +++ b/types/gapi.client.admin/gapi.client.admin-tests.ts @@ -0,0 +1,80 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('admin', 'reports_v1', () => { + /** now we can use gapi.client.admin */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View audit reports for your G Suite domain */ + 'https://www.googleapis.com/auth/admin.reports.audit.readonly', + /** View usage reports for your G Suite domain */ + 'https://www.googleapis.com/auth/admin.reports.usage.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Retrieves a list of activities for a specific customer and application. */ + await gapi.client.activities.list({ + actorIpAddress: "actorIpAddress", + applicationName: "applicationName", + customerId: "customerId", + endTime: "endTime", + eventName: "eventName", + filters: "filters", + maxResults: 7, + pageToken: "pageToken", + startTime: "startTime", + userKey: "userKey", + }); + /** Push changes to activities */ + await gapi.client.activities.watch({ + actorIpAddress: "actorIpAddress", + applicationName: "applicationName", + customerId: "customerId", + endTime: "endTime", + eventName: "eventName", + filters: "filters", + maxResults: 7, + pageToken: "pageToken", + startTime: "startTime", + userKey: "userKey", + }); + /** Stop watching resources through this channel */ + await gapi.client.channels.stop({ + }); + /** Retrieves a report which is a collection of properties / statistics for a specific customer. */ + await gapi.client.customerUsageReports.get({ + customerId: "customerId", + date: "date", + pageToken: "pageToken", + parameters: "parameters", + }); + /** Retrieves a report which is a collection of properties / statistics for a set of users. */ + await gapi.client.userUsageReport.get({ + customerId: "customerId", + date: "date", + filters: "filters", + maxResults: 4, + pageToken: "pageToken", + parameters: "parameters", + userKey: "userKey", + }); + } +}); diff --git a/types/gapi.client.admin/index.d.ts b/types/gapi.client.admin/index.d.ts new file mode 100644 index 0000000000..9e82b6a06c --- /dev/null +++ b/types/gapi.client.admin/index.d.ts @@ -0,0 +1,349 @@ +// Type definitions for Google Admin Reports API reports_v1 1.0 +// Project: https://developers.google.com/admin-sdk/reports/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/admin/reports_v1/rest + +/// + +declare namespace gapi.client { + /** Load Admin Reports API reports_v1 */ + function load(name: "admin", version: "reports_v1"): PromiseLike; + function load(name: "admin", version: "reports_v1", callback: () => any): void; + + const activities: admin.ActivitiesResource; + + const channels: admin.ChannelsResource; + + const customerUsageReports: admin.CustomerUsageReportsResource; + + const userUsageReport: admin.UserUsageReportResource; + + namespace admin { + interface Activities { + /** ETag of the resource. */ + etag?: string; + /** Each record in read response. */ + items?: Activity[]; + /** Kind of list response this is. */ + kind?: string; + /** Token for retrieving the next page */ + nextPageToken?: string; + } + interface Activity { + /** User doing the action. */ + actor?: { + /** User or OAuth 2LO request. */ + callerType?: string; + /** Email address of the user. */ + email?: string; + /** For OAuth 2LO API requests, consumer_key of the requestor. */ + key?: string; + /** Obfuscated user id of the user. */ + profileId?: string; + }; + /** ETag of the entry. */ + etag?: string; + /** Activity events. */ + events?: Array<{ + /** Name of event. */ + name?: string; + /** Parameter value pairs for various applications. */ + parameters?: Array<{ + /** Boolean value of the parameter. */ + boolValue?: boolean; + /** Integral value of the parameter. */ + intValue?: string; + /** Multi-int value of the parameter. */ + multiIntValue?: string[]; + /** Multi-string value of the parameter. */ + multiValue?: string[]; + /** The name of the parameter. */ + name?: string; + /** String value of the parameter. */ + value?: string; + }>; + /** Type of event. */ + type?: string; + }>; + /** Unique identifier for each activity record. */ + id?: { + /** Application name to which the event belongs. */ + applicationName?: string; + /** Obfuscated customer ID of the source customer. */ + customerId?: string; + /** Time of occurrence of the activity. */ + time?: string; + /** Unique qualifier if multiple events have the same time. */ + uniqueQualifier?: string; + }; + /** IP Address of the user doing the action. */ + ipAddress?: string; + /** Kind of resource this is. */ + kind?: string; + /** Domain of source customer. */ + ownerDomain?: string; + } + interface Channel { + /** The address where notifications are delivered for this channel. */ + address?: string; + /** Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. */ + expiration?: string; + /** A UUID or similar unique string that identifies this channel. */ + id?: string; + /** Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel". */ + kind?: string; + /** Additional parameters controlling delivery channel behavior. Optional. */ + params?: Record; + /** A Boolean value to indicate whether payload is wanted. Optional. */ + payload?: boolean; + /** An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. */ + resourceId?: string; + /** A version-specific identifier for the watched resource. */ + resourceUri?: string; + /** An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. */ + token?: string; + /** The type of delivery mechanism used for this channel. */ + type?: string; + } + interface UsageReport { + /** The date to which the record belongs. */ + date?: string; + /** Information about the type of the item. */ + entity?: { + /** Obfuscated customer id for the record. */ + customerId?: string; + /** Obfuscated user id for the record. */ + profileId?: string; + /** The type of item, can be a customer or user. */ + type?: string; + /** user's email. */ + userEmail?: string; + }; + /** ETag of the resource. */ + etag?: string; + /** The kind of object. */ + kind?: string; + /** Parameter value pairs for various applications. */ + parameters?: Array<{ + /** Boolean value of the parameter. */ + boolValue?: boolean; + /** RFC 3339 formatted value of the parameter. */ + datetimeValue?: string; + /** Integral value of the parameter. */ + intValue?: string; + /** Nested message value of the parameter. */ + msgValue?: Array>; + /** The name of the parameter. */ + name?: string; + /** String value of the parameter. */ + stringValue?: string; + }>; + } + interface UsageReports { + /** ETag of the resource. */ + etag?: string; + /** The kind of object. */ + kind?: string; + /** Token for retrieving the next page */ + nextPageToken?: string; + /** Various application parameter records. */ + usageReports?: UsageReport[]; + /** Warnings if any. */ + warnings?: Array<{ + /** Machine readable code / warning type. */ + code?: string; + /** Key-Value pairs to give detailed information on the warning. */ + data?: Array<{ + /** Key associated with a key-value pair to give detailed information on the warning. */ + key?: string; + /** Value associated with a key-value pair to give detailed information on the warning. */ + value?: string; + }>; + /** Human readable message for the warning. */ + message?: string; + }>; + } + interface ActivitiesResource { + /** Retrieves a list of activities for a specific customer and application. */ + list(request: { + /** IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses. */ + actorIpAddress?: string; + /** Data format for the response. */ + alt?: string; + /** Application name for which the events are to be retrieved. */ + applicationName: string; + /** Represents the customer for which the data is to be fetched. */ + customerId?: string; + /** Return events which occurred at or before this time. */ + endTime?: string; + /** Name of the event being queried. */ + eventName?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],... */ + filters?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Number of activity records to be shown in each page. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Token to specify next page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Return events which occurred at or after this time. */ + startTime?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** + * Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for + * all users. + */ + userKey: string; + }): Request; + /** Push changes to activities */ + watch(request: { + /** IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses. */ + actorIpAddress?: string; + /** Data format for the response. */ + alt?: string; + /** Application name for which the events are to be retrieved. */ + applicationName: string; + /** Represents the customer for which the data is to be fetched. */ + customerId?: string; + /** Return events which occurred at or before this time. */ + endTime?: string; + /** Name of the event being queried. */ + eventName?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],... */ + filters?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Number of activity records to be shown in each page. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Token to specify next page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Return events which occurred at or after this time. */ + startTime?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** + * Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for + * all users. + */ + userKey: string; + }): Request; + } + interface ChannelsResource { + /** Stop watching resources through this channel */ + stop(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CustomerUsageReportsResource { + /** Retrieves a report which is a collection of properties / statistics for a specific customer. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Represents the customer for which the data is to be fetched. */ + customerId?: string; + /** Represents the date in yyyy-mm-dd format for which the data is to be fetched. */ + date: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Token to specify next page. */ + pageToken?: string; + /** Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2. */ + parameters?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UserUsageReportResource { + /** Retrieves a report which is a collection of properties / statistics for a set of users. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Represents the customer for which the data is to be fetched. */ + customerId?: string; + /** Represents the date in yyyy-mm-dd format for which the data is to be fetched. */ + date: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Represents the set of filters including parameter operator value. */ + filters?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. Maximum allowed is 1000 */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Token to specify next page. */ + pageToken?: string; + /** Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2. */ + parameters?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Represents the profile id or the user email for which the data should be filtered. */ + userKey: string; + }): Request; + } + } +} diff --git a/types/gapi.client.admin/readme.md b/types/gapi.client.admin/readme.md new file mode 100644 index 0000000000..680dfa99f9 --- /dev/null +++ b/types/gapi.client.admin/readme.md @@ -0,0 +1,82 @@ +# TypeScript typings for Admin Reports API reports_v1 +Fetches reports for the administrators of G Suite customers about the usage, collaboration, security, and risk for their users. +For detailed description please check [documentation](https://developers.google.com/admin-sdk/reports/). + +## Installing + +Install typings for Admin Reports API: +``` +npm install @types/gapi.client.admin@reports_v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('admin', 'reports_v1', () => { + // now we can use gapi.client.admin + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View audit reports for your G Suite domain + 'https://www.googleapis.com/auth/admin.reports.audit.readonly', + + // View usage reports for your G Suite domain + 'https://www.googleapis.com/auth/admin.reports.usage.readonly', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Admin Reports API resources: + +```typescript + +/* +Retrieves a list of activities for a specific customer and application. +*/ +await gapi.client.activities.list({ applicationName: "applicationName", userKey: "userKey", }); + +/* +Push changes to activities +*/ +await gapi.client.activities.watch({ applicationName: "applicationName", userKey: "userKey", }); + +/* +Stop watching resources through this channel +*/ +await gapi.client.channels.stop({ }); + +/* +Retrieves a report which is a collection of properties / statistics for a specific customer. +*/ +await gapi.client.customerUsageReports.get({ date: "date", }); + +/* +Retrieves a report which is a collection of properties / statistics for a set of users. +*/ +await gapi.client.userUsageReport.get({ date: "date", userKey: "userKey", }); +``` \ No newline at end of file diff --git a/types/gapi.client.admin/tsconfig.json b/types/gapi.client.admin/tsconfig.json new file mode 100644 index 0000000000..840f1feb2d --- /dev/null +++ b/types/gapi.client.admin/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.admin-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.admin/tslint.json b/types/gapi.client.admin/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.admin/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.adsense/gapi.client.adsense-tests.ts b/types/gapi.client.adsense/gapi.client.adsense-tests.ts new file mode 100644 index 0000000000..92e9643ad3 --- /dev/null +++ b/types/gapi.client.adsense/gapi.client.adsense-tests.ts @@ -0,0 +1,121 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('adsense', 'v1.4', () => { + /** now we can use gapi.client.adsense */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your AdSense data */ + 'https://www.googleapis.com/auth/adsense', + /** View your AdSense data */ + 'https://www.googleapis.com/auth/adsense.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Get information about the selected AdSense account. */ + await gapi.client.accounts.get({ + accountId: "accountId", + tree: true, + }); + /** List all accounts available to this AdSense account. */ + await gapi.client.accounts.list({ + maxResults: 1, + pageToken: "pageToken", + }); + /** List all ad clients in this AdSense account. */ + await gapi.client.adclients.list({ + maxResults: 1, + pageToken: "pageToken", + }); + /** Gets the specified ad unit in the specified ad client. */ + await gapi.client.adunits.get({ + adClientId: "adClientId", + adUnitId: "adUnitId", + }); + /** Get ad code for the specified ad unit. */ + await gapi.client.adunits.getAdCode({ + adClientId: "adClientId", + adUnitId: "adUnitId", + }); + /** List all ad units in the specified ad client for this AdSense account. */ + await gapi.client.adunits.list({ + adClientId: "adClientId", + includeInactive: true, + maxResults: 3, + pageToken: "pageToken", + }); + /** Dismiss (delete) the specified alert from the publisher's AdSense account. */ + await gapi.client.alerts.delete({ + alertId: "alertId", + }); + /** List the alerts for this AdSense account. */ + await gapi.client.alerts.list({ + locale: "locale", + }); + /** Get the specified custom channel from the specified ad client. */ + await gapi.client.customchannels.get({ + adClientId: "adClientId", + customChannelId: "customChannelId", + }); + /** List all custom channels in the specified ad client for this AdSense account. */ + await gapi.client.customchannels.list({ + adClientId: "adClientId", + maxResults: 2, + pageToken: "pageToken", + }); + /** List the payments for this AdSense account. */ + await gapi.client.payments.list({ + }); + /** + * Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format + * specify "alt=csv" as a query parameter. + */ + await gapi.client.reports.generate({ + accountId: "accountId", + currency: "currency", + dimension: "dimension", + endDate: "endDate", + filter: "filter", + locale: "locale", + maxResults: 7, + metric: "metric", + sort: "sort", + startDate: "startDate", + startIndex: 11, + useTimezoneReporting: true, + }); + /** Get a specific saved ad style from the user's account. */ + await gapi.client.savedadstyles.get({ + savedAdStyleId: "savedAdStyleId", + }); + /** List all saved ad styles in the user's account. */ + await gapi.client.savedadstyles.list({ + maxResults: 1, + pageToken: "pageToken", + }); + /** List all URL channels in the specified ad client for this AdSense account. */ + await gapi.client.urlchannels.list({ + adClientId: "adClientId", + maxResults: 2, + pageToken: "pageToken", + }); + } +}); diff --git a/types/gapi.client.adsense/index.d.ts b/types/gapi.client.adsense/index.d.ts new file mode 100644 index 0000000000..ea9e5fa057 --- /dev/null +++ b/types/gapi.client.adsense/index.d.ts @@ -0,0 +1,1529 @@ +// Type definitions for Google AdSense Management API v1.4 1.4 +// Project: https://developers.google.com/adsense/management/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/adsense/v1.4/rest + +/// + +declare namespace gapi.client { + /** Load AdSense Management API v1.4 */ + function load(name: "adsense", version: "v1.4"): PromiseLike; + function load(name: "adsense", version: "v1.4", callback: () => any): void; + + const accounts: adsense.AccountsResource; + + const adclients: adsense.AdclientsResource; + + const adunits: adsense.AdunitsResource; + + const alerts: adsense.AlertsResource; + + const customchannels: adsense.CustomchannelsResource; + + const metadata: adsense.MetadataResource; + + const payments: adsense.PaymentsResource; + + const reports: adsense.ReportsResource; + + const savedadstyles: adsense.SavedadstylesResource; + + const urlchannels: adsense.UrlchannelsResource; + + namespace adsense { + interface Account { + creation_time?: string; + /** Unique identifier of this account. */ + id?: string; + /** Kind of resource this is, in this case adsense#account. */ + kind?: string; + /** Name of this account. */ + name?: string; + /** Whether this account is premium. */ + premium?: boolean; + /** Sub accounts of the this account. */ + subAccounts?: Account[]; + /** AdSense timezone of this account. */ + timezone?: string; + } + interface Accounts { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The accounts returned in this list response. */ + items?: Account[]; + /** Kind of list this is, in this case adsense#accounts. */ + kind?: string; + /** Continuation token used to page through accounts. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface AdClient { + /** Whether this ad client is opted in to ARC. */ + arcOptIn?: boolean; + /** Unique identifier of this ad client. */ + id?: string; + /** Kind of resource this is, in this case adsense#adClient. */ + kind?: string; + /** This ad client's product code, which corresponds to the PRODUCT_CODE report dimension. */ + productCode?: string; + /** Whether this ad client supports being reported on. */ + supportsReporting?: boolean; + } + interface AdClients { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The ad clients returned in this list response. */ + items?: AdClient[]; + /** Kind of list this is, in this case adsense#adClients. */ + kind?: string; + /** Continuation token used to page through ad clients. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface AdCode { + /** The ad code snippet. */ + adCode?: string; + /** Kind this is, in this case adsense#adCode. */ + kind?: string; + } + interface AdStyle { + /** + * The colors which are included in the style. These are represented as six hexadecimal characters, similar to HTML color codes, but without the leading + * hash. + */ + colors?: { + /** The color of the ad background. */ + background?: string; + /** The color of the ad border. */ + border?: string; + /** The color of the ad text. */ + text?: string; + /** The color of the ad title. */ + title?: string; + /** The color of the ad url. */ + url?: string; + }; + /** The style of the corners in the ad (deprecated: never populated, ignored). */ + corners?: string; + /** The font which is included in the style. */ + font?: { + /** The family of the font. */ + family?: string; + /** The size of the font. */ + size?: string; + }; + /** Kind this is, in this case adsense#adStyle. */ + kind?: string; + } + interface AdUnit { + /** Identity code of this ad unit, not necessarily unique across ad clients. */ + code?: string; + /** Settings specific to content ads (AFC) and highend mobile content ads (AFMC - deprecated). */ + contentAdsSettings?: { + /** The backup option to be used in instances where no ad is available. */ + backupOption?: { + /** Color to use when type is set to COLOR. */ + color?: string; + /** Type of the backup option. Possible values are BLANK, COLOR and URL. */ + type?: string; + /** URL to use when type is set to URL. */ + url?: string; + }; + /** Size of this ad unit. */ + size?: string; + /** Type of this ad unit. */ + type?: string; + }; + /** Custom style information specific to this ad unit. */ + customStyle?: AdStyle; + /** Settings specific to feed ads (AFF) - deprecated. */ + feedAdsSettings?: { + /** The position of the ads relative to the feed entries. */ + adPosition?: string; + /** The frequency at which ads should appear in the feed (i.e. every N entries). */ + frequency?: number; + /** The minimum length an entry should be in order to have attached ads. */ + minimumWordCount?: number; + /** The type of ads which should appear. */ + type?: string; + }; + /** Unique identifier of this ad unit. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */ + id?: string; + /** Kind of resource this is, in this case adsense#adUnit. */ + kind?: string; + /** Settings specific to WAP mobile content ads (AFMC) - deprecated. */ + mobileContentAdsSettings?: { + /** The markup language to use for this ad unit. */ + markupLanguage?: string; + /** The scripting language to use for this ad unit. */ + scriptingLanguage?: string; + /** Size of this ad unit. */ + size?: string; + /** Type of this ad unit. */ + type?: string; + }; + /** Name of this ad unit. */ + name?: string; + /** ID of the saved ad style which holds this ad unit's style information. */ + savedStyleId?: string; + /** + * Status of this ad unit. Possible values are: + * NEW: Indicates that the ad unit was created within the last seven days and does not yet have any activity associated with it. + * + * ACTIVE: Indicates that there has been activity on this ad unit in the last seven days. + * + * INACTIVE: Indicates that there has been no activity on this ad unit in the last seven days. + */ + status?: string; + } + interface AdUnits { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The ad units returned in this list response. */ + items?: AdUnit[]; + /** Kind of list this is, in this case adsense#adUnits. */ + kind?: string; + /** Continuation token used to page through ad units. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface AdsenseReportsGenerateResponse { + /** The averages of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty. */ + averages?: string[]; + /** The requested end date in yyyy-mm-dd format. */ + endDate?: string; + /** + * The header information of the columns requested in the report. This is a list of headers; one for each dimension in the request, followed by one for + * each metric in the request. + */ + headers?: Array<{ + /** The currency of this column. Only present if the header type is METRIC_CURRENCY. */ + currency?: string; + /** The name of the header. */ + name?: string; + /** The type of the header; one of DIMENSION, METRIC_TALLY, METRIC_RATIO, or METRIC_CURRENCY. */ + type?: string; + }>; + /** Kind this is, in this case adsense#report. */ + kind?: string; + /** + * The output rows of the report. Each row is a list of cells; one for each dimension in the request, followed by one for each metric in the request. The + * dimension cells contain strings, and the metric cells contain numbers. + */ + rows?: string[][]; + /** The requested start date in yyyy-mm-dd format. */ + startDate?: string; + /** + * The total number of rows matched by the report request. Fewer rows may be returned in the response due to being limited by the row count requested or + * the report row limit. + */ + totalMatchedRows?: string; + /** The totals of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty. */ + totals?: string[]; + /** Any warnings associated with generation of the report. */ + warnings?: string[]; + } + interface Alert { + /** Unique identifier of this alert. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */ + id?: string; + /** Whether this alert can be dismissed. */ + isDismissible?: boolean; + /** Kind of resource this is, in this case adsense#alert. */ + kind?: string; + /** The localized alert message. */ + message?: string; + /** Severity of this alert. Possible values: INFO, WARNING, SEVERE. */ + severity?: string; + /** + * Type of this alert. Possible values: SELF_HOLD, MIGRATED_TO_BILLING3, ADDRESS_PIN_VERIFICATION, PHONE_PIN_VERIFICATION, CORPORATE_ENTITY, + * GRAYLISTED_PUBLISHER, API_HOLD. + */ + type?: string; + } + interface Alerts { + /** The alerts returned in this list response. */ + items?: Alert[]; + /** Kind of list this is, in this case adsense#alerts. */ + kind?: string; + } + interface CustomChannel { + /** Code of this custom channel, not necessarily unique across ad clients. */ + code?: string; + /** Unique identifier of this custom channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */ + id?: string; + /** Kind of resource this is, in this case adsense#customChannel. */ + kind?: string; + /** Name of this custom channel. */ + name?: string; + /** The targeting information of this custom channel, if activated. */ + targetingInfo?: { + /** The name used to describe this channel externally. */ + adsAppearOn?: string; + /** The external description of the channel. */ + description?: string; + /** + * The locations in which ads appear. (Only valid for content and mobile content ads (deprecated)). Acceptable values for content ads are: TOP_LEFT, + * TOP_CENTER, TOP_RIGHT, MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, BOTTOM_RIGHT, MULTIPLE_LOCATIONS. Acceptable values for + * mobile content ads (deprecated) are: TOP, MIDDLE, BOTTOM, MULTIPLE_LOCATIONS. + */ + location?: string; + /** The language of the sites ads will be displayed on. */ + siteLanguage?: string; + }; + } + interface CustomChannels { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The custom channels returned in this list response. */ + items?: CustomChannel[]; + /** Kind of list this is, in this case adsense#customChannels. */ + kind?: string; + /** Continuation token used to page through custom channels. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface Metadata { + items?: ReportingMetadataEntry[]; + /** Kind of list this is, in this case adsense#metadata. */ + kind?: string; + } + interface Payment { + /** Unique identifier of this Payment. */ + id?: string; + /** Kind of resource this is, in this case adsense#payment. */ + kind?: string; + /** The amount to be paid. */ + paymentAmount?: string; + /** The currency code for the amount to be paid. */ + paymentAmountCurrencyCode?: string; + /** The date this payment was/will be credited to the user, or none if the payment threshold has not been met. */ + paymentDate?: string; + } + interface Payments { + /** The list of Payments for the account. One or both of a) the account's most recent payment; and b) the account's upcoming payment. */ + items?: Payment[]; + /** Kind of list this is, in this case adsense#payments. */ + kind?: string; + } + interface ReportingMetadataEntry { + /** + * For metrics this is a list of dimension IDs which the metric is compatible with, for dimensions it is a list of compatibility groups the dimension + * belongs to. + */ + compatibleDimensions?: string[]; + /** The names of the metrics the dimension or metric this reporting metadata entry describes is compatible with. */ + compatibleMetrics?: string[]; + /** Unique identifier of this reporting metadata entry, corresponding to the name of the appropriate dimension or metric. */ + id?: string; + /** Kind of resource this is, in this case adsense#reportingMetadataEntry. */ + kind?: string; + /** + * The names of the dimensions which the dimension or metric this reporting metadata entry describes requires to also be present in order for the report + * to be valid. Omitting these will not cause an error or warning, but may result in data which cannot be correctly interpreted. + */ + requiredDimensions?: string[]; + /** + * The names of the metrics which the dimension or metric this reporting metadata entry describes requires to also be present in order for the report to + * be valid. Omitting these will not cause an error or warning, but may result in data which cannot be correctly interpreted. + */ + requiredMetrics?: string[]; + /** The codes of the projects supported by the dimension or metric this reporting metadata entry describes. */ + supportedProducts?: string[]; + } + interface SavedAdStyle { + /** The AdStyle itself. */ + adStyle?: AdStyle; + /** Unique identifier of this saved ad style. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */ + id?: string; + /** Kind of resource this is, in this case adsense#savedAdStyle. */ + kind?: string; + /** The user selected name of this SavedAdStyle. */ + name?: string; + } + interface SavedAdStyles { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The saved ad styles returned in this list response. */ + items?: SavedAdStyle[]; + /** Kind of list this is, in this case adsense#savedAdStyles. */ + kind?: string; + /** Continuation token used to page through ad units. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface SavedReport { + /** Unique identifier of this saved report. */ + id?: string; + /** Kind of resource this is, in this case adsense#savedReport. */ + kind?: string; + /** This saved report's name. */ + name?: string; + } + interface SavedReports { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The saved reports returned in this list response. */ + items?: SavedReport[]; + /** Kind of list this is, in this case adsense#savedReports. */ + kind?: string; + /** Continuation token used to page through saved reports. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface UrlChannel { + /** Unique identifier of this URL channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */ + id?: string; + /** Kind of resource this is, in this case adsense#urlChannel. */ + kind?: string; + /** URL Pattern of this URL channel. Does not include "http://" or "https://". Example: www.example.com/home */ + urlPattern?: string; + } + interface UrlChannels { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The URL channels returned in this list response. */ + items?: UrlChannel[]; + /** Kind of list this is, in this case adsense#urlChannels. */ + kind?: string; + /** Continuation token used to page through URL channels. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface AdclientsResource { + /** List all ad clients in the specified account. */ + list(request: { + /** Account for which to list ad clients. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of ad clients to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CustomchannelsResource { + /** List all custom channels which the specified ad unit belongs to. */ + list(request: { + /** Account to which the ad client belongs. */ + accountId: string; + /** Ad client which contains the ad unit. */ + adClientId: string; + /** Ad unit for which to list custom channels. */ + adUnitId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of custom channels to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AdunitsResource { + /** Gets the specified ad unit in the specified ad client for the specified account. */ + get(request: { + /** Account to which the ad client belongs. */ + accountId: string; + /** Ad client for which to get the ad unit. */ + adClientId: string; + /** Ad unit to retrieve. */ + adUnitId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Get ad code for the specified ad unit. */ + getAdCode(request: { + /** Account which contains the ad client. */ + accountId: string; + /** Ad client with contains the ad unit. */ + adClientId: string; + /** Ad unit to get the code for. */ + adUnitId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all ad units in the specified ad client for the specified account. */ + list(request: { + /** Account to which the ad client belongs. */ + accountId: string; + /** Ad client for which to list ad units. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Whether to include inactive ad units. Default: true. */ + includeInactive?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of ad units to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + customchannels: CustomchannelsResource; + } + interface AlertsResource { + /** Dismiss (delete) the specified alert from the specified publisher AdSense account. */ + delete(request: { + /** Account which contains the ad unit. */ + accountId: string; + /** Alert to delete. */ + alertId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List the alerts for the specified AdSense account. */ + list(request: { + /** Account for which to retrieve the alerts. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used + * if the supplied locale is invalid or unsupported. + */ + locale?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AdunitsResource { + /** List all ad units in the specified custom channel. */ + list(request: { + /** Account to which the ad client belongs. */ + accountId: string; + /** Ad client which contains the custom channel. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Custom channel for which to list ad units. */ + customChannelId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Whether to include inactive ad units. Default: true. */ + includeInactive?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of ad units to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CustomchannelsResource { + /** Get the specified custom channel from the specified ad client for the specified account. */ + get(request: { + /** Account to which the ad client belongs. */ + accountId: string; + /** Ad client which contains the custom channel. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Custom channel to retrieve. */ + customChannelId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all custom channels in the specified ad client for the specified account. */ + list(request: { + /** Account to which the ad client belongs. */ + accountId: string; + /** Ad client for which to list custom channels. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of custom channels to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + adunits: AdunitsResource; + } + interface PaymentsResource { + /** List the payments for the specified AdSense account. */ + list(request: { + /** Account for which to retrieve the payments. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SavedResource { + /** Generate an AdSense report based on the saved report ID sent in the query parameters. */ + generate(request: { + /** Account to which the saved reports belong. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. */ + locale?: string; + /** The maximum number of rows of report data to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The saved report to retrieve. */ + savedReportId: string; + /** Index of the first row of report data to return. */ + startIndex?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all saved reports in the specified AdSense account. */ + list(request: { + /** Account to which the saved reports belong. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of saved reports to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ReportsResource { + /** + * Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format + * specify "alt=csv" as a query parameter. + */ + generate(request: { + /** Account upon which to report. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set. */ + currency?: string; + /** Dimensions to base the report on. */ + dimension?: string; + /** End of the date range to report on in "YYYY-MM-DD" format, inclusive. */ + endDate: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Filters to be run on the report. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. */ + locale?: string; + /** The maximum number of rows of report data to return. */ + maxResults?: number; + /** Numeric columns to include in the report. */ + metric?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no + * prefix is specified, the column is sorted ascending. + */ + sort?: string; + /** Start of the date range to report on in "YYYY-MM-DD" format, inclusive. */ + startDate: string; + /** Index of the first row of report data to return. */ + startIndex?: number; + /** Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used. */ + useTimezoneReporting?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + saved: SavedResource; + } + interface SavedadstylesResource { + /** List a specific saved ad style for the specified account. */ + get(request: { + /** Account for which to get the saved ad style. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Saved ad style to retrieve. */ + savedAdStyleId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all saved ad styles in the specified account. */ + list(request: { + /** Account for which to list saved ad styles. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of saved ad styles to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UrlchannelsResource { + /** List all URL channels in the specified ad client for the specified account. */ + list(request: { + /** Account to which the ad client belongs. */ + accountId: string; + /** Ad client for which to list URL channels. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of URL channels to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AccountsResource { + /** Get information about the selected AdSense account. */ + get(request: { + /** Account to get information about. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether the tree of sub accounts should be returned. */ + tree?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all accounts available to this AdSense account. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of accounts to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through accounts. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + adclients: AdclientsResource; + adunits: AdunitsResource; + alerts: AlertsResource; + customchannels: CustomchannelsResource; + payments: PaymentsResource; + reports: ReportsResource; + savedadstyles: SavedadstylesResource; + urlchannels: UrlchannelsResource; + } + interface AdclientsResource { + /** List all ad clients in this AdSense account. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of ad clients to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CustomchannelsResource { + /** List all custom channels which the specified ad unit belongs to. */ + list(request: { + /** Ad client which contains the ad unit. */ + adClientId: string; + /** Ad unit for which to list custom channels. */ + adUnitId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of custom channels to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AdunitsResource { + /** Gets the specified ad unit in the specified ad client. */ + get(request: { + /** Ad client for which to get the ad unit. */ + adClientId: string; + /** Ad unit to retrieve. */ + adUnitId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Get ad code for the specified ad unit. */ + getAdCode(request: { + /** Ad client with contains the ad unit. */ + adClientId: string; + /** Ad unit to get the code for. */ + adUnitId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all ad units in the specified ad client for this AdSense account. */ + list(request: { + /** Ad client for which to list ad units. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Whether to include inactive ad units. Default: true. */ + includeInactive?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of ad units to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + customchannels: CustomchannelsResource; + } + interface AlertsResource { + /** Dismiss (delete) the specified alert from the publisher's AdSense account. */ + delete(request: { + /** Alert to delete. */ + alertId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List the alerts for this AdSense account. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used + * if the supplied locale is invalid or unsupported. + */ + locale?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AdunitsResource { + /** List all ad units in the specified custom channel. */ + list(request: { + /** Ad client which contains the custom channel. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Custom channel for which to list ad units. */ + customChannelId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Whether to include inactive ad units. Default: true. */ + includeInactive?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of ad units to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CustomchannelsResource { + /** Get the specified custom channel from the specified ad client. */ + get(request: { + /** Ad client which contains the custom channel. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Custom channel to retrieve. */ + customChannelId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all custom channels in the specified ad client for this AdSense account. */ + list(request: { + /** Ad client for which to list custom channels. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of custom channels to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + adunits: AdunitsResource; + } + interface DimensionsResource { + /** List the metadata for the dimensions available to this AdSense account. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface MetricsResource { + /** List the metadata for the metrics available to this AdSense account. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface MetadataResource { + dimensions: DimensionsResource; + metrics: MetricsResource; + } + interface PaymentsResource { + /** List the payments for this AdSense account. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SavedResource { + /** Generate an AdSense report based on the saved report ID sent in the query parameters. */ + generate(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. */ + locale?: string; + /** The maximum number of rows of report data to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The saved report to retrieve. */ + savedReportId: string; + /** Index of the first row of report data to return. */ + startIndex?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all saved reports in this AdSense account. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of saved reports to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ReportsResource { + /** + * Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format + * specify "alt=csv" as a query parameter. + */ + generate(request: { + /** Accounts upon which to report. */ + accountId?: string; + /** Data format for the response. */ + alt?: string; + /** Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set. */ + currency?: string; + /** Dimensions to base the report on. */ + dimension?: string; + /** End of the date range to report on in "YYYY-MM-DD" format, inclusive. */ + endDate: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Filters to be run on the report. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. */ + locale?: string; + /** The maximum number of rows of report data to return. */ + maxResults?: number; + /** Numeric columns to include in the report. */ + metric?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no + * prefix is specified, the column is sorted ascending. + */ + sort?: string; + /** Start of the date range to report on in "YYYY-MM-DD" format, inclusive. */ + startDate: string; + /** Index of the first row of report data to return. */ + startIndex?: number; + /** Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used. */ + useTimezoneReporting?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + saved: SavedResource; + } + interface SavedadstylesResource { + /** Get a specific saved ad style from the user's account. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Saved ad style to retrieve. */ + savedAdStyleId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all saved ad styles in the user's account. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of saved ad styles to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UrlchannelsResource { + /** List all URL channels in the specified ad client for this AdSense account. */ + list(request: { + /** Ad client for which to list URL channels. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of URL channels to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.adsense/readme.md b/types/gapi.client.adsense/readme.md new file mode 100644 index 0000000000..49de12e874 --- /dev/null +++ b/types/gapi.client.adsense/readme.md @@ -0,0 +1,132 @@ +# TypeScript typings for AdSense Management API v1.4 +Accesses AdSense publishers' inventory and generates performance reports. +For detailed description please check [documentation](https://developers.google.com/adsense/management/). + +## Installing + +Install typings for AdSense Management API: +``` +npm install @types/gapi.client.adsense@v1.4 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('adsense', 'v1.4', () => { + // now we can use gapi.client.adsense + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your AdSense data + 'https://www.googleapis.com/auth/adsense', + + // View your AdSense data + 'https://www.googleapis.com/auth/adsense.readonly', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use AdSense Management API resources: + +```typescript + +/* +Get information about the selected AdSense account. +*/ +await gapi.client.accounts.get({ accountId: "accountId", }); + +/* +List all accounts available to this AdSense account. +*/ +await gapi.client.accounts.list({ }); + +/* +List all ad clients in this AdSense account. +*/ +await gapi.client.adclients.list({ }); + +/* +Gets the specified ad unit in the specified ad client. +*/ +await gapi.client.adunits.get({ adClientId: "adClientId", adUnitId: "adUnitId", }); + +/* +Get ad code for the specified ad unit. +*/ +await gapi.client.adunits.getAdCode({ adClientId: "adClientId", adUnitId: "adUnitId", }); + +/* +List all ad units in the specified ad client for this AdSense account. +*/ +await gapi.client.adunits.list({ adClientId: "adClientId", }); + +/* +Dismiss (delete) the specified alert from the publisher's AdSense account. +*/ +await gapi.client.alerts.delete({ alertId: "alertId", }); + +/* +List the alerts for this AdSense account. +*/ +await gapi.client.alerts.list({ }); + +/* +Get the specified custom channel from the specified ad client. +*/ +await gapi.client.customchannels.get({ adClientId: "adClientId", customChannelId: "customChannelId", }); + +/* +List all custom channels in the specified ad client for this AdSense account. +*/ +await gapi.client.customchannels.list({ adClientId: "adClientId", }); + +/* +List the payments for this AdSense account. +*/ +await gapi.client.payments.list({ }); + +/* +Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter. +*/ +await gapi.client.reports.generate({ endDate: "endDate", startDate: "startDate", }); + +/* +Get a specific saved ad style from the user's account. +*/ +await gapi.client.savedadstyles.get({ savedAdStyleId: "savedAdStyleId", }); + +/* +List all saved ad styles in the user's account. +*/ +await gapi.client.savedadstyles.list({ }); + +/* +List all URL channels in the specified ad client for this AdSense account. +*/ +await gapi.client.urlchannels.list({ adClientId: "adClientId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.adsense/tsconfig.json b/types/gapi.client.adsense/tsconfig.json new file mode 100644 index 0000000000..49b1e08a5a --- /dev/null +++ b/types/gapi.client.adsense/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.adsense-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.adsense/tslint.json b/types/gapi.client.adsense/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.adsense/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.adsensehost/gapi.client.adsensehost-tests.ts b/types/gapi.client.adsensehost/gapi.client.adsensehost-tests.ts new file mode 100644 index 0000000000..12c14af6da --- /dev/null +++ b/types/gapi.client.adsensehost/gapi.client.adsensehost-tests.ts @@ -0,0 +1,119 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('adsensehost', 'v4.1', () => { + /** now we can use gapi.client.adsensehost */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your AdSense host data and associated accounts */ + 'https://www.googleapis.com/auth/adsensehost', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Get information about the selected associated AdSense account. */ + await gapi.client.accounts.get({ + accountId: "accountId", + }); + /** List hosted accounts associated with this AdSense account by ad client id. */ + await gapi.client.accounts.list({ + filterAdClientId: "filterAdClientId", + }); + /** Get information about one of the ad clients in the Host AdSense account. */ + await gapi.client.adclients.get({ + adClientId: "adClientId", + }); + /** List all host ad clients in this AdSense account. */ + await gapi.client.adclients.list({ + maxResults: 1, + pageToken: "pageToken", + }); + /** Create an association session for initiating an association with an AdSense user. */ + await gapi.client.associationsessions.start({ + productCode: "productCode", + userLocale: "userLocale", + websiteLocale: "websiteLocale", + websiteUrl: "websiteUrl", + }); + /** Verify an association session after the association callback returns from AdSense signup. */ + await gapi.client.associationsessions.verify({ + token: "token", + }); + /** Delete a specific custom channel from the host AdSense account. */ + await gapi.client.customchannels.delete({ + adClientId: "adClientId", + customChannelId: "customChannelId", + }); + /** Get a specific custom channel from the host AdSense account. */ + await gapi.client.customchannels.get({ + adClientId: "adClientId", + customChannelId: "customChannelId", + }); + /** Add a new custom channel to the host AdSense account. */ + await gapi.client.customchannels.insert({ + adClientId: "adClientId", + }); + /** List all host custom channels in this AdSense account. */ + await gapi.client.customchannels.list({ + adClientId: "adClientId", + maxResults: 2, + pageToken: "pageToken", + }); + /** Update a custom channel in the host AdSense account. This method supports patch semantics. */ + await gapi.client.customchannels.patch({ + adClientId: "adClientId", + customChannelId: "customChannelId", + }); + /** Update a custom channel in the host AdSense account. */ + await gapi.client.customchannels.update({ + adClientId: "adClientId", + }); + /** + * Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format + * specify "alt=csv" as a query parameter. + */ + await gapi.client.reports.generate({ + dimension: "dimension", + endDate: "endDate", + filter: "filter", + locale: "locale", + maxResults: 5, + metric: "metric", + sort: "sort", + startDate: "startDate", + startIndex: 9, + }); + /** Delete a URL channel from the host AdSense account. */ + await gapi.client.urlchannels.delete({ + adClientId: "adClientId", + urlChannelId: "urlChannelId", + }); + /** Add a new URL channel to the host AdSense account. */ + await gapi.client.urlchannels.insert({ + adClientId: "adClientId", + }); + /** List all host URL channels in the host AdSense account. */ + await gapi.client.urlchannels.list({ + adClientId: "adClientId", + maxResults: 2, + pageToken: "pageToken", + }); + } +}); diff --git a/types/gapi.client.adsensehost/index.d.ts b/types/gapi.client.adsensehost/index.d.ts new file mode 100644 index 0000000000..1595d36c6c --- /dev/null +++ b/types/gapi.client.adsensehost/index.d.ts @@ -0,0 +1,967 @@ +// Type definitions for Google AdSense Host API v4.1 4.1 +// Project: https://developers.google.com/adsense/host/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/adsensehost/v4.1/rest + +/// + +declare namespace gapi.client { + /** Load AdSense Host API v4.1 */ + function load(name: "adsensehost", version: "v4.1"): PromiseLike; + function load(name: "adsensehost", version: "v4.1", callback: () => any): void; + + const accounts: adsensehost.AccountsResource; + + const adclients: adsensehost.AdclientsResource; + + const associationsessions: adsensehost.AssociationsessionsResource; + + const customchannels: adsensehost.CustomchannelsResource; + + const reports: adsensehost.ReportsResource; + + const urlchannels: adsensehost.UrlchannelsResource; + + namespace adsensehost { + interface Account { + /** Unique identifier of this account. */ + id?: string; + /** Kind of resource this is, in this case adsensehost#account. */ + kind?: string; + /** Name of this account. */ + name?: string; + /** Approval status of this account. One of: PENDING, APPROVED, DISABLED. */ + status?: string; + } + interface Accounts { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The accounts returned in this list response. */ + items?: Account[]; + /** Kind of list this is, in this case adsensehost#accounts. */ + kind?: string; + } + interface AdClient { + /** Whether this ad client is opted in to ARC. */ + arcOptIn?: boolean; + /** Unique identifier of this ad client. */ + id?: string; + /** Kind of resource this is, in this case adsensehost#adClient. */ + kind?: string; + /** This ad client's product code, which corresponds to the PRODUCT_CODE report dimension. */ + productCode?: string; + /** Whether this ad client supports being reported on. */ + supportsReporting?: boolean; + } + interface AdClients { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The ad clients returned in this list response. */ + items?: AdClient[]; + /** Kind of list this is, in this case adsensehost#adClients. */ + kind?: string; + /** Continuation token used to page through ad clients. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface AdCode { + /** The ad code snippet. */ + adCode?: string; + /** Kind this is, in this case adsensehost#adCode. */ + kind?: string; + } + interface AdStyle { + /** The colors included in the style. These are represented as six hexadecimal characters, similar to HTML color codes, but without the leading hash. */ + colors?: { + /** The color of the ad background. */ + background?: string; + /** The color of the ad border. */ + border?: string; + /** The color of the ad text. */ + text?: string; + /** The color of the ad title. */ + title?: string; + /** The color of the ad url. */ + url?: string; + }; + /** The style of the corners in the ad (deprecated: never populated, ignored). */ + corners?: string; + /** The font which is included in the style. */ + font?: { + /** The family of the font. Possible values are: ACCOUNT_DEFAULT_FAMILY, ADSENSE_DEFAULT_FAMILY, ARIAL, TIMES and VERDANA. */ + family?: string; + /** The size of the font. Possible values are: ACCOUNT_DEFAULT_SIZE, ADSENSE_DEFAULT_SIZE, SMALL, MEDIUM and LARGE. */ + size?: string; + }; + /** Kind this is, in this case adsensehost#adStyle. */ + kind?: string; + } + interface AdUnit { + /** Identity code of this ad unit, not necessarily unique across ad clients. */ + code?: string; + /** Settings specific to content ads (AFC) and highend mobile content ads (AFMC - deprecated). */ + contentAdsSettings?: { + /** The backup option to be used in instances where no ad is available. */ + backupOption?: { + /** Color to use when type is set to COLOR. These are represented as six hexadecimal characters, similar to HTML color codes, but without the leading hash. */ + color?: string; + /** Type of the backup option. Possible values are BLANK, COLOR and URL. */ + type?: string; + /** URL to use when type is set to URL. */ + url?: string; + }; + /** Size of this ad unit. Size values are in the form SIZE_{width}_{height}. */ + size?: string; + /** Type of this ad unit. Possible values are TEXT, TEXT_IMAGE, IMAGE and LINK. */ + type?: string; + }; + /** Custom style information specific to this ad unit. */ + customStyle?: AdStyle; + /** Unique identifier of this ad unit. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */ + id?: string; + /** Kind of resource this is, in this case adsensehost#adUnit. */ + kind?: string; + /** Settings specific to WAP mobile content ads (AFMC - deprecated). */ + mobileContentAdsSettings?: { + /** The markup language to use for this ad unit. */ + markupLanguage?: string; + /** The scripting language to use for this ad unit. */ + scriptingLanguage?: string; + /** Size of this ad unit. */ + size?: string; + /** Type of this ad unit. */ + type?: string; + }; + /** Name of this ad unit. */ + name?: string; + /** + * Status of this ad unit. Possible values are: + * NEW: Indicates that the ad unit was created within the last seven days and does not yet have any activity associated with it. + * + * ACTIVE: Indicates that there has been activity on this ad unit in the last seven days. + * + * INACTIVE: Indicates that there has been no activity on this ad unit in the last seven days. + */ + status?: string; + } + interface AdUnits { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The ad units returned in this list response. */ + items?: AdUnit[]; + /** Kind of list this is, in this case adsensehost#adUnits. */ + kind?: string; + /** Continuation token used to page through ad units. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface AssociationSession { + /** Hosted account id of the associated publisher after association. Present if status is ACCEPTED. */ + accountId?: string; + /** Unique identifier of this association session. */ + id?: string; + /** Kind of resource this is, in this case adsensehost#associationSession. */ + kind?: string; + /** The products to associate with the user. Options: AFC, AFG, AFV, AFS (deprecated), AFMC (deprecated) */ + productCodes?: string[]; + /** Redirect URL of this association session. Used to redirect users into the AdSense association flow. */ + redirectUrl?: string; + /** Status of the completed association, available once the association callback token has been verified. One of ACCEPTED, REJECTED, or ERROR. */ + status?: string; + /** The preferred locale of the user themselves when going through the AdSense association flow. */ + userLocale?: string; + /** The locale of the user's hosted website. */ + websiteLocale?: string; + /** The URL of the user's hosted website. */ + websiteUrl?: string; + } + interface CustomChannel { + /** Code of this custom channel, not necessarily unique across ad clients. */ + code?: string; + /** Unique identifier of this custom channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */ + id?: string; + /** Kind of resource this is, in this case adsensehost#customChannel. */ + kind?: string; + /** Name of this custom channel. */ + name?: string; + } + interface CustomChannels { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The custom channels returned in this list response. */ + items?: CustomChannel[]; + /** Kind of list this is, in this case adsensehost#customChannels. */ + kind?: string; + /** Continuation token used to page through custom channels. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface Report { + /** The averages of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty. */ + averages?: string[]; + /** + * The header information of the columns requested in the report. This is a list of headers; one for each dimension in the request, followed by one for + * each metric in the request. + */ + headers?: Array<{ + /** The currency of this column. Only present if the header type is METRIC_CURRENCY. */ + currency?: string; + /** The name of the header. */ + name?: string; + /** The type of the header; one of DIMENSION, METRIC_TALLY, METRIC_RATIO, or METRIC_CURRENCY. */ + type?: string; + }>; + /** Kind this is, in this case adsensehost#report. */ + kind?: string; + /** + * The output rows of the report. Each row is a list of cells; one for each dimension in the request, followed by one for each metric in the request. The + * dimension cells contain strings, and the metric cells contain numbers. + */ + rows?: string[][]; + /** + * The total number of rows matched by the report request. Fewer rows may be returned in the response due to being limited by the row count requested or + * the report row limit. + */ + totalMatchedRows?: string; + /** The totals of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty. */ + totals?: string[]; + /** Any warnings associated with generation of the report. */ + warnings?: string[]; + } + interface UrlChannel { + /** Unique identifier of this URL channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */ + id?: string; + /** Kind of resource this is, in this case adsensehost#urlChannel. */ + kind?: string; + /** URL Pattern of this URL channel. Does not include "http://" or "https://". Example: www.example.com/home */ + urlPattern?: string; + } + interface UrlChannels { + /** ETag of this response for caching purposes. */ + etag?: string; + /** The URL channels returned in this list response. */ + items?: UrlChannel[]; + /** Kind of list this is, in this case adsensehost#urlChannels. */ + kind?: string; + /** Continuation token used to page through URL channels. To retrieve the next page of results, set the next request's "pageToken" value to this. */ + nextPageToken?: string; + } + interface AdclientsResource { + /** Get information about one of the ad clients in the specified publisher's AdSense account. */ + get(request: { + /** Account which contains the ad client. */ + accountId: string; + /** Ad client to get. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all hosted ad clients in the specified hosted account. */ + list(request: { + /** Account for which to list ad clients. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of ad clients to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AdunitsResource { + /** Delete the specified ad unit from the specified publisher AdSense account. */ + delete(request: { + /** Account which contains the ad unit. */ + accountId: string; + /** Ad client for which to get ad unit. */ + adClientId: string; + /** Ad unit to delete. */ + adUnitId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Get the specified host ad unit in this AdSense account. */ + get(request: { + /** Account which contains the ad unit. */ + accountId: string; + /** Ad client for which to get ad unit. */ + adClientId: string; + /** Ad unit to get. */ + adUnitId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Get ad code for the specified ad unit, attaching the specified host custom channels. */ + getAdCode(request: { + /** Account which contains the ad client. */ + accountId: string; + /** Ad client with contains the ad unit. */ + adClientId: string; + /** Ad unit to get the code for. */ + adUnitId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Host custom channel to attach to the ad code. */ + hostCustomChannelId?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Insert the supplied ad unit into the specified publisher AdSense account. */ + insert(request: { + /** Account which will contain the ad unit. */ + accountId: string; + /** Ad client into which to insert the ad unit. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all ad units in the specified publisher's AdSense account. */ + list(request: { + /** Account which contains the ad client. */ + accountId: string; + /** Ad client for which to list ad units. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Whether to include inactive ad units. Default: true. */ + includeInactive?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of ad units to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Update the supplied ad unit in the specified publisher AdSense account. This method supports patch semantics. */ + patch(request: { + /** Account which contains the ad client. */ + accountId: string; + /** Ad client which contains the ad unit. */ + adClientId: string; + /** Ad unit to get. */ + adUnitId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Update the supplied ad unit in the specified publisher AdSense account. */ + update(request: { + /** Account which contains the ad client. */ + accountId: string; + /** Ad client which contains the ad unit. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ReportsResource { + /** + * Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format + * specify "alt=csv" as a query parameter. + */ + generate(request: { + /** Hosted account upon which to report. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Dimensions to base the report on. */ + dimension?: string; + /** End of the date range to report on in "YYYY-MM-DD" format, inclusive. */ + endDate: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Filters to be run on the report. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. */ + locale?: string; + /** The maximum number of rows of report data to return. */ + maxResults?: number; + /** Numeric columns to include in the report. */ + metric?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no + * prefix is specified, the column is sorted ascending. + */ + sort?: string; + /** Start of the date range to report on in "YYYY-MM-DD" format, inclusive. */ + startDate: string; + /** Index of the first row of report data to return. */ + startIndex?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AccountsResource { + /** Get information about the selected associated AdSense account. */ + get(request: { + /** Account to get information about. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List hosted accounts associated with this AdSense account by ad client id. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Ad clients to list accounts for. */ + filterAdClientId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + adclients: AdclientsResource; + adunits: AdunitsResource; + reports: ReportsResource; + } + interface AdclientsResource { + /** Get information about one of the ad clients in the Host AdSense account. */ + get(request: { + /** Ad client to get. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all host ad clients in this AdSense account. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of ad clients to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous + * response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AssociationsessionsResource { + /** Create an association session for initiating an association with an AdSense user. */ + start(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Products to associate with the user. */ + productCode: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The preferred locale of the user. */ + userLocale?: string; + /** The locale of the user's hosted website. */ + websiteLocale?: string; + /** The URL of the user's hosted website. */ + websiteUrl: string; + }): Request; + /** Verify an association session after the association callback returns from AdSense signup. */ + verify(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The token returned to the association callback URL. */ + token: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CustomchannelsResource { + /** Delete a specific custom channel from the host AdSense account. */ + delete(request: { + /** Ad client from which to delete the custom channel. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Custom channel to delete. */ + customChannelId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Get a specific custom channel from the host AdSense account. */ + get(request: { + /** Ad client from which to get the custom channel. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Custom channel to get. */ + customChannelId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Add a new custom channel to the host AdSense account. */ + insert(request: { + /** Ad client to which the new custom channel will be added. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all host custom channels in this AdSense account. */ + list(request: { + /** Ad client for which to list custom channels. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of custom channels to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Update a custom channel in the host AdSense account. This method supports patch semantics. */ + patch(request: { + /** Ad client in which the custom channel will be updated. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Custom channel to get. */ + customChannelId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Update a custom channel in the host AdSense account. */ + update(request: { + /** Ad client in which the custom channel will be updated. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ReportsResource { + /** + * Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format + * specify "alt=csv" as a query parameter. + */ + generate(request: { + /** Data format for the response. */ + alt?: string; + /** Dimensions to base the report on. */ + dimension?: string; + /** End of the date range to report on in "YYYY-MM-DD" format, inclusive. */ + endDate: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Filters to be run on the report. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. */ + locale?: string; + /** The maximum number of rows of report data to return. */ + maxResults?: number; + /** Numeric columns to include in the report. */ + metric?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no + * prefix is specified, the column is sorted ascending. + */ + sort?: string; + /** Start of the date range to report on in "YYYY-MM-DD" format, inclusive. */ + startDate: string; + /** Index of the first row of report data to return. */ + startIndex?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UrlchannelsResource { + /** Delete a URL channel from the host AdSense account. */ + delete(request: { + /** Ad client from which to delete the URL channel. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** URL channel to delete. */ + urlChannelId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Add a new URL channel to the host AdSense account. */ + insert(request: { + /** Ad client to which the new URL channel will be added. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all host URL channels in the host AdSense account. */ + list(request: { + /** Ad client for which to list URL channels. */ + adClientId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of URL channels to include in the response, used for paging. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the + * previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.adsensehost/readme.md b/types/gapi.client.adsensehost/readme.md new file mode 100644 index 0000000000..2418d40442 --- /dev/null +++ b/types/gapi.client.adsensehost/readme.md @@ -0,0 +1,134 @@ +# TypeScript typings for AdSense Host API v4.1 +Generates performance reports, generates ad codes, and provides publisher management capabilities for AdSense Hosts. +For detailed description please check [documentation](https://developers.google.com/adsense/host/). + +## Installing + +Install typings for AdSense Host API: +``` +npm install @types/gapi.client.adsensehost@v4.1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('adsensehost', 'v4.1', () => { + // now we can use gapi.client.adsensehost + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your AdSense host data and associated accounts + 'https://www.googleapis.com/auth/adsensehost', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use AdSense Host API resources: + +```typescript + +/* +Get information about the selected associated AdSense account. +*/ +await gapi.client.accounts.get({ accountId: "accountId", }); + +/* +List hosted accounts associated with this AdSense account by ad client id. +*/ +await gapi.client.accounts.list({ filterAdClientId: "filterAdClientId", }); + +/* +Get information about one of the ad clients in the Host AdSense account. +*/ +await gapi.client.adclients.get({ adClientId: "adClientId", }); + +/* +List all host ad clients in this AdSense account. +*/ +await gapi.client.adclients.list({ }); + +/* +Create an association session for initiating an association with an AdSense user. +*/ +await gapi.client.associationsessions.start({ productCode: "productCode", websiteUrl: "websiteUrl", }); + +/* +Verify an association session after the association callback returns from AdSense signup. +*/ +await gapi.client.associationsessions.verify({ token: "token", }); + +/* +Delete a specific custom channel from the host AdSense account. +*/ +await gapi.client.customchannels.delete({ adClientId: "adClientId", customChannelId: "customChannelId", }); + +/* +Get a specific custom channel from the host AdSense account. +*/ +await gapi.client.customchannels.get({ adClientId: "adClientId", customChannelId: "customChannelId", }); + +/* +Add a new custom channel to the host AdSense account. +*/ +await gapi.client.customchannels.insert({ adClientId: "adClientId", }); + +/* +List all host custom channels in this AdSense account. +*/ +await gapi.client.customchannels.list({ adClientId: "adClientId", }); + +/* +Update a custom channel in the host AdSense account. This method supports patch semantics. +*/ +await gapi.client.customchannels.patch({ adClientId: "adClientId", customChannelId: "customChannelId", }); + +/* +Update a custom channel in the host AdSense account. +*/ +await gapi.client.customchannels.update({ adClientId: "adClientId", }); + +/* +Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter. +*/ +await gapi.client.reports.generate({ endDate: "endDate", startDate: "startDate", }); + +/* +Delete a URL channel from the host AdSense account. +*/ +await gapi.client.urlchannels.delete({ adClientId: "adClientId", urlChannelId: "urlChannelId", }); + +/* +Add a new URL channel to the host AdSense account. +*/ +await gapi.client.urlchannels.insert({ adClientId: "adClientId", }); + +/* +List all host URL channels in the host AdSense account. +*/ +await gapi.client.urlchannels.list({ adClientId: "adClientId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.adsensehost/tsconfig.json b/types/gapi.client.adsensehost/tsconfig.json new file mode 100644 index 0000000000..5cee9dc200 --- /dev/null +++ b/types/gapi.client.adsensehost/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.adsensehost-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.adsensehost/tslint.json b/types/gapi.client.adsensehost/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.adsensehost/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.analytics/gapi.client.analytics-tests.ts b/types/gapi.client.analytics/gapi.client.analytics-tests.ts new file mode 100644 index 0000000000..4a8be2094e --- /dev/null +++ b/types/gapi.client.analytics/gapi.client.analytics-tests.ts @@ -0,0 +1,45 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('analytics', 'v3', () => { + /** now we can use gapi.client.analytics */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your Google Analytics data */ + 'https://www.googleapis.com/auth/analytics', + /** Edit Google Analytics management entities */ + 'https://www.googleapis.com/auth/analytics.edit', + /** Manage Google Analytics Account users by email address */ + 'https://www.googleapis.com/auth/analytics.manage.users', + /** View Google Analytics user permissions */ + 'https://www.googleapis.com/auth/analytics.manage.users.readonly', + /** Create a new Google Analytics account along with its default property and view */ + 'https://www.googleapis.com/auth/analytics.provision', + /** View your Google Analytics data */ + 'https://www.googleapis.com/auth/analytics.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Creates an account ticket. */ + await gapi.client.provisioning.createAccountTicket({ + }); + } +}); diff --git a/types/gapi.client.analytics/index.d.ts b/types/gapi.client.analytics/index.d.ts new file mode 100644 index 0000000000..eeddb3f81f --- /dev/null +++ b/types/gapi.client.analytics/index.d.ts @@ -0,0 +1,4071 @@ +// Type definitions for Google Google Analytics API v3 3.0 +// Project: https://developers.google.com/analytics/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/analytics/v3/rest + +/// + +declare namespace gapi.client { + /** Load Google Analytics API v3 */ + function load(name: "analytics", version: "v3"): PromiseLike; + function load(name: "analytics", version: "v3", callback: () => any): void; + + const data: analytics.DataResource; + + const management: analytics.ManagementResource; + + const metadata: analytics.MetadataResource; + + const provisioning: analytics.ProvisioningResource; + + namespace analytics { + interface Account { + /** Child link for an account entry. Points to the list of web properties for this account. */ + childLink?: { + /** Link to the list of web properties for this account. */ + href?: string; + /** Type of the child link. Its value is "analytics#webproperties". */ + type?: string; + }; + /** Time the account was created. */ + created?: string; + /** Account ID. */ + id?: string; + /** Resource type for Analytics account. */ + kind?: string; + /** Account name. */ + name?: string; + /** Permissions the user has for this account. */ + permissions?: { + /** All the permissions that the user has for this account. These include any implied permissions (e.g., EDIT implies VIEW). */ + effective?: string[]; + }; + /** Link for this account. */ + selfLink?: string; + /** Indicates whether this account is starred or not. */ + starred?: boolean; + /** Time the account was last modified. */ + updated?: string; + } + interface AccountRef { + /** Link for this account. */ + href?: string; + /** Account ID. */ + id?: string; + /** Analytics account reference. */ + kind?: string; + /** Account name. */ + name?: string; + } + interface AccountSummaries { + /** A list of AccountSummaries. */ + items?: AccountSummary[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this AccountSummary collection. */ + nextLink?: string; + /** Link to previous page for this AccountSummary collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface AccountSummary { + /** Account ID. */ + id?: string; + /** Resource type for Analytics AccountSummary. */ + kind?: string; + /** Account name. */ + name?: string; + /** Indicates whether this account is starred or not. */ + starred?: boolean; + /** List of web properties under this account. */ + webProperties?: WebPropertySummary[]; + } + interface AccountTicket { + /** Account for this ticket. */ + account?: Account; + /** Account ticket ID used to access the account ticket. */ + id?: string; + /** Resource type for account ticket. */ + kind?: string; + /** View (Profile) for the account. */ + profile?: Profile; + /** Redirect URI where the user will be sent after accepting Terms of Service. Must be configured in APIs console as a callback URL. */ + redirectUri?: string; + /** Web property for the account. */ + webproperty?: Webproperty; + } + interface Accounts { + /** A list of accounts. */ + items?: Account[]; + /** + * The maximum number of entries the response can contain, regardless of the actual number of entries returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Next link for this account collection. */ + nextLink?: string; + /** Previous link for this account collection. */ + previousLink?: string; + /** The starting index of the entries, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface AdWordsAccount { + /** True if auto-tagging is enabled on the AdWords account. Read-only after the insert operation. */ + autoTaggingEnabled?: boolean; + /** Customer ID. This field is required when creating an AdWords link. */ + customerId?: string; + /** Resource type for AdWords account. */ + kind?: string; + } + interface AnalyticsDataimportDeleteUploadDataRequest { + /** A list of upload UIDs. */ + customDataImportUids?: string[]; + } + interface Column { + /** Map of attribute name and value for this column. */ + attributes?: Record; + /** Column id. */ + id?: string; + /** Resource type for Analytics column. */ + kind?: string; + } + interface Columns { + /** List of attributes names returned by columns. */ + attributeNames?: string[]; + /** Etag of collection. This etag can be compared with the last response etag to check if response has changed. */ + etag?: string; + /** List of columns for a report type. */ + items?: Column[]; + /** Collection type. */ + kind?: string; + /** Total number of columns returned in the response. */ + totalResults?: number; + } + interface CustomDataSource { + /** Account ID to which this custom data source belongs. */ + accountId?: string; + childLink?: { + /** Link to the list of daily uploads for this custom data source. Link to the list of uploads for this custom data source. */ + href?: string; + /** Value is "analytics#dailyUploads". Value is "analytics#uploads". */ + type?: string; + }; + /** Time this custom data source was created. */ + created?: string; + /** Description of custom data source. */ + description?: string; + /** Custom data source ID. */ + id?: string; + importBehavior?: string; + /** Resource type for Analytics custom data source. */ + kind?: string; + /** Name of this custom data source. */ + name?: string; + /** Parent link for this custom data source. Points to the web property to which this custom data source belongs. */ + parentLink?: { + /** Link to the web property to which this custom data source belongs. */ + href?: string; + /** Value is "analytics#webproperty". */ + type?: string; + }; + /** IDs of views (profiles) linked to the custom data source. */ + profilesLinked?: string[]; + /** Collection of schema headers of the custom data source. */ + schema?: string[]; + /** Link for this Analytics custom data source. */ + selfLink?: string; + /** Type of the custom data source. */ + type?: string; + /** Time this custom data source was last modified. */ + updated?: string; + /** Upload type of the custom data source. */ + uploadType?: string; + /** Web property ID of the form UA-XXXXX-YY to which this custom data source belongs. */ + webPropertyId?: string; + } + interface CustomDataSources { + /** Collection of custom data sources. */ + items?: CustomDataSource[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this custom data source collection. */ + nextLink?: string; + /** Link to previous page for this custom data source collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface CustomDimension { + /** Account ID. */ + accountId?: string; + /** Boolean indicating whether the custom dimension is active. */ + active?: boolean; + /** Time the custom dimension was created. */ + created?: string; + /** Custom dimension ID. */ + id?: string; + /** Index of the custom dimension. */ + index?: number; + /** Kind value for a custom dimension. Set to "analytics#customDimension". It is a read-only field. */ + kind?: string; + /** Name of the custom dimension. */ + name?: string; + /** Parent link for the custom dimension. Points to the property to which the custom dimension belongs. */ + parentLink?: { + /** Link to the property to which the custom dimension belongs. */ + href?: string; + /** Type of the parent link. Set to "analytics#webproperty". */ + type?: string; + }; + /** Scope of the custom dimension: HIT, SESSION, USER or PRODUCT. */ + scope?: string; + /** Link for the custom dimension */ + selfLink?: string; + /** Time the custom dimension was last modified. */ + updated?: string; + /** Property ID. */ + webPropertyId?: string; + } + interface CustomDimensions { + /** Collection of custom dimensions. */ + items?: CustomDimension[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this custom dimension collection. */ + nextLink?: string; + /** Link to previous page for this custom dimension collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface CustomMetric { + /** Account ID. */ + accountId?: string; + /** Boolean indicating whether the custom metric is active. */ + active?: boolean; + /** Time the custom metric was created. */ + created?: string; + /** Custom metric ID. */ + id?: string; + /** Index of the custom metric. */ + index?: number; + /** Kind value for a custom metric. Set to "analytics#customMetric". It is a read-only field. */ + kind?: string; + /** Max value of custom metric. */ + max_value?: string; + /** Min value of custom metric. */ + min_value?: string; + /** Name of the custom metric. */ + name?: string; + /** Parent link for the custom metric. Points to the property to which the custom metric belongs. */ + parentLink?: { + /** Link to the property to which the custom metric belongs. */ + href?: string; + /** Type of the parent link. Set to "analytics#webproperty". */ + type?: string; + }; + /** Scope of the custom metric: HIT or PRODUCT. */ + scope?: string; + /** Link for the custom metric */ + selfLink?: string; + /** Data type of custom metric. */ + type?: string; + /** Time the custom metric was last modified. */ + updated?: string; + /** Property ID. */ + webPropertyId?: string; + } + interface CustomMetrics { + /** Collection of custom metrics. */ + items?: CustomMetric[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this custom metric collection. */ + nextLink?: string; + /** Link to previous page for this custom metric collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface EntityAdWordsLink { + /** A list of AdWords client accounts. These cannot be MCC accounts. This field is required when creating an AdWords link. It cannot be empty. */ + adWordsAccounts?: AdWordsAccount[]; + /** Web property being linked. */ + entity?: { + webPropertyRef?: WebPropertyRef; + }; + /** Entity AdWords link ID */ + id?: string; + /** Resource type for entity AdWords link. */ + kind?: string; + /** Name of the link. This field is required when creating an AdWords link. */ + name?: string; + /** IDs of linked Views (Profiles) represented as strings. */ + profileIds?: string[]; + /** URL link for this Google Analytics - Google AdWords link. */ + selfLink?: string; + } + interface EntityAdWordsLinks { + /** A list of entity AdWords links. */ + items?: EntityAdWordsLink[]; + /** + * The maximum number of entries the response can contain, regardless of the actual number of entries returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Next link for this AdWords link collection. */ + nextLink?: string; + /** Previous link for this AdWords link collection. */ + previousLink?: string; + /** The starting index of the entries, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + } + interface EntityUserLink { + /** Entity for this link. It can be an account, a web property, or a view (profile). */ + entity?: { + /** Account for this link. */ + accountRef?: AccountRef; + /** View (Profile) for this link. */ + profileRef?: ProfileRef; + /** Web property for this link. */ + webPropertyRef?: WebPropertyRef; + }; + /** Entity user link ID */ + id?: string; + /** Resource type for entity user link. */ + kind?: string; + /** Permissions the user has for this entity. */ + permissions?: { + /** + * Effective permissions represent all the permissions that a user has for this entity. These include any implied permissions (e.g., EDIT implies VIEW) or + * inherited permissions from the parent entity. Effective permissions are read-only. + */ + effective?: string[]; + /** Permissions that a user has been assigned at this very level. Does not include any implied or inherited permissions. Local permissions are modifiable. */ + local?: string[]; + }; + /** Self link for this resource. */ + selfLink?: string; + /** User reference. */ + userRef?: UserRef; + } + interface EntityUserLinks { + /** A list of entity user links. */ + items?: EntityUserLink[]; + /** + * The maximum number of entries the response can contain, regardless of the actual number of entries returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Next link for this account collection. */ + nextLink?: string; + /** Previous link for this account collection. */ + previousLink?: string; + /** The starting index of the entries, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + } + interface Experiment { + /** Account ID to which this experiment belongs. This field is read-only. */ + accountId?: string; + /** Time the experiment was created. This field is read-only. */ + created?: string; + /** Notes about this experiment. */ + description?: string; + /** If true, the end user will be able to edit the experiment via the Google Analytics user interface. */ + editableInGaUi?: boolean; + /** + * The ending time of the experiment (the time the status changed from RUNNING to ENDED). This field is present only if the experiment has ended. This + * field is read-only. + */ + endTime?: string; + /** + * Boolean specifying whether to distribute traffic evenly across all variations. If the value is False, content experiments follows the default behavior + * of adjusting traffic dynamically based on variation performance. Optional -- defaults to False. This field may not be changed for an experiment whose + * status is ENDED. + */ + equalWeighting?: boolean; + /** Experiment ID. Required for patch and update. Disallowed for create. */ + id?: string; + /** Internal ID for the web property to which this experiment belongs. This field is read-only. */ + internalWebPropertyId?: string; + /** Resource type for an Analytics experiment. This field is read-only. */ + kind?: string; + /** + * An integer number in [3, 90]. Specifies the minimum length of the experiment. Can be changed for a running experiment. This field may not be changed + * for an experiments whose status is ENDED. + */ + minimumExperimentLengthInDays?: number; + /** Experiment name. This field may not be changed for an experiment whose status is ENDED. This field is required when creating an experiment. */ + name?: string; + /** + * The metric that the experiment is optimizing. Valid values: "ga:goal(n)Completions", "ga:adsenseAdsClicks", "ga:adsenseAdsViewed", "ga:adsenseRevenue", + * "ga:bounces", "ga:pageviews", "ga:sessionDuration", "ga:transactions", "ga:transactionRevenue". This field is required if status is "RUNNING" and + * servingFramework is one of "REDIRECT" or "API". + */ + objectiveMetric?: string; + /** + * Whether the objectiveMetric should be minimized or maximized. Possible values: "MAXIMUM", "MINIMUM". Optional--defaults to "MAXIMUM". Cannot be + * specified without objectiveMetric. Cannot be modified when status is "RUNNING" or "ENDED". + */ + optimizationType?: string; + /** Parent link for an experiment. Points to the view (profile) to which this experiment belongs. */ + parentLink?: { + /** Link to the view (profile) to which this experiment belongs. This field is read-only. */ + href?: string; + /** Value is "analytics#profile". This field is read-only. */ + type?: string; + }; + /** View (Profile) ID to which this experiment belongs. This field is read-only. */ + profileId?: string; + /** + * Why the experiment ended. Possible values: "STOPPED_BY_USER", "WINNER_FOUND", "EXPERIMENT_EXPIRED", "ENDED_WITH_NO_WINNER", "GOAL_OBJECTIVE_CHANGED". + * "ENDED_WITH_NO_WINNER" means that the experiment didn't expire but no winner was projected to be found. If the experiment status is changed via the API + * to ENDED this field is set to STOPPED_BY_USER. This field is read-only. + */ + reasonExperimentEnded?: string; + /** + * Boolean specifying whether variations URLS are rewritten to match those of the original. This field may not be changed for an experiments whose status + * is ENDED. + */ + rewriteVariationUrlsAsOriginal?: boolean; + /** Link for this experiment. This field is read-only. */ + selfLink?: string; + /** + * The framework used to serve the experiment variations and evaluate the results. One of: + * - REDIRECT: Google Analytics redirects traffic to different variation pages, reports the chosen variation and evaluates the results. + * - API: Google Analytics chooses and reports the variation to serve and evaluates the results; the caller is responsible for serving the selected + * variation. + * - EXTERNAL: The variations will be served externally and the chosen variation reported to Google Analytics. The caller is responsible for serving the + * selected variation and evaluating the results. + */ + servingFramework?: string; + /** The snippet of code to include on the control page(s). This field is read-only. */ + snippet?: string; + /** + * The starting time of the experiment (the time the status changed from READY_TO_RUN to RUNNING). This field is present only if the experiment has + * started. This field is read-only. + */ + startTime?: string; + /** + * Experiment status. Possible values: "DRAFT", "READY_TO_RUN", "RUNNING", "ENDED". Experiments can be created in the "DRAFT", "READY_TO_RUN" or "RUNNING" + * state. This field is required when creating an experiment. + */ + status?: string; + /** + * A floating-point number in (0, 1]. Specifies the fraction of the traffic that participates in the experiment. Can be changed for a running experiment. + * This field may not be changed for an experiments whose status is ENDED. + */ + trafficCoverage?: number; + /** Time the experiment was last modified. This field is read-only. */ + updated?: string; + /** + * Array of variations. The first variation in the array is the original. The number of variations may not change once an experiment is in the RUNNING + * state. At least two variations are required before status can be set to RUNNING. + */ + variations?: Array<{ + /** The name of the variation. This field is required when creating an experiment. This field may not be changed for an experiment whose status is ENDED. */ + name?: string; + /** + * Status of the variation. Possible values: "ACTIVE", "INACTIVE". INACTIVE variations are not served. This field may not be changed for an experiment + * whose status is ENDED. + */ + status?: string; + /** The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED. */ + url?: string; + /** Weight that this variation should receive. Only present if the experiment is running. This field is read-only. */ + weight?: number; + /** True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only. */ + won?: boolean; + }>; + /** Web property ID to which this experiment belongs. The web property ID is of the form UA-XXXXX-YY. This field is read-only. */ + webPropertyId?: string; + /** + * A floating-point number in (0, 1). Specifies the necessary confidence level to choose a winner. This field may not be changed for an experiments whose + * status is ENDED. + */ + winnerConfidenceLevel?: number; + /** Boolean specifying whether a winner has been found for this experiment. This field is read-only. */ + winnerFound?: boolean; + } + interface Experiments { + /** A list of experiments. */ + items?: Experiment[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this experiment collection. */ + nextLink?: string; + /** Link to previous page for this experiment collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of resources in the result. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface Filter { + /** Account ID to which this filter belongs. */ + accountId?: string; + /** Details for the filter of the type ADVANCED. */ + advancedDetails?: { + /** Indicates if the filter expressions are case sensitive. */ + caseSensitive?: boolean; + /** Expression to extract from field A. */ + extractA?: string; + /** Expression to extract from field B. */ + extractB?: string; + /** Field A. */ + fieldA?: string; + /** The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION. */ + fieldAIndex?: number; + /** Indicates if field A is required to match. */ + fieldARequired?: boolean; + /** Field B. */ + fieldB?: string; + /** The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION. */ + fieldBIndex?: number; + /** Indicates if field B is required to match. */ + fieldBRequired?: boolean; + /** Expression used to construct the output value. */ + outputConstructor?: string; + /** Output field. */ + outputToField?: string; + /** The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION. */ + outputToFieldIndex?: number; + /** Indicates if the existing value of the output field, if any, should be overridden by the output expression. */ + overrideOutputField?: boolean; + }; + /** Time this filter was created. */ + created?: string; + /** Details for the filter of the type EXCLUDE. */ + excludeDetails?: FilterExpression; + /** Filter ID. */ + id?: string; + /** Details for the filter of the type INCLUDE. */ + includeDetails?: FilterExpression; + /** Resource type for Analytics filter. */ + kind?: string; + /** Details for the filter of the type LOWER. */ + lowercaseDetails?: { + /** Field to use in the filter. */ + field?: string; + /** The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION. */ + fieldIndex?: number; + }; + /** Name of this filter. */ + name?: string; + /** Parent link for this filter. Points to the account to which this filter belongs. */ + parentLink?: { + /** Link to the account to which this filter belongs. */ + href?: string; + /** Value is "analytics#account". */ + type?: string; + }; + /** Details for the filter of the type SEARCH_AND_REPLACE. */ + searchAndReplaceDetails?: { + /** Determines if the filter is case sensitive. */ + caseSensitive?: boolean; + /** Field to use in the filter. */ + field?: string; + /** The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION. */ + fieldIndex?: number; + /** Term to replace the search term with. */ + replaceString?: string; + /** Term to search. */ + searchString?: string; + }; + /** Link for this filter. */ + selfLink?: string; + /** Type of this filter. Possible values are INCLUDE, EXCLUDE, LOWERCASE, UPPERCASE, SEARCH_AND_REPLACE and ADVANCED. */ + type?: string; + /** Time this filter was last modified. */ + updated?: string; + /** Details for the filter of the type UPPER. */ + uppercaseDetails?: { + /** Field to use in the filter. */ + field?: string; + /** The Index of the custom dimension. Required if field is a CUSTOM_DIMENSION. */ + fieldIndex?: number; + }; + } + interface FilterExpression { + /** Determines if the filter is case sensitive. */ + caseSensitive?: boolean; + /** Filter expression value */ + expressionValue?: string; + /** + * Field to filter. Possible values: + * - Content and Traffic + * - PAGE_REQUEST_URI, + * - PAGE_HOSTNAME, + * - PAGE_TITLE, + * - REFERRAL, + * - COST_DATA_URI (Campaign target URL), + * - HIT_TYPE, + * - INTERNAL_SEARCH_TERM, + * - INTERNAL_SEARCH_TYPE, + * - SOURCE_PROPERTY_TRACKING_ID, + * - Campaign or AdGroup + * - CAMPAIGN_SOURCE, + * - CAMPAIGN_MEDIUM, + * - CAMPAIGN_NAME, + * - CAMPAIGN_AD_GROUP, + * - CAMPAIGN_TERM, + * - CAMPAIGN_CONTENT, + * - CAMPAIGN_CODE, + * - CAMPAIGN_REFERRAL_PATH, + * - E-Commerce + * - TRANSACTION_COUNTRY, + * - TRANSACTION_REGION, + * - TRANSACTION_CITY, + * - TRANSACTION_AFFILIATION (Store or order location), + * - ITEM_NAME, + * - ITEM_CODE, + * - ITEM_VARIATION, + * - TRANSACTION_ID, + * - TRANSACTION_CURRENCY_CODE, + * - PRODUCT_ACTION_TYPE, + * - Audience/Users + * - BROWSER, + * - BROWSER_VERSION, + * - BROWSER_SIZE, + * - PLATFORM, + * - PLATFORM_VERSION, + * - LANGUAGE, + * - SCREEN_RESOLUTION, + * - SCREEN_COLORS, + * - JAVA_ENABLED (Boolean Field), + * - FLASH_VERSION, + * - GEO_SPEED (Connection speed), + * - VISITOR_TYPE, + * - GEO_ORGANIZATION (ISP organization), + * - GEO_DOMAIN, + * - GEO_IP_ADDRESS, + * - GEO_IP_VERSION, + * - Location + * - GEO_COUNTRY, + * - GEO_REGION, + * - GEO_CITY, + * - Event + * - EVENT_CATEGORY, + * - EVENT_ACTION, + * - EVENT_LABEL, + * - Other + * - CUSTOM_FIELD_1, + * - CUSTOM_FIELD_2, + * - USER_DEFINED_VALUE, + * - Application + * - APP_ID, + * - APP_INSTALLER_ID, + * - APP_NAME, + * - APP_VERSION, + * - SCREEN, + * - IS_APP (Boolean Field), + * - IS_FATAL_EXCEPTION (Boolean Field), + * - EXCEPTION_DESCRIPTION, + * - Mobile device + * - IS_MOBILE (Boolean Field, Deprecated. Use DEVICE_CATEGORY=mobile), + * - IS_TABLET (Boolean Field, Deprecated. Use DEVICE_CATEGORY=tablet), + * - DEVICE_CATEGORY, + * - MOBILE_HAS_QWERTY_KEYBOARD (Boolean Field), + * - MOBILE_HAS_NFC_SUPPORT (Boolean Field), + * - MOBILE_HAS_CELLULAR_RADIO (Boolean Field), + * - MOBILE_HAS_WIFI_SUPPORT (Boolean Field), + * - MOBILE_BRAND_NAME, + * - MOBILE_MODEL_NAME, + * - MOBILE_MARKETING_NAME, + * - MOBILE_POINTING_METHOD, + * - Social + * - SOCIAL_NETWORK, + * - SOCIAL_ACTION, + * - SOCIAL_ACTION_TARGET, + * - Custom dimension + * - CUSTOM_DIMENSION (See accompanying field index), + */ + field?: string; + /** The Index of the custom dimension. Set only if the field is a is CUSTOM_DIMENSION. */ + fieldIndex?: number; + /** Kind value for filter expression */ + kind?: string; + /** + * Match type for this filter. Possible values are BEGINS_WITH, EQUAL, ENDS_WITH, CONTAINS, or MATCHES. GEO_DOMAIN, GEO_IP_ADDRESS, PAGE_REQUEST_URI, or + * PAGE_HOSTNAME filters can use any match type; all other filters must use MATCHES. + */ + matchType?: string; + } + interface FilterRef { + /** Account ID to which this filter belongs. */ + accountId?: string; + /** Link for this filter. */ + href?: string; + /** Filter ID. */ + id?: string; + /** Kind value for filter reference. */ + kind?: string; + /** Name of this filter. */ + name?: string; + } + interface Filters { + /** A list of filters. */ + items?: Filter[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1,000 with + * a value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this filter collection. */ + nextLink?: string; + /** Link to previous page for this filter collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface GaData { + /** Column headers that list dimension names followed by the metric names. The order of dimensions and metrics is same as specified in the request. */ + columnHeaders?: Array<{ + /** Column Type. Either DIMENSION or METRIC. */ + columnType?: string; + /** + * Data type. Dimension column headers have only STRING as the data type. Metric column headers have data types for metric values such as INTEGER, DOUBLE, + * CURRENCY etc. + */ + dataType?: string; + /** Column name. */ + name?: string; + }>; + /** Determines if Analytics data contains samples. */ + containsSampledData?: boolean; + /** The last refreshed time in seconds for Analytics data. */ + dataLastRefreshed?: string; + dataTable?: { + cols?: Array<{ + id?: string; + label?: string; + type?: string; + }>; + rows?: Array<{ + c?: Array<{ + v?: string; + }>; + }>; + }; + /** Unique ID for this data response. */ + id?: string; + /** + * The maximum number of rows the response can contain, regardless of the actual number of rows returned. Its value ranges from 1 to 10,000 with a value + * of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Resource type. */ + kind?: string; + /** Link to next page for this Analytics data query. */ + nextLink?: string; + /** Link to previous page for this Analytics data query. */ + previousLink?: string; + /** Information for the view (profile), for which the Analytics data was requested. */ + profileInfo?: { + /** Account ID to which this view (profile) belongs. */ + accountId?: string; + /** Internal ID for the web property to which this view (profile) belongs. */ + internalWebPropertyId?: string; + /** View (Profile) ID. */ + profileId?: string; + /** View (Profile) name. */ + profileName?: string; + /** Table ID for view (profile). */ + tableId?: string; + /** Web Property ID to which this view (profile) belongs. */ + webPropertyId?: string; + }; + /** Analytics data request query parameters. */ + query?: { + /** List of analytics dimensions. */ + dimensions?: string; + /** End date. */ + "end-date"?: string; + /** Comma-separated list of dimension or metric filters. */ + filters?: string; + /** Unique table ID. */ + ids?: string; + /** Maximum results per page. */ + "max-results"?: number; + /** List of analytics metrics. */ + metrics?: string[]; + /** Desired sampling level */ + samplingLevel?: string; + /** Analytics advanced segment. */ + segment?: string; + /** List of dimensions or metrics based on which Analytics data is sorted. */ + sort?: string[]; + /** Start date. */ + "start-date"?: string; + /** Start index. */ + "start-index"?: number; + }; + /** + * Analytics data rows, where each row contains a list of dimension values followed by the metric values. The order of dimensions and metrics is same as + * specified in the request. + */ + rows?: string[][]; + /** The number of samples used to calculate the result. */ + sampleSize?: string; + /** Total size of the sample space from which the samples were selected. */ + sampleSpace?: string; + /** Link to this page. */ + selfLink?: string; + /** The total number of rows for the query, regardless of the number of rows in the response. */ + totalResults?: number; + /** + * Total values for the requested metrics over all the results, not just the results returned in this response. The order of the metric totals is same as + * the metric order specified in the request. + */ + totalsForAllResults?: Record; + } + interface Goal { + /** Account ID to which this goal belongs. */ + accountId?: string; + /** Determines whether this goal is active. */ + active?: boolean; + /** Time this goal was created. */ + created?: string; + /** Details for the goal of the type EVENT. */ + eventDetails?: { + /** List of event conditions. */ + eventConditions?: Array<{ + /** Type of comparison. Possible values are LESS_THAN, GREATER_THAN or EQUAL. */ + comparisonType?: string; + /** Value used for this comparison. */ + comparisonValue?: string; + /** Expression used for this match. */ + expression?: string; + /** Type of the match to be performed. Possible values are REGEXP, BEGINS_WITH, or EXACT. */ + matchType?: string; + /** Type of this event condition. Possible values are CATEGORY, ACTION, LABEL, or VALUE. */ + type?: string; + }>; + /** Determines if the event value should be used as the value for this goal. */ + useEventValue?: boolean; + }; + /** Goal ID. */ + id?: string; + /** Internal ID for the web property to which this goal belongs. */ + internalWebPropertyId?: string; + /** Resource type for an Analytics goal. */ + kind?: string; + /** Goal name. */ + name?: string; + /** Parent link for a goal. Points to the view (profile) to which this goal belongs. */ + parentLink?: { + /** Link to the view (profile) to which this goal belongs. */ + href?: string; + /** Value is "analytics#profile". */ + type?: string; + }; + /** View (Profile) ID to which this goal belongs. */ + profileId?: string; + /** Link for this goal. */ + selfLink?: string; + /** Goal type. Possible values are URL_DESTINATION, VISIT_TIME_ON_SITE, VISIT_NUM_PAGES, AND EVENT. */ + type?: string; + /** Time this goal was last modified. */ + updated?: string; + /** Details for the goal of the type URL_DESTINATION. */ + urlDestinationDetails?: { + /** Determines if the goal URL must exactly match the capitalization of visited URLs. */ + caseSensitive?: boolean; + /** Determines if the first step in this goal is required. */ + firstStepRequired?: boolean; + /** Match type for the goal URL. Possible values are HEAD, EXACT, or REGEX. */ + matchType?: string; + /** List of steps configured for this goal funnel. */ + steps?: Array<{ + /** Step name. */ + name?: string; + /** Step number. */ + number?: number; + /** URL for this step. */ + url?: string; + }>; + /** URL for this goal. */ + url?: string; + }; + /** Goal value. */ + value?: number; + /** Details for the goal of the type VISIT_NUM_PAGES. */ + visitNumPagesDetails?: { + /** Type of comparison. Possible values are LESS_THAN, GREATER_THAN, or EQUAL. */ + comparisonType?: string; + /** Value used for this comparison. */ + comparisonValue?: string; + }; + /** Details for the goal of the type VISIT_TIME_ON_SITE. */ + visitTimeOnSiteDetails?: { + /** Type of comparison. Possible values are LESS_THAN or GREATER_THAN. */ + comparisonType?: string; + /** Value used for this comparison. */ + comparisonValue?: string; + }; + /** Web property ID to which this goal belongs. The web property ID is of the form UA-XXXXX-YY. */ + webPropertyId?: string; + } + interface Goals { + /** A list of goals. */ + items?: Goal[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this goal collection. */ + nextLink?: string; + /** Link to previous page for this goal collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of resources in the result. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface IncludeConditions { + /** + * The look-back window lets you specify a time frame for evaluating the behavior that qualifies users for your audience. For example, if your filters + * include users from Central Asia, and Transactions Greater than 2, and you set the look-back window to 14 days, then any user from Central Asia whose + * cumulative transactions exceed 2 during the last 14 days is added to the audience. + */ + daysToLookBack?: number; + /** Boolean indicating whether this segment is a smart list. https://support.google.com/analytics/answer/4628577 */ + isSmartList?: boolean; + /** Resource type for include conditions. */ + kind?: string; + /** Number of days (in the range 1 to 540) a user remains in the audience. */ + membershipDurationDays?: number; + /** The segment condition that will cause a user to be added to an audience. */ + segment?: string; + } + interface LinkedForeignAccount { + /** Account ID to which this linked foreign account belongs. */ + accountId?: string; + /** Boolean indicating whether this is eligible for search. */ + eligibleForSearch?: boolean; + /** Entity ad account link ID. */ + id?: string; + /** Internal ID for the web property to which this linked foreign account belongs. */ + internalWebPropertyId?: string; + /** Resource type for linked foreign account. */ + kind?: string; + /** The foreign account ID. For example the an AdWords `linkedAccountId` has the following format XXX-XXX-XXXX. */ + linkedAccountId?: string; + /** Remarketing audience ID to which this linked foreign account belongs. */ + remarketingAudienceId?: string; + /** The status of this foreign account link. */ + status?: string; + /** The type of the foreign account. For example, `ADWORDS_LINKS`, `DBM_LINKS`, `MCC_LINKS` or `OPTIMIZE`. */ + type?: string; + /** Web property ID of the form UA-XXXXX-YY to which this linked foreign account belongs. */ + webPropertyId?: string; + } + interface McfData { + /** Column headers that list dimension names followed by the metric names. The order of dimensions and metrics is same as specified in the request. */ + columnHeaders?: Array<{ + /** Column Type. Either DIMENSION or METRIC. */ + columnType?: string; + /** Data type. Dimension and metric values data types such as INTEGER, DOUBLE, CURRENCY, MCF_SEQUENCE etc. */ + dataType?: string; + /** Column name. */ + name?: string; + }>; + /** Determines if the Analytics data contains sampled data. */ + containsSampledData?: boolean; + /** Unique ID for this data response. */ + id?: string; + /** + * The maximum number of rows the response can contain, regardless of the actual number of rows returned. Its value ranges from 1 to 10,000 with a value + * of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Resource type. */ + kind?: string; + /** Link to next page for this Analytics data query. */ + nextLink?: string; + /** Link to previous page for this Analytics data query. */ + previousLink?: string; + /** Information for the view (profile), for which the Analytics data was requested. */ + profileInfo?: { + /** Account ID to which this view (profile) belongs. */ + accountId?: string; + /** Internal ID for the web property to which this view (profile) belongs. */ + internalWebPropertyId?: string; + /** View (Profile) ID. */ + profileId?: string; + /** View (Profile) name. */ + profileName?: string; + /** Table ID for view (profile). */ + tableId?: string; + /** Web Property ID to which this view (profile) belongs. */ + webPropertyId?: string; + }; + /** Analytics data request query parameters. */ + query?: { + /** List of analytics dimensions. */ + dimensions?: string; + /** End date. */ + "end-date"?: string; + /** Comma-separated list of dimension or metric filters. */ + filters?: string; + /** Unique table ID. */ + ids?: string; + /** Maximum results per page. */ + "max-results"?: number; + /** List of analytics metrics. */ + metrics?: string[]; + /** Desired sampling level */ + samplingLevel?: string; + /** Analytics advanced segment. */ + segment?: string; + /** List of dimensions or metrics based on which Analytics data is sorted. */ + sort?: string[]; + /** Start date. */ + "start-date"?: string; + /** Start index. */ + "start-index"?: number; + }; + /** + * Analytics data rows, where each row contains a list of dimension values followed by the metric values. The order of dimensions and metrics is same as + * specified in the request. + */ + rows?: Array; + /** A primitive dimension value. A primitive metric value. */ + primitiveValue?: string; + }>>; + /** The number of samples used to calculate the result. */ + sampleSize?: string; + /** Total size of the sample space from which the samples were selected. */ + sampleSpace?: string; + /** Link to this page. */ + selfLink?: string; + /** The total number of rows for the query, regardless of the number of rows in the response. */ + totalResults?: number; + /** + * Total values for the requested metrics over all the results, not just the results returned in this response. The order of the metric totals is same as + * the metric order specified in the request. + */ + totalsForAllResults?: Record; + } + interface Profile { + /** Account ID to which this view (profile) belongs. */ + accountId?: string; + /** Indicates whether bot filtering is enabled for this view (profile). */ + botFilteringEnabled?: boolean; + /** Child link for this view (profile). Points to the list of goals for this view (profile). */ + childLink?: { + /** Link to the list of goals for this view (profile). */ + href?: string; + /** Value is "analytics#goals". */ + type?: string; + }; + /** Time this view (profile) was created. */ + created?: string; + /** + * The currency type associated with this view (profile), defaults to USD. The supported values are: + * USD, JPY, EUR, GBP, AUD, KRW, BRL, CNY, DKK, RUB, SEK, NOK, PLN, TRY, TWD, HKD, THB, IDR, ARS, MXN, VND, PHP, INR, CHF, CAD, CZK, NZD, HUF, BGN, LTL, + * ZAR, UAH, AED, BOB, CLP, COP, EGP, HRK, ILS, MAD, MYR, PEN, PKR, RON, RSD, SAR, SGD, VEF, LVL + */ + currency?: string; + /** Default page for this view (profile). */ + defaultPage?: string; + /** Indicates whether ecommerce tracking is enabled for this view (profile). */ + eCommerceTracking?: boolean; + /** Indicates whether enhanced ecommerce tracking is enabled for this view (profile). This property can only be enabled if ecommerce tracking is enabled. */ + enhancedECommerceTracking?: boolean; + /** The query parameters that are excluded from this view (profile). */ + excludeQueryParameters?: string; + /** View (Profile) ID. */ + id?: string; + /** Internal ID for the web property to which this view (profile) belongs. */ + internalWebPropertyId?: string; + /** Resource type for Analytics view (profile). */ + kind?: string; + /** Name of this view (profile). */ + name?: string; + /** Parent link for this view (profile). Points to the web property to which this view (profile) belongs. */ + parentLink?: { + /** Link to the web property to which this view (profile) belongs. */ + href?: string; + /** Value is "analytics#webproperty". */ + type?: string; + }; + /** Permissions the user has for this view (profile). */ + permissions?: { + /** + * All the permissions that the user has for this view (profile). These include any implied permissions (e.g., EDIT implies VIEW) or inherited permissions + * from the parent web property. + */ + effective?: string[]; + }; + /** Link for this view (profile). */ + selfLink?: string; + /** Site search category parameters for this view (profile). */ + siteSearchCategoryParameters?: string; + /** The site search query parameters for this view (profile). */ + siteSearchQueryParameters?: string; + /** Indicates whether this view (profile) is starred or not. */ + starred?: boolean; + /** Whether or not Analytics will strip search category parameters from the URLs in your reports. */ + stripSiteSearchCategoryParameters?: boolean; + /** Whether or not Analytics will strip search query parameters from the URLs in your reports. */ + stripSiteSearchQueryParameters?: boolean; + /** Time zone for which this view (profile) has been configured. Time zones are identified by strings from the TZ database. */ + timezone?: string; + /** View (Profile) type. Supported types: WEB or APP. */ + type?: string; + /** Time this view (profile) was last modified. */ + updated?: string; + /** Web property ID of the form UA-XXXXX-YY to which this view (profile) belongs. */ + webPropertyId?: string; + /** Website URL for this view (profile). */ + websiteUrl?: string; + } + interface ProfileFilterLink { + /** Filter for this link. */ + filterRef?: FilterRef; + /** Profile filter link ID. */ + id?: string; + /** Resource type for Analytics filter. */ + kind?: string; + /** View (Profile) for this link. */ + profileRef?: ProfileRef; + /** + * The rank of this profile filter link relative to the other filters linked to the same profile. + * For readonly (i.e., list and get) operations, the rank always starts at 1. + * For write (i.e., create, update, or delete) operations, you may specify a value between 0 and 255 inclusively, [0, 255]. In order to insert a link at + * the end of the list, either don't specify a rank or set a rank to a number greater than the largest rank in the list. In order to insert a link to the + * beginning of the list specify a rank that is less than or equal to 1. The new link will move all existing filters with the same or lower rank down the + * list. After the link is inserted/updated/deleted all profile filter links will be renumbered starting at 1. + */ + rank?: number; + /** Link for this profile filter link. */ + selfLink?: string; + } + interface ProfileFilterLinks { + /** A list of profile filter links. */ + items?: ProfileFilterLink[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1,000 with + * a value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this profile filter link collection. */ + nextLink?: string; + /** Link to previous page for this profile filter link collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface ProfileRef { + /** Account ID to which this view (profile) belongs. */ + accountId?: string; + /** Link for this view (profile). */ + href?: string; + /** View (Profile) ID. */ + id?: string; + /** Internal ID for the web property to which this view (profile) belongs. */ + internalWebPropertyId?: string; + /** Analytics view (profile) reference. */ + kind?: string; + /** Name of this view (profile). */ + name?: string; + /** Web property ID of the form UA-XXXXX-YY to which this view (profile) belongs. */ + webPropertyId?: string; + } + interface ProfileSummary { + /** View (profile) ID. */ + id?: string; + /** Resource type for Analytics ProfileSummary. */ + kind?: string; + /** View (profile) name. */ + name?: string; + /** Indicates whether this view (profile) is starred or not. */ + starred?: boolean; + /** View (Profile) type. Supported types: WEB or APP. */ + type?: string; + } + interface Profiles { + /** A list of views (profiles). */ + items?: Profile[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this view (profile) collection. */ + nextLink?: string; + /** Link to previous page for this view (profile) collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface RealtimeData { + /** Column headers that list dimension names followed by the metric names. The order of dimensions and metrics is same as specified in the request. */ + columnHeaders?: Array<{ + /** Column Type. Either DIMENSION or METRIC. */ + columnType?: string; + /** + * Data type. Dimension column headers have only STRING as the data type. Metric column headers have data types for metric values such as INTEGER, DOUBLE, + * CURRENCY etc. + */ + dataType?: string; + /** Column name. */ + name?: string; + }>; + /** Unique ID for this data response. */ + id?: string; + /** Resource type. */ + kind?: string; + /** Information for the view (profile), for which the real time data was requested. */ + profileInfo?: { + /** Account ID to which this view (profile) belongs. */ + accountId?: string; + /** Internal ID for the web property to which this view (profile) belongs. */ + internalWebPropertyId?: string; + /** View (Profile) ID. */ + profileId?: string; + /** View (Profile) name. */ + profileName?: string; + /** Table ID for view (profile). */ + tableId?: string; + /** Web Property ID to which this view (profile) belongs. */ + webPropertyId?: string; + }; + /** Real time data request query parameters. */ + query?: { + /** List of real time dimensions. */ + dimensions?: string; + /** Comma-separated list of dimension or metric filters. */ + filters?: string; + /** Unique table ID. */ + ids?: string; + /** Maximum results per page. */ + "max-results"?: number; + /** List of real time metrics. */ + metrics?: string[]; + /** List of dimensions or metrics based on which real time data is sorted. */ + sort?: string[]; + }; + /** + * Real time data rows, where each row contains a list of dimension values followed by the metric values. The order of dimensions and metrics is same as + * specified in the request. + */ + rows?: string[][]; + /** Link to this page. */ + selfLink?: string; + /** The total number of rows for the query, regardless of the number of rows in the response. */ + totalResults?: number; + /** + * Total values for the requested metrics over all the results, not just the results returned in this response. The order of the metric totals is same as + * the metric order specified in the request. + */ + totalsForAllResults?: Record; + } + interface RemarketingAudience { + /** Account ID to which this remarketing audience belongs. */ + accountId?: string; + /** The simple audience definition that will cause a user to be added to an audience. */ + audienceDefinition?: { + /** Defines the conditions to include users to the audience. */ + includeConditions?: IncludeConditions; + }; + /** The type of audience, either SIMPLE or STATE_BASED. */ + audienceType?: string; + /** Time this remarketing audience was created. */ + created?: string; + /** The description of this remarketing audience. */ + description?: string; + /** Remarketing Audience ID. */ + id?: string; + /** Internal ID for the web property to which this remarketing audience belongs. */ + internalWebPropertyId?: string; + /** Collection type. */ + kind?: string; + /** The linked ad accounts associated with this remarketing audience. A remarketing audience can have only one linkedAdAccount currently. */ + linkedAdAccounts?: LinkedForeignAccount[]; + /** The views (profiles) that this remarketing audience is linked to. */ + linkedViews?: string[]; + /** The name of this remarketing audience. */ + name?: string; + /** A state based audience definition that will cause a user to be added or removed from an audience. */ + stateBasedAudienceDefinition?: { + /** Defines the conditions to exclude users from the audience. */ + excludeConditions?: { + /** Whether to make the exclusion TEMPORARY or PERMANENT. */ + exclusionDuration?: string; + /** The segment condition that will cause a user to be removed from an audience. */ + segment?: string; + }; + /** Defines the conditions to include users to the audience. */ + includeConditions?: IncludeConditions; + }; + /** Time this remarketing audience was last modified. */ + updated?: string; + /** Web property ID of the form UA-XXXXX-YY to which this remarketing audience belongs. */ + webPropertyId?: string; + } + interface RemarketingAudiences { + /** A list of remarketing audiences. */ + items?: RemarketingAudience[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this remarketing audience collection. */ + nextLink?: string; + /** Link to previous page for this view (profile) collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface Segment { + /** Time the segment was created. */ + created?: string; + /** Segment definition. */ + definition?: string; + /** Segment ID. */ + id?: string; + /** Resource type for Analytics segment. */ + kind?: string; + /** Segment name. */ + name?: string; + /** Segment ID. Can be used with the 'segment' parameter in Core Reporting API. */ + segmentId?: string; + /** Link for this segment. */ + selfLink?: string; + /** Type for a segment. Possible values are "BUILT_IN" or "CUSTOM". */ + type?: string; + /** Time the segment was last modified. */ + updated?: string; + } + interface Segments { + /** A list of segments. */ + items?: Segment[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type for segments. */ + kind?: string; + /** Link to next page for this segment collection. */ + nextLink?: string; + /** Link to previous page for this segment collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface UnsampledReport { + /** Account ID to which this unsampled report belongs. */ + accountId?: string; + /** Download details for a file stored in Google Cloud Storage. */ + cloudStorageDownloadDetails?: { + /** Id of the bucket the file object is stored in. */ + bucketId?: string; + /** Id of the file object containing the report data. */ + objectId?: string; + }; + /** Time this unsampled report was created. */ + created?: string; + /** The dimensions for the unsampled report. */ + dimensions?: string; + /** + * The type of download you need to use for the report data file. Possible values include `GOOGLE_DRIVE` and `GOOGLE_CLOUD_STORAGE`. If the value is + * `GOOGLE_DRIVE`, see the `driveDownloadDetails` field. If the value is `GOOGLE_CLOUD_STORAGE`, see the `cloudStorageDownloadDetails` field. + */ + downloadType?: string; + /** Download details for a file stored in Google Drive. */ + driveDownloadDetails?: { + /** Id of the document/file containing the report data. */ + documentId?: string; + }; + /** The end date for the unsampled report. */ + "end-date"?: string; + /** The filters for the unsampled report. */ + filters?: string; + /** Unsampled report ID. */ + id?: string; + /** Resource type for an Analytics unsampled report. */ + kind?: string; + /** The metrics for the unsampled report. */ + metrics?: string; + /** View (Profile) ID to which this unsampled report belongs. */ + profileId?: string; + /** The segment for the unsampled report. */ + segment?: string; + /** Link for this unsampled report. */ + selfLink?: string; + /** The start date for the unsampled report. */ + "start-date"?: string; + /** Status of this unsampled report. Possible values are PENDING, COMPLETED, or FAILED. */ + status?: string; + /** Title of the unsampled report. */ + title?: string; + /** Time this unsampled report was last modified. */ + updated?: string; + /** Web property ID to which this unsampled report belongs. The web property ID is of the form UA-XXXXX-YY. */ + webPropertyId?: string; + } + interface UnsampledReports { + /** A list of unsampled reports. */ + items?: UnsampledReport[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this unsampled report collection. */ + nextLink?: string; + /** Link to previous page for this unsampled report collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of resources in the result. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface Upload { + /** Account Id to which this upload belongs. */ + accountId?: string; + /** Custom data source Id to which this data import belongs. */ + customDataSourceId?: string; + /** Data import errors collection. */ + errors?: string[]; + /** A unique ID for this upload. */ + id?: string; + /** Resource type for Analytics upload. */ + kind?: string; + /** Upload status. Possible values: PENDING, COMPLETED, FAILED, DELETING, DELETED. */ + status?: string; + /** Time this file is uploaded. */ + uploadTime?: string; + } + interface Uploads { + /** A list of uploads. */ + items?: Upload[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this upload collection. */ + nextLink?: string; + /** Link to previous page for this upload collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of resources in the result. */ + totalResults?: number; + } + interface UserRef { + /** Email ID of this user. */ + email?: string; + /** User ID. */ + id?: string; + kind?: string; + } + interface WebPropertyRef { + /** Account ID to which this web property belongs. */ + accountId?: string; + /** Link for this web property. */ + href?: string; + /** Web property ID of the form UA-XXXXX-YY. */ + id?: string; + /** Internal ID for this web property. */ + internalWebPropertyId?: string; + /** Analytics web property reference. */ + kind?: string; + /** Name of this web property. */ + name?: string; + } + interface WebPropertySummary { + /** Web property ID of the form UA-XXXXX-YY. */ + id?: string; + /** Internal ID for this web property. */ + internalWebPropertyId?: string; + /** Resource type for Analytics WebPropertySummary. */ + kind?: string; + /** Level for this web property. Possible values are STANDARD or PREMIUM. */ + level?: string; + /** Web property name. */ + name?: string; + /** List of profiles under this web property. */ + profiles?: ProfileSummary[]; + /** Indicates whether this web property is starred or not. */ + starred?: boolean; + /** Website url for this web property. */ + websiteUrl?: string; + } + interface Webproperties { + /** A list of web properties. */ + items?: Webproperty[]; + /** + * The maximum number of resources the response can contain, regardless of the actual number of resources returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query parameter. + */ + itemsPerPage?: number; + /** Collection type. */ + kind?: string; + /** Link to next page for this web property collection. */ + nextLink?: string; + /** Link to previous page for this web property collection. */ + previousLink?: string; + /** The starting index of the resources, which is 1 by default or otherwise specified by the start-index query parameter. */ + startIndex?: number; + /** The total number of results for the query, regardless of the number of results in the response. */ + totalResults?: number; + /** Email ID of the authenticated user */ + username?: string; + } + interface Webproperty { + /** Account ID to which this web property belongs. */ + accountId?: string; + /** Child link for this web property. Points to the list of views (profiles) for this web property. */ + childLink?: { + /** Link to the list of views (profiles) for this web property. */ + href?: string; + /** Type of the parent link. Its value is "analytics#profiles". */ + type?: string; + }; + /** Time this web property was created. */ + created?: string; + /** Default view (profile) ID. */ + defaultProfileId?: string; + /** Web property ID of the form UA-XXXXX-YY. */ + id?: string; + /** The industry vertical/category selected for this web property. */ + industryVertical?: string; + /** Internal ID for this web property. */ + internalWebPropertyId?: string; + /** Resource type for Analytics WebProperty. */ + kind?: string; + /** Level for this web property. Possible values are STANDARD or PREMIUM. */ + level?: string; + /** Name of this web property. */ + name?: string; + /** Parent link for this web property. Points to the account to which this web property belongs. */ + parentLink?: { + /** Link to the account for this web property. */ + href?: string; + /** Type of the parent link. Its value is "analytics#account". */ + type?: string; + }; + /** Permissions the user has for this web property. */ + permissions?: { + /** + * All the permissions that the user has for this web property. These include any implied permissions (e.g., EDIT implies VIEW) or inherited permissions + * from the parent account. + */ + effective?: string[]; + }; + /** View (Profile) count for this web property. */ + profileCount?: number; + /** Link for this web property. */ + selfLink?: string; + /** Indicates whether this web property is starred or not. */ + starred?: boolean; + /** Time this web property was last modified. */ + updated?: string; + /** Website url for this web property. */ + websiteUrl?: string; + } + interface GaResource { + /** Returns Analytics data for a view (profile). */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** A comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city'. */ + dimensions?: string; + /** + * End date for fetching Analytics data. Request can should specify an end date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or + * 7daysAgo). The default value is yesterday. + */ + "end-date": string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** A comma-separated list of dimension or metric filters to be applied to Analytics data. */ + filters?: string; + /** Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. */ + ids: string; + /** The response will include empty rows if this parameter is set to true, the default is true */ + "include-empty-rows"?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of entries to include in this feed. */ + "max-results"?: number; + /** A comma-separated list of Analytics metrics. E.g., 'ga:sessions,ga:pageviews'. At least one metric must be specified. */ + metrics: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The selected format for the response. Default format is JSON. */ + output?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The desired sampling level. */ + samplingLevel?: string; + /** An Analytics segment to be applied to data. */ + segment?: string; + /** A comma-separated list of dimensions or metrics that determine the sort order for Analytics data. */ + sort?: string; + /** + * Start date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or + * 7daysAgo). The default value is 7daysAgo. + */ + "start-date": string; + /** An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface McfResource { + /** Returns Analytics Multi-Channel Funnels data for a view (profile). */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** A comma-separated list of Multi-Channel Funnels dimensions. E.g., 'mcf:source,mcf:medium'. */ + dimensions?: string; + /** + * End date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or + * 7daysAgo). The default value is 7daysAgo. + */ + "end-date": string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** A comma-separated list of dimension or metric filters to be applied to the Analytics data. */ + filters?: string; + /** Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. */ + ids: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of entries to include in this feed. */ + "max-results"?: number; + /** A comma-separated list of Multi-Channel Funnels metrics. E.g., 'mcf:totalConversions,mcf:totalConversionValue'. At least one metric must be specified. */ + metrics: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The desired sampling level. */ + samplingLevel?: string; + /** A comma-separated list of dimensions or metrics that determine the sort order for the Analytics data. */ + sort?: string; + /** + * Start date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or + * 7daysAgo). The default value is 7daysAgo. + */ + "start-date": string; + /** An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RealtimeResource { + /** Returns real time data for a view (profile). */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** A comma-separated list of real time dimensions. E.g., 'rt:medium,rt:city'. */ + dimensions?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** A comma-separated list of dimension or metric filters to be applied to real time data. */ + filters?: string; + /** Unique table ID for retrieving real time data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. */ + ids: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of entries to include in this feed. */ + "max-results"?: number; + /** A comma-separated list of real time metrics. E.g., 'rt:activeUsers'. At least one metric must be specified. */ + metrics: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** A comma-separated list of dimensions or metrics that determine the sort order for real time data. */ + sort?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DataResource { + ga: GaResource; + mcf: McfResource; + realtime: RealtimeResource; + } + interface AccountSummariesResource { + /** Lists account summaries (lightweight tree comprised of accounts/properties/profiles) to which the user has access. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of account summaries to include in this response, where the largest acceptable value is 1000. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AccountUserLinksResource { + /** Removes a user from the given account. */ + delete(request: { + /** Account ID to delete the user link for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Link ID to delete the user link for. */ + linkId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Adds a new user to the given account. */ + insert(request: { + /** Account ID to create the user link for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists account-user links for a given account. */ + list(request: { + /** Account ID to retrieve the user links for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of account-user links to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first account-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates permissions for an existing user on the given account. */ + update(request: { + /** Account ID to update the account-user link for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Link ID to update the account-user link for. */ + linkId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AccountsResource { + /** Lists all accounts to which the user has access. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of accounts to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first account to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CustomDataSourcesResource { + /** List custom data sources to which the user has access. */ + list(request: { + /** Account Id for the custom data sources to retrieve. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of custom data sources to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** A 1-based index of the first custom data source to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property Id for the custom data sources to retrieve. */ + webPropertyId: string; + }): Request; + } + interface CustomDimensionsResource { + /** Get a custom dimension to which the user has access. */ + get(request: { + /** Account ID for the custom dimension to retrieve. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** The ID of the custom dimension to retrieve. */ + customDimensionId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID for the custom dimension to retrieve. */ + webPropertyId: string; + }): Request; + /** Create a new custom dimension. */ + insert(request: { + /** Account ID for the custom dimension to create. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID for the custom dimension to create. */ + webPropertyId: string; + }): Request; + /** Lists custom dimensions to which the user has access. */ + list(request: { + /** Account ID for the custom dimensions to retrieve. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of custom dimensions to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID for the custom dimensions to retrieve. */ + webPropertyId: string; + }): Request; + /** Updates an existing custom dimension. This method supports patch semantics. */ + patch(request: { + /** Account ID for the custom dimension to update. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Custom dimension ID for the custom dimension to update. */ + customDimensionId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Force the update and ignore any warnings related to the custom dimension being linked to a custom data source / data set. */ + ignoreCustomDataSourceLinks?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID for the custom dimension to update. */ + webPropertyId: string; + }): Request; + /** Updates an existing custom dimension. */ + update(request: { + /** Account ID for the custom dimension to update. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Custom dimension ID for the custom dimension to update. */ + customDimensionId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Force the update and ignore any warnings related to the custom dimension being linked to a custom data source / data set. */ + ignoreCustomDataSourceLinks?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID for the custom dimension to update. */ + webPropertyId: string; + }): Request; + } + interface CustomMetricsResource { + /** Get a custom metric to which the user has access. */ + get(request: { + /** Account ID for the custom metric to retrieve. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** The ID of the custom metric to retrieve. */ + customMetricId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID for the custom metric to retrieve. */ + webPropertyId: string; + }): Request; + /** Create a new custom metric. */ + insert(request: { + /** Account ID for the custom metric to create. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID for the custom dimension to create. */ + webPropertyId: string; + }): Request; + /** Lists custom metrics to which the user has access. */ + list(request: { + /** Account ID for the custom metrics to retrieve. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of custom metrics to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID for the custom metrics to retrieve. */ + webPropertyId: string; + }): Request; + /** Updates an existing custom metric. This method supports patch semantics. */ + patch(request: { + /** Account ID for the custom metric to update. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Custom metric ID for the custom metric to update. */ + customMetricId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Force the update and ignore any warnings related to the custom metric being linked to a custom data source / data set. */ + ignoreCustomDataSourceLinks?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID for the custom metric to update. */ + webPropertyId: string; + }): Request; + /** Updates an existing custom metric. */ + update(request: { + /** Account ID for the custom metric to update. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Custom metric ID for the custom metric to update. */ + customMetricId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Force the update and ignore any warnings related to the custom metric being linked to a custom data source / data set. */ + ignoreCustomDataSourceLinks?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID for the custom metric to update. */ + webPropertyId: string; + }): Request; + } + interface ExperimentsResource { + /** Delete an experiment. */ + delete(request: { + /** Account ID to which the experiment belongs */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** ID of the experiment to delete */ + experimentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to which the experiment belongs */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to which the experiment belongs */ + webPropertyId: string; + }): Request; + /** Returns an experiment to which the user has access. */ + get(request: { + /** Account ID to retrieve the experiment for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Experiment ID to retrieve the experiment for. */ + experimentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to retrieve the experiment for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to retrieve the experiment for. */ + webPropertyId: string; + }): Request; + /** Create a new experiment. */ + insert(request: { + /** Account ID to create the experiment for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to create the experiment for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to create the experiment for. */ + webPropertyId: string; + }): Request; + /** Lists experiments to which the user has access. */ + list(request: { + /** Account ID to retrieve experiments for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of experiments to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to retrieve experiments for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first experiment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to retrieve experiments for. */ + webPropertyId: string; + }): Request; + /** Update an existing experiment. This method supports patch semantics. */ + patch(request: { + /** Account ID of the experiment to update. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Experiment ID of the experiment to update. */ + experimentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID of the experiment to update. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID of the experiment to update. */ + webPropertyId: string; + }): Request; + /** Update an existing experiment. */ + update(request: { + /** Account ID of the experiment to update. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Experiment ID of the experiment to update. */ + experimentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID of the experiment to update. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID of the experiment to update. */ + webPropertyId: string; + }): Request; + } + interface FiltersResource { + /** Delete a filter. */ + delete(request: { + /** Account ID to delete the filter for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** ID of the filter to be deleted. */ + filterId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns a filters to which the user has access. */ + get(request: { + /** Account ID to retrieve filters for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Filter ID to retrieve filters for. */ + filterId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Create a new filter. */ + insert(request: { + /** Account ID to create filter for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all filters for an account */ + list(request: { + /** Account ID to retrieve filters for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of filters to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing filter. This method supports patch semantics. */ + patch(request: { + /** Account ID to which the filter belongs. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** ID of the filter to be updated. */ + filterId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing filter. */ + update(request: { + /** Account ID to which the filter belongs. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** ID of the filter to be updated. */ + filterId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface GoalsResource { + /** Gets a goal to which the user has access. */ + get(request: { + /** Account ID to retrieve the goal for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Goal ID to retrieve the goal for. */ + goalId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to retrieve the goal for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to retrieve the goal for. */ + webPropertyId: string; + }): Request; + /** Create a new goal. */ + insert(request: { + /** Account ID to create the goal for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to create the goal for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to create the goal for. */ + webPropertyId: string; + }): Request; + /** Lists goals to which the user has access. */ + list(request: { + /** Account ID to retrieve goals for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of goals to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * View (Profile) ID to retrieve goals for. Can either be a specific view (profile) ID or '~all', which refers to all the views (profiles) that user has + * access to. + */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first goal to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** + * Web property ID to retrieve goals for. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access + * to. + */ + webPropertyId: string; + }): Request; + /** Updates an existing goal. This method supports patch semantics. */ + patch(request: { + /** Account ID to update the goal. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Index of the goal to be updated. */ + goalId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to update the goal. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to update the goal. */ + webPropertyId: string; + }): Request; + /** Updates an existing goal. */ + update(request: { + /** Account ID to update the goal. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Index of the goal to be updated. */ + goalId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to update the goal. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to update the goal. */ + webPropertyId: string; + }): Request; + } + interface ProfileFilterLinksResource { + /** Delete a profile filter link. */ + delete(request: { + /** Account ID to which the profile filter link belongs. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ID of the profile filter link to delete. */ + linkId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Profile ID to which the filter link belongs. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property Id to which the profile filter link belongs. */ + webPropertyId: string; + }): Request; + /** Returns a single profile filter link. */ + get(request: { + /** Account ID to retrieve profile filter link for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ID of the profile filter link. */ + linkId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Profile ID to retrieve filter link for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property Id to retrieve profile filter link for. */ + webPropertyId: string; + }): Request; + /** Create a new profile filter link. */ + insert(request: { + /** Account ID to create profile filter link for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Profile ID to create filter link for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property Id to create profile filter link for. */ + webPropertyId: string; + }): Request; + /** Lists all profile filter links for a profile. */ + list(request: { + /** Account ID to retrieve profile filter links for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of profile filter links to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Profile ID to retrieve filter links for. Can either be a specific profile ID or '~all', which refers to all the profiles that user has access to. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** + * Web property Id for profile filter links for. Can either be a specific web property ID or '~all', which refers to all the web properties that user has + * access to. + */ + webPropertyId: string; + }): Request; + /** Update an existing profile filter link. This method supports patch semantics. */ + patch(request: { + /** Account ID to which profile filter link belongs. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ID of the profile filter link to be updated. */ + linkId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Profile ID to which filter link belongs */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property Id to which profile filter link belongs */ + webPropertyId: string; + }): Request; + /** Update an existing profile filter link. */ + update(request: { + /** Account ID to which profile filter link belongs. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ID of the profile filter link to be updated. */ + linkId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Profile ID to which filter link belongs */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property Id to which profile filter link belongs */ + webPropertyId: string; + }): Request; + } + interface ProfileUserLinksResource { + /** Removes a user from the given view (profile). */ + delete(request: { + /** Account ID to delete the user link for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Link ID to delete the user link for. */ + linkId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to delete the user link for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web Property ID to delete the user link for. */ + webPropertyId: string; + }): Request; + /** Adds a new user to the given view (profile). */ + insert(request: { + /** Account ID to create the user link for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to create the user link for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web Property ID to create the user link for. */ + webPropertyId: string; + }): Request; + /** Lists profile-user links for a given view (profile). */ + list(request: { + /** Account ID which the given view (profile) belongs to. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of profile-user links to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * View (Profile) ID to retrieve the profile-user links for. Can either be a specific profile ID or '~all', which refers to all the profiles that user has + * access to. + */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first profile-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** + * Web Property ID which the given view (profile) belongs to. Can either be a specific web property ID or '~all', which refers to all the web properties + * that user has access to. + */ + webPropertyId: string; + }): Request; + /** Updates permissions for an existing user on the given view (profile). */ + update(request: { + /** Account ID to update the user link for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Link ID to update the user link for. */ + linkId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile ID) to update the user link for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web Property ID to update the user link for. */ + webPropertyId: string; + }): Request; + } + interface ProfilesResource { + /** Deletes a view (profile). */ + delete(request: { + /** Account ID to delete the view (profile) for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** ID of the view (profile) to be deleted. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to delete the view (profile) for. */ + webPropertyId: string; + }): Request; + /** Gets a view (profile) to which the user has access. */ + get(request: { + /** Account ID to retrieve the view (profile) for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to retrieve the view (profile) for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to retrieve the view (profile) for. */ + webPropertyId: string; + }): Request; + /** Create a new view (profile). */ + insert(request: { + /** Account ID to create the view (profile) for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to create the view (profile) for. */ + webPropertyId: string; + }): Request; + /** Lists views (profiles) to which the user has access. */ + list(request: { + /** + * Account ID for the view (profiles) to retrieve. Can either be a specific account ID or '~all', which refers to all the accounts to which the user has + * access. + */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of views (profiles) to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** + * Web property ID for the views (profiles) to retrieve. Can either be a specific web property ID or '~all', which refers to all the web properties to + * which the user has access. + */ + webPropertyId: string; + }): Request; + /** Updates an existing view (profile). This method supports patch semantics. */ + patch(request: { + /** Account ID to which the view (profile) belongs */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** ID of the view (profile) to be updated. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to which the view (profile) belongs */ + webPropertyId: string; + }): Request; + /** Updates an existing view (profile). */ + update(request: { + /** Account ID to which the view (profile) belongs */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** ID of the view (profile) to be updated. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to which the view (profile) belongs */ + webPropertyId: string; + }): Request; + } + interface RemarketingAudienceResource { + /** Delete a remarketing audience. */ + delete(request: { + /** Account ID to which the remarketing audience belongs. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the remarketing audience to delete. */ + remarketingAudienceId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to which the remarketing audience belongs. */ + webPropertyId: string; + }): Request; + /** Gets a remarketing audience to which the user has access. */ + get(request: { + /** The account ID of the remarketing audience to retrieve. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the remarketing audience to retrieve. */ + remarketingAudienceId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The web property ID of the remarketing audience to retrieve. */ + webPropertyId: string; + }): Request; + /** Creates a new remarketing audience. */ + insert(request: { + /** The account ID for which to create the remarketing audience. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID for which to create the remarketing audience. */ + webPropertyId: string; + }): Request; + /** Lists remarketing audiences to which the user has access. */ + list(request: { + /** The account ID of the remarketing audiences to retrieve. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of remarketing audiences to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + type?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The web property ID of the remarketing audiences to retrieve. */ + webPropertyId: string; + }): Request; + /** Updates an existing remarketing audience. This method supports patch semantics. */ + patch(request: { + /** The account ID of the remarketing audience to update. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the remarketing audience to update. */ + remarketingAudienceId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The web property ID of the remarketing audience to update. */ + webPropertyId: string; + }): Request; + /** Updates an existing remarketing audience. */ + update(request: { + /** The account ID of the remarketing audience to update. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the remarketing audience to update. */ + remarketingAudienceId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The web property ID of the remarketing audience to update. */ + webPropertyId: string; + }): Request; + } + interface SegmentsResource { + /** Lists segments to which the user has access. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of segments to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first segment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UnsampledReportsResource { + /** Deletes an unsampled report. */ + delete(request: { + /** Account ID to delete the unsampled report for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to delete the unsampled report for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ID of the unsampled report to be deleted. */ + unsampledReportId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to delete the unsampled reports for. */ + webPropertyId: string; + }): Request; + /** Returns a single unsampled report. */ + get(request: { + /** Account ID to retrieve unsampled report for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to retrieve unsampled report for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ID of the unsampled report to retrieve. */ + unsampledReportId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to retrieve unsampled reports for. */ + webPropertyId: string; + }): Request; + /** Create a new unsampled report. */ + insert(request: { + /** Account ID to create the unsampled report for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to create the unsampled report for. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to create the unsampled report for. */ + webPropertyId: string; + }): Request; + /** Lists unsampled reports to which the user has access. */ + list(request: { + /** Account ID to retrieve unsampled reports for. Must be a specific account ID, ~all is not supported. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of unsampled reports to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** View (Profile) ID to retrieve unsampled reports for. Must be a specific view (profile) ID, ~all is not supported. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first unsampled report to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to retrieve unsampled reports for. Must be a specific web property ID, ~all is not supported. */ + webPropertyId: string; + }): Request; + } + interface UploadsResource { + /** Delete data associated with a previous upload. */ + deleteUploadData(request: { + /** Account Id for the uploads to be deleted. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Custom data source Id for the uploads to be deleted. */ + customDataSourceId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property Id for the uploads to be deleted. */ + webPropertyId: string; + }): Request; + /** List uploads to which the user has access. */ + get(request: { + /** Account Id for the upload to retrieve. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Custom data source Id for upload to retrieve. */ + customDataSourceId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Upload Id to retrieve. */ + uploadId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property Id for the upload to retrieve. */ + webPropertyId: string; + }): Request; + /** List uploads to which the user has access. */ + list(request: { + /** Account Id for the uploads to retrieve. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Custom data source Id for uploads to retrieve. */ + customDataSourceId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of uploads to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** A 1-based index of the first upload to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property Id for the uploads to retrieve. */ + webPropertyId: string; + }): Request; + /** Upload data for a custom data source. */ + uploadData(request: { + /** Account Id associated with the upload. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Custom data source Id to which the data being uploaded belongs. */ + customDataSourceId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property UA-string associated with the upload. */ + webPropertyId: string; + }): Request; + } + interface WebPropertyAdWordsLinksResource { + /** Deletes a web property-AdWords link. */ + delete(request: { + /** ID of the account which the given web property belongs to. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property AdWords link ID. */ + webPropertyAdWordsLinkId: string; + /** Web property ID to delete the AdWords link for. */ + webPropertyId: string; + }): Request; + /** Returns a web property-AdWords link to which the user has access. */ + get(request: { + /** ID of the account which the given web property belongs to. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property-AdWords link ID. */ + webPropertyAdWordsLinkId: string; + /** Web property ID to retrieve the AdWords link for. */ + webPropertyId: string; + }): Request; + /** Creates a webProperty-AdWords link. */ + insert(request: { + /** ID of the Google Analytics account to create the link for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to create the link for. */ + webPropertyId: string; + }): Request; + /** Lists webProperty-AdWords links for a given web property. */ + list(request: { + /** ID of the account which the given web property belongs to. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of webProperty-AdWords links to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first webProperty-AdWords link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to retrieve the AdWords links for. */ + webPropertyId: string; + }): Request; + /** Updates an existing webProperty-AdWords link. This method supports patch semantics. */ + patch(request: { + /** ID of the account which the given web property belongs to. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property-AdWords link ID. */ + webPropertyAdWordsLinkId: string; + /** Web property ID to retrieve the AdWords link for. */ + webPropertyId: string; + }): Request; + /** Updates an existing webProperty-AdWords link. */ + update(request: { + /** ID of the account which the given web property belongs to. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property-AdWords link ID. */ + webPropertyAdWordsLinkId: string; + /** Web property ID to retrieve the AdWords link for. */ + webPropertyId: string; + }): Request; + } + interface WebpropertiesResource { + /** Gets a web property to which the user has access. */ + get(request: { + /** Account ID to retrieve the web property for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** ID to retrieve the web property for. */ + webPropertyId: string; + }): Request; + /** + * Create a new property if the account has fewer than 20 properties. Web properties are visible in the Google Analytics interface only if they have at + * least one profile. + */ + insert(request: { + /** Account ID to create the web property for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists web properties to which the user has access. */ + list(request: { + /** Account ID to retrieve web properties for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of web properties to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing web property. This method supports patch semantics. */ + patch(request: { + /** Account ID to which the web property belongs */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID */ + webPropertyId: string; + }): Request; + /** Updates an existing web property. */ + update(request: { + /** Account ID to which the web property belongs */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID */ + webPropertyId: string; + }): Request; + } + interface WebpropertyUserLinksResource { + /** Removes a user from the given web property. */ + delete(request: { + /** Account ID to delete the user link for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Link ID to delete the user link for. */ + linkId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web Property ID to delete the user link for. */ + webPropertyId: string; + }): Request; + /** Adds a new user to the given web property. */ + insert(request: { + /** Account ID to create the user link for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web Property ID to create the user link for. */ + webPropertyId: string; + }): Request; + /** Lists webProperty-user links for a given web property. */ + list(request: { + /** Account ID which the given web property belongs to. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of webProperty-user Links to include in this response. */ + "max-results"?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An index of the first webProperty-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. */ + "start-index"?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** + * Web Property ID for the webProperty-user links to retrieve. Can either be a specific web property ID or '~all', which refers to all the web properties + * that user has access to. + */ + webPropertyId: string; + }): Request; + /** Updates permissions for an existing user on the given web property. */ + update(request: { + /** Account ID to update the account-user link for. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Link ID to update the account-user link for. */ + linkId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Web property ID to update the account-user link for. */ + webPropertyId: string; + }): Request; + } + interface ManagementResource { + accountSummaries: AccountSummariesResource; + accountUserLinks: AccountUserLinksResource; + accounts: AccountsResource; + customDataSources: CustomDataSourcesResource; + customDimensions: CustomDimensionsResource; + customMetrics: CustomMetricsResource; + experiments: ExperimentsResource; + filters: FiltersResource; + goals: GoalsResource; + profileFilterLinks: ProfileFilterLinksResource; + profileUserLinks: ProfileUserLinksResource; + profiles: ProfilesResource; + remarketingAudience: RemarketingAudienceResource; + segments: SegmentsResource; + unsampledReports: UnsampledReportsResource; + uploads: UploadsResource; + webPropertyAdWordsLinks: WebPropertyAdWordsLinksResource; + webproperties: WebpropertiesResource; + webpropertyUserLinks: WebpropertyUserLinksResource; + } + interface ColumnsResource { + /** Lists all columns for a report type */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Report type. Allowed Values: 'ga'. Where 'ga' corresponds to the Core Reporting API */ + reportType: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface MetadataResource { + columns: ColumnsResource; + } + interface ProvisioningResource { + /** Creates an account ticket. */ + createAccountTicket(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.analytics/readme.md b/types/gapi.client.analytics/readme.md new file mode 100644 index 0000000000..a5d16c9613 --- /dev/null +++ b/types/gapi.client.analytics/readme.md @@ -0,0 +1,74 @@ +# TypeScript typings for Google Analytics API v3 +Views and manages your Google Analytics data. +For detailed description please check [documentation](https://developers.google.com/analytics/). + +## Installing + +Install typings for Google Analytics API: +``` +npm install @types/gapi.client.analytics@v3 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('analytics', 'v3', () => { + // now we can use gapi.client.analytics + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your Google Analytics data + 'https://www.googleapis.com/auth/analytics', + + // Edit Google Analytics management entities + 'https://www.googleapis.com/auth/analytics.edit', + + // Manage Google Analytics Account users by email address + 'https://www.googleapis.com/auth/analytics.manage.users', + + // View Google Analytics user permissions + 'https://www.googleapis.com/auth/analytics.manage.users.readonly', + + // Create a new Google Analytics account along with its default property and view + 'https://www.googleapis.com/auth/analytics.provision', + + // View your Google Analytics data + 'https://www.googleapis.com/auth/analytics.readonly', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Analytics API resources: + +```typescript + +/* +Creates an account ticket. +*/ +await gapi.client.provisioning.createAccountTicket({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.analytics/tsconfig.json b/types/gapi.client.analytics/tsconfig.json new file mode 100644 index 0000000000..24b9a3e308 --- /dev/null +++ b/types/gapi.client.analytics/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.analytics-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.analytics/tslint.json b/types/gapi.client.analytics/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.analytics/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.analyticsreporting/gapi.client.analyticsreporting-tests.ts b/types/gapi.client.analyticsreporting/gapi.client.analyticsreporting-tests.ts new file mode 100644 index 0000000000..bacc354694 --- /dev/null +++ b/types/gapi.client.analyticsreporting/gapi.client.analyticsreporting-tests.ts @@ -0,0 +1,37 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('analyticsreporting', 'v4', () => { + /** now we can use gapi.client.analyticsreporting */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your Google Analytics data */ + 'https://www.googleapis.com/auth/analytics', + /** View your Google Analytics data */ + 'https://www.googleapis.com/auth/analytics.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Returns the Analytics data. */ + await gapi.client.reports.batchGet({ + }); + } +}); diff --git a/types/gapi.client.analyticsreporting/index.d.ts b/types/gapi.client.analyticsreporting/index.d.ts new file mode 100644 index 0000000000..e5e1b7aabe --- /dev/null +++ b/types/gapi.client.analyticsreporting/index.d.ts @@ -0,0 +1,698 @@ +// Type definitions for Google Google Analytics Reporting API v4 4.0 +// Project: https://developers.google.com/analytics/devguides/reporting/core/v4/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://analyticsreporting.googleapis.com/$discovery/rest?version=v4 + +/// + +declare namespace gapi.client { + /** Load Google Analytics Reporting API v4 */ + function load(name: "analyticsreporting", version: "v4"): PromiseLike; + function load(name: "analyticsreporting", version: "v4", callback: () => any): void; + + const reports: analyticsreporting.ReportsResource; + + namespace analyticsreporting { + interface Cohort { + /** + * This is used for `FIRST_VISIT_DATE` cohort, the cohort selects users + * whose first visit date is between start date and end date defined in the + * DateRange. The date ranges should be aligned for cohort requests. If the + * request contains `ga:cohortNthDay` it should be exactly one day long, + * if `ga:cohortNthWeek` it should be aligned to the week boundary (starting + * at Sunday and ending Saturday), and for `ga:cohortNthMonth` the date range + * should be aligned to the month (starting at the first and ending on the + * last day of the month). + * For LTV requests there are no such restrictions. + * You do not need to supply a date range for the + * `reportsRequest.dateRanges` field. + */ + dateRange?: DateRange; + /** + * A unique name for the cohort. If not defined name will be auto-generated + * with values cohort_[1234...]. + */ + name?: string; + /** + * Type of the cohort. The only supported type as of now is + * `FIRST_VISIT_DATE`. If this field is unspecified the cohort is treated + * as `FIRST_VISIT_DATE` type cohort. + */ + type?: string; + } + interface CohortGroup { + /** The definition for the cohort. */ + cohorts?: Cohort[]; + /** + * Enable Life Time Value (LTV). LTV measures lifetime value for users + * acquired through different channels. + * Please see: + * [Cohort Analysis](https://support.google.com/analytics/answer/6074676) and + * [Lifetime Value](https://support.google.com/analytics/answer/6182550) + * If the value of lifetimeValue is false: + * + * - The metric values are similar to the values in the web interface cohort + * report. + * - The cohort definition date ranges must be aligned to the calendar week + * and month. i.e. while requesting `ga:cohortNthWeek` the `startDate` in + * the cohort definition should be a Sunday and the `endDate` should be the + * following Saturday, and for `ga:cohortNthMonth`, the `startDate` + * should be the 1st of the month and `endDate` should be the last day + * of the month. + * + * When the lifetimeValue is true: + * + * - The metric values will correspond to the values in the web interface + * LifeTime value report. + * - The Lifetime Value report shows you how user value (Revenue) and + * engagement (Appviews, Goal Completions, Sessions, and Session Duration) + * grow during the 90 days after a user is acquired. + * - The metrics are calculated as a cumulative average per user per the time + * increment. + * - The cohort definition date ranges need not be aligned to the calendar + * week and month boundaries. + * - The `viewId` must be an + * [app view ID](https://support.google.com/analytics/answer/2649553#WebVersusAppViews) + */ + lifetimeValue?: boolean; + } + interface ColumnHeader { + /** The dimension names in the response. */ + dimensions?: string[]; + /** Metric headers for the metrics in the response. */ + metricHeader?: MetricHeader; + } + interface DateRange { + /** The end date for the query in the format `YYYY-MM-DD`. */ + endDate?: string; + /** The start date for the query in the format `YYYY-MM-DD`. */ + startDate?: string; + } + interface DateRangeValues { + /** The values of each pivot region. */ + pivotValueRegions?: PivotValueRegion[]; + /** Each value corresponds to each Metric in the request. */ + values?: string[]; + } + interface Dimension { + /** + * If non-empty, we place dimension values into buckets after string to + * int64. Dimension values that are not the string representation of an + * integral value will be converted to zero. The bucket values have to be in + * increasing order. Each bucket is closed on the lower end, and open on the + * upper end. The "first" bucket includes all values less than the first + * boundary, the "last" bucket includes all values up to infinity. Dimension + * values that fall in a bucket get transformed to a new dimension value. For + * example, if one gives a list of "0, 1, 3, 4, 7", then we return the + * following buckets: + * + * - bucket #1: values < 0, dimension value "<0" + * - bucket #2: values in [0,1), dimension value "0" + * - bucket #3: values in [1,3), dimension value "1-2" + * - bucket #4: values in [3,4), dimension value "3" + * - bucket #5: values in [4,7), dimension value "4-6" + * - bucket #6: values >= 7, dimension value "7+" + * + * NOTE: If you are applying histogram mutation on any dimension, and using + * that dimension in sort, you will want to use the sort type + * `HISTOGRAM_BUCKET` for that purpose. Without that the dimension values + * will be sorted according to dictionary + * (lexicographic) order. For example the ascending dictionary order is: + * + * "<50", "1001+", "121-1000", "50-120" + * + * And the ascending `HISTOGRAM_BUCKET` order is: + * + * "<50", "50-120", "121-1000", "1001+" + * + * The client has to explicitly request `"orderType": "HISTOGRAM_BUCKET"` + * for a histogram-mutated dimension. + */ + histogramBuckets?: string[]; + /** Name of the dimension to fetch, for example `ga:browser`. */ + name?: string; + } + interface DimensionFilter { + /** Should the match be case sensitive? Default is false. */ + caseSensitive?: boolean; + /** The dimension to filter on. A DimensionFilter must contain a dimension. */ + dimensionName?: string; + /** + * Strings or regular expression to match against. Only the first value of + * the list is used for comparison unless the operator is `IN_LIST`. + * If `IN_LIST` operator, then the entire list is used to filter the + * dimensions as explained in the description of the `IN_LIST` operator. + */ + expressions?: string[]; + /** + * Logical `NOT` operator. If this boolean is set to true, then the matching + * dimension values will be excluded in the report. The default is false. + */ + not?: boolean; + /** How to match the dimension to the expression. The default is REGEXP. */ + operator?: string; + } + interface DimensionFilterClause { + /** + * The repeated set of filters. They are logically combined based on the + * operator specified. + */ + filters?: DimensionFilter[]; + /** + * The operator for combining multiple dimension filters. If unspecified, it + * is treated as an `OR`. + */ + operator?: string; + } + interface DynamicSegment { + /** The name of the dynamic segment. */ + name?: string; + /** Session Segment to select sessions to include in the segment. */ + sessionSegment?: SegmentDefinition; + /** User Segment to select users to include in the segment. */ + userSegment?: SegmentDefinition; + } + interface GetReportsRequest { + /** + * Requests, each request will have a separate response. + * There can be a maximum of 5 requests. All requests should have the same + * `dateRanges`, `viewId`, `segments`, `samplingLevel`, and `cohortGroup`. + */ + reportRequests?: ReportRequest[]; + } + interface GetReportsResponse { + /** Responses corresponding to each of the request. */ + reports?: Report[]; + } + interface Metric { + /** + * An alias for the metric expression is an alternate name for the + * expression. The alias can be used for filtering and sorting. This field + * is optional and is useful if the expression is not a single metric but + * a complex expression which cannot be used in filtering and sorting. + * The alias is also used in the response column header. + */ + alias?: string; + /** + * A metric expression in the request. An expression is constructed from one + * or more metrics and numbers. Accepted operators include: Plus (+), Minus + * (-), Negation (Unary -), Divided by (/), Multiplied by (*), Parenthesis, + * Positive cardinal numbers (0-9), can include decimals and is limited to + * 1024 characters. Example `ga:totalRefunds/ga:users`, in most cases the + * metric expression is just a single metric name like `ga:users`. + * Adding mixed `MetricType` (E.g., `CURRENCY` + `PERCENTAGE`) metrics + * will result in unexpected results. + */ + expression?: string; + /** + * Specifies how the metric expression should be formatted, for example + * `INTEGER`. + */ + formattingType?: string; + } + interface MetricFilter { + /** The value to compare against. */ + comparisonValue?: string; + /** + * The metric that will be filtered on. A metricFilter must contain a metric + * name. A metric name can be an alias earlier defined as a metric or it can + * also be a metric expression. + */ + metricName?: string; + /** + * Logical `NOT` operator. If this boolean is set to true, then the matching + * metric values will be excluded in the report. The default is false. + */ + not?: boolean; + /** + * Is the metric `EQUAL`, `LESS_THAN` or `GREATER_THAN` the + * comparisonValue, the default is `EQUAL`. If the operator is + * `IS_MISSING`, checks if the metric is missing and would ignore the + * comparisonValue. + */ + operator?: string; + } + interface MetricFilterClause { + /** + * The repeated set of filters. They are logically combined based on the + * operator specified. + */ + filters?: MetricFilter[]; + /** + * The operator for combining multiple metric filters. If unspecified, it is + * treated as an `OR`. + */ + operator?: string; + } + interface MetricHeader { + /** Headers for the metrics in the response. */ + metricHeaderEntries?: MetricHeaderEntry[]; + /** Headers for the pivots in the response. */ + pivotHeaders?: PivotHeader[]; + } + interface MetricHeaderEntry { + /** The name of the header. */ + name?: string; + /** The type of the metric, for example `INTEGER`. */ + type?: string; + } + interface OrFiltersForSegment { + /** List of segment filters to be combined with a `OR` operator. */ + segmentFilterClauses?: SegmentFilterClause[]; + } + interface OrderBy { + /** + * The field which to sort by. The default sort order is ascending. Example: + * `ga:browser`. + * Note, that you can only specify one field for sort here. For example, + * `ga:browser, ga:city` is not valid. + */ + fieldName?: string; + /** The order type. The default orderType is `VALUE`. */ + orderType?: string; + /** The sorting order for the field. */ + sortOrder?: string; + } + interface Pivot { + /** + * DimensionFilterClauses are logically combined with an `AND` operator: only + * data that is included by all these DimensionFilterClauses contributes to + * the values in this pivot region. Dimension filters can be used to restrict + * the columns shown in the pivot region. For example if you have + * `ga:browser` as the requested dimension in the pivot region, and you + * specify key filters to restrict `ga:browser` to only "IE" or "Firefox", + * then only those two browsers would show up as columns. + */ + dimensionFilterClauses?: DimensionFilterClause[]; + /** + * A list of dimensions to show as pivot columns. A Pivot can have a maximum + * of 4 dimensions. Pivot dimensions are part of the restriction on the + * total number of dimensions allowed in the request. + */ + dimensions?: Dimension[]; + /** + * Specifies the maximum number of groups to return. + * The default value is 10, also the maximum value is 1,000. + */ + maxGroupCount?: number; + /** + * The pivot metrics. Pivot metrics are part of the + * restriction on total number of metrics allowed in the request. + */ + metrics?: Metric[]; + /** + * If k metrics were requested, then the response will contain some + * data-dependent multiple of k columns in the report. E.g., if you pivoted + * on the dimension `ga:browser` then you'd get k columns for "Firefox", k + * columns for "IE", k columns for "Chrome", etc. The ordering of the groups + * of columns is determined by descending order of "total" for the first of + * the k values. Ties are broken by lexicographic ordering of the first + * pivot dimension, then lexicographic ordering of the second pivot + * dimension, and so on. E.g., if the totals for the first value for + * Firefox, IE, and Chrome were 8, 2, 8, respectively, the order of columns + * would be Chrome, Firefox, IE. + * + * The following let you choose which of the groups of k columns are + * included in the response. + */ + startGroup?: number; + } + interface PivotHeader { + /** A single pivot section header. */ + pivotHeaderEntries?: PivotHeaderEntry[]; + /** The total number of groups for this pivot. */ + totalPivotGroupsCount?: number; + } + interface PivotHeaderEntry { + /** The name of the dimensions in the pivot response. */ + dimensionNames?: string[]; + /** The values for the dimensions in the pivot. */ + dimensionValues?: string[]; + /** The metric header for the metric in the pivot. */ + metric?: MetricHeaderEntry; + } + interface PivotValueRegion { + /** The values of the metrics in each of the pivot regions. */ + values?: string[]; + } + interface Report { + /** The column headers. */ + columnHeader?: ColumnHeader; + /** Response data. */ + data?: ReportData; + /** Page token to retrieve the next page of results in the list. */ + nextPageToken?: string; + } + interface ReportData { + /** + * The last time the data in the report was refreshed. All the hits received + * before this timestamp are included in the calculation of the report. + */ + dataLastRefreshed?: string; + /** + * Indicates if response to this request is golden or not. Data is + * golden when the exact same request will not produce any new results if + * asked at a later point in time. + */ + isDataGolden?: boolean; + /** + * Minimum and maximum values seen over all matching rows. These are both + * empty when `hideValueRanges` in the request is false, or when + * rowCount is zero. + */ + maximums?: DateRangeValues[]; + /** + * Minimum and maximum values seen over all matching rows. These are both + * empty when `hideValueRanges` in the request is false, or when + * rowCount is zero. + */ + minimums?: DateRangeValues[]; + /** Total number of matching rows for this query. */ + rowCount?: number; + /** There's one ReportRow for every unique combination of dimensions. */ + rows?: ReportRow[]; + /** + * If the results are + * [sampled](https://support.google.com/analytics/answer/2637192), + * this returns the total number of samples read, one entry per date range. + * If the results are not sampled this field will not be defined. See + * [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling) + * for details. + */ + samplesReadCounts?: string[]; + /** + * If the results are + * [sampled](https://support.google.com/analytics/answer/2637192), + * this returns the total number of + * samples present, one entry per date range. If the results are not sampled + * this field will not be defined. See + * [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling) + * for details. + */ + samplingSpaceSizes?: string[]; + /** + * For each requested date range, for the set of all rows that match + * the query, every requested value format gets a total. The total + * for a value format is computed by first totaling the metrics + * mentioned in the value format and then evaluating the value + * format as a scalar expression. E.g., The "totals" for + * `3 / (ga:sessions + 2)` we compute + * `3 / ((sum of all relevant ga:sessions) + 2)`. + * Totals are computed before pagination. + */ + totals?: DateRangeValues[]; + } + interface ReportRequest { + /** + * Cohort group associated with this request. If there is a cohort group + * in the request the `ga:cohort` dimension must be present. + * Every [ReportRequest](#ReportRequest) within a `batchGet` method must + * contain the same `cohortGroup` definition. + */ + cohortGroup?: CohortGroup; + /** + * Date ranges in the request. The request can have a maximum of 2 date + * ranges. The response will contain a set of metric values for each + * combination of the dimensions for each date range in the request. So, if + * there are two date ranges, there will be two set of metric values, one for + * the original date range and one for the second date range. + * The `reportRequest.dateRanges` field should not be specified for cohorts + * or Lifetime value requests. + * If a date range is not provided, the default date range is (startDate: + * current date - 7 days, endDate: current date - 1 day). Every + * [ReportRequest](#ReportRequest) within a `batchGet` method must + * contain the same `dateRanges` definition. + */ + dateRanges?: DateRange[]; + /** + * The dimension filter clauses for filtering Dimension Values. They are + * logically combined with the `AND` operator. Note that filtering occurs + * before any dimensions are aggregated, so that the returned metrics + * represent the total for only the relevant dimensions. + */ + dimensionFilterClauses?: DimensionFilterClause[]; + /** + * The dimensions requested. + * Requests can have a total of 7 dimensions. + */ + dimensions?: Dimension[]; + /** + * Dimension or metric filters that restrict the data returned for your + * request. To use the `filtersExpression`, supply a dimension or metric on + * which to filter, followed by the filter expression. For example, the + * following expression selects `ga:browser` dimension which starts with + * Firefox; `ga:browser=~^Firefox`. For more information on dimensions + * and metric filters, see + * [Filters reference](https://developers.google.com/analytics/devguides/reporting/core/v3/reference#filters). + */ + filtersExpression?: string; + /** + * If set to true, hides the total of all metrics for all the matching rows, + * for every date range. The default false and will return the totals. + */ + hideTotals?: boolean; + /** + * If set to true, hides the minimum and maximum across all matching rows. + * The default is false and the value ranges are returned. + */ + hideValueRanges?: boolean; + /** + * If set to false, the response does not include rows if all the retrieved + * metrics are equal to zero. The default is false which will exclude these + * rows. + */ + includeEmptyRows?: boolean; + /** + * The metric filter clauses. They are logically combined with the `AND` + * operator. Metric filters look at only the first date range and not the + * comparing date range. Note that filtering on metrics occurs after the + * metrics are aggregated. + */ + metricFilterClauses?: MetricFilterClause[]; + /** + * The metrics requested. + * Requests must specify at least one metric. Requests can have a + * total of 10 metrics. + */ + metrics?: Metric[]; + /** + * Sort order on output rows. To compare two rows, the elements of the + * following are applied in order until a difference is found. All date + * ranges in the output get the same row order. + */ + orderBys?: OrderBy[]; + /** + * Page size is for paging and specifies the maximum number of returned rows. + * Page size should be >= 0. A query returns the default of 1,000 rows. + * The Analytics Core Reporting API returns a maximum of 10,000 rows per + * request, no matter how many you ask for. It can also return fewer rows + * than requested, if there aren't as many dimension segments as you expect. + * For instance, there are fewer than 300 possible values for `ga:country`, + * so when segmenting only by country, you can't get more than 300 rows, + * even if you set `pageSize` to a higher value. + */ + pageSize?: number; + /** + * A continuation token to get the next page of the results. Adding this to + * the request will return the rows after the pageToken. The pageToken should + * be the value returned in the nextPageToken parameter in the response to + * the GetReports request. + */ + pageToken?: string; + /** The pivot definitions. Requests can have a maximum of 2 pivots. */ + pivots?: Pivot[]; + /** + * The desired report + * [sample](https://support.google.com/analytics/answer/2637192) size. + * If the the `samplingLevel` field is unspecified the `DEFAULT` sampling + * level is used. Every [ReportRequest](#ReportRequest) within a + * `batchGet` method must contain the same `samplingLevel` definition. See + * [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling) + * for details. + */ + samplingLevel?: string; + /** + * Segment the data returned for the request. A segment definition helps look + * at a subset of the segment request. A request can contain up to four + * segments. Every [ReportRequest](#ReportRequest) within a + * `batchGet` method must contain the same `segments` definition. Requests + * with segments must have the `ga:segment` dimension. + */ + segments?: Segment[]; + /** + * The Analytics + * [view ID](https://support.google.com/analytics/answer/1009618) + * from which to retrieve data. Every [ReportRequest](#ReportRequest) + * within a `batchGet` method must contain the same `viewId`. + */ + viewId?: string; + } + interface ReportRow { + /** List of requested dimensions. */ + dimensions?: string[]; + /** List of metrics for each requested DateRange. */ + metrics?: DateRangeValues[]; + } + interface Segment { + /** A dynamic segment definition in the request. */ + dynamicSegment?: DynamicSegment; + /** The segment ID of a built-in or custom segment, for example `gaid::-3`. */ + segmentId?: string; + } + interface SegmentDefinition { + /** + * A segment is defined by a set of segment filters which are combined + * together with a logical `AND` operation. + */ + segmentFilters?: SegmentFilter[]; + } + interface SegmentDimensionFilter { + /** Should the match be case sensitive, ignored for `IN_LIST` operator. */ + caseSensitive?: boolean; + /** Name of the dimension for which the filter is being applied. */ + dimensionName?: string; + /** The list of expressions, only the first element is used for all operators */ + expressions?: string[]; + /** Maximum comparison values for `BETWEEN` match type. */ + maxComparisonValue?: string; + /** Minimum comparison values for `BETWEEN` match type. */ + minComparisonValue?: string; + /** The operator to use to match the dimension with the expressions. */ + operator?: string; + } + interface SegmentFilter { + /** + * If true, match the complement of simple or sequence segment. + * For example, to match all visits not from "New York", we can define the + * segment as follows: + * + * "sessionSegment": { + * "segmentFilters": [{ + * "simpleSegment" :{ + * "orFiltersForSegment": [{ + * "segmentFilterClauses":[{ + * "dimensionFilter": { + * "dimensionName": "ga:city", + * "expressions": ["New York"] + * } + * }] + * }] + * }, + * "not": "True" + * }] + * }, + */ + not?: boolean; + /** + * Sequence conditions consist of one or more steps, where each step is + * defined by one or more dimension/metric conditions. Multiple steps can + * be combined with special sequence operators. + */ + sequenceSegment?: SequenceSegment; + /** + * A Simple segment conditions consist of one or more dimension/metric + * conditions that can be combined + */ + simpleSegment?: SimpleSegment; + } + interface SegmentFilterClause { + /** Dimension Filter for the segment definition. */ + dimensionFilter?: SegmentDimensionFilter; + /** Metric Filter for the segment definition. */ + metricFilter?: SegmentMetricFilter; + /** Matches the complement (`!`) of the filter. */ + not?: boolean; + } + interface SegmentMetricFilter { + /** + * The value to compare against. If the operator is `BETWEEN`, this value is + * treated as minimum comparison value. + */ + comparisonValue?: string; + /** Max comparison value is only used for `BETWEEN` operator. */ + maxComparisonValue?: string; + /** + * The metric that will be filtered on. A `metricFilter` must contain a + * metric name. + */ + metricName?: string; + /** + * Specifies is the operation to perform to compare the metric. The default + * is `EQUAL`. + */ + operator?: string; + /** + * Scope for a metric defines the level at which that metric is defined. The + * specified metric scope must be equal to or greater than its primary scope + * as defined in the data model. The primary scope is defined by if the + * segment is selecting users or sessions. + */ + scope?: string; + } + interface SegmentSequenceStep { + /** + * Specifies if the step immediately precedes or can be any time before the + * next step. + */ + matchType?: string; + /** + * A sequence is specified with a list of Or grouped filters which are + * combined with `AND` operator. + */ + orFiltersForSegment?: OrFiltersForSegment[]; + } + interface SequenceSegment { + /** + * If set, first step condition must match the first hit of the visitor (in + * the date range). + */ + firstStepShouldMatchFirstHit?: boolean; + /** The list of steps in the sequence. */ + segmentSequenceSteps?: SegmentSequenceStep[]; + } + interface SimpleSegment { + /** + * A list of segment filters groups which are combined with logical `AND` + * operator. + */ + orFiltersForSegment?: OrFiltersForSegment[]; + } + interface ReportsResource { + /** Returns the Analytics data. */ + batchGet(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.analyticsreporting/readme.md b/types/gapi.client.analyticsreporting/readme.md new file mode 100644 index 0000000000..96b09af1b4 --- /dev/null +++ b/types/gapi.client.analyticsreporting/readme.md @@ -0,0 +1,62 @@ +# TypeScript typings for Google Analytics Reporting API v4 +Accesses Analytics report data. +For detailed description please check [documentation](https://developers.google.com/analytics/devguides/reporting/core/v4/). + +## Installing + +Install typings for Google Analytics Reporting API: +``` +npm install @types/gapi.client.analyticsreporting@v4 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('analyticsreporting', 'v4', () => { + // now we can use gapi.client.analyticsreporting + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your Google Analytics data + 'https://www.googleapis.com/auth/analytics', + + // View your Google Analytics data + 'https://www.googleapis.com/auth/analytics.readonly', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Analytics Reporting API resources: + +```typescript + +/* +Returns the Analytics data. +*/ +await gapi.client.reports.batchGet({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.analyticsreporting/tsconfig.json b/types/gapi.client.analyticsreporting/tsconfig.json new file mode 100644 index 0000000000..2f65484898 --- /dev/null +++ b/types/gapi.client.analyticsreporting/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.analyticsreporting-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.analyticsreporting/tslint.json b/types/gapi.client.analyticsreporting/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.analyticsreporting/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.androiddeviceprovisioning/gapi.client.androiddeviceprovisioning-tests.ts b/types/gapi.client.androiddeviceprovisioning/gapi.client.androiddeviceprovisioning-tests.ts new file mode 100644 index 0000000000..b2c1cac362 --- /dev/null +++ b/types/gapi.client.androiddeviceprovisioning/gapi.client.androiddeviceprovisioning-tests.ts @@ -0,0 +1,24 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('androiddeviceprovisioning', 'v1', () => { + /** now we can use gapi.client.androiddeviceprovisioning */ + + run(); + }); + + async function run() { + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + */ + await gapi.client.operations.get({ + name: "name", + }); + } +}); diff --git a/types/gapi.client.androiddeviceprovisioning/index.d.ts b/types/gapi.client.androiddeviceprovisioning/index.d.ts new file mode 100644 index 0000000000..0b896d6fbb --- /dev/null +++ b/types/gapi.client.androiddeviceprovisioning/index.d.ts @@ -0,0 +1,683 @@ +// Type definitions for Google Android Device Provisioning Partner API v1 1.0 +// Project: https://developers.google.com/zero-touch/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://androiddeviceprovisioning.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Android Device Provisioning Partner API v1 */ + function load(name: "androiddeviceprovisioning", version: "v1"): PromiseLike; + function load(name: "androiddeviceprovisioning", version: "v1", callback: () => any): void; + + const operations: androiddeviceprovisioning.OperationsResource; + + const partners: androiddeviceprovisioning.PartnersResource; + + namespace androiddeviceprovisioning { + interface ClaimDeviceRequest { + /** The customer to claim for. */ + customerId?: string; + /** The device identifier of the device to claim. */ + deviceIdentifier?: DeviceIdentifier; + /** The section to claim. */ + sectionType?: string; + } + interface ClaimDeviceResponse { + /** The device ID of the claimed device. */ + deviceId?: string; + /** + * The resource name of the device in the format + * `partners/[PARTNER_ID]/devices/[DEVICE_ID]`. + */ + deviceName?: string; + } + interface ClaimDevicesRequest { + /** List of claims. */ + claims?: PartnerClaim[]; + } + interface Company { + /** + * Input only. Optional. Email address of customer's users in the admin role. + * Each email address must be associated with a Google Account. + */ + adminEmails?: string[]; + /** Output only. The ID of the company. Assigned by the server. */ + companyId?: string; + /** + * Required. The name of the company. For example _XYZ Corp_. Characters + * allowed are: Latin letters, numerals, hyphens, and spaces. Displayed to the + * customer's employees in the zero-touch enrollment portal. + */ + companyName?: string; + /** + * Output only. The API resource name of the company in the format + * `partners/[PARTNER_ID]/customers/[CUSTOMER_ID]`. Assigned by the server. + */ + name?: string; + /** + * Input only. Email address of customer's users in the owner role. At least + * one `owner_email` is required. Each email address must be associated with a + * Google Account. Owners share the same access as admins but can also add, + * delete, and edit your organization's portal users. + */ + ownerEmails?: string[]; + } + interface CreateCustomerRequest { + /** + * Required. The company data to populate the new customer. Must contain a + * value for `companyName` and at least one `owner_email` that's associated + * with a Google Account. The values for `companyId` and `name` must be empty. + */ + customer?: Company; + } + interface Device { + /** Claims. */ + claims?: DeviceClaim[]; + /** + * The resource name of the configuration. + * Only set for customers. + */ + configuration?: string; + /** Device ID. */ + deviceId?: string; + /** Device identifier. */ + deviceIdentifier?: DeviceIdentifier; + /** Device metadata. */ + deviceMetadata?: DeviceMetadata; + /** Resource name in `partners/[PARTNER_ID]/devices/[DEVICE_ID]`. */ + name?: string; + } + interface DeviceClaim { + /** Owner ID. */ + ownerCompanyId?: string; + /** Section type of the device claim. */ + sectionType?: string; + } + interface DeviceIdentifier { + /** IMEI number. */ + imei?: string; + /** + * Manufacturer name to match `android.os.Build.MANUFACTURER` (required). + * Allowed values listed in + * [manufacturer names](/zero-touch/resources/manufacturer-names). + */ + manufacturer?: string; + /** MEID number. */ + meid?: string; + /** Serial number (optional). */ + serialNumber?: string; + } + interface DeviceMetadata { + /** Metadata entries */ + entries?: Record; + } + interface DevicesLongRunningOperationMetadata { + /** Number of devices parsed in your requests. */ + devicesCount?: number; + /** The overall processing status. */ + processingStatus?: string; + /** Processing progress from 0 to 100. */ + progress?: number; + } + interface DevicesLongRunningOperationResponse { + /** + * Processing status for each device. + * One `PerDeviceStatus` per device. The order is the same as in your requests. + */ + perDeviceStatus?: OperationPerDevice[]; + /** Number of succeesfully processed ones. */ + successCount?: number; + } + interface FindDevicesByDeviceIdentifierRequest { + /** The device identifier to search. */ + deviceIdentifier?: DeviceIdentifier; + /** Number of devices to show. */ + limit?: string; + /** Page token. */ + pageToken?: string; + } + interface FindDevicesByDeviceIdentifierResponse { + /** Found devices. */ + devices?: Device[]; + /** Page token of the next page. */ + nextPageToken?: string; + } + interface FindDevicesByOwnerRequest { + /** List of customer IDs to search for. */ + customerId?: string[]; + /** The number of devices to show in the result. */ + limit?: string; + /** Page token. */ + pageToken?: string; + /** The section type. */ + sectionType?: string; + } + interface FindDevicesByOwnerResponse { + /** Devices found. */ + devices?: Device[]; + /** Page token of the next page. */ + nextPageToken?: string; + } + interface ListCustomersResponse { + /** List of customers related to this partner. */ + customers?: Company[]; + } + interface Operation { + /** + * If the value is `false`, it means the operation is still in progress. + * If `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done?: boolean; + /** + * This field will always be not set if the operation is created by `claimAsync`, `unclaimAsync`, or `updateMetadataAsync`. In this case, error + * information for each device is set in `response.perDeviceStatus.result.status`. + */ + error?: Status; + /** + * This field will contain a `DevicesLongRunningOperationMetadata` object if the operation is created by `claimAsync`, `unclaimAsync`, or + * `updateMetadataAsync`. + */ + metadata?: Record; + /** + * The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name?: string; + /** + * This field will contain a `DevicesLongRunningOperationResponse` object if the operation is created by `claimAsync`, `unclaimAsync`, or + * `updateMetadataAsync`. + */ + response?: Record; + } + interface OperationPerDevice { + /** Request to claim a device. */ + claim?: PartnerClaim; + /** Processing result for every device. */ + result?: PerDeviceStatusInBatch; + /** Request to unclaim a device. */ + unclaim?: PartnerUnclaim; + /** Request to set metadata for a device. */ + updateMetadata?: UpdateMetadataArguments; + } + interface PartnerClaim { + /** Customer ID to claim for. */ + customerId?: string; + /** Device identifier of the device. */ + deviceIdentifier?: DeviceIdentifier; + /** Metadata to set at claim. */ + deviceMetadata?: DeviceMetadata; + /** Section type to claim. */ + sectionType?: string; + } + interface PartnerUnclaim { + /** Device ID of the device. */ + deviceId?: string; + /** Device identifier of the device. */ + deviceIdentifier?: DeviceIdentifier; + /** Section type to unclaim. */ + sectionType?: string; + } + interface PerDeviceStatusInBatch { + /** Device ID of the device if process succeeds. */ + deviceId?: string; + /** Error identifier. */ + errorIdentifier?: string; + /** Error message. */ + errorMessage?: string; + /** Process result. */ + status?: string; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface UnclaimDeviceRequest { + /** The device ID returned by `ClaimDevice`. */ + deviceId?: string; + /** The device identifier you used when you claimed this device. */ + deviceIdentifier?: DeviceIdentifier; + /** The section type to unclaim for. */ + sectionType?: string; + } + interface UnclaimDevicesRequest { + /** List of devices to unclaim. */ + unclaims?: PartnerUnclaim[]; + } + interface UpdateDeviceMetadataInBatchRequest { + /** List of metadata updates. */ + updates?: UpdateMetadataArguments[]; + } + interface UpdateDeviceMetadataRequest { + /** The metdata to set. */ + deviceMetadata?: DeviceMetadata; + } + interface UpdateMetadataArguments { + /** Device ID of the device. */ + deviceId?: string; + /** Device identifier. */ + deviceIdentifier?: DeviceIdentifier; + /** The metadata to update. */ + deviceMetadata?: DeviceMetadata; + } + interface OperationsResource { + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface CustomersResource { + /** + * Creates a customer for zero-touch enrollment. After the method returns + * successfully, admin and owner roles can manage devices and EMM configs + * by calling API methods or using their zero-touch enrollment portal. The API + * doesn't notify the customer that they have access. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Required. The parent resource ID in format `partners/[PARTNER_ID]` that + * identifies the reseller. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists the customers that are enrolled to the reseller identified by the + * `partnerId` argument. This list includes customers that the reseller + * created and customers that enrolled themselves using the portal. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the partner. */ + partnerId: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface DevicesResource { + /** Claim the device identified by device identifier. */ + claim(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** ID of the partner. */ + partnerId: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Claim devices asynchronously. */ + claimAsync(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Partner ID. */ + partnerId: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Find devices by device identifier. */ + findByIdentifier(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** ID of the partner. */ + partnerId: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Find devices by ownership. */ + findByOwner(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** ID of the partner. */ + partnerId: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Get a device. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Resource name in `partners/[PARTNER_ID]/devices/[DEVICE_ID]`. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Update the metadata. */ + metadata(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** ID of the partner. */ + deviceId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The owner of the newly set metadata. Set this to the partner ID. */ + metadataOwnerId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Unclaim the device identified by the `device_id` or the `deviceIdentifier`. */ + unclaim(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** ID of the partner. */ + partnerId: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Unclaim devices asynchronously. */ + unclaimAsync(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Partner ID. */ + partnerId: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Set metadata in batch asynchronously. */ + updateMetadataAsync(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Partner ID. */ + partnerId: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface PartnersResource { + customers: CustomersResource; + devices: DevicesResource; + } + } +} diff --git a/types/gapi.client.androiddeviceprovisioning/readme.md b/types/gapi.client.androiddeviceprovisioning/readme.md new file mode 100644 index 0000000000..bdeb55a582 --- /dev/null +++ b/types/gapi.client.androiddeviceprovisioning/readme.md @@ -0,0 +1,42 @@ +# TypeScript typings for Android Device Provisioning Partner API v1 +Automates reseller integration into zero-touch enrollment by assigning devices to customers and creating device reports. +For detailed description please check [documentation](https://developers.google.com/zero-touch/). + +## Installing + +Install typings for Android Device Provisioning Partner API: +``` +npm install @types/gapi.client.androiddeviceprovisioning@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('androiddeviceprovisioning', 'v1', () => { + // now we can use gapi.client.androiddeviceprovisioning + // ... +}); +``` + + + +After that you can use Android Device Provisioning Partner API resources: + +```typescript + +/* +Gets the latest state of a long-running operation. Clients can use this +method to poll the operation result at intervals as recommended by the API +service. +*/ +await gapi.client.operations.get({ name: "name", }); +``` \ No newline at end of file diff --git a/types/gapi.client.androiddeviceprovisioning/tsconfig.json b/types/gapi.client.androiddeviceprovisioning/tsconfig.json new file mode 100644 index 0000000000..953923be00 --- /dev/null +++ b/types/gapi.client.androiddeviceprovisioning/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.androiddeviceprovisioning-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.androiddeviceprovisioning/tslint.json b/types/gapi.client.androiddeviceprovisioning/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.androiddeviceprovisioning/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.androidenterprise/gapi.client.androidenterprise-tests.ts b/types/gapi.client.androidenterprise/gapi.client.androidenterprise-tests.ts new file mode 100644 index 0000000000..63c1f9101d --- /dev/null +++ b/types/gapi.client.androidenterprise/gapi.client.androidenterprise-tests.ts @@ -0,0 +1,559 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('androidenterprise', 'v1', () => { + /** now we can use gapi.client.androidenterprise */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** Manage corporate Android devices */ + 'https://www.googleapis.com/auth/androidenterprise', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Retrieves the details of a device. */ + await gapi.client.devices.get({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** + * Retrieves whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android + * devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is + * only supported for Google-managed users. + */ + await gapi.client.devices.getState({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** Retrieves the IDs of all of a user's devices. */ + await gapi.client.devices.list({ + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** + * Sets whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android + * devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is + * only supported for Google-managed users. + */ + await gapi.client.devices.setState({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** Acknowledges notifications that were received from Enterprises.PullNotificationSet to prevent subsequent calls from returning the same notifications. */ + await gapi.client.enterprises.acknowledgeNotificationSet({ + notificationSetId: "notificationSetId", + }); + /** + * Completes the signup flow, by specifying the Completion token and Enterprise token. This request must not be called multiple times for a given + * Enterprise Token. + */ + await gapi.client.enterprises.completeSignup({ + completionToken: "completionToken", + enterpriseToken: "enterpriseToken", + }); + /** + * Returns a unique token to access an embeddable UI. To generate a web UI, pass the generated token into the managed Google Play javascript API. Each + * token may only be used to start one UI session. See the javascript API documentation for further information. + */ + await gapi.client.enterprises.createWebToken({ + enterpriseId: "enterpriseId", + }); + /** + * Deletes the binding between the EMM and enterprise. This is now deprecated. Use this method only to unenroll customers that were previously enrolled + * with the insert call, then enroll them again with the enroll call. + */ + await gapi.client.enterprises.delete({ + enterpriseId: "enterpriseId", + }); + /** Enrolls an enterprise with the calling EMM. */ + await gapi.client.enterprises.enroll({ + token: "token", + }); + /** Generates a sign-up URL. */ + await gapi.client.enterprises.generateSignupUrl({ + callbackUrl: "callbackUrl", + }); + /** Retrieves the name and domain of an enterprise. */ + await gapi.client.enterprises.get({ + enterpriseId: "enterpriseId", + }); + /** Returns the Android Device Policy config resource. */ + await gapi.client.enterprises.getAndroidDevicePolicyConfig({ + enterpriseId: "enterpriseId", + }); + /** + * Returns a service account and credentials. The service account can be bound to the enterprise by calling setAccount. The service account is unique to + * this enterprise and EMM, and will be deleted if the enterprise is unbound. The credentials contain private key data and are not stored server-side. + * + * This method can only be called after calling Enterprises.Enroll or Enterprises.CompleteSignup, and before Enterprises.SetAccount; at other times it + * will return an error. + * + * Subsequent calls after the first will generate a new, unique set of credentials, and invalidate the previously generated credentials. + * + * Once the service account is bound to the enterprise, it can be managed using the serviceAccountKeys resource. + */ + await gapi.client.enterprises.getServiceAccount({ + enterpriseId: "enterpriseId", + keyType: "keyType", + }); + /** Returns the store layout for the enterprise. If the store layout has not been set, returns "basic" as the store layout type and no homepage. */ + await gapi.client.enterprises.getStoreLayout({ + enterpriseId: "enterpriseId", + }); + /** Establishes the binding between the EMM and an enterprise. This is now deprecated; use enroll instead. */ + await gapi.client.enterprises.insert({ + token: "token", + }); + /** + * Looks up an enterprise by domain name. This is only supported for enterprises created via the Google-initiated creation flow. Lookup of the id is not + * needed for enterprises created via the EMM-initiated flow since the EMM learns the enterprise ID in the callback specified in the + * Enterprises.generateSignupUrl call. + */ + await gapi.client.enterprises.list({ + domain: "domain", + }); + /** + * Pulls and returns a notification set for the enterprises associated with the service account authenticated for the request. The notification set may be + * empty if no notification are pending. + * A notification set returned needs to be acknowledged within 20 seconds by calling Enterprises.AcknowledgeNotificationSet, unless the notification set + * is empty. + * Notifications that are not acknowledged within the 20 seconds will eventually be included again in the response to another PullNotificationSet request, + * and those that are never acknowledged will ultimately be deleted according to the Google Cloud Platform Pub/Sub system policy. + * Multiple requests might be performed concurrently to retrieve notifications, in which case the pending notifications (if any) will be split among each + * caller, if any are pending. + * If no notifications are present, an empty notification list is returned. Subsequent requests may return more notifications once they become available. + */ + await gapi.client.enterprises.pullNotificationSet({ + requestMode: "requestMode", + }); + /** Sends a test notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise. */ + await gapi.client.enterprises.sendTestPushNotification({ + enterpriseId: "enterpriseId", + }); + /** Sets the account that will be used to authenticate to the API as the enterprise. */ + await gapi.client.enterprises.setAccount({ + enterpriseId: "enterpriseId", + }); + /** + * Sets the Android Device Policy config resource. EMM may use this method to enable or disable Android Device Policy support for the specified + * enterprise. To learn more about managing devices and apps with Android Device Policy, see the Android Management API. + */ + await gapi.client.enterprises.setAndroidDevicePolicyConfig({ + enterpriseId: "enterpriseId", + }); + /** + * Sets the store layout for the enterprise. By default, storeLayoutType is set to "basic" and the basic store layout is enabled. The basic layout only + * contains apps approved by the admin, and that have been added to the available product set for a user (using the setAvailableProductSet call). Apps on + * the page are sorted in order of their product ID value. If you create a custom store layout (by setting storeLayoutType = "custom" and setting a + * homepage), the basic store layout is disabled. + */ + await gapi.client.enterprises.setStoreLayout({ + enterpriseId: "enterpriseId", + }); + /** Unenrolls an enterprise from the calling EMM. */ + await gapi.client.enterprises.unenroll({ + enterpriseId: "enterpriseId", + }); + /** Removes an entitlement to an app for a user. */ + await gapi.client.entitlements.delete({ + enterpriseId: "enterpriseId", + entitlementId: "entitlementId", + userId: "userId", + }); + /** Retrieves details of an entitlement. */ + await gapi.client.entitlements.get({ + enterpriseId: "enterpriseId", + entitlementId: "entitlementId", + userId: "userId", + }); + /** Lists all entitlements for the specified user. Only the ID is set. */ + await gapi.client.entitlements.list({ + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** Adds or updates an entitlement to an app for a user. This method supports patch semantics. */ + await gapi.client.entitlements.patch({ + enterpriseId: "enterpriseId", + entitlementId: "entitlementId", + install: true, + userId: "userId", + }); + /** Adds or updates an entitlement to an app for a user. */ + await gapi.client.entitlements.update({ + enterpriseId: "enterpriseId", + entitlementId: "entitlementId", + install: true, + userId: "userId", + }); + /** Retrieves details of an enterprise's group license for a product. */ + await gapi.client.grouplicenses.get({ + enterpriseId: "enterpriseId", + groupLicenseId: "groupLicenseId", + }); + /** Retrieves IDs of all products for which the enterprise has a group license. */ + await gapi.client.grouplicenses.list({ + enterpriseId: "enterpriseId", + }); + /** Retrieves the IDs of the users who have been granted entitlements under the license. */ + await gapi.client.grouplicenseusers.list({ + enterpriseId: "enterpriseId", + groupLicenseId: "groupLicenseId", + }); + /** Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed. */ + await gapi.client.installs.delete({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + installId: "installId", + userId: "userId", + }); + /** Retrieves details of an installation of an app on a device. */ + await gapi.client.installs.get({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + installId: "installId", + userId: "userId", + }); + /** Retrieves the details of all apps installed on the specified device. */ + await gapi.client.installs.list({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** + * Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. + * This method supports patch semantics. + */ + await gapi.client.installs.patch({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + installId: "installId", + userId: "userId", + }); + /** Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. */ + await gapi.client.installs.update({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + installId: "installId", + userId: "userId", + }); + /** Removes a per-device managed configuration for an app for the specified device. */ + await gapi.client.managedconfigurationsfordevice.delete({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + managedConfigurationForDeviceId: "managedConfigurationForDeviceId", + userId: "userId", + }); + /** Retrieves details of a per-device managed configuration. */ + await gapi.client.managedconfigurationsfordevice.get({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + managedConfigurationForDeviceId: "managedConfigurationForDeviceId", + userId: "userId", + }); + /** Lists all the per-device managed configurations for the specified device. Only the ID is set. */ + await gapi.client.managedconfigurationsfordevice.list({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** Adds or updates a per-device managed configuration for an app for the specified device. This method supports patch semantics. */ + await gapi.client.managedconfigurationsfordevice.patch({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + managedConfigurationForDeviceId: "managedConfigurationForDeviceId", + userId: "userId", + }); + /** Adds or updates a per-device managed configuration for an app for the specified device. */ + await gapi.client.managedconfigurationsfordevice.update({ + deviceId: "deviceId", + enterpriseId: "enterpriseId", + managedConfigurationForDeviceId: "managedConfigurationForDeviceId", + userId: "userId", + }); + /** Removes a per-user managed configuration for an app for the specified user. */ + await gapi.client.managedconfigurationsforuser.delete({ + enterpriseId: "enterpriseId", + managedConfigurationForUserId: "managedConfigurationForUserId", + userId: "userId", + }); + /** Retrieves details of a per-user managed configuration for an app for the specified user. */ + await gapi.client.managedconfigurationsforuser.get({ + enterpriseId: "enterpriseId", + managedConfigurationForUserId: "managedConfigurationForUserId", + userId: "userId", + }); + /** Lists all the per-user managed configurations for the specified user. Only the ID is set. */ + await gapi.client.managedconfigurationsforuser.list({ + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** Adds or updates a per-user managed configuration for an app for the specified user. This method supports patch semantics. */ + await gapi.client.managedconfigurationsforuser.patch({ + enterpriseId: "enterpriseId", + managedConfigurationForUserId: "managedConfigurationForUserId", + userId: "userId", + }); + /** Adds or updates a per-user managed configuration for an app for the specified user. */ + await gapi.client.managedconfigurationsforuser.update({ + enterpriseId: "enterpriseId", + managedConfigurationForUserId: "managedConfigurationForUserId", + userId: "userId", + }); + /** Retrieves details of an Android app permission for display to an enterprise admin. */ + await gapi.client.permissions.get({ + language: "language", + permissionId: "permissionId", + }); + /** + * Approves the specified product and the relevant app permissions, if any. The maximum number of products that you can approve per enterprise customer is + * 1,000. + * + * To learn how to use managed Google Play to design and create a store layout to display approved products to your users, see Store Layout Design. + */ + await gapi.client.products.approve({ + enterpriseId: "enterpriseId", + productId: "productId", + }); + /** + * Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and + * accept them on behalf of their organization in order to approve that product. + * + * Admins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of + * this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display + * permissions for up to 1 day. + */ + await gapi.client.products.generateApprovalUrl({ + enterpriseId: "enterpriseId", + languageCode: "languageCode", + productId: "productId", + }); + /** Retrieves details of a product for display to an enterprise admin. */ + await gapi.client.products.get({ + enterpriseId: "enterpriseId", + language: "language", + productId: "productId", + }); + /** + * Retrieves the schema that defines the configurable properties for this product. All products have a schema, but this schema may be empty if no managed + * configurations have been defined. This schema can be used to populate a UI that allows an admin to configure the product. To apply a managed + * configuration based on the schema obtained using this API, see Managed Configurations through Play. + */ + await gapi.client.products.getAppRestrictionsSchema({ + enterpriseId: "enterpriseId", + language: "language", + productId: "productId", + }); + /** Retrieves the Android app permissions required by this app. */ + await gapi.client.products.getPermissions({ + enterpriseId: "enterpriseId", + productId: "productId", + }); + /** Finds approved products that match a query, or all approved products if there is no query. */ + await gapi.client.products.list({ + approved: true, + enterpriseId: "enterpriseId", + language: "language", + maxResults: 4, + query: "query", + token: "token", + }); + /** Unapproves the specified product (and the relevant app permissions, if any) */ + await gapi.client.products.unapprove({ + enterpriseId: "enterpriseId", + productId: "productId", + }); + /** + * Removes and invalidates the specified credentials for the service account associated with this enterprise. The calling service account must have been + * retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. + */ + await gapi.client.serviceaccountkeys.delete({ + enterpriseId: "enterpriseId", + keyId: "keyId", + }); + /** + * Generates new credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling + * Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. + * + * Only the type of the key should be populated in the resource to be inserted. + */ + await gapi.client.serviceaccountkeys.insert({ + enterpriseId: "enterpriseId", + }); + /** + * Lists all active credentials for the service account associated with this enterprise. Only the ID and key type are returned. The calling service + * account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling + * Enterprises.SetAccount. + */ + await gapi.client.serviceaccountkeys.list({ + enterpriseId: "enterpriseId", + }); + /** Deletes a cluster. */ + await gapi.client.storelayoutclusters.delete({ + clusterId: "clusterId", + enterpriseId: "enterpriseId", + pageId: "pageId", + }); + /** Retrieves details of a cluster. */ + await gapi.client.storelayoutclusters.get({ + clusterId: "clusterId", + enterpriseId: "enterpriseId", + pageId: "pageId", + }); + /** Inserts a new cluster in a page. */ + await gapi.client.storelayoutclusters.insert({ + enterpriseId: "enterpriseId", + pageId: "pageId", + }); + /** Retrieves the details of all clusters on the specified page. */ + await gapi.client.storelayoutclusters.list({ + enterpriseId: "enterpriseId", + pageId: "pageId", + }); + /** Updates a cluster. This method supports patch semantics. */ + await gapi.client.storelayoutclusters.patch({ + clusterId: "clusterId", + enterpriseId: "enterpriseId", + pageId: "pageId", + }); + /** Updates a cluster. */ + await gapi.client.storelayoutclusters.update({ + clusterId: "clusterId", + enterpriseId: "enterpriseId", + pageId: "pageId", + }); + /** Deletes a store page. */ + await gapi.client.storelayoutpages.delete({ + enterpriseId: "enterpriseId", + pageId: "pageId", + }); + /** Retrieves details of a store page. */ + await gapi.client.storelayoutpages.get({ + enterpriseId: "enterpriseId", + pageId: "pageId", + }); + /** Inserts a new store page. */ + await gapi.client.storelayoutpages.insert({ + enterpriseId: "enterpriseId", + }); + /** Retrieves the details of all pages in the store. */ + await gapi.client.storelayoutpages.list({ + enterpriseId: "enterpriseId", + }); + /** Updates the content of a store page. This method supports patch semantics. */ + await gapi.client.storelayoutpages.patch({ + enterpriseId: "enterpriseId", + pageId: "pageId", + }); + /** Updates the content of a store page. */ + await gapi.client.storelayoutpages.update({ + enterpriseId: "enterpriseId", + pageId: "pageId", + }); + /** Deleted an EMM-managed user. */ + await gapi.client.users.delete({ + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** + * Generates an authentication token which the device policy client can use to provision the given EMM-managed user account on a device. The generated + * token is single-use and expires after a few minutes. + * + * This call only works with EMM-managed accounts. + */ + await gapi.client.users.generateAuthenticationToken({ + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** + * Generates a token (activation code) to allow this user to configure their managed account in the Android Setup Wizard. Revokes any previously generated + * token. + * + * This call only works with Google managed accounts. + */ + await gapi.client.users.generateToken({ + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** Retrieves a user's details. */ + await gapi.client.users.get({ + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** Retrieves the set of products a user is entitled to access. */ + await gapi.client.users.getAvailableProductSet({ + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** + * Creates a new EMM-managed user. + * + * The Users resource passed in the body of the request should include an accountIdentifier and an accountType. + * If a corresponding user already exists with the same account identifier, the user will be updated with the resource. In this case only the displayName + * field can be changed. + */ + await gapi.client.users.insert({ + enterpriseId: "enterpriseId", + }); + /** + * Looks up a user by primary email address. This is only supported for Google-managed users. Lookup of the id is not needed for EMM-managed users because + * the id is already returned in the result of the Users.insert call. + */ + await gapi.client.users.list({ + email: "email", + enterpriseId: "enterpriseId", + }); + /** + * Updates the details of an EMM-managed user. + * + * Can be used with EMM-managed users only (not Google managed users). Pass the new details in the Users resource in the request body. Only the + * displayName field can be changed. Other fields must either be unset or have the currently active value. This method supports patch semantics. + */ + await gapi.client.users.patch({ + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** Revokes a previously generated token (activation code) for the user. */ + await gapi.client.users.revokeToken({ + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** + * Modifies the set of products that a user is entitled to access (referred to as whitelisted products). Only products that are approved or products that + * were previously approved (products with revoked approval) can be whitelisted. + */ + await gapi.client.users.setAvailableProductSet({ + enterpriseId: "enterpriseId", + userId: "userId", + }); + /** + * Updates the details of an EMM-managed user. + * + * Can be used with EMM-managed users only (not Google managed users). Pass the new details in the Users resource in the request body. Only the + * displayName field can be changed. Other fields must either be unset or have the currently active value. + */ + await gapi.client.users.update({ + enterpriseId: "enterpriseId", + userId: "userId", + }); + } +}); diff --git a/types/gapi.client.androidenterprise/index.d.ts b/types/gapi.client.androidenterprise/index.d.ts new file mode 100644 index 0000000000..1e81143609 --- /dev/null +++ b/types/gapi.client.androidenterprise/index.d.ts @@ -0,0 +1,2830 @@ +// Type definitions for Google Google Play EMM API v1 1.0 +// Project: https://developers.google.com/android/work/play/emm-api +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/androidenterprise/v1/rest + +/// + +declare namespace gapi.client { + /** Load Google Play EMM API v1 */ + function load(name: "androidenterprise", version: "v1"): PromiseLike; + function load(name: "androidenterprise", version: "v1", callback: () => any): void; + + const devices: androidenterprise.DevicesResource; + + const enterprises: androidenterprise.EnterprisesResource; + + const entitlements: androidenterprise.EntitlementsResource; + + const grouplicenses: androidenterprise.GrouplicensesResource; + + const grouplicenseusers: androidenterprise.GrouplicenseusersResource; + + const installs: androidenterprise.InstallsResource; + + const managedconfigurationsfordevice: androidenterprise.ManagedconfigurationsfordeviceResource; + + const managedconfigurationsforuser: androidenterprise.ManagedconfigurationsforuserResource; + + const permissions: androidenterprise.PermissionsResource; + + const products: androidenterprise.ProductsResource; + + const serviceaccountkeys: androidenterprise.ServiceaccountkeysResource; + + const storelayoutclusters: androidenterprise.StorelayoutclustersResource; + + const storelayoutpages: androidenterprise.StorelayoutpagesResource; + + const users: androidenterprise.UsersResource; + + namespace androidenterprise { + interface Administrator { + /** The admin's email address. */ + email?: string; + } + interface AdministratorWebToken { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#administratorWebToken". */ + kind?: string; + /** An opaque token to be passed to the Play front-end to generate an iframe. */ + token?: string; + } + interface AdministratorWebTokenSpec { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#administratorWebTokenSpec". */ + kind?: string; + /** The URI of the parent frame hosting the iframe. To prevent XSS, the iframe may not be hosted at other URIs. This URI must be https. */ + parent?: string; + /** + * The list of permissions the admin is granted within the iframe. The admin will only be allowed to view an iframe if they have all of the permissions + * associated with it. The only valid value is "approveApps" that will allow the admin to access the iframe in "approve" mode. + */ + permission?: string[]; + } + interface AndroidDevicePolicyConfig { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#androidDevicePolicyConfig". */ + kind?: string; + /** + * The state of Android Device Policy. "enabled" indicates that Android Device Policy is enabled for the enterprise and the EMM is allowed to manage + * devices with Android Device Policy, while "disabled" means that it cannot. + */ + state?: string; + } + interface AppRestrictionsSchema { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#appRestrictionsSchema". */ + kind?: string; + /** The set of restrictions that make up this schema. */ + restrictions?: AppRestrictionsSchemaRestriction[]; + } + interface AppRestrictionsSchemaChangeEvent { + /** The id of the product (e.g. "app:com.google.android.gm") for which the app restriction schema changed. This field will always be present. */ + productId?: string; + } + interface AppRestrictionsSchemaRestriction { + /** The default value of the restriction. bundle and bundleArray restrictions never have a default value. */ + defaultValue?: AppRestrictionsSchemaRestrictionRestrictionValue; + /** A longer description of the restriction, giving more detail of what it affects. */ + description?: string; + /** For choice or multiselect restrictions, the list of possible entries' human-readable names. */ + entry?: string[]; + /** + * For choice or multiselect restrictions, the list of possible entries' machine-readable values. These values should be used in the configuration, either + * as a single string value for a choice restriction or in a stringArray for a multiselect restriction. + */ + entryValue?: string[]; + /** The unique key that the product uses to identify the restriction, e.g. "com.google.android.gm.fieldname". */ + key?: string; + /** + * For bundle or bundleArray restrictions, the list of nested restrictions. A bundle restriction is always nested within a bundleArray restriction, and a + * bundleArray restriction is at most two levels deep. + */ + nestedRestriction?: AppRestrictionsSchemaRestriction[]; + /** The type of the restriction. */ + restrictionType?: string; + /** The name of the restriction. */ + title?: string; + } + interface AppRestrictionsSchemaRestrictionRestrictionValue { + /** The type of the value being provided. */ + type?: string; + /** The boolean value - this will only be present if type is bool. */ + valueBool?: boolean; + /** The integer value - this will only be present if type is integer. */ + valueInteger?: number; + /** The list of string values - this will only be present if type is multiselect. */ + valueMultiselect?: string[]; + /** The string value - this will be present for types string, choice and hidden. */ + valueString?: string; + } + interface AppUpdateEvent { + /** The id of the product (e.g. "app:com.google.android.gm") that was updated. This field will always be present. */ + productId?: string; + } + interface AppVersion { + /** The track that this app was published in. For example if track is "alpha", this is an alpha version of the app. */ + track?: string; + /** Unique increasing identifier for the app version. */ + versionCode?: number; + /** + * The string used in the Play store by the app developer to identify the version. The string is not necessarily unique or localized (for example, the + * string could be "1.4"). + */ + versionString?: string; + } + interface ApprovalUrlInfo { + /** A URL that displays a product's permissions and that can also be used to approve the product with the Products.approve call. */ + approvalUrl?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#approvalUrlInfo". */ + kind?: string; + } + interface AuthenticationToken { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#authenticationToken". */ + kind?: string; + /** + * The authentication token to be passed to the device policy client on the device where it can be used to provision the account for which this token was + * generated. + */ + token?: string; + } + interface Device { + /** The Google Play Services Android ID for the device encoded as a lowercase hex string. For example, "123456789abcdef0". */ + androidId?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#device". */ + kind?: string; + /** + * Identifies the extent to which the device is controlled by a managed Google Play EMM in various deployment configurations. + * + * Possible values include: + * - "managedDevice", a device that has the EMM's device policy controller (DPC) as the device owner. + * - "managedProfile", a device that has a profile managed by the DPC (DPC is profile owner) in addition to a separate, personal profile that is + * unavailable to the DPC. + * - "containerApp", no longer used (deprecated). + * - "unmanagedProfile", a device that has been allowed (by the domain's admin, using the Admin Console to enable the privilege) to use managed Google + * Play, but the profile is itself not owned by a DPC. + */ + managementType?: string; + } + interface DeviceState { + /** + * The state of the Google account on the device. "enabled" indicates that the Google account on the device can be used to access Google services + * (including Google Play), while "disabled" means that it cannot. A new device is initially in the "disabled" state. + */ + accountState?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#deviceState". */ + kind?: string; + } + interface DevicesListResponse { + /** A managed device. */ + device?: Device[]; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#devicesListResponse". */ + kind?: string; + } + interface Enterprise { + /** Admins of the enterprise. This is only supported for enterprises created via the EMM-initiated flow. */ + administrator?: Administrator[]; + /** The unique ID for the enterprise. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#enterprise". */ + kind?: string; + /** The name of the enterprise, for example, "Example, Inc". */ + name?: string; + /** The enterprise's primary domain, such as "example.com". */ + primaryDomain?: string; + } + interface EnterpriseAccount { + /** The email address of the service account. */ + accountEmail?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#enterpriseAccount". */ + kind?: string; + } + interface EnterprisesListResponse { + /** An enterprise. */ + enterprise?: Enterprise[]; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#enterprisesListResponse". */ + kind?: string; + } + interface EnterprisesSendTestPushNotificationResponse { + /** The message ID of the test push notification that was sent. */ + messageId?: string; + /** The name of the Cloud Pub/Sub topic to which notifications for this enterprise's enrolled account will be sent. */ + topicName?: string; + } + interface Entitlement { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#entitlement". */ + kind?: string; + /** The ID of the product that the entitlement is for. For example, "app:com.google.android.gm". */ + productId?: string; + /** + * The reason for the entitlement. For example, "free" for free apps. This property is temporary: it will be replaced by the acquisition kind field of + * group licenses. + */ + reason?: string; + } + interface EntitlementsListResponse { + /** + * An entitlement of a user to a product (e.g. an app). For example, a free app that they have installed, or a paid app that they have been allocated a + * license to. + */ + entitlement?: Entitlement[]; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#entitlementsListResponse". */ + kind?: string; + } + interface GroupLicense { + /** + * How this group license was acquired. "bulkPurchase" means that this Grouplicenses resource was created because the enterprise purchased licenses for + * this product; otherwise, the value is "free" (for free products). + */ + acquisitionKind?: string; + /** + * Whether the product to which this group license relates is currently approved by the enterprise. Products are approved when a group license is first + * created, but this approval may be revoked by an enterprise admin via Google Play. Unapproved products will not be visible to end users in collections, + * and new entitlements to them should not normally be created. + */ + approval?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#groupLicense". */ + kind?: string; + /** The total number of provisioned licenses for this product. Returned by read operations, but ignored in write operations. */ + numProvisioned?: number; + /** + * The number of purchased licenses (possibly in multiple purchases). If this field is omitted, then there is no limit on the number of licenses that can + * be provisioned (for example, if the acquisition kind is "free"). + */ + numPurchased?: number; + /** + * The permission approval status of the product. This field is only set if the product is approved. Possible states are: + * - "currentApproved", the current set of permissions is approved, but additional permissions will require the administrator to reapprove the product (If + * the product was approved without specifying the approved permissions setting, then this is the default behavior.), + * - "needsReapproval", the product has unapproved permissions. No additional product licenses can be assigned until the product is reapproved, + * - "allCurrentAndFutureApproved", the current permissions are approved and any future permission updates will be automatically approved without + * administrator review. + */ + permissions?: string; + /** The ID of the product that the license is for. For example, "app:com.google.android.gm". */ + productId?: string; + } + interface GroupLicenseUsersListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#groupLicenseUsersListResponse". */ + kind?: string; + /** A user of an enterprise. */ + user?: User[]; + } + interface GroupLicensesListResponse { + /** A group license for a product approved for use in the enterprise. */ + groupLicense?: GroupLicense[]; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#groupLicensesListResponse". */ + kind?: string; + } + interface Install { + /** + * Install state. The state "installPending" means that an install request has recently been made and download to the device is in progress. The state + * "installed" means that the app has been installed. This field is read-only. + */ + installState?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#install". */ + kind?: string; + /** The ID of the product that the install is for. For example, "app:com.google.android.gm". */ + productId?: string; + /** The version of the installed product. Guaranteed to be set only if the install state is "installed". */ + versionCode?: number; + } + interface InstallFailureEvent { + /** The Android ID of the device. This field will always be present. */ + deviceId?: string; + /** Additional details on the failure if applicable. */ + failureDetails?: string; + /** The reason for the installation failure. This field will always be present. */ + failureReason?: string; + /** The id of the product (e.g. "app:com.google.android.gm") for which the install failure event occured. This field will always be present. */ + productId?: string; + /** The ID of the user. This field will always be present. */ + userId?: string; + } + interface InstallsListResponse { + /** An installation of an app for a user on a specific device. The existence of an install implies that the user must have an entitlement to the app. */ + install?: Install[]; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#installsListResponse". */ + kind?: string; + } + interface LocalizedText { + /** The BCP47 tag for a locale. (e.g. "en-US", "de"). */ + locale?: string; + /** The text localized in the associated locale. */ + text?: string; + } + interface ManagedConfiguration { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#managedConfiguration". */ + kind?: string; + /** The set of managed properties for this configuration. */ + managedProperty?: ManagedProperty[]; + /** The ID of the product that the managed configuration is for, e.g. "app:com.google.android.gm". */ + productId?: string; + } + interface ManagedConfigurationsForDeviceListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#managedConfigurationsForDeviceListResponse". */ + kind?: string; + /** A managed configuration for an app on a specific device. */ + managedConfigurationForDevice?: ManagedConfiguration[]; + } + interface ManagedConfigurationsForUserListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#managedConfigurationsForUserListResponse". */ + kind?: string; + /** A managed configuration for an app for a specific user. */ + managedConfigurationForUser?: ManagedConfiguration[]; + } + interface ManagedProperty { + /** The unique key that identifies the property. */ + key?: string; + /** The boolean value - this will only be present if type of the property is bool. */ + valueBool?: boolean; + /** The bundle of managed properties - this will only be present if type of the property is bundle. */ + valueBundle?: ManagedPropertyBundle; + /** The list of bundles of properties - this will only be present if type of the property is bundle_array. */ + valueBundleArray?: ManagedPropertyBundle[]; + /** The integer value - this will only be present if type of the property is integer. */ + valueInteger?: number; + /** The string value - this will only be present if type of the property is string, choice or hidden. */ + valueString?: string; + /** The list of string values - this will only be present if type of the property is multiselect. */ + valueStringArray?: string[]; + } + interface ManagedPropertyBundle { + /** The list of managed properties. */ + managedProperty?: ManagedProperty[]; + } + interface NewDeviceEvent { + /** The Android ID of the device. This field will always be present. */ + deviceId?: string; + /** + * Identifies the extent to which the device is controlled by an Android EMM in various deployment configurations. + * + * Possible values include: + * - "managedDevice", a device where the DPC is set as device owner, + * - "managedProfile", a device where the DPC is set as profile owner. + */ + managementType?: string; + /** The ID of the user. This field will always be present. */ + userId?: string; + } + interface NewPermissionsEvent { + /** + * The set of permissions that the enterprise admin has already approved for this application. Use Permissions.Get on the EMM API to retrieve details + * about these permissions. + */ + approvedPermissions?: string[]; + /** The id of the product (e.g. "app:com.google.android.gm") for which new permissions were added. This field will always be present. */ + productId?: string; + /** The set of permissions that the app is currently requesting. Use Permissions.Get on the EMM API to retrieve details about these permissions. */ + requestedPermissions?: string[]; + } + interface Notification { + /** Notifications about new app restrictions schema changes. */ + appRestrictionsSchemaChangeEvent?: AppRestrictionsSchemaChangeEvent; + /** Notifications about app updates. */ + appUpdateEvent?: AppUpdateEvent; + /** The ID of the enterprise for which the notification is sent. This will always be present. */ + enterpriseId?: string; + /** Notifications about an app installation failure. */ + installFailureEvent?: InstallFailureEvent; + /** Notifications about new devices. */ + newDeviceEvent?: NewDeviceEvent; + /** Notifications about new app permissions. */ + newPermissionsEvent?: NewPermissionsEvent; + /** Type of the notification. */ + notificationType?: string; + /** Notifications about changes to a product's approval status. */ + productApprovalEvent?: ProductApprovalEvent; + /** Notifications about product availability changes. */ + productAvailabilityChangeEvent?: ProductAvailabilityChangeEvent; + /** The time when the notification was published in milliseconds since 1970-01-01T00:00:00Z. This will always be present. */ + timestampMillis?: string; + } + interface NotificationSet { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#notificationSet". */ + kind?: string; + /** The notifications received, or empty if no notifications are present. */ + notification?: Notification[]; + /** + * The notification set ID, required to mark the notification as received with the Enterprises.AcknowledgeNotification API. This will be omitted if no + * notifications are present. + */ + notificationSetId?: string; + } + interface PageInfo { + resultPerPage?: number; + startIndex?: number; + totalResults?: number; + } + interface Permission { + /** A longer description of the Permissions resource, giving more details of what it affects. */ + description?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#permission". */ + kind?: string; + /** The name of the permission. */ + name?: string; + /** An opaque string uniquely identifying the permission. */ + permissionId?: string; + } + interface Product { + /** App versions currently available for this product. */ + appVersion?: AppVersion[]; + /** The name of the author of the product (for example, the app developer). */ + authorName?: string; + /** The tracks that are visible to the enterprise. */ + availableTracks?: string[]; + /** A link to the (consumer) Google Play details page for the product. */ + detailsUrl?: string; + /** + * How and to whom the package is made available. The value publicGoogleHosted means that the package is available through the Play store and not + * restricted to a specific enterprise. The value privateGoogleHosted means that the package is a private app (restricted to an enterprise) but hosted by + * Google. The value privateSelfHosted means that the package is a private app (restricted to an enterprise) and is privately hosted. + */ + distributionChannel?: string; + /** A link to an image that can be used as an icon for the product. This image is suitable for use at up to 512px x 512px. */ + iconUrl?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#product". */ + kind?: string; + /** A string of the form app:. For example, app:com.google.android.gm represents the Gmail app. */ + productId?: string; + /** + * Whether this product is free, free with in-app purchases, or paid. If the pricing is unknown, this means the product is not generally available anymore + * (even though it might still be available to people who own it). + */ + productPricing?: string; + /** Deprecated. */ + requiresContainerApp?: boolean; + /** The certificate used to sign this product. */ + signingCertificate?: ProductSigningCertificate; + /** A link to a smaller image that can be used as an icon for the product. This image is suitable for use at up to 128px x 128px. */ + smallIconUrl?: string; + /** The name of the product. */ + title?: string; + /** A link to the managed Google Play details page for the product, for use by an Enterprise admin. */ + workDetailsUrl?: string; + } + interface ProductApprovalEvent { + /** Whether the product was approved or unapproved. This field will always be present. */ + approved?: string; + /** The id of the product (e.g. "app:com.google.android.gm") for which the approval status has changed. This field will always be present. */ + productId?: string; + } + interface ProductAvailabilityChangeEvent { + /** The new state of the product. This field will always be present. */ + availabilityStatus?: string; + /** The id of the product (e.g. "app:com.google.android.gm") for which the product availability changed. This field will always be present. */ + productId?: string; + } + interface ProductPermission { + /** An opaque string uniquely identifying the permission. */ + permissionId?: string; + /** Whether the permission has been accepted or not. */ + state?: string; + } + interface ProductPermissions { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#productPermissions". */ + kind?: string; + /** The permissions required by the app. */ + permission?: ProductPermission[]; + /** The ID of the app that the permissions relate to, e.g. "app:com.google.android.gm". */ + productId?: string; + } + interface ProductSet { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#productSet". */ + kind?: string; + /** The list of product IDs making up the set of products. */ + productId?: string[]; + /** + * The interpretation of this product set. "unknown" should never be sent and is ignored if received. "whitelist" means that the user is entitled to + * access the product set. "includeAll" means that all products are accessible, including products that are approved, products with revoked approval, and + * products that have never been approved. "allApproved" means that the user is entitled to access all products that are approved for the enterprise. If + * the value is "allApproved" or "includeAll", the productId field is ignored. If no value is provided, it is interpreted as "whitelist" for backwards + * compatibility. Further "allApproved" or "includeAll" does not enable automatic visibility of "alpha" or "beta" tracks for Android app. Use + * ProductVisibility to enable "alpha" or "beta" tracks per user. + */ + productSetBehavior?: string; + /** + * Other products that are part of the set, in addition to those specified in the productId array. The only difference between this field and the + * productId array is that it's possible to specify additional information about this product visibility, see ProductVisibility and its fields for more + * information. Specifying the same product ID both here and in the productId array is not allowed and it will result in an error. + */ + productVisibility?: ProductVisibility[]; + } + interface ProductSigningCertificate { + /** + * The base64 urlsafe encoded SHA1 hash of the certificate. (This field is deprecated in favor of SHA2-256. It should not be used and may be removed at + * any time.) + */ + certificateHashSha1?: string; + /** The base64 urlsafe encoded SHA2-256 hash of the certificate. */ + certificateHashSha256?: string; + } + interface ProductVisibility { + /** The product ID that should be made visible to the user. This is required. */ + productId?: string; + /** + * This allows to only grant visibility to the specified tracks of the app. For example, if an app has a prod version, a beta version and an alpha version + * and the enterprise has been granted visibility to both the alpha and beta tracks, if tracks is {"beta", "production"} the user will be able to install + * the app and they will get the beta version of the app. If there are no app versions in the specified track or if the enterprise wasn't granted + * visibility for the track, adding the "alpha" and "beta" values to the list of tracks will have no effect for now; however they will take effect once + * both conditions are met. Note that the enterprise itself needs to be granted access to the alpha and/or beta tracks, regardless of whether individual + * users or admins have access to those tracks. + * + * The allowed sets are: {} (considered equivalent to {"production"}) {"production"} {"beta", "production"} {"alpha", "beta", "production"} The order of + * elements is not relevant. Any other set of tracks will be rejected with an error. + */ + tracks?: string[]; + } + interface ProductsApproveRequest { + /** + * The approval URL that was shown to the user. Only the permissions shown to the user with that URL will be accepted, which may not be the product's + * entire set of permissions. For example, the URL may only display new permissions from an update after the product was approved, or not include new + * permissions if the product was updated since the URL was generated. + */ + approvalUrlInfo?: ApprovalUrlInfo; + /** + * Sets how new permission requests for the product are handled. "allPermissions" automatically approves all current and future permissions for the + * product. "currentPermissionsOnly" approves the current set of permissions for the product, but any future permissions added through updates will + * require manual reapproval. If not specified, only the current set of permissions will be approved. + */ + approvedPermissions?: string; + } + interface ProductsGenerateApprovalUrlResponse { + /** + * A URL that can be rendered in an iframe to display the permissions (if any) of a product. This URL can be used to approve the product only once and + * only within 24 hours of being generated, using the Products.approve call. If the product is currently unapproved and has no permissions, this URL will + * point to an empty page. If the product is currently approved, a URL will only be generated if that product has added permissions since it was last + * approved, and the URL will only display those new permissions that have not yet been accepted. + */ + url?: string; + } + interface ProductsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#productsListResponse". */ + kind?: string; + /** General pagination information. */ + pageInfo?: PageInfo; + /** Information about a product (e.g. an app) in the Google Play store, for display to an enterprise admin. */ + product?: Product[]; + /** Pagination information for token pagination. */ + tokenPagination?: TokenPagination; + } + interface ServiceAccount { + /** Credentials that can be used to authenticate as this ServiceAccount. */ + key?: ServiceAccountKey; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#serviceAccount". */ + kind?: string; + /** The account name of the service account, in the form of an email address. Assigned by the server. */ + name?: string; + } + interface ServiceAccountKey { + /** + * The body of the private key credentials file, in string format. This is only populated when the ServiceAccountKey is created, and is not stored by + * Google. + */ + data?: string; + /** An opaque, unique identifier for this ServiceAccountKey. Assigned by the server. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#serviceAccountKey". */ + kind?: string; + /** + * Public key data for the credentials file. This is an X.509 cert. If you are using the googleCredentials key type, this is identical to the cert that + * can be retrieved by using the X.509 cert url inside of the credentials file. + */ + publicData?: string; + /** The file format of the generated key data. */ + type?: string; + } + interface ServiceAccountKeysListResponse { + /** The service account credentials. */ + serviceAccountKey?: ServiceAccountKey[]; + } + interface SignupInfo { + /** An opaque token that will be required, along with the Enterprise Token, for obtaining the enterprise resource from CompleteSignup. */ + completionToken?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#signupInfo". */ + kind?: string; + /** A URL under which the Admin can sign up for an enterprise. The page pointed to cannot be rendered in an iframe. */ + url?: string; + } + interface StoreCluster { + /** Unique ID of this cluster. Assigned by the server. Immutable once assigned. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#storeCluster". */ + kind?: string; + /** + * Ordered list of localized strings giving the name of this page. The text displayed is the one that best matches the user locale, or the first entry if + * there is no good match. There needs to be at least one entry. + */ + name?: LocalizedText[]; + /** + * String (US-ASCII only) used to determine order of this cluster within the parent page's elements. Page elements are sorted in lexicographic order of + * this field. Duplicated values are allowed, but ordering between elements with duplicate order is undefined. + * + * The value of this field is never visible to a user, it is used solely for the purpose of defining an ordering. Maximum length is 256 characters. + */ + orderInPage?: string; + /** List of products in the order they are displayed in the cluster. There should not be duplicates within a cluster. */ + productId?: string[]; + } + interface StoreLayout { + /** + * The ID of the store page to be used as the homepage. The homepage is the first page shown in the managed Google Play Store. + * + * Not specifying a homepage is equivalent to setting the store layout type to "basic". + */ + homepageId?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#storeLayout". */ + kind?: string; + /** + * The store layout type. By default, this value is set to "basic" if the homepageId field is not set, and to "custom" otherwise. If set to "basic", the + * layout will consist of all approved apps that have been whitelisted for the user. + */ + storeLayoutType?: string; + } + interface StoreLayoutClustersListResponse { + /** A store cluster of an enterprise. */ + cluster?: StoreCluster[]; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#storeLayoutClustersListResponse". */ + kind?: string; + } + interface StoreLayoutPagesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#storeLayoutPagesListResponse". */ + kind?: string; + /** A store page of an enterprise. */ + page?: StorePage[]; + } + interface StorePage { + /** Unique ID of this page. Assigned by the server. Immutable once assigned. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#storePage". */ + kind?: string; + /** + * Ordered list of pages a user should be able to reach from this page. The pages must exist, must not be this page, and once a link is created the page + * linked to cannot be deleted until all links to it are removed. It is recommended that the basic pages are created first, before adding the links + * between pages. + * + * No attempt is made to verify that all pages are reachable from the homepage. + */ + link?: string[]; + /** + * Ordered list of localized strings giving the name of this page. The text displayed is the one that best matches the user locale, or the first entry if + * there is no good match. There needs to be at least one entry. + */ + name?: LocalizedText[]; + } + interface TokenPagination { + nextPageToken?: string; + previousPageToken?: string; + } + interface User { + /** + * A unique identifier you create for this user, such as "user342" or "asset#44418". Do not use personally identifiable information (PII) for this + * property. Must always be set for EMM-managed users. Not set for Google-managed users. + */ + accountIdentifier?: string; + /** + * The type of account that this user represents. A userAccount can be installed on multiple devices, but a deviceAccount is specific to a single device. + * An EMM-managed user (emmManaged) can be either type (userAccount, deviceAccount), but a Google-managed user (googleManaged) is always a userAccount. + */ + accountType?: string; + /** + * The name that will appear in user interfaces. Setting this property is optional when creating EMM-managed users. If you do set this property, use + * something generic about the organization (such as "Example, Inc.") or your name (as EMM). Not used for Google-managed user accounts. + */ + displayName?: string; + /** The unique ID for the user. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#user". */ + kind?: string; + /** + * The entity that manages the user. With googleManaged users, the source of truth is Google so EMMs have to make sure a Google Account exists for the + * user. With emmManaged users, the EMM is in charge. + */ + managementType?: string; + /** The user's primary email address, for example, "jsmith@example.com". Will always be set for Google managed users and not set for EMM managed users. */ + primaryEmail?: string; + } + interface UserToken { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#userToken". */ + kind?: string; + /** The token (activation code) to be entered by the user. This consists of a sequence of decimal digits. Note that the leading digit may be 0. */ + token?: string; + /** The unique ID for the user. */ + userId?: string; + } + interface UsersListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "androidenterprise#usersListResponse". */ + kind?: string; + /** A user of an enterprise. */ + user?: User[]; + } + interface DevicesResource { + /** Retrieves the details of a device. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Retrieves whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android + * devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is + * only supported for Google-managed users. + */ + getState(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the IDs of all of a user's devices. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Sets whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android + * devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is + * only supported for Google-managed users. + */ + setState(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface EnterprisesResource { + /** Acknowledges notifications that were received from Enterprises.PullNotificationSet to prevent subsequent calls from returning the same notifications. */ + acknowledgeNotificationSet(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The notification set ID as returned by Enterprises.PullNotificationSet. This must be provided. */ + notificationSetId?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Completes the signup flow, by specifying the Completion token and Enterprise token. This request must not be called multiple times for a given + * Enterprise Token. + */ + completeSignup(request: { + /** Data format for the response. */ + alt?: string; + /** The Completion token initially returned by GenerateSignupUrl. */ + completionToken?: string; + /** The Enterprise token appended to the Callback URL. */ + enterpriseToken?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Returns a unique token to access an embeddable UI. To generate a web UI, pass the generated token into the managed Google Play javascript API. Each + * token may only be used to start one UI session. See the javascript API documentation for further information. + */ + createWebToken(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Deletes the binding between the EMM and enterprise. This is now deprecated. Use this method only to unenroll customers that were previously enrolled + * with the insert call, then enroll them again with the enroll call. + */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Enrolls an enterprise with the calling EMM. */ + enroll(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The token provided by the enterprise to register the EMM. */ + token: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Generates a sign-up URL. */ + generateSignupUrl(request: { + /** Data format for the response. */ + alt?: string; + /** + * The callback URL to which the Admin will be redirected after successfully creating an enterprise. Before redirecting there the system will add a single + * query parameter to this URL named "enterpriseToken" which will contain an opaque token to be used for the CompleteSignup request. + * Beware that this means that the URL will be parsed, the parameter added and then a new URL formatted, i.e. there may be some minor formatting changes + * and, more importantly, the URL must be well-formed so that it can be parsed. + */ + callbackUrl?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the name and domain of an enterprise. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the Android Device Policy config resource. */ + getAndroidDevicePolicyConfig(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Returns a service account and credentials. The service account can be bound to the enterprise by calling setAccount. The service account is unique to + * this enterprise and EMM, and will be deleted if the enterprise is unbound. The credentials contain private key data and are not stored server-side. + * + * This method can only be called after calling Enterprises.Enroll or Enterprises.CompleteSignup, and before Enterprises.SetAccount; at other times it + * will return an error. + * + * Subsequent calls after the first will generate a new, unique set of credentials, and invalidate the previously generated credentials. + * + * Once the service account is bound to the enterprise, it can be managed using the serviceAccountKeys resource. + */ + getServiceAccount(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The type of credential to return with the service account. Required. */ + keyType?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the store layout for the enterprise. If the store layout has not been set, returns "basic" as the store layout type and no homepage. */ + getStoreLayout(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Establishes the binding between the EMM and an enterprise. This is now deprecated; use enroll instead. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The token provided by the enterprise to register the EMM. */ + token: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Looks up an enterprise by domain name. This is only supported for enterprises created via the Google-initiated creation flow. Lookup of the id is not + * needed for enterprises created via the EMM-initiated flow since the EMM learns the enterprise ID in the callback specified in the + * Enterprises.generateSignupUrl call. + */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The exact primary domain name of the enterprise to look up. */ + domain: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Pulls and returns a notification set for the enterprises associated with the service account authenticated for the request. The notification set may be + * empty if no notification are pending. + * A notification set returned needs to be acknowledged within 20 seconds by calling Enterprises.AcknowledgeNotificationSet, unless the notification set + * is empty. + * Notifications that are not acknowledged within the 20 seconds will eventually be included again in the response to another PullNotificationSet request, + * and those that are never acknowledged will ultimately be deleted according to the Google Cloud Platform Pub/Sub system policy. + * Multiple requests might be performed concurrently to retrieve notifications, in which case the pending notifications (if any) will be split among each + * caller, if any are pending. + * If no notifications are present, an empty notification list is returned. Subsequent requests may return more notifications once they become available. + */ + pullNotificationSet(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * The request mode for pulling notifications. + * Specifying waitForNotifications will cause the request to block and wait until one or more notifications are present, or return an empty notification + * list if no notifications are present after some time. + * Speciying returnImmediately will cause the request to immediately return the pending notifications, or an empty list if no notifications are present. + * If omitted, defaults to waitForNotifications. + */ + requestMode?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Sends a test notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise. */ + sendTestPushNotification(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Sets the account that will be used to authenticate to the API as the enterprise. */ + setAccount(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Sets the Android Device Policy config resource. EMM may use this method to enable or disable Android Device Policy support for the specified + * enterprise. To learn more about managing devices and apps with Android Device Policy, see the Android Management API. + */ + setAndroidDevicePolicyConfig(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Sets the store layout for the enterprise. By default, storeLayoutType is set to "basic" and the basic store layout is enabled. The basic layout only + * contains apps approved by the admin, and that have been added to the available product set for a user (using the setAvailableProductSet call). Apps on + * the page are sorted in order of their product ID value. If you create a custom store layout (by setting storeLayoutType = "custom" and setting a + * homepage), the basic store layout is disabled. + */ + setStoreLayout(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Unenrolls an enterprise from the calling EMM. */ + unenroll(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface EntitlementsResource { + /** Removes an entitlement to an app for a user. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm". */ + entitlementId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves details of an entitlement. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm". */ + entitlementId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all entitlements for the specified user. Only the ID is set. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Adds or updates an entitlement to an app for a user. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm". */ + entitlementId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Set to true to also install the product on all the user's devices where possible. Failure to install on one or more devices will not prevent this + * operation from returning successfully, as long as the entitlement was successfully assigned to the user. + */ + install?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Adds or updates an entitlement to an app for a user. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm". */ + entitlementId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Set to true to also install the product on all the user's devices where possible. Failure to install on one or more devices will not prevent this + * operation from returning successfully, as long as the entitlement was successfully assigned to the user. + */ + install?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface GrouplicensesResource { + /** Retrieves details of an enterprise's group license for a product. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the product the group license is for, e.g. "app:com.google.android.gm". */ + groupLicenseId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves IDs of all products for which the enterprise has a group license. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface GrouplicenseusersResource { + /** Retrieves the IDs of the users who have been granted entitlements under the license. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the product the group license is for, e.g. "app:com.google.android.gm". */ + groupLicenseId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface InstallsResource { + /** Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The Android ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the product represented by the install, e.g. "app:com.google.android.gm". */ + installId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves details of an installation of an app on a device. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The Android ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the product represented by the install, e.g. "app:com.google.android.gm". */ + installId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the details of all apps installed on the specified device. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The Android ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. + * This method supports patch semantics. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** The Android ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the product represented by the install, e.g. "app:com.google.android.gm". */ + installId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The Android ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the product represented by the install, e.g. "app:com.google.android.gm". */ + installId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ManagedconfigurationsfordeviceResource { + /** Removes a per-device managed configuration for an app for the specified device. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The Android ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". */ + managedConfigurationForDeviceId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves details of a per-device managed configuration. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The Android ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". */ + managedConfigurationForDeviceId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all the per-device managed configurations for the specified device. Only the ID is set. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The Android ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Adds or updates a per-device managed configuration for an app for the specified device. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** The Android ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". */ + managedConfigurationForDeviceId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Adds or updates a per-device managed configuration for an app for the specified device. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The Android ID of the device. */ + deviceId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". */ + managedConfigurationForDeviceId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ManagedconfigurationsforuserResource { + /** Removes a per-user managed configuration for an app for the specified user. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". */ + managedConfigurationForUserId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves details of a per-user managed configuration for an app for the specified user. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". */ + managedConfigurationForUserId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all the per-user managed configurations for the specified user. Only the ID is set. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Adds or updates a per-user managed configuration for an app for the specified user. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". */ + managedConfigurationForUserId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Adds or updates a per-user managed configuration for an app for the specified user. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". */ + managedConfigurationForUserId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PermissionsResource { + /** Retrieves details of an Android app permission for display to an enterprise admin. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The BCP47 tag for the user's preferred language (e.g. "en-US", "de") */ + language?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the permission. */ + permissionId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ProductsResource { + /** + * Approves the specified product and the relevant app permissions, if any. The maximum number of products that you can approve per enterprise customer is + * 1,000. + * + * To learn how to use managed Google Play to design and create a store layout to display approved products to your users, see Store Layout Design. + */ + approve(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the product. */ + productId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and + * accept them on behalf of their organization in order to approve that product. + * + * Admins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of + * this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display + * permissions for up to 1 day. + */ + generateApprovalUrl(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The BCP 47 language code used for permission names and descriptions in the returned iframe, for instance "en-US". */ + languageCode?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the product. */ + productId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves details of a product for display to an enterprise admin. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The BCP47 tag for the user's preferred language (e.g. "en-US", "de"). */ + language?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the product, e.g. "app:com.google.android.gm". */ + productId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Retrieves the schema that defines the configurable properties for this product. All products have a schema, but this schema may be empty if no managed + * configurations have been defined. This schema can be used to populate a UI that allows an admin to configure the product. To apply a managed + * configuration based on the schema obtained using this API, see Managed Configurations through Play. + */ + getAppRestrictionsSchema(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The BCP47 tag for the user's preferred language (e.g. "en-US", "de"). */ + language?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the product. */ + productId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the Android app permissions required by this app. */ + getPermissions(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the product. */ + productId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Finds approved products that match a query, or all approved products if there is no query. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** + * Specifies whether to search among all products (false) or among only products that have been approved (true). Only "true" is supported, and should be + * specified. + */ + approved?: boolean; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The BCP47 tag for the user's preferred language (e.g. "en-US", "de"). Results are returned in the language best matching the preferred language. */ + language?: string; + /** + * Specifies the maximum number of products that can be returned per request. If not specified, uses a default value of 100, which is also the maximum + * retrievable within a single response. + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The search query as typed in the Google Play store search box. If omitted, all approved apps will be returned (using the pagination parameters), + * including apps that are not available in the store (e.g. unpublished apps). + */ + query?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * A pagination token is contained in a request''s response when there are more products. The token can be used in a subsequent request to obtain more + * products, and so forth. This parameter cannot be used in the initial request. + */ + token?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Unapproves the specified product (and the relevant app permissions, if any) */ + unapprove(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the product. */ + productId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ServiceaccountkeysResource { + /** + * Removes and invalidates the specified credentials for the service account associated with this enterprise. The calling service account must have been + * retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. + */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the key. */ + keyId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Generates new credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling + * Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. + * + * Only the type of the key should be populated in the resource to be inserted. + */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Lists all active credentials for the service account associated with this enterprise. Only the ID and key type are returned. The calling service + * account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling + * Enterprises.SetAccount. + */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface StorelayoutclustersResource { + /** Deletes a cluster. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the cluster. */ + clusterId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves details of a cluster. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the cluster. */ + clusterId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new cluster in a page. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the details of all clusters on the specified page. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a cluster. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the cluster. */ + clusterId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a cluster. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the cluster. */ + clusterId: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface StorelayoutpagesResource { + /** Deletes a store page. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves details of a store page. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new store page. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the details of all pages in the store. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the content of a store page. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the content of a store page. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UsersResource { + /** Deleted an EMM-managed user. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Generates an authentication token which the device policy client can use to provision the given EMM-managed user account on a device. The generated + * token is single-use and expires after a few minutes. + * + * This call only works with EMM-managed accounts. + */ + generateAuthenticationToken(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Generates a token (activation code) to allow this user to configure their managed account in the Android Setup Wizard. Revokes any previously generated + * token. + * + * This call only works with Google managed accounts. + */ + generateToken(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a user's details. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the set of products a user is entitled to access. */ + getAvailableProductSet(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Creates a new EMM-managed user. + * + * The Users resource passed in the body of the request should include an accountIdentifier and an accountType. + * If a corresponding user already exists with the same account identifier, the user will be updated with the resource. In this case only the displayName + * field can be changed. + */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Looks up a user by primary email address. This is only supported for Google-managed users. Lookup of the id is not needed for EMM-managed users because + * the id is already returned in the result of the Users.insert call. + */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The exact primary email address of the user to look up. */ + email: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the details of an EMM-managed user. + * + * Can be used with EMM-managed users only (not Google managed users). Pass the new details in the Users resource in the request body. Only the + * displayName field can be changed. Other fields must either be unset or have the currently active value. This method supports patch semantics. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Revokes a previously generated token (activation code) for the user. */ + revokeToken(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Modifies the set of products that a user is entitled to access (referred to as whitelisted products). Only products that are approved or products that + * were previously approved (products with revoked approval) can be whitelisted. + */ + setAvailableProductSet(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the details of an EMM-managed user. + * + * Can be used with EMM-managed users only (not Google managed users). Pass the new details in the Users resource in the request body. Only the + * displayName field can be changed. Other fields must either be unset or have the currently active value. + */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the enterprise. */ + enterpriseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.androidenterprise/readme.md b/types/gapi.client.androidenterprise/readme.md new file mode 100644 index 0000000000..af095b5ae6 --- /dev/null +++ b/types/gapi.client.androidenterprise/readme.md @@ -0,0 +1,476 @@ +# TypeScript typings for Google Play EMM API v1 +Manages the deployment of apps to Android for Work users. +For detailed description please check [documentation](https://developers.google.com/android/work/play/emm-api). + +## Installing + +Install typings for Google Play EMM API: +``` +npm install @types/gapi.client.androidenterprise@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('androidenterprise', 'v1', () => { + // now we can use gapi.client.androidenterprise + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // Manage corporate Android devices + 'https://www.googleapis.com/auth/androidenterprise', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Play EMM API resources: + +```typescript + +/* +Retrieves the details of a device. +*/ +await gapi.client.devices.get({ deviceId: "deviceId", enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Retrieves whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users. +*/ +await gapi.client.devices.getState({ deviceId: "deviceId", enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Retrieves the IDs of all of a user's devices. +*/ +await gapi.client.devices.list({ enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Sets whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users. +*/ +await gapi.client.devices.setState({ deviceId: "deviceId", enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Acknowledges notifications that were received from Enterprises.PullNotificationSet to prevent subsequent calls from returning the same notifications. +*/ +await gapi.client.enterprises.acknowledgeNotificationSet({ }); + +/* +Completes the signup flow, by specifying the Completion token and Enterprise token. This request must not be called multiple times for a given Enterprise Token. +*/ +await gapi.client.enterprises.completeSignup({ }); + +/* +Returns a unique token to access an embeddable UI. To generate a web UI, pass the generated token into the managed Google Play javascript API. Each token may only be used to start one UI session. See the javascript API documentation for further information. +*/ +await gapi.client.enterprises.createWebToken({ enterpriseId: "enterpriseId", }); + +/* +Deletes the binding between the EMM and enterprise. This is now deprecated. Use this method only to unenroll customers that were previously enrolled with the insert call, then enroll them again with the enroll call. +*/ +await gapi.client.enterprises.delete({ enterpriseId: "enterpriseId", }); + +/* +Enrolls an enterprise with the calling EMM. +*/ +await gapi.client.enterprises.enroll({ token: "token", }); + +/* +Generates a sign-up URL. +*/ +await gapi.client.enterprises.generateSignupUrl({ }); + +/* +Retrieves the name and domain of an enterprise. +*/ +await gapi.client.enterprises.get({ enterpriseId: "enterpriseId", }); + +/* +Returns the Android Device Policy config resource. +*/ +await gapi.client.enterprises.getAndroidDevicePolicyConfig({ enterpriseId: "enterpriseId", }); + +/* +Returns a service account and credentials. The service account can be bound to the enterprise by calling setAccount. The service account is unique to this enterprise and EMM, and will be deleted if the enterprise is unbound. The credentials contain private key data and are not stored server-side. + +This method can only be called after calling Enterprises.Enroll or Enterprises.CompleteSignup, and before Enterprises.SetAccount; at other times it will return an error. + +Subsequent calls after the first will generate a new, unique set of credentials, and invalidate the previously generated credentials. + +Once the service account is bound to the enterprise, it can be managed using the serviceAccountKeys resource. +*/ +await gapi.client.enterprises.getServiceAccount({ enterpriseId: "enterpriseId", }); + +/* +Returns the store layout for the enterprise. If the store layout has not been set, returns "basic" as the store layout type and no homepage. +*/ +await gapi.client.enterprises.getStoreLayout({ enterpriseId: "enterpriseId", }); + +/* +Establishes the binding between the EMM and an enterprise. This is now deprecated; use enroll instead. +*/ +await gapi.client.enterprises.insert({ token: "token", }); + +/* +Looks up an enterprise by domain name. This is only supported for enterprises created via the Google-initiated creation flow. Lookup of the id is not needed for enterprises created via the EMM-initiated flow since the EMM learns the enterprise ID in the callback specified in the Enterprises.generateSignupUrl call. +*/ +await gapi.client.enterprises.list({ domain: "domain", }); + +/* +Pulls and returns a notification set for the enterprises associated with the service account authenticated for the request. The notification set may be empty if no notification are pending. +A notification set returned needs to be acknowledged within 20 seconds by calling Enterprises.AcknowledgeNotificationSet, unless the notification set is empty. +Notifications that are not acknowledged within the 20 seconds will eventually be included again in the response to another PullNotificationSet request, and those that are never acknowledged will ultimately be deleted according to the Google Cloud Platform Pub/Sub system policy. +Multiple requests might be performed concurrently to retrieve notifications, in which case the pending notifications (if any) will be split among each caller, if any are pending. +If no notifications are present, an empty notification list is returned. Subsequent requests may return more notifications once they become available. +*/ +await gapi.client.enterprises.pullNotificationSet({ }); + +/* +Sends a test notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise. +*/ +await gapi.client.enterprises.sendTestPushNotification({ enterpriseId: "enterpriseId", }); + +/* +Sets the account that will be used to authenticate to the API as the enterprise. +*/ +await gapi.client.enterprises.setAccount({ enterpriseId: "enterpriseId", }); + +/* +Sets the Android Device Policy config resource. EMM may use this method to enable or disable Android Device Policy support for the specified enterprise. To learn more about managing devices and apps with Android Device Policy, see the Android Management API. +*/ +await gapi.client.enterprises.setAndroidDevicePolicyConfig({ enterpriseId: "enterpriseId", }); + +/* +Sets the store layout for the enterprise. By default, storeLayoutType is set to "basic" and the basic store layout is enabled. The basic layout only contains apps approved by the admin, and that have been added to the available product set for a user (using the setAvailableProductSet call). Apps on the page are sorted in order of their product ID value. If you create a custom store layout (by setting storeLayoutType = "custom" and setting a homepage), the basic store layout is disabled. +*/ +await gapi.client.enterprises.setStoreLayout({ enterpriseId: "enterpriseId", }); + +/* +Unenrolls an enterprise from the calling EMM. +*/ +await gapi.client.enterprises.unenroll({ enterpriseId: "enterpriseId", }); + +/* +Removes an entitlement to an app for a user. +*/ +await gapi.client.entitlements.delete({ enterpriseId: "enterpriseId", entitlementId: "entitlementId", userId: "userId", }); + +/* +Retrieves details of an entitlement. +*/ +await gapi.client.entitlements.get({ enterpriseId: "enterpriseId", entitlementId: "entitlementId", userId: "userId", }); + +/* +Lists all entitlements for the specified user. Only the ID is set. +*/ +await gapi.client.entitlements.list({ enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Adds or updates an entitlement to an app for a user. This method supports patch semantics. +*/ +await gapi.client.entitlements.patch({ enterpriseId: "enterpriseId", entitlementId: "entitlementId", userId: "userId", }); + +/* +Adds or updates an entitlement to an app for a user. +*/ +await gapi.client.entitlements.update({ enterpriseId: "enterpriseId", entitlementId: "entitlementId", userId: "userId", }); + +/* +Retrieves details of an enterprise's group license for a product. +*/ +await gapi.client.grouplicenses.get({ enterpriseId: "enterpriseId", groupLicenseId: "groupLicenseId", }); + +/* +Retrieves IDs of all products for which the enterprise has a group license. +*/ +await gapi.client.grouplicenses.list({ enterpriseId: "enterpriseId", }); + +/* +Retrieves the IDs of the users who have been granted entitlements under the license. +*/ +await gapi.client.grouplicenseusers.list({ enterpriseId: "enterpriseId", groupLicenseId: "groupLicenseId", }); + +/* +Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed. +*/ +await gapi.client.installs.delete({ deviceId: "deviceId", enterpriseId: "enterpriseId", installId: "installId", userId: "userId", }); + +/* +Retrieves details of an installation of an app on a device. +*/ +await gapi.client.installs.get({ deviceId: "deviceId", enterpriseId: "enterpriseId", installId: "installId", userId: "userId", }); + +/* +Retrieves the details of all apps installed on the specified device. +*/ +await gapi.client.installs.list({ deviceId: "deviceId", enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. This method supports patch semantics. +*/ +await gapi.client.installs.patch({ deviceId: "deviceId", enterpriseId: "enterpriseId", installId: "installId", userId: "userId", }); + +/* +Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. +*/ +await gapi.client.installs.update({ deviceId: "deviceId", enterpriseId: "enterpriseId", installId: "installId", userId: "userId", }); + +/* +Removes a per-device managed configuration for an app for the specified device. +*/ +await gapi.client.managedconfigurationsfordevice.delete({ deviceId: "deviceId", enterpriseId: "enterpriseId", managedConfigurationForDeviceId: "managedConfigurationForDeviceId", userId: "userId", }); + +/* +Retrieves details of a per-device managed configuration. +*/ +await gapi.client.managedconfigurationsfordevice.get({ deviceId: "deviceId", enterpriseId: "enterpriseId", managedConfigurationForDeviceId: "managedConfigurationForDeviceId", userId: "userId", }); + +/* +Lists all the per-device managed configurations for the specified device. Only the ID is set. +*/ +await gapi.client.managedconfigurationsfordevice.list({ deviceId: "deviceId", enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Adds or updates a per-device managed configuration for an app for the specified device. This method supports patch semantics. +*/ +await gapi.client.managedconfigurationsfordevice.patch({ deviceId: "deviceId", enterpriseId: "enterpriseId", managedConfigurationForDeviceId: "managedConfigurationForDeviceId", userId: "userId", }); + +/* +Adds or updates a per-device managed configuration for an app for the specified device. +*/ +await gapi.client.managedconfigurationsfordevice.update({ deviceId: "deviceId", enterpriseId: "enterpriseId", managedConfigurationForDeviceId: "managedConfigurationForDeviceId", userId: "userId", }); + +/* +Removes a per-user managed configuration for an app for the specified user. +*/ +await gapi.client.managedconfigurationsforuser.delete({ enterpriseId: "enterpriseId", managedConfigurationForUserId: "managedConfigurationForUserId", userId: "userId", }); + +/* +Retrieves details of a per-user managed configuration for an app for the specified user. +*/ +await gapi.client.managedconfigurationsforuser.get({ enterpriseId: "enterpriseId", managedConfigurationForUserId: "managedConfigurationForUserId", userId: "userId", }); + +/* +Lists all the per-user managed configurations for the specified user. Only the ID is set. +*/ +await gapi.client.managedconfigurationsforuser.list({ enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Adds or updates a per-user managed configuration for an app for the specified user. This method supports patch semantics. +*/ +await gapi.client.managedconfigurationsforuser.patch({ enterpriseId: "enterpriseId", managedConfigurationForUserId: "managedConfigurationForUserId", userId: "userId", }); + +/* +Adds or updates a per-user managed configuration for an app for the specified user. +*/ +await gapi.client.managedconfigurationsforuser.update({ enterpriseId: "enterpriseId", managedConfigurationForUserId: "managedConfigurationForUserId", userId: "userId", }); + +/* +Retrieves details of an Android app permission for display to an enterprise admin. +*/ +await gapi.client.permissions.get({ permissionId: "permissionId", }); + +/* +Approves the specified product and the relevant app permissions, if any. The maximum number of products that you can approve per enterprise customer is 1,000. + +To learn how to use managed Google Play to design and create a store layout to display approved products to your users, see Store Layout Design. +*/ +await gapi.client.products.approve({ enterpriseId: "enterpriseId", productId: "productId", }); + +/* +Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product. + +Admins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display permissions for up to 1 day. +*/ +await gapi.client.products.generateApprovalUrl({ enterpriseId: "enterpriseId", productId: "productId", }); + +/* +Retrieves details of a product for display to an enterprise admin. +*/ +await gapi.client.products.get({ enterpriseId: "enterpriseId", productId: "productId", }); + +/* +Retrieves the schema that defines the configurable properties for this product. All products have a schema, but this schema may be empty if no managed configurations have been defined. This schema can be used to populate a UI that allows an admin to configure the product. To apply a managed configuration based on the schema obtained using this API, see Managed Configurations through Play. +*/ +await gapi.client.products.getAppRestrictionsSchema({ enterpriseId: "enterpriseId", productId: "productId", }); + +/* +Retrieves the Android app permissions required by this app. +*/ +await gapi.client.products.getPermissions({ enterpriseId: "enterpriseId", productId: "productId", }); + +/* +Finds approved products that match a query, or all approved products if there is no query. +*/ +await gapi.client.products.list({ enterpriseId: "enterpriseId", }); + +/* +Unapproves the specified product (and the relevant app permissions, if any) +*/ +await gapi.client.products.unapprove({ enterpriseId: "enterpriseId", productId: "productId", }); + +/* +Removes and invalidates the specified credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. +*/ +await gapi.client.serviceaccountkeys.delete({ enterpriseId: "enterpriseId", keyId: "keyId", }); + +/* +Generates new credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. + +Only the type of the key should be populated in the resource to be inserted. +*/ +await gapi.client.serviceaccountkeys.insert({ enterpriseId: "enterpriseId", }); + +/* +Lists all active credentials for the service account associated with this enterprise. Only the ID and key type are returned. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. +*/ +await gapi.client.serviceaccountkeys.list({ enterpriseId: "enterpriseId", }); + +/* +Deletes a cluster. +*/ +await gapi.client.storelayoutclusters.delete({ clusterId: "clusterId", enterpriseId: "enterpriseId", pageId: "pageId", }); + +/* +Retrieves details of a cluster. +*/ +await gapi.client.storelayoutclusters.get({ clusterId: "clusterId", enterpriseId: "enterpriseId", pageId: "pageId", }); + +/* +Inserts a new cluster in a page. +*/ +await gapi.client.storelayoutclusters.insert({ enterpriseId: "enterpriseId", pageId: "pageId", }); + +/* +Retrieves the details of all clusters on the specified page. +*/ +await gapi.client.storelayoutclusters.list({ enterpriseId: "enterpriseId", pageId: "pageId", }); + +/* +Updates a cluster. This method supports patch semantics. +*/ +await gapi.client.storelayoutclusters.patch({ clusterId: "clusterId", enterpriseId: "enterpriseId", pageId: "pageId", }); + +/* +Updates a cluster. +*/ +await gapi.client.storelayoutclusters.update({ clusterId: "clusterId", enterpriseId: "enterpriseId", pageId: "pageId", }); + +/* +Deletes a store page. +*/ +await gapi.client.storelayoutpages.delete({ enterpriseId: "enterpriseId", pageId: "pageId", }); + +/* +Retrieves details of a store page. +*/ +await gapi.client.storelayoutpages.get({ enterpriseId: "enterpriseId", pageId: "pageId", }); + +/* +Inserts a new store page. +*/ +await gapi.client.storelayoutpages.insert({ enterpriseId: "enterpriseId", }); + +/* +Retrieves the details of all pages in the store. +*/ +await gapi.client.storelayoutpages.list({ enterpriseId: "enterpriseId", }); + +/* +Updates the content of a store page. This method supports patch semantics. +*/ +await gapi.client.storelayoutpages.patch({ enterpriseId: "enterpriseId", pageId: "pageId", }); + +/* +Updates the content of a store page. +*/ +await gapi.client.storelayoutpages.update({ enterpriseId: "enterpriseId", pageId: "pageId", }); + +/* +Deleted an EMM-managed user. +*/ +await gapi.client.users.delete({ enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Generates an authentication token which the device policy client can use to provision the given EMM-managed user account on a device. The generated token is single-use and expires after a few minutes. + +This call only works with EMM-managed accounts. +*/ +await gapi.client.users.generateAuthenticationToken({ enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Generates a token (activation code) to allow this user to configure their managed account in the Android Setup Wizard. Revokes any previously generated token. + +This call only works with Google managed accounts. +*/ +await gapi.client.users.generateToken({ enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Retrieves a user's details. +*/ +await gapi.client.users.get({ enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Retrieves the set of products a user is entitled to access. +*/ +await gapi.client.users.getAvailableProductSet({ enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Creates a new EMM-managed user. + +The Users resource passed in the body of the request should include an accountIdentifier and an accountType. +If a corresponding user already exists with the same account identifier, the user will be updated with the resource. In this case only the displayName field can be changed. +*/ +await gapi.client.users.insert({ enterpriseId: "enterpriseId", }); + +/* +Looks up a user by primary email address. This is only supported for Google-managed users. Lookup of the id is not needed for EMM-managed users because the id is already returned in the result of the Users.insert call. +*/ +await gapi.client.users.list({ email: "email", enterpriseId: "enterpriseId", }); + +/* +Updates the details of an EMM-managed user. + +Can be used with EMM-managed users only (not Google managed users). Pass the new details in the Users resource in the request body. Only the displayName field can be changed. Other fields must either be unset or have the currently active value. This method supports patch semantics. +*/ +await gapi.client.users.patch({ enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Revokes a previously generated token (activation code) for the user. +*/ +await gapi.client.users.revokeToken({ enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Modifies the set of products that a user is entitled to access (referred to as whitelisted products). Only products that are approved or products that were previously approved (products with revoked approval) can be whitelisted. +*/ +await gapi.client.users.setAvailableProductSet({ enterpriseId: "enterpriseId", userId: "userId", }); + +/* +Updates the details of an EMM-managed user. + +Can be used with EMM-managed users only (not Google managed users). Pass the new details in the Users resource in the request body. Only the displayName field can be changed. Other fields must either be unset or have the currently active value. +*/ +await gapi.client.users.update({ enterpriseId: "enterpriseId", userId: "userId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.androidenterprise/tsconfig.json b/types/gapi.client.androidenterprise/tsconfig.json new file mode 100644 index 0000000000..d641db9824 --- /dev/null +++ b/types/gapi.client.androidenterprise/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.androidenterprise-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.androidenterprise/tslint.json b/types/gapi.client.androidenterprise/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.androidenterprise/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.androidmanagement/gapi.client.androidmanagement-tests.ts b/types/gapi.client.androidmanagement/gapi.client.androidmanagement-tests.ts new file mode 100644 index 0000000000..8710ad7485 --- /dev/null +++ b/types/gapi.client.androidmanagement/gapi.client.androidmanagement-tests.ts @@ -0,0 +1,52 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('androidmanagement', 'v1', () => { + /** now we can use gapi.client.androidmanagement */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** Manage Android devices and apps for your customers */ + 'https://www.googleapis.com/auth/androidmanagement', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Creates an enterprise by completing the enterprise signup flow. */ + await gapi.client.enterprises.create({ + enterpriseToken: "enterpriseToken", + projectId: "projectId", + signupUrlName: "signupUrlName", + }); + /** Gets an enterprise. */ + await gapi.client.enterprises.get({ + name: "name", + }); + /** Updates an enterprise. */ + await gapi.client.enterprises.patch({ + name: "name", + updateMask: "updateMask", + }); + /** Creates an enterprise signup URL. */ + await gapi.client.signupUrls.create({ + callbackUrl: "callbackUrl", + projectId: "projectId", + }); + } +}); diff --git a/types/gapi.client.androidmanagement/index.d.ts b/types/gapi.client.androidmanagement/index.d.ts new file mode 100644 index 0000000000..b24ccab3e5 --- /dev/null +++ b/types/gapi.client.androidmanagement/index.d.ts @@ -0,0 +1,1385 @@ +// Type definitions for Google Android Management API v1 1.0 +// Project: https://developers.google.com/android/management +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://androidmanagement.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Android Management API v1 */ + function load(name: "androidmanagement", version: "v1"): PromiseLike; + function load(name: "androidmanagement", version: "v1", callback: () => any): void; + + const enterprises: androidmanagement.EnterprisesResource; + + const signupUrls: androidmanagement.SignupUrlsResource; + + namespace androidmanagement { + interface ApiLevelCondition { + /** + * The minimum desired Android Framework API level. If the device does not meet the minimum requirement, this condition is satisfied. Must be greater than + * zero. + */ + minApiLevel?: number; + } + interface Application { + /** The set of managed properties available to be pre-configured for the application. */ + managedProperties?: ManagedProperty[]; + /** The name of the application in the form enterprises/{enterpriseId}/applications/{package_name} */ + name?: string; + /** The permissions required by the app. */ + permissions?: ApplicationPermission[]; + /** The title of the application. Localized. */ + title?: string; + } + interface ApplicationPermission { + /** A longer description of the permission, giving more details of what it affects. Localized. */ + description?: string; + /** The name of the permission. Localized. */ + name?: string; + /** An opaque string uniquely identifying the permission. Not localized. */ + permissionId?: string; + } + interface ApplicationPolicy { + /** + * The default policy for all permissions requested by the app. If specified, this overrides the policy-level default_permission_policy which applies to + * all apps. + */ + defaultPermissionPolicy?: string; + /** The type of installation to perform. */ + installType?: string; + /** Whether the application is allowed to lock itself in full-screen mode. */ + lockTaskAllowed?: boolean; + /** + * Managed configuration applied to the app. The format for the configuration is dictated by the ManagedProperty values supported by the app. Each field + * name in the managed configuration must match the key field of the ManagedProperty. The field value must be compatible with the type of the + * ManagedProperty: + * + * + *
    typeJSON value
    BOOLtrue or false
    STRINGstring
    INTEGERnumber
    CHOICEstring
    MULTISELECTarray of strings
    HIDDENstring
    BUNDLE_ARRAYarray of objects
    + */ + managedConfiguration?: Record; + /** The package name of the app, e.g. com.google.android.youtube for the YouTube app. */ + packageName?: string; + /** Explicit permission grants or denials for the app. These values override the default_permission_policy. */ + permissionGrants?: PermissionGrant[]; + } + interface Command { + /** The timestamp at which the command was created. The timestamp is automatically generated by the server. */ + createTime?: string; + /** + * The duration for which the command is valid. The command will expire if not executed by the device during this time. The default duration if + * unspecified is ten minutes. There is no maximum duration. + */ + duration?: string; + /** For commands of type RESET_PASSWORD, optionally specifies the new password. */ + newPassword?: string; + /** For commands of type RESET_PASSWORD, optionally specifies flags. */ + resetPasswordFlags?: string[]; + /** The type of the command. */ + type?: string; + } + interface ComplianceRule { + /** A condition which is satisfied if the Android Framework API level on the device does not meet a minimum requirement. */ + apiLevelCondition?: ApiLevelCondition; + /** + * If set to true, the rule includes a mitigating action to disable applications so that the device is effectively disabled, but application data is + * preserved. If the device is running an app in locked task mode, the app will be closed and a UI showing the reason for non-compliance will be + * displayed. + */ + disableApps?: boolean; + /** A condition which is satisfied if there exists any matching NonComplianceDetail for the device. */ + nonComplianceDetailCondition?: NonComplianceDetailCondition; + } + interface Device { + /** The API level of the Android platform version running on the device. */ + apiLevel?: number; + /** The name of the policy that is currently applied by the device. */ + appliedPolicyName?: string; + /** The version of the policy that is currently applied by the device. */ + appliedPolicyVersion?: string; + /** The state that is currently applied by the device. */ + appliedState?: string; + /** + * If the device state is DISABLED, an optional message that is displayed on the device indicating the reason the device is disabled. This field may be + * modified by an update request. + */ + disabledReason?: UserFacingMessage; + /** Displays on the device. This information is only available when displayInfoEnabled is true in the device's policy. */ + displays?: Display[]; + /** The time of device enrollment. */ + enrollmentTime?: string; + /** If this device was enrolled with an enrollment token with additional data provided, this field contains that data. */ + enrollmentTokenData?: string; + /** If this device was enrolled with an enrollment token, this field contains the name of the token. */ + enrollmentTokenName?: string; + /** Detailed information about the device hardware. */ + hardwareInfo?: HardwareInfo; + /** Hardware status samples in chronological order. This information is only available when hardwareStatusEnabled is true in the device's policy. */ + hardwareStatusSamples?: HardwareStatus[]; + /** The last time the device sent a policy compliance report. */ + lastPolicyComplianceReportTime?: string; + /** The last time the device fetched its policy. */ + lastPolicySyncTime?: string; + /** The last time the device sent a status report. */ + lastStatusReportTime?: string; + /** + * Events related to memory and storage measurements in chronological order. This information is only available when memoryInfoEnabled is true in the + * device's policy. + */ + memoryEvents?: MemoryEvent[]; + /** Memory information. This information is only available when memoryInfoEnabled is true in the device's policy. */ + memoryInfo?: MemoryInfo; + /** The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId} */ + name?: string; + /** Device network information. This information is only available when networkInfoEnabled is true in the device's policy. */ + networkInfo?: NetworkInfo; + /** Details about policy settings for which the device is not in compliance. */ + nonComplianceDetails?: NonComplianceDetail[]; + /** Whether the device is compliant with its policy. */ + policyCompliant?: boolean; + /** + * The name of the policy that is intended to be applied to the device. If empty, the policy with id default is applied. This field may be modified by an + * update request. The name of the policy is in the form enterprises/{enterpriseId}/policies/{policyId}. It is also permissible to only specify the + * policyId when updating this field as long as the policyId contains no slashes since the rest of the policy name can be inferred from context. + */ + policyName?: string; + /** + * Power management events on the device in chronological order. This information is only available when powerManagementEventsEnabled is true in the + * device's policy. + */ + powerManagementEvents?: PowerManagementEvent[]; + /** + * The previous device names used for the same physical device when it has been enrolled multiple times. The serial number is used as the unique + * identifier to determine if the same physical device has enrolled previously. The names are in chronological order. + */ + previousDeviceNames?: string[]; + /** Detailed information about the device software. This information is only available when softwareInfoEnabled is true in the device's policy. */ + softwareInfo?: SoftwareInfo; + /** + * The state that is intended to be applied to the device. This field may be modified by an update request. Note that UpdateDevice only handles toggling + * between ACTIVE and DISABLED states. Use the delete device method to cause the device to enter the DELETED state. + */ + state?: string; + /** + * The resource name of the user of the device in the form enterprises/{enterpriseId}/users/{userId}. This is the name of the device account automatically + * created for this device. + */ + userName?: string; + } + interface Display { + /** Display density expressed as dots-per-inch. */ + density?: number; + /** Unique display id. */ + displayId?: number; + /** Display height in pixels. */ + height?: number; + /** Name of the display. */ + name?: string; + /** Refresh rate of the display in frames per second. */ + refreshRate?: number; + /** State of the display. */ + state?: string; + /** Display width in pixels. */ + width?: number; + } + interface EnrollmentToken { + /** + * Optional, arbitrary data associated with the enrollment token. This could contain, for example, the id of an org unit to which the device is assigned + * after enrollment. After a device enrolls with the token, this data will be exposed in the enrollment_token_data field of the Device resource. The data + * must be 1024 characters or less; otherwise, the creation request will fail. + */ + additionalData?: string; + /** The duration of the token. If not specified, the duration will be 1 hour. The allowed range is 1 minute to 30 days. */ + duration?: string; + /** The expiration time of the token. This is a read-only field generated by the server. */ + expirationTimestamp?: string; + /** + * The name of the enrollment token, which is generated by the server during creation, in the form + * enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId} + */ + name?: string; + /** + * The name of the policy that will be initially applied to the enrolled device in the form enterprises/{enterpriseId}/policies/{policyId}. If not + * specified, the policy with id default is applied. It is permissible to only specify the policyId when updating this field as long as the policyId + * contains no slashes since the rest of the policy name can be inferred from context. + */ + policyName?: string; + /** + * A JSON string whose UTF-8 representation can be used to generate a QR code to enroll a device with this enrollment token. To enroll a device using NFC, + * the NFC record must contain a serialized java.util.Properties representation of the properties in the JSON. + */ + qrCode?: string; + /** The token value which is passed to the device and authorizes the device to enroll. This is a read-only field generated by the server. */ + value?: string; + } + interface Enterprise { + /** + * Whether app auto-approval is enabled. When enabled, apps installed via policy for this enterprise have all permissions automatically approved. When + * enabled, it is the caller's responsibility to display the permissions required by an app to the enterprise admin before setting the app to be installed + * in a policy. + */ + appAutoApprovalEnabled?: boolean; + /** The notification types to enable via Google Cloud Pub/Sub. */ + enabledNotificationTypes?: string[]; + /** The name of the enterprise as it will appear to users. */ + enterpriseDisplayName?: string; + /** + * An image displayed as a logo during device provisioning. Supported types are: image/bmp, image/gif, image/x-ico, image/jpeg, image/png, image/webp, + * image/vnd.wap.wbmp, image/x-adobe-dng. + */ + logo?: ExternalData; + /** The name of the enterprise which is generated by the server during creation, in the form enterprises/{enterpriseId} */ + name?: string; + /** + * A color in RGB format indicating the predominant color to display in the device management app UI. The color components are stored as follows: (red << + * 16) | (green << 8) | blue, where each component may take a value between 0 and 255 inclusive. + */ + primaryColor?: number; + /** + * When Cloud Pub/Sub notifications are enabled, this field is required to indicate the topic to which the notifications will be published. The format of + * this field is projects/{project}/topics/{topic}. You must have granted the publish permission on this topic to + * android-cloud-policy@system.gserviceaccount.com + */ + pubsubTopic?: string; + } + interface ExternalData { + /** The base-64 encoded SHA-256 hash of the content hosted at url. If the content does not match this hash, Android Device Policy will not use the data. */ + sha256Hash?: string; + /** + * The absolute URL to the data, which must use either the http or https scheme. Android Device Policy does not provide any credentials in the GET + * request, so the URL must be publicly accessible. Including a long, random component in the URL may be used to prevent attackers from discovering the + * URL. + */ + url?: string; + } + interface HardwareInfo { + /** Battery shutdown temperature thresholds in Celsius for each battery on the device. */ + batteryShutdownTemperatures?: number[]; + /** Battery throttling temperature thresholds in Celsius for each battery on the device. */ + batteryThrottlingTemperatures?: number[]; + /** Brand of the device, e.g. Google. */ + brand?: string; + /** CPU shutdown temperature thresholds in Celsius for each CPU on the device. */ + cpuShutdownTemperatures?: number[]; + /** CPU throttling temperature thresholds in Celsius for each CPU on the device. */ + cpuThrottlingTemperatures?: number[]; + /** Baseband version, e.g. MDM9625_104662.22.05.34p. */ + deviceBasebandVersion?: string; + /** GPU shutdown temperature thresholds in Celsius for each GPU on the device. */ + gpuShutdownTemperatures?: number[]; + /** GPU throttling temperature thresholds in Celsius for each GPU on the device. */ + gpuThrottlingTemperatures?: number[]; + /** Name of the hardware, e.g. Angler. */ + hardware?: string; + /** Manufacturer, e.g. Motorola. */ + manufacturer?: string; + /** The model of the device, e.g. Asus Nexus 7. */ + model?: string; + /** The device serial number. */ + serialNumber?: string; + /** Device skin shutdown temperature thresholds in Celsius. */ + skinShutdownTemperatures?: number[]; + /** Device skin throttling temperature thresholds in Celsius. */ + skinThrottlingTemperatures?: number[]; + } + interface HardwareStatus { + /** Current battery temperatures in Celsius for each battery on the device. */ + batteryTemperatures?: number[]; + /** Current CPU temperatures in Celsius for each CPU on the device. */ + cpuTemperatures?: number[]; + /** + * CPU usages in percentage for each core available on the device. Usage is 0 for each unplugged core. Empty array implies that CPU usage is not supported + * in the system. + */ + cpuUsages?: number[]; + /** The time the measurements were taken. */ + createTime?: string; + /** Fan speeds in RPM for each fan on the device. Empty array means that there are no fans or fan speed is not supported on the system. */ + fanSpeeds?: number[]; + /** Current GPU temperatures in Celsius for each GPU on the device. */ + gpuTemperatures?: number[]; + /** Current device skin temperatures in Celsius. */ + skinTemperatures?: number[]; + } + interface ListDevicesResponse { + /** The list of devices. */ + devices?: Device[]; + /** If there are more results, a token to retrieve next page of results. */ + nextPageToken?: string; + } + interface ListOperationsResponse { + /** The standard List next-page token. */ + nextPageToken?: string; + /** A list of operations that matches the specified filter in the request. */ + operations?: Operation[]; + } + interface ListPoliciesResponse { + /** If there are more results, a token to retrieve next page of results. */ + nextPageToken?: string; + /** The list of policies. */ + policies?: Policy[]; + } + interface ManagedProperty { + /** The default value of the properties. BUNDLE_ARRAY properties never have a default value. */ + defaultValue?: any; + /** A longer description of the property, giving more detail of what it affects. Localized. */ + description?: string; + /** For CHOICE or MULTISELECT properties, the list of possible entries. */ + entries?: ManagedPropertyEntry[]; + /** The unique key that the application uses to identify the property, e.g. "com.google.android.gm.fieldname". */ + key?: string; + /** For BUNDLE_ARRAY properties, the list of nested properties. A BUNDLE_ARRAY property is at most two levels deep. */ + nestedProperties?: ManagedProperty[]; + /** The name of the property. Localized. */ + title?: string; + /** The type of the property. */ + type?: string; + } + interface ManagedPropertyEntry { + /** The human-readable name of the value. Localized. */ + name?: string; + /** The machine-readable value of the entry, which should be used in the configuration. Not localized. */ + value?: string; + } + interface MemoryEvent { + /** The number of free bytes in the medium, or for EXTERNAL_STORAGE_DETECTED, the total capacity in bytes of the storage medium. */ + byteCount?: string; + /** The creation time of the event. */ + createTime?: string; + /** Event type. */ + eventType?: string; + } + interface MemoryInfo { + /** Total internal storage on device in bytes. */ + totalInternalStorage?: string; + /** Total RAM on device in bytes. */ + totalRam?: string; + } + interface NetworkInfo { + /** IMEI number of the GSM device, e.g. A1000031212. */ + imei?: string; + /** MEID number of the CDMA device, e.g. A00000292788E1. */ + meid?: string; + /** WiFi MAC address of the device, e.g. 7c:11:11:11:11:11. */ + wifiMacAddress?: string; + } + interface NonComplianceDetail { + /** If the policy setting could not be applied, the current value of the setting on the device. */ + currentValue?: any; + /** + * For settings with nested fields, if a particular nested field is out of compliance, this specifies the full path to the offending field. The path is + * formatted in the same way the policy JSON field would be referenced in JavaScript, that is: 1) For object-typed fields, the field name is followed by a + * dot then by a subfield name. 2) For array-typed fields, the field name is followed by the array index enclosed in brackets. For example, to indicate + * a problem with the url field in the externalData field in the 3rd application, the path would be applications[2].externalData.url + */ + fieldPath?: string; + /** + * If package_name is set and the non-compliance reason is APP_NOT_INSTALLED or APP_NOT_UPDATED, the detailed reason the app cannot be installed or + * updated. + */ + installationFailureReason?: string; + /** The reason the device is not in compliance with the setting. */ + nonComplianceReason?: string; + /** The package name indicating which application is out of compliance, if applicable. */ + packageName?: string; + /** The name of the policy setting. This is the JSON field name of a top-level Policy field. */ + settingName?: string; + } + interface NonComplianceDetailCondition { + /** The reason the device is not in compliance with the setting. If not set, then this condition matches any reason. */ + nonComplianceReason?: string; + /** The package name indicating which application is out of compliance. If not set, then this condition matches any package name. */ + packageName?: string; + /** The name of the policy setting. This is the JSON field name of a top-level Policy field. If not set, then this condition matches any setting name. */ + settingName?: string; + } + interface Operation { + /** If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available. */ + done?: boolean; + /** The error result of the operation in case of failure or cancellation. */ + error?: Status; + /** + * Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some + * services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. + */ + metadata?: Record; + /** + * The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should + * have the format of operations/some/unique/name. + */ + name?: string; + /** + * The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is + * google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response + * should have the type XxxResponse, where Xxx is the original method name. For example, if the original method name is TakeSnapshot(), the inferred + * response type is TakeSnapshotResponse. + */ + response?: Record; + } + interface PasswordRequirements { + /** A device will be wiped after too many incorrect device-unlock passwords have been entered. A value of 0 means there is no restriction. */ + maximumFailedPasswordsForWipe?: number; + /** Password expiration timeout. */ + passwordExpirationTimeout?: string; + /** + * The length of the password history. After setting this, the user will not be able to enter a new password that is the same as any password in the + * history. A value of 0 means there is no restriction. + */ + passwordHistoryLength?: number; + /** + * The minimum allowed password length. A value of 0 means there is no restriction. Only enforced when password_quality is NUMERIC, NUMERIC_COMPLEX, + * ALPHABETIC, ALPHANUMERIC, or COMPLEX. + */ + passwordMinimumLength?: number; + /** Minimum number of letters required in the password. Only enforced when password_quality is COMPLEX. */ + passwordMinimumLetters?: number; + /** Minimum number of lower case letters required in the password. Only enforced when password_quality is COMPLEX. */ + passwordMinimumLowerCase?: number; + /** Minimum number of non-letter characters (numerical digits or symbols) required in the password. Only enforced when password_quality is COMPLEX. */ + passwordMinimumNonLetter?: number; + /** Minimum number of numerical digits required in the password. Only enforced when password_quality is COMPLEX. */ + passwordMinimumNumeric?: number; + /** Minimum number of symbols required in the password. Only enforced when password_quality is COMPLEX. */ + passwordMinimumSymbols?: number; + /** Minimum number of upper case letters required in the password. Only enforced when password_quality is COMPLEX. */ + passwordMinimumUpperCase?: number; + /** The required password quality. */ + passwordQuality?: string; + } + interface PermissionGrant { + /** The android permission, e.g. android.permission.READ_CALENDAR. */ + permission?: string; + /** The policy for granting the permission. */ + policy?: string; + } + interface PersistentPreferredActivity { + /** + * The intent actions to match in the filter. If any actions are included in the filter, then an intent's action must be one of those values for it to + * match. If no actions are included, the intent action is ignored. + */ + actions?: string[]; + /** + * The intent categories to match in the filter. An intent includes the categories that it requires, all of which must be included in the filter in order + * to match. In other words, adding a category to the filter has no impact on matching unless that category is specified in the intent. + */ + categories?: string[]; + /** + * The activity that should be the default intent handler. This should be an Android component name, e.g. com.android.enterprise.app/.MainActivity. + * Alternatively, the value may be the package name of an app, which causes Android Device Policy to choose an appropriate activity from the app to handle + * the intent. + */ + receiverActivity?: string; + } + interface Policy { + /** Whether adding new users and profiles is disabled. */ + addUserDisabled?: boolean; + /** Whether adjusting the master volume is disabled. */ + adjustVolumeDisabled?: boolean; + /** Policy applied to apps. */ + applications?: ApplicationPolicy[]; + /** Whether auto time is required, which prevents the user from manually setting the date and time. */ + autoTimeRequired?: boolean; + /** + * Whether applications other than the ones configured in applications are blocked from being installed. When set, applications that were installed under + * a previous policy but no longer appear in the policy are automatically uninstalled. + */ + blockApplicationsEnabled?: boolean; + /** Whether all cameras on the device are disabled. */ + cameraDisabled?: boolean; + /** + * Rules declaring which mitigating actions to take when a device is not compliant with its policy. When the conditions for multiple rules are satisfied, + * all of the mitigating actions for the rules are taken. There is a maximum limit of 100 rules. + */ + complianceRules?: ComplianceRule[]; + /** Whether the user is allowed to enable debugging features. */ + debuggingFeaturesAllowed?: boolean; + /** The default permission policy for requests for runtime permissions. */ + defaultPermissionPolicy?: string; + /** Whether factory resetting from settings is disabled. */ + factoryResetDisabled?: boolean; + /** + * Email addresses of device administrators for factory reset protection. When the device is factory reset, it will require one of these admins to log in + * with the Google account email and password to unlock the device. If no admins are specified, the device will not provide factory reset protection. + */ + frpAdminEmails?: string[]; + /** Whether the user is allowed to have fun. Controls whether the Easter egg game in Settings is disabled. */ + funDisabled?: boolean; + /** Whether the user is allowed to enable the "Unknown Sources" setting, which allows installation of apps from unknown sources. */ + installUnknownSourcesAllowed?: boolean; + /** Whether the keyguard is disabled. */ + keyguardDisabled?: boolean; + /** Maximum time in milliseconds for user activity until the device will lock. A value of 0 means there is no restriction. */ + maximumTimeToLock?: string; + /** Whether adding or removing accounts is disabled. */ + modifyAccountsDisabled?: boolean; + /** The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId} */ + name?: string; + /** + * Whether the network escape hatch is enabled. If a network connection can't be made at boot time, the escape hatch prompts the user to temporarily + * connect to a network in order to refresh the device policy. After applying policy, the temporary network will be forgotten and the device will continue + * booting. This prevents being unable to connect to a network if there is no suitable network in the last policy and the device boots into an app in lock + * task mode, or the user is otherwise unable to reach device settings. + */ + networkEscapeHatchEnabled?: boolean; + /** Network configuration for the device. See configure networks for more information. */ + openNetworkConfiguration?: Record; + /** Password requirements. */ + passwordRequirements?: PasswordRequirements; + /** Default intent handler activities. */ + persistentPreferredActivities?: PersistentPreferredActivity[]; + /** Whether removing other users is disabled. */ + removeUserDisabled?: boolean; + /** Whether rebooting the device into safe boot is disabled. */ + safeBootDisabled?: boolean; + /** Whether screen capture is disabled. */ + screenCaptureDisabled?: boolean; + /** Whether the status bar is disabled. This disables notifications, quick settings and other screen overlays that allow escape from full-screen mode. */ + statusBarDisabled?: boolean; + /** Status reporting settings */ + statusReportingSettings?: StatusReportingSettings; + /** + * The battery plugged in modes for which the device stays on. When using this setting, it is recommended to clear maximum_time_to_lock so that the device + * doesn't lock itself while it stays on. + */ + stayOnPluggedModes?: string[]; + /** + * The system update policy, which controls how OS updates are applied. If the update type is WINDOWED and the device has a device account, the update + * window will automatically apply to Play app updates as well. + */ + systemUpdate?: SystemUpdate; + /** Whether the microphone is muted and adjusting microphone volume is disabled. */ + unmuteMicrophoneDisabled?: boolean; + /** The version of the policy. This is a read-only field. The version is incremented each time the policy is updated. */ + version?: string; + /** Whether configuring WiFi access points is disabled. */ + wifiConfigDisabled?: boolean; + /** Whether WiFi networks defined in Open Network Configuration are locked so they cannot be edited by the user. */ + wifiConfigsLockdownEnabled?: boolean; + } + interface PowerManagementEvent { + /** For BATTERY_LEVEL_COLLECTED events, the battery level as a percentage. */ + batteryLevel?: number; + /** The creation time of the event. */ + createTime?: string; + /** Event type. */ + eventType?: string; + } + interface SignupUrl { + /** The name of the resource. This must be included in the create enterprise request at the end of the signup flow. */ + name?: string; + /** A URL under which the Admin can sign up for an enterprise. The page pointed to cannot be rendered in an iframe. */ + url?: string; + } + interface SoftwareInfo { + /** Android build Id string meant for displaying to the user, e.g. shamu-userdebug 6.0.1 MOB30I 2756745 dev-keys. */ + androidBuildNumber?: string; + /** Build time. */ + androidBuildTime?: string; + /** The user visible Android version string, e.g. 6.0.1. */ + androidVersion?: string; + /** The system bootloader version number, e.g. 0.6.7. */ + bootloaderVersion?: string; + /** Kernel version, e.g. 2.6.32.9-g103d848. */ + deviceKernelVersion?: string; + /** Security patch level, e.g. 2016-05-01. */ + securityPatchLevel?: string; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** A list of messages that carry the error details. There is a common set of message types for APIs to use. */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface StatusReportingSettings { + /** Whether displays reporting is enabled. */ + displayInfoEnabled?: boolean; + /** Whether hardware status reporting is enabled. */ + hardwareStatusEnabled?: boolean; + /** Whether memory info reporting is enabled. */ + memoryInfoEnabled?: boolean; + /** Whether network info reporting is enabled. */ + networkInfoEnabled?: boolean; + /** Whether power management event reporting is enabled. */ + powerManagementEventsEnabled?: boolean; + /** Whether software info reporting is enabled. */ + softwareInfoEnabled?: boolean; + } + interface SystemUpdate { + /** + * If the type is WINDOWED, the end of the maintenance window, measured as the number of minutes after midnight in device local time. This value must be + * between 0 and 1439, inclusive. If this value is less than start_minutes, then the maintenance window spans midnight. If the maintenance window + * specified is smaller than 30 minutes, the actual window is extended to 30 minutes beyond the start time. + */ + endMinutes?: number; + /** + * If the type is WINDOWED, the start of the maintenance window, measured as the number of minutes after midnight in device local time. This value must be + * between 0 and 1439, inclusive. + */ + startMinutes?: number; + /** The type of system update to configure. */ + type?: string; + } + interface UserFacingMessage { + /** + * The default message that gets displayed if no localized message is specified, or the user's locale does not match with any of the localized messages. A + * default message must be provided if any localized messages are provided. + */ + defaultMessage?: string; + /** A map which contains pairs. The locale is a BCP 47 language code, e.g. en-US, es-ES, fr. */ + localizedMessages?: Record; + } + interface WebToken { + /** The name of the web token, which is generated by the server during creation, in the form enterprises/{enterpriseId}/webTokens/{webTokenId}. */ + name?: string; + /** + * The URL of the parent frame hosting the iframe with the embedded UI. To prevent XSS, the iframe may not be hosted at other URLs. The URL must use the + * https scheme. + */ + parentFrameUrl?: string; + /** Permissions the admin may exercise in the embedded UI. The admin must have all of these permissions in order to view the UI. */ + permissions?: string[]; + /** The token value which is used in the hosting page to generate the iframe with the embedded UI. This is a read-only field generated by the server. */ + value?: string; + } + interface ApplicationsResource { + /** Gets info about an application. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The preferred language for localized application info, as a BCP47 tag (e.g. "en-US", "de"). If not specified the default language of the application + * will be used. + */ + languageCode?: string; + /** The name of the application in the form enterprises/{enterpriseId}/applications/{package_name} */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface OperationsResource { + /** + * Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If + * the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check + * whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; + * instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED. + */ + cancel(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource to be cancelled. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource to be deleted. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API + * service. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name + * binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API + * services can add a binding such as "/v1/{name=users/*}/operations" to their service configuration. For backwards compatibility, the default name + * includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection + * id. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The standard list filter. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation's parent resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The standard list page size. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface DevicesResource { + /** Deletes a device, which causes the device to be wiped. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId} */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Gets a device. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId} */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Issues a command to a device. The Operation resource returned contains a Command in its metadata field. Use the get operation method to get the status + * of the command. + */ + issueCommand(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId} */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists devices for a given enterprise. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The requested page size. The actual page size may be fixed to a min or max value. */ + pageSize?: number; + /** A token identifying a page of results the server should return. */ + pageToken?: string; + /** The name of the enterprise in the form enterprises/{enterpriseId} */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Updates a device. */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId} */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** The field mask indicating the fields to update. If not set, all modifiable fields will be modified. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + operations: OperationsResource; + } + interface EnrollmentTokensResource { + /** Creates an enrollment token for a given enterprise. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The name of the enterprise in the form enterprises/{enterpriseId} */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Deletes an enrollment token, which prevents future use of the token. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the enrollment token in the form enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId} */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + } + interface PoliciesResource { + /** Deletes a policy. This operation is only permitted if no devices are currently referencing the policy. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId} */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Gets a policy. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId} */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists policies for a given enterprise. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The requested page size. The actual page size may be fixed to a min or max value. */ + pageSize?: number; + /** A token identifying a page of results the server should return. */ + pageToken?: string; + /** The name of the enterprise in the form enterprises/{enterpriseId} */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Updates or creates a policy. */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId} */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** The field mask indicating the fields to update. If not set, all modifiable fields will be modified. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface WebTokensResource { + /** Creates a web token to access an embeddable managed Google Play web UI for a given enterprise. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The name of the enterprise in the form enterprises/{enterpriseId} */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface EnterprisesResource { + /** Creates an enterprise by completing the enterprise signup flow. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The enterprise token appended to the callback URL. */ + enterpriseToken?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The id of the Google Cloud Platform project which will own the enterprise. */ + projectId?: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** The name of the SignupUrl used to sign up for the enterprise. */ + signupUrlName?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Gets an enterprise. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the enterprise in the form enterprises/{enterpriseId} */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Updates an enterprise. */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the enterprise in the form enterprises/{enterpriseId} */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** The field mask indicating the fields to update. If not set, all modifiable fields will be modified. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + applications: ApplicationsResource; + devices: DevicesResource; + enrollmentTokens: EnrollmentTokensResource; + policies: PoliciesResource; + webTokens: WebTokensResource; + } + interface SignupUrlsResource { + /** Creates an enterprise signup URL. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The callback URL to which the admin will be redirected after successfully creating an enterprise. Before redirecting there the system will add a query + * parameter to this URL named enterpriseToken which will contain an opaque token to be used for the create enterprise request. The URL will be parsed + * then reformatted in order to add the enterpriseToken parameter, so there may be some minor formatting changes. + */ + callbackUrl?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The id of the Google Cloud Platform project which will own the enterprise. */ + projectId?: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.androidmanagement/readme.md b/types/gapi.client.androidmanagement/readme.md new file mode 100644 index 0000000000..e38e2b2653 --- /dev/null +++ b/types/gapi.client.androidmanagement/readme.md @@ -0,0 +1,74 @@ +# TypeScript typings for Android Management API v1 +The Android Management API provides remote enterprise management of Android devices and apps. +For detailed description please check [documentation](https://developers.google.com/android/management). + +## Installing + +Install typings for Android Management API: +``` +npm install @types/gapi.client.androidmanagement@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('androidmanagement', 'v1', () => { + // now we can use gapi.client.androidmanagement + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // Manage Android devices and apps for your customers + 'https://www.googleapis.com/auth/androidmanagement', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Android Management API resources: + +```typescript + +/* +Creates an enterprise by completing the enterprise signup flow. +*/ +await gapi.client.enterprises.create({ }); + +/* +Gets an enterprise. +*/ +await gapi.client.enterprises.get({ name: "name", }); + +/* +Updates an enterprise. +*/ +await gapi.client.enterprises.patch({ name: "name", }); + +/* +Creates an enterprise signup URL. +*/ +await gapi.client.signupUrls.create({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.androidmanagement/tsconfig.json b/types/gapi.client.androidmanagement/tsconfig.json new file mode 100644 index 0000000000..3cfbad08e0 --- /dev/null +++ b/types/gapi.client.androidmanagement/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.androidmanagement-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.androidmanagement/tslint.json b/types/gapi.client.androidmanagement/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.androidmanagement/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.androidpublisher/gapi.client.androidpublisher-tests.ts b/types/gapi.client.androidpublisher/gapi.client.androidpublisher-tests.ts new file mode 100644 index 0000000000..6dfad512ac --- /dev/null +++ b/types/gapi.client.androidpublisher/gapi.client.androidpublisher-tests.ts @@ -0,0 +1,122 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('androidpublisher', 'v2', () => { + /** now we can use gapi.client.androidpublisher */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your Google Play Developer account */ + 'https://www.googleapis.com/auth/androidpublisher', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Commits/applies the changes made in this edit back to the app. */ + await gapi.client.edits.commit({ + editId: "editId", + packageName: "packageName", + }); + /** + * Deletes an edit for an app. Creating a new edit will automatically delete any of your previous edits so this method need only be called if you want to + * preemptively abandon an edit. + */ + await gapi.client.edits.delete({ + editId: "editId", + packageName: "packageName", + }); + /** Returns information about the edit specified. Calls will fail if the edit is no long active (e.g. has been deleted, superseded or expired). */ + await gapi.client.edits.get({ + editId: "editId", + packageName: "packageName", + }); + /** Creates a new edit for an app, populated with the app's current state. */ + await gapi.client.edits.insert({ + packageName: "packageName", + }); + /** Checks that the edit can be successfully committed. The edit's changes are not applied to the live app. */ + await gapi.client.edits.validate({ + editId: "editId", + packageName: "packageName", + }); + /** Lists the user's current inapp item or subscription entitlements */ + await gapi.client.entitlements.list({ + maxResults: 1, + packageName: "packageName", + productId: "productId", + startIndex: 4, + token: "token", + }); + await gapi.client.inappproducts.batch({ + }); + /** Delete an in-app product for an app. */ + await gapi.client.inappproducts.delete({ + packageName: "packageName", + sku: "sku", + }); + /** Returns information about the in-app product specified. */ + await gapi.client.inappproducts.get({ + packageName: "packageName", + sku: "sku", + }); + /** Creates a new in-app product for an app. */ + await gapi.client.inappproducts.insert({ + autoConvertMissingPrices: true, + packageName: "packageName", + }); + /** List all the in-app products for an Android app, both subscriptions and managed in-app products.. */ + await gapi.client.inappproducts.list({ + maxResults: 1, + packageName: "packageName", + startIndex: 3, + token: "token", + }); + /** Updates the details of an in-app product. This method supports patch semantics. */ + await gapi.client.inappproducts.patch({ + autoConvertMissingPrices: true, + packageName: "packageName", + sku: "sku", + }); + /** Updates the details of an in-app product. */ + await gapi.client.inappproducts.update({ + autoConvertMissingPrices: true, + packageName: "packageName", + sku: "sku", + }); + /** Returns a single review. */ + await gapi.client.reviews.get({ + packageName: "packageName", + reviewId: "reviewId", + translationLanguage: "translationLanguage", + }); + /** Returns a list of reviews. Only reviews from last week will be returned. */ + await gapi.client.reviews.list({ + maxResults: 1, + packageName: "packageName", + startIndex: 3, + token: "token", + translationLanguage: "translationLanguage", + }); + /** Reply to a single review, or update an existing reply. */ + await gapi.client.reviews.reply({ + packageName: "packageName", + reviewId: "reviewId", + }); + } +}); diff --git a/types/gapi.client.androidpublisher/index.d.ts b/types/gapi.client.androidpublisher/index.d.ts new file mode 100644 index 0000000000..beae0fb512 --- /dev/null +++ b/types/gapi.client.androidpublisher/index.d.ts @@ -0,0 +1,2062 @@ +// Type definitions for Google Google Play Developer API v2 2.0 +// Project: https://developers.google.com/android-publisher +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/androidpublisher/v2/rest + +/// + +declare namespace gapi.client { + /** Load Google Play Developer API v2 */ + function load(name: "androidpublisher", version: "v2"): PromiseLike; + function load(name: "androidpublisher", version: "v2", callback: () => any): void; + + const edits: androidpublisher.EditsResource; + + const entitlements: androidpublisher.EntitlementsResource; + + const inappproducts: androidpublisher.InappproductsResource; + + const purchases: androidpublisher.PurchasesResource; + + const reviews: androidpublisher.ReviewsResource; + + namespace androidpublisher { + interface Apk { + /** Information about the binary payload of this APK. */ + binary?: ApkBinary; + /** The version code of the APK, as specified in the APK's manifest file. */ + versionCode?: number; + } + interface ApkBinary { + /** A sha1 hash of the APK payload, encoded as a hex string and matching the output of the sha1sum command. */ + sha1?: string; + /** A sha256 hash of the APK payload, encoded as a hex string and matching the output of the sha256sum command. */ + sha256?: string; + } + interface ApkListing { + /** The language code, in BCP 47 format (eg "en-US"). */ + language?: string; + /** Describe what's new in your APK. */ + recentChanges?: string; + } + interface ApkListingsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "androidpublisher#apkListingsListResponse". */ + kind?: string; + listings?: ApkListing[]; + } + interface ApksAddExternallyHostedRequest { + /** The definition of the externally-hosted APK and where it is located. */ + externallyHostedApk?: ExternallyHostedApk; + } + interface ApksAddExternallyHostedResponse { + /** The definition of the externally-hosted APK and where it is located. */ + externallyHostedApk?: ExternallyHostedApk; + } + interface ApksListResponse { + apks?: Apk[]; + /** Identifies what kind of resource this is. Value: the fixed string "androidpublisher#apksListResponse". */ + kind?: string; + } + interface AppDetails { + /** The user-visible support email for this app. */ + contactEmail?: string; + /** The user-visible support telephone number for this app. */ + contactPhone?: string; + /** The user-visible website for this app. */ + contactWebsite?: string; + /** Default language code, in BCP 47 format (eg "en-US"). */ + defaultLanguage?: string; + } + interface AppEdit { + /** The time at which the edit will expire and will be no longer valid for use in any subsequent API calls (encoded as seconds since the Epoch). */ + expiryTimeSeconds?: string; + /** The ID of the edit that can be used in subsequent API calls. */ + id?: string; + } + interface Comment { + /** A comment from a developer. */ + developerComment?: DeveloperComment; + /** A comment from a user. */ + userComment?: UserComment; + } + interface DeobfuscationFile { + /** The type of the deobfuscation file. */ + symbolType?: string; + } + interface DeobfuscationFilesUploadResponse { + deobfuscationFile?: DeobfuscationFile; + } + interface DeveloperComment { + /** The last time at which this comment was updated. */ + lastModified?: Timestamp; + /** The content of the comment, i.e. reply body. */ + text?: string; + } + interface DeviceMetadata { + /** Device CPU make e.g. "Qualcomm" */ + cpuMake?: string; + /** Device CPU model e.g. "MSM8974" */ + cpuModel?: string; + /** Device class (e.g. tablet) */ + deviceClass?: string; + /** OpenGL version */ + glEsVersion?: number; + /** Device manufacturer (e.g. Motorola) */ + manufacturer?: string; + /** Comma separated list of native platforms (e.g. "arm", "arm7") */ + nativePlatform?: string; + /** Device model name (e.g. Droid) */ + productName?: string; + /** Device RAM in Megabytes e.g. "2048" */ + ramMb?: number; + /** Screen density in DPI */ + screenDensityDpi?: number; + /** Screen height in pixels */ + screenHeightPx?: number; + /** Screen width in pixels */ + screenWidthPx?: number; + } + interface Entitlement { + /** This kind represents an entitlement object in the androidpublisher service. */ + kind?: string; + /** The SKU of the product. */ + productId?: string; + /** + * The type of the inapp product. Possible values are: + * - In-app item: "inapp" + * - Subscription: "subs" + */ + productType?: string; + /** The token which can be verified using the subscriptions or products API. */ + token?: string; + } + interface EntitlementsListResponse { + pageInfo?: PageInfo; + resources?: Entitlement[]; + tokenPagination?: TokenPagination; + } + interface ExpansionFile { + /** + * If set this field indicates that this APK has an Expansion File uploaded to it: this APK does not reference another APK's Expansion File. The field's + * value is the size of the uploaded Expansion File in bytes. + */ + fileSize?: string; + /** If set this APK's Expansion File references another APK's Expansion File. The file_size field will not be set. */ + referencesVersion?: number; + } + interface ExpansionFilesUploadResponse { + expansionFile?: ExpansionFile; + } + interface ExternallyHostedApk { + /** The application label. */ + applicationLabel?: string; + /** A certificate (or array of certificates if a certificate-chain is used) used to signed this APK, represented as a base64 encoded byte array. */ + certificateBase64s?: string[]; + /** The URL at which the APK is hosted. This must be an https URL. */ + externallyHostedUrl?: string; + /** The SHA1 checksum of this APK, represented as a base64 encoded byte array. */ + fileSha1Base64?: string; + /** The SHA256 checksum of this APK, represented as a base64 encoded byte array. */ + fileSha256Base64?: string; + /** The file size in bytes of this APK. */ + fileSize?: string; + /** The icon image from the APK, as a base64 encoded byte array. */ + iconBase64?: string; + /** The maximum SDK supported by this APK (optional). */ + maximumSdk?: number; + /** The minimum SDK targeted by this APK. */ + minimumSdk?: number; + /** The native code environments supported by this APK (optional). */ + nativeCodes?: string[]; + /** The package name. */ + packageName?: string; + /** The features required by this APK (optional). */ + usesFeatures?: string[]; + /** The permissions requested by this APK. */ + usesPermissions?: ExternallyHostedApkUsesPermission[]; + /** The version code of this APK. */ + versionCode?: number; + /** The version name of this APK. */ + versionName?: string; + } + interface ExternallyHostedApkUsesPermission { + /** Optionally, the maximum SDK version for which the permission is required. */ + maxSdkVersion?: number; + /** The name of the permission requested. */ + name?: string; + } + interface Image { + /** A unique id representing this image. */ + id?: string; + /** A sha1 hash of the image that was uploaded. */ + sha1?: string; + /** A URL that will serve a preview of the image. */ + url?: string; + } + interface ImagesDeleteAllResponse { + deleted?: Image[]; + } + interface ImagesListResponse { + images?: Image[]; + } + interface ImagesUploadResponse { + image?: Image; + } + interface InAppProduct { + /** The default language of the localized data, as defined by BCP 47. e.g. "en-US", "en-GB". */ + defaultLanguage?: string; + /** Default price cannot be zero. In-app products can never be free. Default price is always in the developer's Checkout merchant currency. */ + defaultPrice?: Price; + /** List of localized title and description data. */ + listings?: Record; + /** The package name of the parent app. */ + packageName?: string; + /** Prices per buyer region. None of these prices should be zero. In-app products can never be free. */ + prices?: Record; + /** Purchase type enum value. Unmodifiable after creation. */ + purchaseType?: string; + /** Definition of a season for a seasonal subscription. Can be defined only for yearly subscriptions. */ + season?: Season; + /** The stock-keeping-unit (SKU) of the product, unique within an app. */ + sku?: string; + status?: string; + /** + * Subscription period, specified in ISO 8601 format. Acceptable values are "P1W" (one week), "P1M" (one month), "P3M" (three months), "P6M" (six months), + * and "P1Y" (one year). + */ + subscriptionPeriod?: string; + /** + * Trial period, specified in ISO 8601 format. Acceptable values are anything between "P7D" (seven days) and "P999D" (999 days). Seasonal subscriptions + * cannot have a trial period. + */ + trialPeriod?: string; + } + interface InAppProductListing { + description?: string; + title?: string; + } + interface InappproductsBatchRequest { + entrys?: InappproductsBatchRequestEntry[]; + } + interface InappproductsBatchRequestEntry { + batchId?: number; + inappproductsinsertrequest?: InappproductsInsertRequest; + inappproductsupdaterequest?: InappproductsUpdateRequest; + methodName?: string; + } + interface InappproductsBatchResponse { + entrys?: InappproductsBatchResponseEntry[]; + /** Identifies what kind of resource this is. Value: the fixed string "androidpublisher#inappproductsBatchResponse". */ + kind?: string; + } + interface InappproductsBatchResponseEntry { + batchId?: number; + inappproductsinsertresponse?: InappproductsInsertResponse; + inappproductsupdateresponse?: InappproductsUpdateResponse; + } + interface InappproductsInsertRequest { + inappproduct?: InAppProduct; + } + interface InappproductsInsertResponse { + inappproduct?: InAppProduct; + } + interface InappproductsListResponse { + inappproduct?: InAppProduct[]; + /** Identifies what kind of resource this is. Value: the fixed string "androidpublisher#inappproductsListResponse". */ + kind?: string; + pageInfo?: PageInfo; + tokenPagination?: TokenPagination; + } + interface InappproductsUpdateRequest { + inappproduct?: InAppProduct; + } + interface InappproductsUpdateResponse { + inappproduct?: InAppProduct; + } + interface Listing { + /** Full description of the app; this may be up to 4000 characters in length. */ + fullDescription?: string; + /** Language localization code (for example, "de-AT" for Austrian German). */ + language?: string; + /** Short description of the app (previously known as promo text); this may be up to 80 characters in length. */ + shortDescription?: string; + /** App's localized title. */ + title?: string; + /** URL of a promotional YouTube video for the app. */ + video?: string; + } + interface ListingsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "androidpublisher#listingsListResponse". */ + kind?: string; + listings?: Listing[]; + } + interface MonthDay { + /** Day of a month, value in [1, 31] range. Valid range depends on the specified month. */ + day?: number; + /** Month of a year. e.g. 1 = JAN, 2 = FEB etc. */ + month?: number; + } + interface PageInfo { + resultPerPage?: number; + startIndex?: number; + totalResults?: number; + } + interface Price { + /** 3 letter Currency code, as defined by ISO 4217. */ + currency?: string; + /** The price in millionths of the currency base unit represented as a string. */ + priceMicros?: string; + } + interface ProductPurchase { + /** + * The consumption state of the inapp product. Possible values are: + * - Yet to be consumed + * - Consumed + */ + consumptionState?: number; + /** A developer-specified string that contains supplemental information about an order. */ + developerPayload?: string; + /** This kind represents an inappPurchase object in the androidpublisher service. */ + kind?: string; + /** The order id associated with the purchase of the inapp product. */ + orderId?: string; + /** + * The purchase state of the order. Possible values are: + * - Purchased + * - Cancelled + */ + purchaseState?: number; + /** The time the product was purchased, in milliseconds since the epoch (Jan 1, 1970). */ + purchaseTimeMillis?: string; + } + interface Prorate { + /** + * Default price cannot be zero and must be less than the full subscription price. Default price is always in the developer's Checkout merchant currency. + * Targeted countries have their prices set automatically based on the default_price. + */ + defaultPrice?: Price; + /** Defines the first day on which the price takes effect. */ + start?: MonthDay; + } + interface Review { + /** The name of the user who wrote the review. */ + authorName?: string; + /** A repeated field containing comments for the review. */ + comments?: Comment[]; + /** Unique identifier for this review. */ + reviewId?: string; + } + interface ReviewReplyResult { + /** The time at which the reply took effect. */ + lastEdited?: Timestamp; + /** The reply text that was applied. */ + replyText?: string; + } + interface ReviewsListResponse { + pageInfo?: PageInfo; + reviews?: Review[]; + tokenPagination?: TokenPagination; + } + interface ReviewsReplyRequest { + /** The text to set as the reply. Replies of more than approximately 350 characters will be rejected. HTML tags will be stripped. */ + replyText?: string; + } + interface ReviewsReplyResponse { + result?: ReviewReplyResult; + } + interface Season { + /** Inclusive end date of the recurrence period. */ + end?: MonthDay; + /** + * Optionally present list of prorations for the season. Each proration is a one-off discounted entry into a subscription. Each proration contains the + * first date on which the discount is available and the new pricing information. + */ + prorations?: Prorate[]; + /** Inclusive start date of the recurrence period. */ + start?: MonthDay; + } + interface SubscriptionDeferralInfo { + /** + * The desired next expiry time to assign to the subscription, in milliseconds since the Epoch. The given time must be later/greater than the current + * expiry time for the subscription. + */ + desiredExpiryTimeMillis?: string; + /** + * The expected expiry time for the subscription. If the current expiry time for the subscription is not the value specified here, the deferral will not + * occur. + */ + expectedExpiryTimeMillis?: string; + } + interface SubscriptionPurchase { + /** Whether the subscription will automatically be renewed when it reaches its current expiry time. */ + autoRenewing?: boolean; + /** + * The reason why a subscription was cancelled or is not auto-renewing. Possible values are: + * - User cancelled the subscription + * - Subscription was cancelled by the system, for example because of a billing problem + * - Subscription was replaced with a new subscription + */ + cancelReason?: number; + /** ISO 3166-1 alpha-2 billing country/region code of the user at the time the subscription was granted. */ + countryCode?: string; + /** A developer-specified string that contains supplemental information about an order. */ + developerPayload?: string; + /** Time at which the subscription will expire, in milliseconds since the Epoch. */ + expiryTimeMillis?: string; + /** This kind represents a subscriptionPurchase object in the androidpublisher service. */ + kind?: string; + /** The order id of the latest recurring order associated with the purchase of the subscription. */ + orderId?: string; + /** + * The payment state of the subscription. Possible values are: + * - Payment pending + * - Payment received + * - Free trial + */ + paymentState?: number; + /** + * Price of the subscription, not including tax. Price is expressed in micro-units, where 1,000,000 micro-units represents one unit of the currency. For + * example, if the subscription price is €1.99, price_amount_micros is 1990000. + */ + priceAmountMicros?: string; + /** ISO 4217 currency code for the subscription price. For example, if the price is specified in British pounds sterling, price_currency_code is "GBP". */ + priceCurrencyCode?: string; + /** Time at which the subscription was granted, in milliseconds since the Epoch. */ + startTimeMillis?: string; + /** The time at which the subscription was canceled by the user, in milliseconds since the epoch. Only present if cancelReason is 0. */ + userCancellationTimeMillis?: string; + } + interface SubscriptionPurchasesDeferRequest { + /** The information about the new desired expiry time for the subscription. */ + deferralInfo?: SubscriptionDeferralInfo; + } + interface SubscriptionPurchasesDeferResponse { + /** The new expiry time for the subscription in milliseconds since the Epoch. */ + newExpiryTimeMillis?: string; + } + interface Testers { + googleGroups?: string[]; + googlePlusCommunities?: string[]; + } + interface Timestamp { + nanos?: number; + seconds?: string; + } + interface TokenPagination { + nextPageToken?: string; + previousPageToken?: string; + } + interface Track { + track?: string; + userFraction?: number; + versionCodes?: number[]; + } + interface TracksListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "androidpublisher#tracksListResponse". */ + kind?: string; + tracks?: Track[]; + } + interface UserComment { + /** Integer Android SDK version of the user's device at the time the review was written, e.g. 23 is Marshmallow. May be absent. */ + androidOsVersion?: number; + /** Integer version code of the app as installed at the time the review was written. May be absent. */ + appVersionCode?: number; + /** String version name of the app as installed at the time the review was written. May be absent. */ + appVersionName?: string; + /** Codename for the reviewer's device, e.g. klte, flounder. May be absent. */ + device?: string; + /** Some information about the characteristics of the user's device */ + deviceMetadata?: DeviceMetadata; + /** The last time at which this comment was updated. */ + lastModified?: Timestamp; + /** Untranslated text of the review, in the case where the review has been translated. If the review has not been translated this is left blank. */ + originalText?: string; + /** + * Language code for the reviewer. This is taken from the device settings so is not guaranteed to match the language the review is written in. May be + * absent. + */ + reviewerLanguage?: string; + /** The star rating associated with the review, from 1 to 5. */ + starRating?: number; + /** + * The content of the comment, i.e. review body. In some cases users have been able to write a review with separate title and body; in those cases the + * title and body are concatenated and separated by a tab character. + */ + text?: string; + /** Number of users who have given this review a thumbs down */ + thumbsDownCount?: number; + /** Number of users who have given this review a thumbs up */ + thumbsUpCount?: number; + } + interface VoidedPurchase { + /** This kind represents a voided purchase object in the androidpublisher service. */ + kind?: string; + /** The time at which the purchase was made, in milliseconds since the epoch (Jan 1, 1970). */ + purchaseTimeMillis?: string; + /** The token that was generated when a purchase was made. This uniquely identifies a purchase. */ + purchaseToken?: string; + /** The time at which the purchase was cancelled/refunded/charged-back, in milliseconds since the epoch (Jan 1, 1970). */ + voidedTimeMillis?: string; + } + interface VoidedPurchasesListResponse { + pageInfo?: PageInfo; + tokenPagination?: TokenPagination; + voidedPurchases?: VoidedPurchase[]; + } + interface ApklistingsResource { + /** Deletes the APK-specific localized listing for a specified APK and language code. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The APK version code whose APK-specific listings should be read or modified. */ + apkVersionCode: number; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass + * "de-AT". + */ + language: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes all the APK-specific localized listings for a specified APK. */ + deleteall(request: { + /** Data format for the response. */ + alt?: string; + /** The APK version code whose APK-specific listings should be read or modified. */ + apkVersionCode: number; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Fetches the APK-specific localized listing for a specified APK and language code. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The APK version code whose APK-specific listings should be read or modified. */ + apkVersionCode: number; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass + * "de-AT". + */ + language: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all the APK-specific localized listings for a specified APK. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The APK version code whose APK-specific listings should be read or modified. */ + apkVersionCode: number; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates or creates the APK-specific localized listing for a specified APK and language code. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** The APK version code whose APK-specific listings should be read or modified. */ + apkVersionCode: number; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass + * "de-AT". + */ + language: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates or creates the APK-specific localized listing for a specified APK and language code. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The APK version code whose APK-specific listings should be read or modified. */ + apkVersionCode: number; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass + * "de-AT". + */ + language: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ApksResource { + /** + * Creates a new APK without uploading the APK itself to Google Play, instead hosting the APK at a specified URL. This function is only available to + * enterprises using Google Play for Work whose application is configured to restrict distribution to the enterprise domain. + */ + addexternallyhosted(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + list(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + upload(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DeobfuscationfilesResource { + /** Uploads the deobfuscation file of the specified APK. If a deobfuscation file already exists, it will be replaced. */ + upload(request: { + /** Data format for the response. */ + alt?: string; + /** The version code of the APK whose deobfuscation file is being uploaded. */ + apkVersionCode: number; + deobfuscationFileType: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier of the Android app for which the deobfuscatiuon files are being uploaded; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DetailsResource { + /** Fetches app details for this edit. This includes the default language and developer support contact information. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates app details for this edit. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates app details for this edit. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ExpansionfilesResource { + /** Fetches the Expansion File configuration for the APK specified. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The version code of the APK whose Expansion File configuration is being read or modified. */ + apkVersionCode: number; + /** Unique identifier for this edit. */ + editId: string; + expansionFileType: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the APK's Expansion File configuration to reference another APK's Expansion Files. To add a new Expansion File use the Upload method. This + * method supports patch semantics. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** The version code of the APK whose Expansion File configuration is being read or modified. */ + apkVersionCode: number; + /** Unique identifier for this edit. */ + editId: string; + expansionFileType: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the APK's Expansion File configuration to reference another APK's Expansion Files. To add a new Expansion File use the Upload method. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The version code of the APK whose Expansion File configuration is being read or modified. */ + apkVersionCode: number; + /** Unique identifier for this edit. */ + editId: string; + expansionFileType: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Uploads and attaches a new Expansion File to the APK specified. */ + upload(request: { + /** Data format for the response. */ + alt?: string; + /** The version code of the APK whose Expansion File configuration is being read or modified. */ + apkVersionCode: number; + /** Unique identifier for this edit. */ + editId: string; + expansionFileType: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ImagesResource { + /** Deletes the image (specified by id) from the edit. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Unique identifier an image within the set of images attached to this edit. */ + imageId: string; + imageType: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass + * "de-AT". + */ + language: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes all images for the specified language and image type. */ + deleteall(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + imageType: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass + * "de-AT". + */ + language: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all images for the specified language and image type. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + imageType: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass + * "de-AT". + */ + language: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Uploads a new image and adds it to the list of images for the specified language and image type. */ + upload(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + imageType: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass + * "de-AT". + */ + language: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ListingsResource { + /** Deletes the specified localized store listing from an edit. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass "de-AT". */ + language: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes all localized listings from an edit. */ + deleteall(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Fetches information about a localized store listing. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass "de-AT". */ + language: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns all of the localized store listings attached to this edit. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates or updates a localized store listing. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass "de-AT". */ + language: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates or updates a localized store listing. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass "de-AT". */ + language: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TestersResource { + get(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + track: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + track: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + update(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + track: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TracksResource { + /** Fetches the track configuration for the specified track type. Includes the APK version codes that are in this track. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The track type to read or modify. */ + track: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all the track configurations for this edit. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the track configuration for the specified track type. When halted, the rollout track cannot be updated without adding new APKs, and adding new + * APKs will cause it to resume. This method supports patch semantics. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The track type to read or modify. */ + track: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the track configuration for the specified track type. When halted, the rollout track cannot be updated without adding new APKs, and adding new + * APKs will cause it to resume. + */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The track type to read or modify. */ + track: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface EditsResource { + /** Commits/applies the changes made in this edit back to the app. */ + commit(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Deletes an edit for an app. Creating a new edit will automatically delete any of your previous edits so this method need only be called if you want to + * preemptively abandon an edit. + */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns information about the edit specified. Calls will fail if the edit is no long active (e.g. has been deleted, superseded or expired). */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a new edit for an app, populated with the app's current state. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Checks that the edit can be successfully committed. The edit's changes are not applied to the live app. */ + validate(request: { + /** Data format for the response. */ + alt?: string; + /** Unique identifier for this edit. */ + editId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app that is being updated; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + apklistings: ApklistingsResource; + apks: ApksResource; + deobfuscationfiles: DeobfuscationfilesResource; + details: DetailsResource; + expansionfiles: ExpansionfilesResource; + images: ImagesResource; + listings: ListingsResource; + testers: TestersResource; + tracks: TracksResource; + } + interface EntitlementsResource { + /** Lists the user's current inapp item or subscription entitlements */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The package name of the application the inapp product was sold in (for example, 'com.some.thing'). */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The product id of the inapp product (for example, 'sku1'). This can be used to restrict the result set. */ + productId?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + startIndex?: number; + token?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface InappproductsResource { + batch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Delete an in-app product for an app. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app with the in-app product; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Unique identifier for the in-app product. */ + sku: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns information about the in-app product specified. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Unique identifier for the in-app product. */ + sku: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a new in-app product for an app. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** + * If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the + * target currency based on the default price. Defaults to false. + */ + autoConvertMissingPrices?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all the in-app products for an Android app, both subscriptions and managed in-app products.. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app with in-app products; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + startIndex?: number; + token?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the details of an in-app product. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** + * If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the + * target currency based on the default price. Defaults to false. + */ + autoConvertMissingPrices?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app with the in-app product; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Unique identifier for the in-app product. */ + sku: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the details of an in-app product. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** + * If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the + * target currency based on the default price. Defaults to false. + */ + autoConvertMissingPrices?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app with the in-app product; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Unique identifier for the in-app product. */ + sku: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ProductsResource { + /** Checks the purchase and consumption status of an inapp item. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The package name of the application the inapp product was sold in (for example, 'com.some.thing'). */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The inapp product SKU (for example, 'com.some.thing.inapp1'). */ + productId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The token provided to the user's device when the inapp product was purchased. */ + token: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SubscriptionsResource { + /** Cancels a user's subscription purchase. The subscription remains valid until its expiration time. */ + cancel(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The purchased subscription ID (for example, 'monthly001'). */ + subscriptionId: string; + /** The token provided to the user's device when the subscription was purchased. */ + token: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Defers a user's subscription purchase until a specified future expiration time. */ + defer(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The purchased subscription ID (for example, 'monthly001'). */ + subscriptionId: string; + /** The token provided to the user's device when the subscription was purchased. */ + token: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Checks whether a user's subscription purchase is valid and returns its expiry time. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The purchased subscription ID (for example, 'monthly001'). */ + subscriptionId: string; + /** The token provided to the user's device when the subscription was purchased. */ + token: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Refunds a user's subscription purchase, but the subscription remains valid until its expiration time and it will continue to recur. */ + refund(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The purchased subscription ID (for example, 'monthly001'). */ + subscriptionId: string; + /** The token provided to the user's device when the subscription was purchased. */ + token: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Refunds and immediately revokes a user's subscription purchase. Access to the subscription will be terminated immediately and it will stop recurring. */ + revoke(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The purchased subscription ID (for example, 'monthly001'). */ + subscriptionId: string; + /** The token provided to the user's device when the subscription was purchased. */ + token: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface VoidedpurchasesResource { + /** Lists the purchases that were cancelled, refunded or charged-back. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** + * The time, in milliseconds since the Epoch, of the newest voided in-app product purchase that you want to see in the response. The value of this + * parameter cannot be greater than the current time and is ignored if a pagination token is set. Default value is current time. Note: This filter is + * applied on the time at which the record is seen as voided by our systems and not the actual voided time returned in the response. + */ + endTime?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The package name of the application for which voided purchases need to be returned (for example, 'com.some.thing'). */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + startIndex?: number; + /** + * The time, in milliseconds since the Epoch, of the oldest voided in-app product purchase that you want to see in the response. The value of this + * parameter cannot be older than 30 days and is ignored if a pagination token is set. Default value is current time minus 30 days. Note: This filter is + * applied on the time at which the record is seen as voided by our systems and not the actual voided time returned in the response. + */ + startTime?: string; + token?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PurchasesResource { + products: ProductsResource; + subscriptions: SubscriptionsResource; + voidedpurchases: VoidedpurchasesResource; + } + interface ReviewsResource { + /** Returns a single review. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app for which we want reviews; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + reviewId: string; + translationLanguage?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns a list of reviews. Only reviews from last week will be returned. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app for which we want reviews; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + startIndex?: number; + token?: string; + translationLanguage?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Reply to a single review, or update an existing reply. */ + reply(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Unique identifier for the Android app for which we want reviews; for example, "com.spiffygame". */ + packageName: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + reviewId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.androidpublisher/readme.md b/types/gapi.client.androidpublisher/readme.md new file mode 100644 index 0000000000..a4bbff05c0 --- /dev/null +++ b/types/gapi.client.androidpublisher/readme.md @@ -0,0 +1,134 @@ +# TypeScript typings for Google Play Developer API v2 +Lets Android application developers access their Google Play accounts. +For detailed description please check [documentation](https://developers.google.com/android-publisher). + +## Installing + +Install typings for Google Play Developer API: +``` +npm install @types/gapi.client.androidpublisher@v2 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('androidpublisher', 'v2', () => { + // now we can use gapi.client.androidpublisher + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your Google Play Developer account + 'https://www.googleapis.com/auth/androidpublisher', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Play Developer API resources: + +```typescript + +/* +Commits/applies the changes made in this edit back to the app. +*/ +await gapi.client.edits.commit({ editId: "editId", packageName: "packageName", }); + +/* +Deletes an edit for an app. Creating a new edit will automatically delete any of your previous edits so this method need only be called if you want to preemptively abandon an edit. +*/ +await gapi.client.edits.delete({ editId: "editId", packageName: "packageName", }); + +/* +Returns information about the edit specified. Calls will fail if the edit is no long active (e.g. has been deleted, superseded or expired). +*/ +await gapi.client.edits.get({ editId: "editId", packageName: "packageName", }); + +/* +Creates a new edit for an app, populated with the app's current state. +*/ +await gapi.client.edits.insert({ packageName: "packageName", }); + +/* +Checks that the edit can be successfully committed. The edit's changes are not applied to the live app. +*/ +await gapi.client.edits.validate({ editId: "editId", packageName: "packageName", }); + +/* +Lists the user's current inapp item or subscription entitlements +*/ +await gapi.client.entitlements.list({ packageName: "packageName", }); + +/* +undefined +*/ +await gapi.client.inappproducts.batch({ }); + +/* +Delete an in-app product for an app. +*/ +await gapi.client.inappproducts.delete({ packageName: "packageName", sku: "sku", }); + +/* +Returns information about the in-app product specified. +*/ +await gapi.client.inappproducts.get({ packageName: "packageName", sku: "sku", }); + +/* +Creates a new in-app product for an app. +*/ +await gapi.client.inappproducts.insert({ packageName: "packageName", }); + +/* +List all the in-app products for an Android app, both subscriptions and managed in-app products.. +*/ +await gapi.client.inappproducts.list({ packageName: "packageName", }); + +/* +Updates the details of an in-app product. This method supports patch semantics. +*/ +await gapi.client.inappproducts.patch({ packageName: "packageName", sku: "sku", }); + +/* +Updates the details of an in-app product. +*/ +await gapi.client.inappproducts.update({ packageName: "packageName", sku: "sku", }); + +/* +Returns a single review. +*/ +await gapi.client.reviews.get({ packageName: "packageName", reviewId: "reviewId", }); + +/* +Returns a list of reviews. Only reviews from last week will be returned. +*/ +await gapi.client.reviews.list({ packageName: "packageName", }); + +/* +Reply to a single review, or update an existing reply. +*/ +await gapi.client.reviews.reply({ packageName: "packageName", reviewId: "reviewId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.androidpublisher/tsconfig.json b/types/gapi.client.androidpublisher/tsconfig.json new file mode 100644 index 0000000000..6f724fe172 --- /dev/null +++ b/types/gapi.client.androidpublisher/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.androidpublisher-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.androidpublisher/tslint.json b/types/gapi.client.androidpublisher/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.androidpublisher/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.appengine/gapi.client.appengine-tests.ts b/types/gapi.client.appengine/gapi.client.appengine-tests.ts new file mode 100644 index 0000000000..221a648770 --- /dev/null +++ b/types/gapi.client.appengine/gapi.client.appengine-tests.ts @@ -0,0 +1,64 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('appengine', 'v1', () => { + /** now we can use gapi.client.appengine */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your applications deployed on Google App Engine */ + 'https://www.googleapis.com/auth/appengine.admin', + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** + * Creates an App Engine application for a Google Cloud Platform project. Required fields: + * id - The ID of the target Cloud Platform project. + * location - The region (https://cloud.google.com/appengine/docs/locations) where you want the App Engine application located.For more information about + * App Engine applications, see Managing Projects, Applications, and Billing (https://cloud.google.com/appengine/docs/python/console/). + */ + await gapi.client.apps.create({ + }); + /** Gets information about an application. */ + await gapi.client.apps.get({ + appsId: "appsId", + }); + /** + * Updates the specified Application resource. You can update the following fields: + * auth_domain - Google authentication domain for controlling user access to the application. + * default_cookie_expiration - Cookie expiration policy for the application. + */ + await gapi.client.apps.patch({ + appsId: "appsId", + updateMask: "updateMask", + }); + /** + * Recreates the required App Engine features for the specified App Engine application, for example a Cloud Storage bucket or App Engine service account. + * Use this method if you receive an error message about a missing feature, for example, Error retrieving the App Engine service account. + */ + await gapi.client.apps.repair({ + appsId: "appsId", + }); + } +}); diff --git a/types/gapi.client.appengine/index.d.ts b/types/gapi.client.appengine/index.d.ts new file mode 100644 index 0000000000..2b97368fb5 --- /dev/null +++ b/types/gapi.client.appengine/index.d.ts @@ -0,0 +1,2263 @@ +// Type definitions for Google Google App Engine Admin API v1 1.0 +// Project: https://cloud.google.com/appengine/docs/admin-api/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://appengine.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Google App Engine Admin API v1 */ + function load(name: "appengine", version: "v1"): PromiseLike; + function load(name: "appengine", version: "v1", callback: () => any): void; + + const apps: appengine.AppsResource; + + namespace appengine { + interface ApiConfigHandler { + /** Action to take when users access resources that require authentication. Defaults to redirect. */ + authFailAction?: string; + /** Level of login required to access this resource. Defaults to optional. */ + login?: string; + /** Path to the script from the application root directory. */ + script?: string; + /** Security (HTTPS) enforcement for this URL. */ + securityLevel?: string; + /** URL to serve the endpoint at. */ + url?: string; + } + interface ApiEndpointHandler { + /** Path to the script from the application root directory. */ + scriptPath?: string; + } + interface Application { + /** Google Apps authentication domain that controls which users can access this application.Defaults to open access for any Google Account. */ + authDomain?: string; + /** + * Google Cloud Storage bucket that can be used for storing files associated with this application. This bucket is associated with the application and can + * be used by the gcloud deployment commands.@OutputOnly + */ + codeBucket?: string; + /** Google Cloud Storage bucket that can be used by this application to store content.@OutputOnly */ + defaultBucket?: string; + /** Cookie expiration policy for this application. */ + defaultCookieExpiration?: string; + /** Hostname used to reach this application, as resolved by App Engine.@OutputOnly */ + defaultHostname?: string; + /** + * HTTP path dispatch rules for requests to the application that do not explicitly target a service or version. Rules are order-dependent. Up to 20 + * dispatch rules can be supported.@OutputOnly + */ + dispatchRules?: UrlDispatchRule[]; + /** The feature specific settings to be used in the application. */ + featureSettings?: FeatureSettings; + /** The Google Container Registry domain used for storing managed build docker images for this application. */ + gcrDomain?: string; + iap?: IdentityAwareProxy; + /** + * Identifier of the Application resource. This identifier is equivalent to the project ID of the Google Cloud Platform project where you want to deploy + * your application. Example: myapp. + */ + id?: string; + /** + * Location from which this application will be run. Application instances will run out of data centers in the chosen location, which is also where all of + * the application's end user content is stored.Defaults to us-central.Options are:us-central - Central USeurope-west - Western Europeus-east1 - Eastern + * US + */ + locationId?: string; + /** Full path to the Application resource in the API. Example: apps/myapp.@OutputOnly */ + name?: string; + /** Serving status of this application. */ + servingStatus?: string; + } + interface AuthorizedCertificate { + /** The SSL certificate serving the AuthorizedCertificate resource. This must be obtained independently from a certificate authority. */ + certificateRawData?: CertificateRawData; + /** The user-specified display name of the certificate. This is not guaranteed to be unique. Example: My Certificate. */ + displayName?: string; + /** + * Aggregate count of the domain mappings with this certificate mapped. This count includes domain mappings on applications for which the user does not + * have VIEWER permissions.Only returned by GET or LIST requests when specifically requested by the view=FULL_CERTIFICATE option.@OutputOnly + */ + domainMappingsCount?: number; + /** Topmost applicable domains of this certificate. This certificate applies to these domains and their subdomains. Example: example.com.@OutputOnly */ + domainNames?: string[]; + /** + * The time when this certificate expires. To update the renewal time on this certificate, upload an SSL certificate with a different expiration time + * using AuthorizedCertificates.UpdateAuthorizedCertificate.@OutputOnly + */ + expireTime?: string; + /** Relative name of the certificate. This is a unique value autogenerated on AuthorizedCertificate resource creation. Example: 12345.@OutputOnly */ + id?: string; + /** Full path to the AuthorizedCertificate resource in the API. Example: apps/myapp/authorizedCertificates/12345.@OutputOnly */ + name?: string; + /** + * The full paths to user visible Domain Mapping resources that have this certificate mapped. Example: apps/myapp/domainMappings/example.com.This may not + * represent the full list of mapped domain mappings if the user does not have VIEWER permissions on all of the applications that have this certificate + * mapped. See domain_mappings_count for a complete count.Only returned by GET or LIST requests when specifically requested by the view=FULL_CERTIFICATE + * option.@OutputOnly + */ + visibleDomainMappings?: string[]; + } + interface AuthorizedDomain { + /** Fully qualified domain name of the domain authorized for use. Example: example.com. */ + id?: string; + /** Full path to the AuthorizedDomain resource in the API. Example: apps/myapp/authorizedDomains/example.com.@OutputOnly */ + name?: string; + } + interface AutomaticScaling { + /** + * Amount of time that the Autoscaler (https://cloud.google.com/compute/docs/autoscaler/) should wait between changes to the number of virtual machines. + * Only applicable for VM runtimes. + */ + coolDownPeriod?: string; + /** Target scaling by CPU usage. */ + cpuUtilization?: CpuUtilization; + /** Target scaling by disk usage. */ + diskUtilization?: DiskUtilization; + /** Number of concurrent requests an automatic scaling instance can accept before the scheduler spawns a new instance.Defaults to a runtime-specific value. */ + maxConcurrentRequests?: number; + /** Maximum number of idle instances that should be maintained for this version. */ + maxIdleInstances?: number; + /** Maximum amount of time that a request should wait in the pending queue before starting a new instance to handle it. */ + maxPendingLatency?: string; + /** Maximum number of instances that should be started to handle requests. */ + maxTotalInstances?: number; + /** Minimum number of idle instances that should be maintained for this version. Only applicable for the default version of a service. */ + minIdleInstances?: number; + /** Minimum amount of time a request should wait in the pending queue before starting a new instance to handle it. */ + minPendingLatency?: string; + /** Minimum number of instances that should be maintained for this version. */ + minTotalInstances?: number; + /** Target scaling by network usage. */ + networkUtilization?: NetworkUtilization; + /** Target scaling by request utilization. */ + requestUtilization?: RequestUtilization; + } + interface BasicScaling { + /** Duration of time after the last request that an instance must wait before the instance is shut down. */ + idleTimeout?: string; + /** Maximum number of instances to create for this version. */ + maxInstances?: number; + } + interface BatchUpdateIngressRulesRequest { + /** A list of FirewallRules to replace the existing set. */ + ingressRules?: FirewallRule[]; + } + interface BatchUpdateIngressRulesResponse { + /** The full list of ingress FirewallRules for this application. */ + ingressRules?: FirewallRule[]; + } + interface CertificateRawData { + /** + * Unencrypted PEM encoded RSA private key. This field is set once on certificate creation and then encrypted. The key size must be 2048 bits or fewer. + * Must include the header and footer. Example:
     -----BEGIN RSA PRIVATE KEY-----  -----END RSA PRIVATE KEY----- 
    + * @InputOnly + */ + privateKey?: string; + /** + * PEM encoded x.509 public key certificate. This field is set once on certificate creation. Must include the header and footer. Example:
     -----BEGIN
    +             * CERTIFICATE-----  -----END CERTIFICATE----- 
    + */ + publicCertificate?: string; + } + interface ContainerInfo { + /** + * URI to the hosted container image in Google Container Registry. The URI must be fully qualified and include a tag or digest. Examples: + * "gcr.io/my-project/image:tag" or "gcr.io/my-project/image@digest" + */ + image?: string; + } + interface CpuUtilization { + /** Period of time over which CPU utilization is calculated. */ + aggregationWindowLength?: string; + /** Target CPU utilization ratio to maintain when scaling. Must be between 0 and 1. */ + targetUtilization?: number; + } + interface DebugInstanceRequest { + /** + * Public SSH key to add to the instance. Examples: + * [USERNAME]:ssh-rsa [KEY_VALUE] [USERNAME] + * [USERNAME]:ssh-rsa [KEY_VALUE] google-ssh {"userName":"[USERNAME]","expireOn":"[EXPIRE_TIME]"}For more information, see Adding and Removing SSH Keys + * (https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys). + */ + sshKey?: string; + } + interface Deployment { + /** The Docker image for the container that runs the version. Only applicable for instances running in the App Engine flexible environment. */ + container?: ContainerInfo; + /** + * Manifest of the files stored in Google Cloud Storage that are included as part of this version. All files must be readable using the credentials + * supplied with this call. + */ + files?: Record; + /** The zip file for this deployment, if this is a zip deployment. */ + zip?: ZipInfo; + } + interface DiskUtilization { + /** Target bytes read per second. */ + targetReadBytesPerSecond?: number; + /** Target ops read per seconds. */ + targetReadOpsPerSecond?: number; + /** Target bytes written per second. */ + targetWriteBytesPerSecond?: number; + /** Target ops written per second. */ + targetWriteOpsPerSecond?: number; + } + interface DomainMapping { + /** Relative name of the domain serving the application. Example: example.com. */ + id?: string; + /** Full path to the DomainMapping resource in the API. Example: apps/myapp/domainMapping/example.com.@OutputOnly */ + name?: string; + /** + * The resource records required to configure this domain mapping. These records must be added to the domain's DNS configuration in order to serve the + * application via this domain mapping.@OutputOnly + */ + resourceRecords?: ResourceRecord[]; + /** SSL configuration for this domain. If unconfigured, this domain will not serve with SSL. */ + sslSettings?: SslSettings; + } + interface EndpointsApiService { + /** Endpoints service configuration id as specified by the Service Management API. For example "2016-09-19r1" */ + configId?: string; + /** Endpoints service name which is the name of the "service" resource in the Service Management API. For example "myapi.endpoints.myproject.cloud.goog" */ + name?: string; + } + interface ErrorHandler { + /** Error condition this handler applies to. */ + errorCode?: string; + /** MIME type of file. Defaults to text/html. */ + mimeType?: string; + /** Static file content to be served for this error. */ + staticFile?: string; + } + interface FeatureSettings { + /** + * Boolean value indicating if split health checks should be used instead of the legacy health checks. At an app.yaml level, this means defaulting to + * 'readiness_check' and 'liveness_check' values instead of 'health_check' ones. Once the legacy 'health_check' behavior is deprecated, and this value is + * always true, this setting can be removed. + */ + splitHealthChecks?: boolean; + } + interface FileInfo { + /** The MIME type of the file.Defaults to the value from Google Cloud Storage. */ + mimeType?: string; + /** The SHA1 hash of the file, in hex. */ + sha1Sum?: string; + /** + * URL source to use to fetch this file. Must be a URL to a resource in Google Cloud Storage in the form + * 'http(s)://storage.googleapis.com//'. + */ + sourceUrl?: string; + } + interface FirewallRule { + /** The action to take on matched requests. */ + action?: string; + /** An optional string description of this rule. This field has a maximum length of 100 characters. */ + description?: string; + /** + * A positive integer between 1, Int32.MaxValue-1 that defines the order of rule evaluation. Rules with the lowest priority are evaluated first.A default + * rule at priority Int32.MaxValue matches all IPv4 and IPv6 traffic when no previous rule matches. Only the action of this rule can be modified by the + * user. + */ + priority?: number; + /** + * IP address or range, defined using CIDR notation, of requests that this rule applies to. You can use the wildcard character "*" to match all IPs + * equivalent to "0/0" and "::/0" together. Examples: 192.168.1.1 or 192.168.0.0/16 or 2001:db8::/32 or + * 2001:0db8:0000:0042:0000:8a2e:0370:7334.

    Truncation will be silently performed on addresses which are not properly truncated. For example, 1.2.3.4/24 + * is accepted as the same address as 1.2.3.0/24. Similarly, for IPv6, 2001:db8::1/32 is accepted as the same address as 2001:db8::/32. + */ + sourceRange?: string; + } + interface HealthCheck { + /** Interval between health checks. */ + checkInterval?: string; + /** Whether to explicitly disable health checks for this instance. */ + disableHealthCheck?: boolean; + /** Number of consecutive successful health checks required before receiving traffic. */ + healthyThreshold?: number; + /** Host header to send when performing an HTTP health check. Example: "myapp.appspot.com" */ + host?: string; + /** Number of consecutive failed health checks required before an instance is restarted. */ + restartThreshold?: number; + /** Time before the health check is considered failed. */ + timeout?: string; + /** Number of consecutive failed health checks required before removing traffic. */ + unhealthyThreshold?: number; + } + interface IdentityAwareProxy { + /** + * Whether the serving infrastructure will authenticate and authorize all incoming requests.If true, the oauth2_client_id and oauth2_client_secret fields + * must be non-empty. + */ + enabled?: boolean; + /** OAuth2 client ID to use for the authentication flow. */ + oauth2ClientId?: string; + /** + * OAuth2 client secret to use for the authentication flow.For security reasons, this value cannot be retrieved via the API. Instead, the SHA-256 hash of + * the value is returned in the oauth2_client_secret_sha256 field.@InputOnly + */ + oauth2ClientSecret?: string; + /** Hex-encoded SHA-256 hash of the client secret.@OutputOnly */ + oauth2ClientSecretSha256?: string; + } + interface Instance { + /** App Engine release this instance is running on.@OutputOnly */ + appEngineRelease?: string; + /** Availability of the instance.@OutputOnly */ + availability?: string; + /** Average latency (ms) over the last minute.@OutputOnly */ + averageLatency?: number; + /** Number of errors since this instance was started.@OutputOnly */ + errors?: number; + /** Relative name of the instance within the version. Example: instance-1.@OutputOnly */ + id?: string; + /** Total memory in use (bytes).@OutputOnly */ + memoryUsage?: string; + /** Full path to the Instance resource in the API. Example: apps/myapp/services/default/versions/v1/instances/instance-1.@OutputOnly */ + name?: string; + /** Average queries per second (QPS) over the last minute.@OutputOnly */ + qps?: number; + /** Number of requests since this instance was started.@OutputOnly */ + requests?: number; + /** Time that this instance was started.@OutputOnly */ + startTime?: string; + /** Whether this instance is in debug mode. Only applicable for instances in App Engine flexible environment.@OutputOnly */ + vmDebugEnabled?: boolean; + /** Virtual machine ID of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly */ + vmId?: string; + /** The IP address of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly */ + vmIp?: string; + /** Name of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly */ + vmName?: string; + /** Status of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly */ + vmStatus?: string; + /** Zone where the virtual machine is located. Only applicable for instances in App Engine flexible environment.@OutputOnly */ + vmZoneName?: string; + } + interface Library { + /** Name of the library. Example: "django". */ + name?: string; + /** Version of the library to select, or "latest". */ + version?: string; + } + interface ListAuthorizedCertificatesResponse { + /** The SSL certificates the user is authorized to administer. */ + certificates?: AuthorizedCertificate[]; + /** Continuation token for fetching the next page of results. */ + nextPageToken?: string; + } + interface ListAuthorizedDomainsResponse { + /** The authorized domains belonging to the user. */ + domains?: AuthorizedDomain[]; + /** Continuation token for fetching the next page of results. */ + nextPageToken?: string; + } + interface ListDomainMappingsResponse { + /** The domain mappings for the application. */ + domainMappings?: DomainMapping[]; + /** Continuation token for fetching the next page of results. */ + nextPageToken?: string; + } + interface ListIngressRulesResponse { + /** The ingress FirewallRules for this application. */ + ingressRules?: FirewallRule[]; + /** Continuation token for fetching the next page of results. */ + nextPageToken?: string; + } + interface ListInstancesResponse { + /** The instances belonging to the requested version. */ + instances?: Instance[]; + /** Continuation token for fetching the next page of results. */ + nextPageToken?: string; + } + interface ListLocationsResponse { + /** A list of locations that matches the specified filter in the request. */ + locations?: Location[]; + /** The standard List next-page token. */ + nextPageToken?: string; + } + interface ListOperationsResponse { + /** The standard List next-page token. */ + nextPageToken?: string; + /** A list of operations that matches the specified filter in the request. */ + operations?: Operation[]; + } + interface ListServicesResponse { + /** Continuation token for fetching the next page of results. */ + nextPageToken?: string; + /** The services belonging to the requested application. */ + services?: Service[]; + } + interface ListVersionsResponse { + /** Continuation token for fetching the next page of results. */ + nextPageToken?: string; + /** The versions belonging to the requested service. */ + versions?: Version[]; + } + interface LivenessCheck { + /** Interval between health checks. */ + checkInterval?: string; + /** Number of consecutive failed checks required before considering the VM unhealthy. */ + failureThreshold?: number; + /** Host header to send when performing a HTTP Liveness check. Example: "myapp.appspot.com" */ + host?: string; + /** The initial delay before starting to execute the checks. */ + initialDelay?: string; + /** The request path. */ + path?: string; + /** Number of consecutive successful checks required before considering the VM healthy. */ + successThreshold?: number; + /** Time before the check is considered failed. */ + timeout?: string; + } + interface Location { + /** + * Cross-service attributes for the location. For example + * {"cloud.googleapis.com/region": "us-east1"} + */ + labels?: Record; + /** The canonical id for this location. For example: "us-east1". */ + locationId?: string; + /** Service-specific metadata. For example the available capacity at the given location. */ + metadata?: Record; + /** Resource name for the location, which may vary between implementations. For example: "projects/example-project/locations/us-east1" */ + name?: string; + } + interface LocationMetadata { + /** App Engine Flexible Environment is available in the given location.@OutputOnly */ + flexibleEnvironmentAvailable?: boolean; + /** App Engine Standard Environment is available in the given location.@OutputOnly */ + standardEnvironmentAvailable?: boolean; + } + interface ManualScaling { + /** + * Number of instances to assign to the service at the start. This number can later be altered by using the Modules API + * (https://cloud.google.com/appengine/docs/python/modules/functions) set_num_instances() function. + */ + instances?: number; + } + interface Network { + /** + * List of ports, or port pairs, to forward from the virtual machine to the application container. Only applicable for App Engine flexible environment + * versions. + */ + forwardedPorts?: string[]; + /** Tag to apply to the VM instance during creation. Only applicable for for App Engine flexible environment versions. */ + instanceTag?: string; + /** Google Compute Engine network where the virtual machines are created. Specify the short name, not the resource path.Defaults to default. */ + name?: string; + /** + * Google Cloud Platform sub-network where the virtual machines are created. Specify the short name, not the resource path.If a subnetwork name is + * specified, a network name will also be required unless it is for the default network. + * If the network the VM instance is being created in is a Legacy network, then the IP address is allocated from the IPv4Range. + * If the network the VM instance is being created in is an auto Subnet Mode Network, then only network name should be specified (not the subnetwork_name) + * and the IP address is created from the IPCidrRange of the subnetwork that exists in that zone for that network. + * If the network the VM instance is being created in is a custom Subnet Mode Network, then the subnetwork_name must be specified and the IP address is + * created from the IPCidrRange of the subnetwork.If specified, the subnetwork must exist in the same region as the App Engine flexible environment + * application. + */ + subnetworkName?: string; + } + interface NetworkUtilization { + /** Target bytes received per second. */ + targetReceivedBytesPerSecond?: number; + /** Target packets received per second. */ + targetReceivedPacketsPerSecond?: number; + /** Target bytes sent per second. */ + targetSentBytesPerSecond?: number; + /** Target packets sent per second. */ + targetSentPacketsPerSecond?: number; + } + interface Operation { + /** If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available. */ + done?: boolean; + /** The error result of the operation in case of failure or cancellation. */ + error?: Status; + /** + * Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some + * services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. + */ + metadata?: Record; + /** + * The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should + * have the format of operations/some/unique/name. + */ + name?: string; + /** + * The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is + * google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response + * should have the type XxxResponse, where Xxx is the original method name. For example, if the original method name is TakeSnapshot(), the inferred + * response type is TakeSnapshotResponse. + */ + response?: Record; + } + interface OperationMetadata { + /** Timestamp that this operation completed.@OutputOnly */ + endTime?: string; + /** Timestamp that this operation was created.@OutputOnly */ + insertTime?: string; + /** API method that initiated this operation. Example: google.appengine.v1beta4.Version.CreateVersion.@OutputOnly */ + method?: string; + /** Type of this operation. Deprecated, use method field instead. Example: "create_version".@OutputOnly */ + operationType?: string; + /** Name of the resource that this operation is acting on. Example: apps/myapp/modules/default.@OutputOnly */ + target?: string; + /** User who requested this operation.@OutputOnly */ + user?: string; + } + interface OperationMetadataExperimental { + /** Time that this operation completed.@OutputOnly */ + endTime?: string; + /** Time that this operation was created.@OutputOnly */ + insertTime?: string; + /** API method that initiated this operation. Example: google.appengine.experimental.CustomDomains.CreateCustomDomain.@OutputOnly */ + method?: string; + /** Name of the resource that this operation is acting on. Example: apps/myapp/customDomains/example.com.@OutputOnly */ + target?: string; + /** User who requested this operation.@OutputOnly */ + user?: string; + } + interface OperationMetadataV1 { + /** Time that this operation completed.@OutputOnly */ + endTime?: string; + /** Ephemeral message that may change every time the operation is polled. @OutputOnly */ + ephemeralMessage?: string; + /** Time that this operation was created.@OutputOnly */ + insertTime?: string; + /** API method that initiated this operation. Example: google.appengine.v1.Versions.CreateVersion.@OutputOnly */ + method?: string; + /** Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly */ + target?: string; + /** User who requested this operation.@OutputOnly */ + user?: string; + /** Durable messages that persist on every operation poll. @OutputOnly */ + warning?: string[]; + } + interface OperationMetadataV1Alpha { + /** Time that this operation completed.@OutputOnly */ + endTime?: string; + /** Ephemeral message that may change every time the operation is polled. @OutputOnly */ + ephemeralMessage?: string; + /** Time that this operation was created.@OutputOnly */ + insertTime?: string; + /** API method that initiated this operation. Example: google.appengine.v1alpha.Versions.CreateVersion.@OutputOnly */ + method?: string; + /** Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly */ + target?: string; + /** User who requested this operation.@OutputOnly */ + user?: string; + /** Durable messages that persist on every operation poll. @OutputOnly */ + warning?: string[]; + } + interface OperationMetadataV1Beta { + /** Time that this operation completed.@OutputOnly */ + endTime?: string; + /** Ephemeral message that may change every time the operation is polled. @OutputOnly */ + ephemeralMessage?: string; + /** Time that this operation was created.@OutputOnly */ + insertTime?: string; + /** API method that initiated this operation. Example: google.appengine.v1beta.Versions.CreateVersion.@OutputOnly */ + method?: string; + /** Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly */ + target?: string; + /** User who requested this operation.@OutputOnly */ + user?: string; + /** Durable messages that persist on every operation poll. @OutputOnly */ + warning?: string[]; + } + interface OperationMetadataV1Beta5 { + /** Timestamp that this operation completed.@OutputOnly */ + endTime?: string; + /** Timestamp that this operation was created.@OutputOnly */ + insertTime?: string; + /** API method name that initiated this operation. Example: google.appengine.v1beta5.Version.CreateVersion.@OutputOnly */ + method?: string; + /** Name of the resource that this operation is acting on. Example: apps/myapp/services/default.@OutputOnly */ + target?: string; + /** User who requested this operation.@OutputOnly */ + user?: string; + } + interface ReadinessCheck { + /** + * A maximum time limit on application initialization, measured from moment the application successfully replies to a healthcheck until it is ready to + * serve traffic. + */ + appStartTimeout?: string; + /** Interval between health checks. */ + checkInterval?: string; + /** Number of consecutive failed checks required before removing traffic. */ + failureThreshold?: number; + /** Host header to send when performing a HTTP Readiness check. Example: "myapp.appspot.com" */ + host?: string; + /** The request path. */ + path?: string; + /** Number of consecutive successful checks required before receiving traffic. */ + successThreshold?: number; + /** Time before the check is considered failed. */ + timeout?: string; + } + interface RequestUtilization { + /** Target number of concurrent requests. */ + targetConcurrentRequests?: number; + /** Target requests per second. */ + targetRequestCountPerSecond?: number; + } + interface ResourceRecord { + /** Relative name of the object affected by this record. Only applicable for CNAME records. Example: 'www'. */ + name?: string; + /** Data for this record. Values vary by record type, as defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1). */ + rrdata?: string; + /** Resource record type. Example: AAAA. */ + type?: string; + } + interface Resources { + /** Number of CPU cores needed. */ + cpu?: number; + /** Disk size (GB) needed. */ + diskGb?: number; + /** Memory (GB) needed. */ + memoryGb?: number; + /** User specified volumes. */ + volumes?: Volume[]; + } + interface ScriptHandler { + /** Path to the script from the application root directory. */ + scriptPath?: string; + } + interface Service { + /** Relative name of the service within the application. Example: default.@OutputOnly */ + id?: string; + /** Full path to the Service resource in the API. Example: apps/myapp/services/default.@OutputOnly */ + name?: string; + /** Mapping that defines fractional HTTP traffic diversion to different versions within the service. */ + split?: TrafficSplit; + } + interface SslSettings { + /** ID of the AuthorizedCertificate resource configuring SSL for the application. Clearing this field will remove SSL support. Example: 12345. */ + certificateId?: string; + } + interface StaticFilesHandler { + /** + * Whether files should also be uploaded as code data. By default, files declared in static file handlers are uploaded as static data and are only served + * to end users; they cannot be read by the application. If enabled, uploads are charged against both your code and static data storage resource quotas. + */ + applicationReadable?: boolean; + /** Time a static file served by this handler should be cached by web proxies and browsers. */ + expiration?: string; + /** HTTP headers to use for all responses from these URLs. */ + httpHeaders?: Record; + /** MIME type used to serve all files served by this handler.Defaults to file-specific MIME types, which are derived from each file's filename extension. */ + mimeType?: string; + /** + * Path to the static files matched by the URL pattern, from the application root directory. The path can refer to text matched in groupings in the URL + * pattern. + */ + path?: string; + /** Whether this handler should match the request if the file referenced by the handler does not exist. */ + requireMatchingFile?: boolean; + /** Regular expression that matches the file paths for all files that should be referenced by this handler. */ + uploadPathRegex?: string; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** A list of messages that carry the error details. There is a common set of message types for APIs to use. */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface TrafficSplit { + /** + * Mapping from version IDs within the service to fractional (0.000, 1] allocations of traffic for that version. Each version can be specified only once, + * but some versions in the service may not have any traffic allocation. Services that have traffic allocated cannot be deleted until either the service + * is deleted or their traffic allocation is removed. Allocations must sum to 1. Up to two decimal place precision is supported for IP-based splits and up + * to three decimal places is supported for cookie-based splits. + */ + allocations?: Record; + /** + * Mechanism used to determine which version a request is sent to. The traffic selection algorithm will be stable for either type until allocations are + * changed. + */ + shardBy?: string; + } + interface UrlDispatchRule { + /** Domain name to match against. The wildcard "*" is supported if specified before a period: "*.".Defaults to matching all domains: "*". */ + domain?: string; + /** + * Pathname within the host. Must start with a "/". A single "*" can be included at the end of the path.The sum of the lengths of the domain and path may + * not exceed 100 characters. + */ + path?: string; + /** Resource ID of a service in this application that should serve the matched request. The service must already exist. Example: default. */ + service?: string; + } + interface UrlMap { + /** Uses API Endpoints to handle requests. */ + apiEndpoint?: ApiEndpointHandler; + /** Action to take when users access resources that require authentication. Defaults to redirect. */ + authFailAction?: string; + /** Level of login required to access this resource. */ + login?: string; + /** 30x code to use when performing redirects for the secure field. Defaults to 302. */ + redirectHttpResponseCode?: string; + /** Executes a script to handle the request that matches this URL pattern. */ + script?: ScriptHandler; + /** Security (HTTPS) enforcement for this URL. */ + securityLevel?: string; + /** Returns the contents of a file, such as an image, as the response. */ + staticFiles?: StaticFilesHandler; + /** + * URL prefix. Uses regular expression syntax, which means regexp special characters must be escaped, but should not contain groupings. All URLs that + * begin with this prefix are handled by this handler, using the portion of the URL after the prefix as part of the file path. + */ + urlRegex?: string; + } + interface Version { + /** + * Serving configuration for Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/).Only returned in GET requests if view=FULL + * is set. + */ + apiConfig?: ApiConfigHandler; + /** Automatic scaling is based on request rate, response latencies, and other application metrics. */ + automaticScaling?: AutomaticScaling; + /** + * A service with basic scaling will create an instance when the application receives a request. The instance will be turned down when the app becomes + * idle. Basic scaling is ideal for work that is intermittent or driven by user activity. + */ + basicScaling?: BasicScaling; + /** Metadata settings that are supplied to this version to enable beta runtime features. */ + betaSettings?: Record; + /** Time that this version was created.@OutputOnly */ + createTime?: string; + /** Email address of the user who created this version.@OutputOnly */ + createdBy?: string; + /** + * Duration that static files should be cached by web proxies and browsers. Only applicable if the corresponding StaticFilesHandler + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#staticfileshandler) does not specify its own expiration + * time.Only returned in GET requests if view=FULL is set. + */ + defaultExpiration?: string; + /** Code and application artifacts that make up this version.Only returned in GET requests if view=FULL is set. */ + deployment?: Deployment; + /** Total size in bytes of all the files that are included in this version and curerntly hosted on the App Engine disk.@OutputOnly */ + diskUsageBytes?: string; + /** + * Cloud Endpoints configuration.If endpoints_api_service is set, the Cloud Endpoints Extensible Service Proxy will be provided to serve the API + * implemented by the app. + */ + endpointsApiService?: EndpointsApiService; + /** App Engine execution environment for this version.Defaults to standard. */ + env?: string; + /** Environment variables available to the application.Only returned in GET requests if view=FULL is set. */ + envVariables?: Record; + /** Custom static error pages. Limited to 10KB per page.Only returned in GET requests if view=FULL is set. */ + errorHandlers?: ErrorHandler[]; + /** + * An ordered list of URL-matching patterns that should be applied to incoming requests. The first matching URL handles the request and other request + * handlers are not attempted.Only returned in GET requests if view=FULL is set. + */ + handlers?: UrlMap[]; + /** + * Configures health checking for VM instances. Unhealthy instances are stopped and replaced with new instances. Only applicable for VM runtimes.Only + * returned in GET requests if view=FULL is set. + */ + healthCheck?: HealthCheck; + /** + * Relative name of the version within the service. Example: v1. Version names can contain only lowercase letters, numbers, or hyphens. Reserved names: + * "default", "latest", and any name with the prefix "ah-". + */ + id?: string; + /** Before an application can receive email or XMPP messages, the application must be configured to enable the service. */ + inboundServices?: string[]; + /** + * Instance class that is used to run this version. Valid values are: + * AutomaticScaling: F1, F2, F4, F4_1G + * ManualScaling or BasicScaling: B1, B2, B4, B8, B4_1GDefaults to F1 for AutomaticScaling and B1 for ManualScaling or BasicScaling. + */ + instanceClass?: string; + /** Configuration for third-party Python runtime libraries that are required by the application.Only returned in GET requests if view=FULL is set. */ + libraries?: Library[]; + /** + * Configures liveness health checking for VM instances. Unhealthy instances are stopped and replaced with new instancesOnly returned in GET requests if + * view=FULL is set. + */ + livenessCheck?: LivenessCheck; + /** A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time. */ + manualScaling?: ManualScaling; + /** Full path to the Version resource in the API. Example: apps/myapp/services/default/versions/v1.@OutputOnly */ + name?: string; + /** Extra network settings. Only applicable for App Engine flexible environment versions. */ + network?: Network; + /** Files that match this pattern will not be built into this version. Only applicable for Go runtimes.Only returned in GET requests if view=FULL is set. */ + nobuildFilesRegex?: string; + /** + * Configures readiness health checking for VM instances. Unhealthy instances are not put into the backend traffic rotation.Only returned in GET requests + * if view=FULL is set. + */ + readinessCheck?: ReadinessCheck; + /** Machine resources for this version. Only applicable for VM runtimes. */ + resources?: Resources; + /** Desired runtime. Example: python27. */ + runtime?: string; + /** + * The version of the API in the given runtime environment. Please see the app.yaml reference for valid values at + * https://cloud.google.com/appengine/docs/standard//config/appref + */ + runtimeApiVersion?: string; + /** + * Current serving status of this version. Only the versions with a SERVING status create instances and can be billed.SERVING_STATUS_UNSPECIFIED is an + * invalid value. Defaults to SERVING. + */ + servingStatus?: string; + /** Whether multiple requests can be dispatched to this version at once. */ + threadsafe?: boolean; + /** Serving URL for this version. Example: "https://myversion-dot-myservice-dot-myapp.appspot.com"@OutputOnly */ + versionUrl?: string; + /** Whether to deploy this version in a container on a virtual machine. */ + vm?: boolean; + } + interface Volume { + /** Unique name for the volume. */ + name?: string; + /** Volume size in gigabytes. */ + sizeGb?: number; + /** Underlying volume type, e.g. 'tmpfs'. */ + volumeType?: string; + } + interface ZipInfo { + /** + * An estimate of the number of files in a zip for a zip deployment. If set, must be greater than or equal to the actual number of files. Used for + * optimizing performance; if not provided, deployment may be slow. + */ + filesCount?: number; + /** + * URL of the zip file to deploy from. Must be a URL to a resource in Google Cloud Storage in the form + * 'http(s)://storage.googleapis.com//'. + */ + sourceUrl?: string; + } + interface AuthorizedCertificatesResource { + /** Uploads the specified SSL certificate. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `parent`. Name of the parent Application resource. Example: apps/myapp. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Deletes the specified SSL certificate. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource to delete. Example: apps/myapp/authorizedCertificates/12345. */ + appsId: string; + /** Part of `name`. See documentation of `appsId`. */ + authorizedCertificatesId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Gets the specified SSL certificate. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource requested. Example: apps/myapp/authorizedCertificates/12345. */ + appsId: string; + /** Part of `name`. See documentation of `appsId`. */ + authorizedCertificatesId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Controls the set of fields returned in the GET response. */ + view?: string; + }): Request; + /** Lists all SSL certificates the user is authorized to administer. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `parent`. Name of the parent Application resource. Example: apps/myapp. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Maximum results to return per page. */ + pageSize?: number; + /** Continuation token for fetching the next page of results. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Controls the set of fields returned in the LIST response. */ + view?: string; + }): Request; + /** + * Updates the specified SSL certificate. To renew a certificate and maintain its existing domain mappings, update certificate_data with a new + * certificate. The new certificate must be applicable to the same domains as the original certificate. The certificate display_name may also be updated. + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource to update. Example: apps/myapp/authorizedCertificates/12345. */ + appsId: string; + /** Part of `name`. See documentation of `appsId`. */ + authorizedCertificatesId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Standard field mask for the set of fields to be updated. Updates are only supported on the certificate_raw_data and display_name fields. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface AuthorizedDomainsResource { + /** Lists all domains the user is authorized to administer. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `parent`. Name of the parent Application resource. Example: apps/myapp. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Maximum results to return per page. */ + pageSize?: number; + /** Continuation token for fetching the next page of results. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface DomainMappingsResource { + /** + * Maps a domain to an application. A user must be authorized to administer a domain in order to map it to an application. For a list of available + * authorized domains, see AuthorizedDomains.ListAuthorizedDomains. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `parent`. Name of the parent Application resource. Example: apps/myapp. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Deletes the specified domain mapping. A user must be authorized to administer the associated domain in order to delete a DomainMapping resource. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource to delete. Example: apps/myapp/domainMappings/example.com. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Part of `name`. See documentation of `appsId`. */ + domainMappingsId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Gets the specified domain mapping. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource requested. Example: apps/myapp/domainMappings/example.com. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Part of `name`. See documentation of `appsId`. */ + domainMappingsId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists the domain mappings on an application. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `parent`. Name of the parent Application resource. Example: apps/myapp. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Maximum results to return per page. */ + pageSize?: number; + /** Continuation token for fetching the next page of results. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates the specified domain mapping. To map an SSL certificate to a domain mapping, update certificate_id to point to an AuthorizedCertificate + * resource. A user must be authorized to administer the associated domain in order to update a DomainMapping resource. + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource to update. Example: apps/myapp/domainMappings/example.com. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Part of `name`. See documentation of `appsId`. */ + domainMappingsId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Standard field mask for the set of fields to be updated. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface IngressRulesResource { + /** + * Replaces the entire firewall ruleset in one bulk operation. This overrides and replaces the rules of an existing firewall with the new rules.If the + * final rule does not match traffic with the '*' wildcard IP range, then an "allow all" rule is explicitly added to the end of the list. + */ + batchUpdate(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the Firewall collection to set. Example: apps/myapp/firewall/ingressRules. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Creates a firewall rule for the application. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `parent`. Name of the parent Firewall collection in which to create a new rule. Example: apps/myapp/firewall/ingressRules. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Deletes the specified firewall rule. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the Firewall resource to delete. Example: apps/myapp/firewall/ingressRules/100. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Part of `name`. See documentation of `appsId`. */ + ingressRulesId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Gets the specified firewall rule. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the Firewall resource to retrieve. Example: apps/myapp/firewall/ingressRules/100. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Part of `name`. See documentation of `appsId`. */ + ingressRulesId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists the firewall rules of an application. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `parent`. Name of the Firewall collection to retrieve. Example: apps/myapp/firewall/ingressRules. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * A valid IP Address. If set, only rules matching this address will be returned. The first returned rule will be the rule that fires on requests from + * this IP. + */ + matchingAddress?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Maximum results to return per page. */ + pageSize?: number; + /** Continuation token for fetching the next page of results. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Updates the specified firewall rule. */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the Firewall resource to update. Example: apps/myapp/firewall/ingressRules/100. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Part of `name`. See documentation of `appsId`. */ + ingressRulesId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Standard field mask for the set of fields to be updated. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface FirewallResource { + ingressRules: IngressRulesResource; + } + interface LocationsResource { + /** Get information about a location. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Resource name for the location. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Part of `name`. See documentation of `appsId`. */ + locationsId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists information about the supported locations for this service. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. The resource that owns the locations collection, if applicable. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The standard list filter. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The standard list page size. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface OperationsResource { + /** + * Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API + * service. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. The name of the operation resource. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Part of `name`. See documentation of `appsId`. */ + operationsId: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name + * binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API + * services can add a binding such as "/v1/{name=users/*}/operations" to their service configuration. For backwards compatibility, the default name + * includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection + * id. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. The name of the operation's parent resource. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The standard list filter. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The standard list page size. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface InstancesResource { + /** + * Enables debugging on a VM instance. This allows you to use the SSH command to connect to the virtual machine where the instance lives. While in "debug + * mode", the instance continues to serve live traffic. You should delete the instance when you are done debugging and then allow the system to take over + * and determine if another instance should be started.Only applicable for instances in App Engine flexible environment. + */ + debug(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Part of `name`. See documentation of `appsId`. */ + instancesId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Part of `name`. See documentation of `appsId`. */ + servicesId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Part of `name`. See documentation of `appsId`. */ + versionsId: string; + }): Request; + /** Stops a running instance. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Part of `name`. See documentation of `appsId`. */ + instancesId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Part of `name`. See documentation of `appsId`. */ + servicesId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Part of `name`. See documentation of `appsId`. */ + versionsId: string; + }): Request; + /** Gets instance information. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Part of `name`. See documentation of `appsId`. */ + instancesId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Part of `name`. See documentation of `appsId`. */ + servicesId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Part of `name`. See documentation of `appsId`. */ + versionsId: string; + }): Request; + /** + * Lists the instances of a version.Tip: To aggregate details about instances over time, see the Stackdriver Monitoring API + * (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `parent`. Name of the parent Version resource. Example: apps/myapp/services/default/versions/v1. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Maximum results to return per page. */ + pageSize?: number; + /** Continuation token for fetching the next page of results. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Part of `parent`. See documentation of `appsId`. */ + servicesId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Part of `parent`. See documentation of `appsId`. */ + versionsId: string; + }): Request; + } + interface VersionsResource { + /** Deploys code and resource files to a new version. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `parent`. Name of the parent resource to create this version under. Example: apps/myapp/services/default. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Part of `parent`. See documentation of `appsId`. */ + servicesId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Deletes an existing Version resource. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Part of `name`. See documentation of `appsId`. */ + servicesId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Part of `name`. See documentation of `appsId`. */ + versionsId: string; + }): Request; + /** Gets the specified Version resource. By default, only a BASIC_VIEW will be returned. Specify the FULL_VIEW parameter to get the full resource. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Part of `name`. See documentation of `appsId`. */ + servicesId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Part of `name`. See documentation of `appsId`. */ + versionsId: string; + /** Controls the set of fields returned in the Get response. */ + view?: string; + }): Request; + /** Lists the versions of a service. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `parent`. Name of the parent Service resource. Example: apps/myapp/services/default. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Maximum results to return per page. */ + pageSize?: number; + /** Continuation token for fetching the next page of results. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Part of `parent`. See documentation of `appsId`. */ + servicesId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Controls the set of fields returned in the List response. */ + view?: string; + }): Request; + /** + * Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the + * version resource uses: + * serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status): For Version + * resources that use basic scaling, manual scaling, or run in the App Engine flexible environment. + * instance_class (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class): For Version + * resources that run in the App Engine standard environment. + * automatic_scaling.min_idle_instances + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources + * that use automatic scaling and run in the App Engine standard environment. + * automatic_scaling.max_idle_instances + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources + * that use automatic scaling and run in the App Engine standard environment. + * automatic_scaling.min_total_instances + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources + * that use automatic scaling and run in the App Engine Flexible environment. + * automatic_scaling.max_total_instances + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources + * that use automatic scaling and run in the App Engine Flexible environment. + * automatic_scaling.cool_down_period_sec + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources + * that use automatic scaling and run in the App Engine Flexible environment. + * automatic_scaling.cpu_utilization.target_utilization + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources + * that use automatic scaling and run in the App Engine Flexible environment. + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource to update. Example: apps/myapp/services/default/versions/1. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Part of `name`. See documentation of `appsId`. */ + servicesId: string; + /** Standard field mask for the set of fields to be updated. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Part of `name`. See documentation of `appsId`. */ + versionsId: string; + }): Request; + instances: InstancesResource; + } + interface ServicesResource { + /** Deletes the specified service and all enclosed versions. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource requested. Example: apps/myapp/services/default. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Part of `name`. See documentation of `appsId`. */ + servicesId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Gets the current configuration of the specified service. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource requested. Example: apps/myapp/services/default. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Part of `name`. See documentation of `appsId`. */ + servicesId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists all the services in the application. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `parent`. Name of the parent Application resource. Example: apps/myapp. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Maximum results to return per page. */ + pageSize?: number; + /** Continuation token for fetching the next page of results. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Updates the configuration of the specified service. */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the resource to update. Example: apps/myapp/services/default. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Set to true to gradually shift traffic to one or more versions that you specify. By default, traffic is shifted immediately. For gradual traffic + * migration, the target versions must be located within instances that are configured for both warmup requests + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#inboundservicetype) and automatic scaling + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#automaticscaling). You must specify the shardBy + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services#shardby) field in the Service resource. Gradual traffic migration is + * not supported in the App Engine flexible environment. For examples, see Migrating and Splitting Traffic + * (https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic). + */ + migrateTraffic?: boolean; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Part of `name`. See documentation of `appsId`. */ + servicesId: string; + /** Standard field mask for the set of fields to be updated. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + versions: VersionsResource; + } + interface AppsResource { + /** + * Creates an App Engine application for a Google Cloud Platform project. Required fields: + * id - The ID of the target Cloud Platform project. + * location - The region (https://cloud.google.com/appengine/docs/locations) where you want the App Engine application located.For more information about + * App Engine applications, see Managing Projects, Applications, and Billing (https://cloud.google.com/appengine/docs/python/console/). + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Gets information about an application. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the Application resource to get. Example: apps/myapp. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates the specified Application resource. You can update the following fields: + * auth_domain - Google authentication domain for controlling user access to the application. + * default_cookie_expiration - Cookie expiration policy for the application. + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the Application resource to update. Example: apps/myapp. */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Standard field mask for the set of fields to be updated. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Recreates the required App Engine features for the specified App Engine application, for example a Cloud Storage bucket or App Engine service account. + * Use this method if you receive an error message about a missing feature, for example, Error retrieving the App Engine service account. + */ + repair(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** Part of `name`. Name of the application to repair. Example: apps/myapp */ + appsId: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + authorizedCertificates: AuthorizedCertificatesResource; + authorizedDomains: AuthorizedDomainsResource; + domainMappings: DomainMappingsResource; + firewall: FirewallResource; + locations: LocationsResource; + operations: OperationsResource; + services: ServicesResource; + } + } +} diff --git a/types/gapi.client.appengine/readme.md b/types/gapi.client.appengine/readme.md new file mode 100644 index 0000000000..c038ebf322 --- /dev/null +++ b/types/gapi.client.appengine/readme.md @@ -0,0 +1,84 @@ +# TypeScript typings for Google App Engine Admin API v1 +The App Engine Admin API enables developers to provision and manage their App Engine applications. +For detailed description please check [documentation](https://cloud.google.com/appengine/docs/admin-api/). + +## Installing + +Install typings for Google App Engine Admin API: +``` +npm install @types/gapi.client.appengine@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('appengine', 'v1', () => { + // now we can use gapi.client.appengine + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your applications deployed on Google App Engine + 'https://www.googleapis.com/auth/appengine.admin', + + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google App Engine Admin API resources: + +```typescript + +/* +Creates an App Engine application for a Google Cloud Platform project. Required fields: +id - The ID of the target Cloud Platform project. +location - The region (https://cloud.google.com/appengine/docs/locations) where you want the App Engine application located.For more information about App Engine applications, see Managing Projects, Applications, and Billing (https://cloud.google.com/appengine/docs/python/console/). +*/ +await gapi.client.apps.create({ }); + +/* +Gets information about an application. +*/ +await gapi.client.apps.get({ appsId: "appsId", }); + +/* +Updates the specified Application resource. You can update the following fields: +auth_domain - Google authentication domain for controlling user access to the application. +default_cookie_expiration - Cookie expiration policy for the application. +*/ +await gapi.client.apps.patch({ appsId: "appsId", }); + +/* +Recreates the required App Engine features for the specified App Engine application, for example a Cloud Storage bucket or App Engine service account. Use this method if you receive an error message about a missing feature, for example, Error retrieving the App Engine service account. +*/ +await gapi.client.apps.repair({ appsId: "appsId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.appengine/tsconfig.json b/types/gapi.client.appengine/tsconfig.json new file mode 100644 index 0000000000..0af2b9eade --- /dev/null +++ b/types/gapi.client.appengine/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.appengine-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.appengine/tslint.json b/types/gapi.client.appengine/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.appengine/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.appsactivity/gapi.client.appsactivity-tests.ts b/types/gapi.client.appsactivity/gapi.client.appsactivity-tests.ts new file mode 100644 index 0000000000..aa972684b8 --- /dev/null +++ b/types/gapi.client.appsactivity/gapi.client.appsactivity-tests.ts @@ -0,0 +1,54 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('appsactivity', 'v1', () => { + /** now we can use gapi.client.appsactivity */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View the activity history of your Google apps */ + 'https://www.googleapis.com/auth/activity', + /** View and manage the files in your Google Drive */ + 'https://www.googleapis.com/auth/drive', + /** View and manage metadata of files in your Google Drive */ + 'https://www.googleapis.com/auth/drive.metadata', + /** View metadata for files in your Google Drive */ + 'https://www.googleapis.com/auth/drive.metadata.readonly', + /** View the files in your Google Drive */ + 'https://www.googleapis.com/auth/drive.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** + * Returns a list of activities visible to the current logged in user. Visible activities are determined by the visiblity settings of the object that was + * acted on, e.g. Drive files a user can see. An activity is a record of past events. Multiple events may be merged if they are similar. A request is + * scoped to activities from a given Google service using the source parameter. + */ + await gapi.client.activities.list({ + "drive.ancestorId": "drive.ancestorId", + "drive.fileId": "drive.fileId", + groupingStrategy: "groupingStrategy", + pageSize: 4, + pageToken: "pageToken", + source: "source", + userId: "userId", + }); + } +}); diff --git a/types/gapi.client.appsactivity/index.d.ts b/types/gapi.client.appsactivity/index.d.ts new file mode 100644 index 0000000000..e8c9c49f18 --- /dev/null +++ b/types/gapi.client.appsactivity/index.d.ts @@ -0,0 +1,168 @@ +// Type definitions for Google G Suite Activity API v1 1.0 +// Project: https://developers.google.com/google-apps/activity/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/appsactivity/v1/rest + +/// + +declare namespace gapi.client { + /** Load G Suite Activity API v1 */ + function load(name: "appsactivity", version: "v1"): PromiseLike; + function load(name: "appsactivity", version: "v1", callback: () => any): void; + + const activities: appsactivity.ActivitiesResource; + + namespace appsactivity { + interface Activity { + /** The fields common to all of the singleEvents that make up the Activity. */ + combinedEvent?: Event; + /** A list of all the Events that make up the Activity. */ + singleEvents?: Event[]; + } + interface Event { + /** + * Additional event types. Some events may have multiple types when multiple actions are part of a single event. For example, creating a document, + * renaming it, and sharing it may be part of a single file-creation event. + */ + additionalEventTypes?: string[]; + /** The time at which the event occurred formatted as Unix time in milliseconds. */ + eventTimeMillis?: string; + /** Whether this event is caused by a user being deleted. */ + fromUserDeletion?: boolean; + /** Extra information for move type events, such as changes in an object's parents. */ + move?: Move; + /** Extra information for permissionChange type events, such as the user or group the new permission applies to. */ + permissionChanges?: PermissionChange[]; + /** The main type of event that occurred. */ + primaryEventType?: string; + /** Extra information for rename type events, such as the old and new names. */ + rename?: Rename; + /** Information specific to the Target object modified by the event. */ + target?: Target; + /** Represents the user responsible for the event. */ + user?: User; + } + interface ListActivitiesResponse { + /** List of activities. */ + activities?: Activity[]; + /** Token for the next page of results. */ + nextPageToken?: string; + } + interface Move { + /** The added parent(s). */ + addedParents?: Parent[]; + /** The removed parent(s). */ + removedParents?: Parent[]; + } + interface Parent { + /** The parent's ID. */ + id?: string; + /** Whether this is the root folder. */ + isRoot?: boolean; + /** The parent's title. */ + title?: string; + } + interface Permission { + /** The name of the user or group the permission applies to. */ + name?: string; + /** The ID for this permission. Corresponds to the Drive API's permission ID returned as part of the Drive Permissions resource. */ + permissionId?: string; + /** Indicates the Google Drive permissions role. The role determines a user's ability to read, write, or comment on the file. */ + role?: string; + /** Indicates how widely permissions are granted. */ + type?: string; + /** The user's information if the type is USER. */ + user?: User; + /** Whether the permission requires a link to the file. */ + withLink?: boolean; + } + interface PermissionChange { + /** Lists all Permission objects added. */ + addedPermissions?: Permission[]; + /** Lists all Permission objects removed. */ + removedPermissions?: Permission[]; + } + interface Photo { + /** The URL of the photo. */ + url?: string; + } + interface Rename { + /** The new title. */ + newTitle?: string; + /** The old title. */ + oldTitle?: string; + } + interface Target { + /** The ID of the target. For example, in Google Drive, this is the file or folder ID. */ + id?: string; + /** The MIME type of the target. */ + mimeType?: string; + /** The name of the target. For example, in Google Drive, this is the title of the file. */ + name?: string; + } + interface User { + /** A boolean which indicates whether the specified User was deleted. If true, name, photo and permission_id will be omitted. */ + isDeleted?: boolean; + /** Whether the user is the authenticated user. */ + isMe?: boolean; + /** The displayable name of the user. */ + name?: string; + /** + * The permission ID associated with this user. Equivalent to the Drive API's permission ID for this user, returned as part of the Drive Permissions + * resource. + */ + permissionId?: string; + /** The profile photo of the user. Not present if the user has no profile photo. */ + photo?: Photo; + } + interface ActivitiesResource { + /** + * Returns a list of activities visible to the current logged in user. Visible activities are determined by the visiblity settings of the object that was + * acted on, e.g. Drive files a user can see. An activity is a record of past events. Multiple events may be merged if they are similar. A request is + * scoped to activities from a given Google service using the source parameter. + */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Identifies the Drive folder containing the items for which to return activities. */ + "drive.ancestorId"?: string; + /** Identifies the Drive item to return activities for. */ + "drive.fileId"?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Indicates the strategy to use when grouping singleEvents items in the associated combinedEvent object. */ + groupingStrategy?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The maximum number of events to return on a page. The response includes a continuation token if there are more events. */ + pageSize?: number; + /** A token to retrieve a specific page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * The Google service from which to return activities. Possible values of source are: + * - drive.google.com + */ + source?: string; + /** Indicates the user to return activity for. Use the special value me to indicate the currently authenticated user. */ + userId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.appsactivity/readme.md b/types/gapi.client.appsactivity/readme.md new file mode 100644 index 0000000000..9f6052ff29 --- /dev/null +++ b/types/gapi.client.appsactivity/readme.md @@ -0,0 +1,71 @@ +# TypeScript typings for G Suite Activity API v1 +Provides a historical view of activity. +For detailed description please check [documentation](https://developers.google.com/google-apps/activity/). + +## Installing + +Install typings for G Suite Activity API: +``` +npm install @types/gapi.client.appsactivity@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('appsactivity', 'v1', () => { + // now we can use gapi.client.appsactivity + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View the activity history of your Google apps + 'https://www.googleapis.com/auth/activity', + + // View and manage the files in your Google Drive + 'https://www.googleapis.com/auth/drive', + + // View and manage metadata of files in your Google Drive + 'https://www.googleapis.com/auth/drive.metadata', + + // View metadata for files in your Google Drive + 'https://www.googleapis.com/auth/drive.metadata.readonly', + + // View the files in your Google Drive + 'https://www.googleapis.com/auth/drive.readonly', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use G Suite Activity API resources: + +```typescript + +/* +Returns a list of activities visible to the current logged in user. Visible activities are determined by the visiblity settings of the object that was acted on, e.g. Drive files a user can see. An activity is a record of past events. Multiple events may be merged if they are similar. A request is scoped to activities from a given Google service using the source parameter. +*/ +await gapi.client.activities.list({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.appsactivity/tsconfig.json b/types/gapi.client.appsactivity/tsconfig.json new file mode 100644 index 0000000000..0afc87f3ad --- /dev/null +++ b/types/gapi.client.appsactivity/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.appsactivity-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.appsactivity/tslint.json b/types/gapi.client.appsactivity/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.appsactivity/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.appstate/gapi.client.appstate-tests.ts b/types/gapi.client.appstate/gapi.client.appstate-tests.ts new file mode 100644 index 0000000000..d34d46e2ee --- /dev/null +++ b/types/gapi.client.appstate/gapi.client.appstate-tests.ts @@ -0,0 +1,64 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('appstate', 'v1', () => { + /** now we can use gapi.client.appstate */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data for this application */ + 'https://www.googleapis.com/auth/appstate', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** + * Clears (sets to empty) the data for the passed key if and only if the passed version matches the currently stored version. This method results in a + * conflict error on version mismatch. + */ + await gapi.client.states.clear({ + currentDataVersion: "currentDataVersion", + stateKey: 2, + }); + /** + * Deletes a key and the data associated with it. The key is removed and no longer counts against the key quota. Note that since this method is not safe + * in the face of concurrent modifications, it should only be used for development and testing purposes. Invoking this method in shipping code can result + * in data loss and data corruption. + */ + await gapi.client.states.delete({ + stateKey: 1, + }); + /** Retrieves the data corresponding to the passed key. If the key does not exist on the server, an HTTP 404 will be returned. */ + await gapi.client.states.get({ + stateKey: 1, + }); + /** Lists all the states keys, and optionally the state data. */ + await gapi.client.states.list({ + includeData: true, + }); + /** + * Update the data associated with the input key if and only if the passed version matches the currently stored version. This method is safe in the face + * of concurrent writes. Maximum per-key size is 128KB. + */ + await gapi.client.states.update({ + currentStateVersion: "currentStateVersion", + stateKey: 2, + }); + } +}); diff --git a/types/gapi.client.appstate/index.d.ts b/types/gapi.client.appstate/index.d.ts new file mode 100644 index 0000000000..9ae6561cb1 --- /dev/null +++ b/types/gapi.client.appstate/index.d.ts @@ -0,0 +1,184 @@ +// Type definitions for Google Google App State API v1 1.0 +// Project: https://developers.google.com/games/services/web/api/states +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/appstate/v1/rest + +/// + +declare namespace gapi.client { + /** Load Google App State API v1 */ + function load(name: "appstate", version: "v1"): PromiseLike; + function load(name: "appstate", version: "v1", callback: () => any): void; + + const states: appstate.StatesResource; + + namespace appstate { + interface GetResponse { + /** The current app state version. */ + currentStateVersion?: string; + /** The requested data. */ + data?: string; + /** Uniquely identifies the type of this resource. Value is always the fixed string appstate#getResponse. */ + kind?: string; + /** The key for the data. */ + stateKey?: number; + } + interface ListResponse { + /** The app state data. */ + items?: GetResponse[]; + /** Uniquely identifies the type of this resource. Value is always the fixed string appstate#listResponse. */ + kind?: string; + /** The maximum number of keys allowed for this user. */ + maximumKeyCount?: number; + } + interface UpdateRequest { + /** The new app state data that your application is trying to update with. */ + data?: string; + /** Uniquely identifies the type of this resource. Value is always the fixed string appstate#updateRequest. */ + kind?: string; + } + interface WriteResult { + /** The version of the data for this key on the server. */ + currentStateVersion?: string; + /** Uniquely identifies the type of this resource. Value is always the fixed string appstate#writeResult. */ + kind?: string; + /** The written key. */ + stateKey?: number; + } + interface StatesResource { + /** + * Clears (sets to empty) the data for the passed key if and only if the passed version matches the currently stored version. This method results in a + * conflict error on version mismatch. + */ + clear(request: { + /** Data format for the response. */ + alt?: string; + /** The version of the data to be cleared. Version strings are returned by the server. */ + currentDataVersion?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The key for the data to be retrieved. */ + stateKey: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Deletes a key and the data associated with it. The key is removed and no longer counts against the key quota. Note that since this method is not safe + * in the face of concurrent modifications, it should only be used for development and testing purposes. Invoking this method in shipping code can result + * in data loss and data corruption. + */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The key for the data to be retrieved. */ + stateKey: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the data corresponding to the passed key. If the key does not exist on the server, an HTTP 404 will be returned. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The key for the data to be retrieved. */ + stateKey: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all the states keys, and optionally the state data. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Whether to include the full data in addition to the version number */ + includeData?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Update the data associated with the input key if and only if the passed version matches the currently stored version. This method is safe in the face + * of concurrent writes. Maximum per-key size is 128KB. + */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** + * The version of the app state your application is attempting to update. If this does not match the current version, this method will return a conflict + * error. If there is no data stored on the server for this key, the update will succeed irrespective of the value of this parameter. + */ + currentStateVersion?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The key for the data to be retrieved. */ + stateKey: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.appstate/readme.md b/types/gapi.client.appstate/readme.md new file mode 100644 index 0000000000..a98a3e7942 --- /dev/null +++ b/types/gapi.client.appstate/readme.md @@ -0,0 +1,79 @@ +# TypeScript typings for Google App State API v1 +The Google App State API. +For detailed description please check [documentation](https://developers.google.com/games/services/web/api/states). + +## Installing + +Install typings for Google App State API: +``` +npm install @types/gapi.client.appstate@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('appstate', 'v1', () => { + // now we can use gapi.client.appstate + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data for this application + 'https://www.googleapis.com/auth/appstate', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google App State API resources: + +```typescript + +/* +Clears (sets to empty) the data for the passed key if and only if the passed version matches the currently stored version. This method results in a conflict error on version mismatch. +*/ +await gapi.client.states.clear({ stateKey: 1, }); + +/* +Deletes a key and the data associated with it. The key is removed and no longer counts against the key quota. Note that since this method is not safe in the face of concurrent modifications, it should only be used for development and testing purposes. Invoking this method in shipping code can result in data loss and data corruption. +*/ +await gapi.client.states.delete({ stateKey: 1, }); + +/* +Retrieves the data corresponding to the passed key. If the key does not exist on the server, an HTTP 404 will be returned. +*/ +await gapi.client.states.get({ stateKey: 1, }); + +/* +Lists all the states keys, and optionally the state data. +*/ +await gapi.client.states.list({ }); + +/* +Update the data associated with the input key if and only if the passed version matches the currently stored version. This method is safe in the face of concurrent writes. Maximum per-key size is 128KB. +*/ +await gapi.client.states.update({ stateKey: 1, }); +``` \ No newline at end of file diff --git a/types/gapi.client.appstate/tsconfig.json b/types/gapi.client.appstate/tsconfig.json new file mode 100644 index 0000000000..e9b5b7a850 --- /dev/null +++ b/types/gapi.client.appstate/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.appstate-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.appstate/tslint.json b/types/gapi.client.appstate/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.appstate/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.bigquery/gapi.client.bigquery-tests.ts b/types/gapi.client.bigquery/gapi.client.bigquery-tests.ts new file mode 100644 index 0000000000..3bdcc43b1d --- /dev/null +++ b/types/gapi.client.bigquery/gapi.client.bigquery-tests.ts @@ -0,0 +1,202 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('bigquery', 'v2', () => { + /** now we can use gapi.client.bigquery */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data in Google BigQuery */ + 'https://www.googleapis.com/auth/bigquery', + /** Insert data into Google BigQuery */ + 'https://www.googleapis.com/auth/bigquery.insertdata', + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform.read-only', + /** Manage your data and permissions in Google Cloud Storage */ + 'https://www.googleapis.com/auth/devstorage.full_control', + /** View your data in Google Cloud Storage */ + 'https://www.googleapis.com/auth/devstorage.read_only', + /** Manage your data in Google Cloud Storage */ + 'https://www.googleapis.com/auth/devstorage.read_write', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** + * Deletes the dataset specified by the datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying + * deleteContents. Immediately after deletion, you can create another dataset with the same name. + */ + await gapi.client.datasets.delete({ + datasetId: "datasetId", + deleteContents: true, + projectId: "projectId", + }); + /** Returns the dataset specified by datasetID. */ + await gapi.client.datasets.get({ + datasetId: "datasetId", + projectId: "projectId", + }); + /** Creates a new empty dataset. */ + await gapi.client.datasets.insert({ + projectId: "projectId", + }); + /** Lists all datasets in the specified project to which you have been granted the READER dataset role. */ + await gapi.client.datasets.list({ + all: true, + filter: "filter", + maxResults: 3, + pageToken: "pageToken", + projectId: "projectId", + }); + /** + * Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that + * are provided in the submitted dataset resource. This method supports patch semantics. + */ + await gapi.client.datasets.patch({ + datasetId: "datasetId", + projectId: "projectId", + }); + /** + * Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that + * are provided in the submitted dataset resource. + */ + await gapi.client.datasets.update({ + datasetId: "datasetId", + projectId: "projectId", + }); + /** + * Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed + * successfully. Cancelled jobs may still incur costs. + */ + await gapi.client.jobs.cancel({ + jobId: "jobId", + projectId: "projectId", + }); + /** + * Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran + * the job, or have the Is Owner project role. + */ + await gapi.client.jobs.get({ + jobId: "jobId", + projectId: "projectId", + }); + /** Retrieves the results of a query job. */ + await gapi.client.jobs.getQueryResults({ + jobId: "jobId", + maxResults: 2, + pageToken: "pageToken", + projectId: "projectId", + startIndex: "startIndex", + timeoutMs: 6, + }); + /** Starts a new asynchronous job. Requires the Can View project role. */ + await gapi.client.jobs.insert({ + projectId: "projectId", + }); + /** + * Lists all jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in + * reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property. + */ + await gapi.client.jobs.list({ + allUsers: true, + maxResults: 2, + pageToken: "pageToken", + projectId: "projectId", + projection: "projection", + stateFilter: "stateFilter", + }); + /** Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout. */ + await gapi.client.jobs.query({ + projectId: "projectId", + }); + /** Returns the email address of the service account for your project used for interactions with Google Cloud KMS. */ + await gapi.client.projects.getServiceAccount({ + projectId: "projectId", + }); + /** Lists all projects to which you have been granted any project role. */ + await gapi.client.projects.list({ + maxResults: 1, + pageToken: "pageToken", + }); + /** Streams data into BigQuery one record at a time without needing to run a load job. Requires the WRITER dataset role. */ + await gapi.client.tabledata.insertAll({ + datasetId: "datasetId", + projectId: "projectId", + tableId: "tableId", + }); + /** Retrieves table data from a specified set of rows. Requires the READER dataset role. */ + await gapi.client.tabledata.list({ + datasetId: "datasetId", + maxResults: 2, + pageToken: "pageToken", + projectId: "projectId", + selectedFields: "selectedFields", + startIndex: "startIndex", + tableId: "tableId", + }); + /** Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted. */ + await gapi.client.tables.delete({ + datasetId: "datasetId", + projectId: "projectId", + tableId: "tableId", + }); + /** + * Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes + * the structure of this table. + */ + await gapi.client.tables.get({ + datasetId: "datasetId", + projectId: "projectId", + selectedFields: "selectedFields", + tableId: "tableId", + }); + /** Creates a new, empty table in the dataset. */ + await gapi.client.tables.insert({ + datasetId: "datasetId", + projectId: "projectId", + }); + /** Lists all tables in the specified dataset. Requires the READER dataset role. */ + await gapi.client.tables.list({ + datasetId: "datasetId", + maxResults: 2, + pageToken: "pageToken", + projectId: "projectId", + }); + /** + * Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are + * provided in the submitted table resource. This method supports patch semantics. + */ + await gapi.client.tables.patch({ + datasetId: "datasetId", + projectId: "projectId", + tableId: "tableId", + }); + /** + * Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are + * provided in the submitted table resource. + */ + await gapi.client.tables.update({ + datasetId: "datasetId", + projectId: "projectId", + tableId: "tableId", + }); + } +}); diff --git a/types/gapi.client.bigquery/index.d.ts b/types/gapi.client.bigquery/index.d.ts new file mode 100644 index 0000000000..813d668ea7 --- /dev/null +++ b/types/gapi.client.bigquery/index.d.ts @@ -0,0 +1,1810 @@ +// Type definitions for Google BigQuery API v2 2.0 +// Project: https://cloud.google.com/bigquery/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/bigquery/v2/rest + +/// + +declare namespace gapi.client { + /** Load BigQuery API v2 */ + function load(name: "bigquery", version: "v2"): PromiseLike; + function load(name: "bigquery", version: "v2", callback: () => any): void; + + const datasets: bigquery.DatasetsResource; + + const jobs: bigquery.JobsResource; + + const projects: bigquery.ProjectsResource; + + const tabledata: bigquery.TabledataResource; + + const tables: bigquery.TablesResource; + + namespace bigquery { + interface BigtableColumn { + /** + * [Optional] The encoding of the values when the type is not STRING. Acceptable encoding values are: TEXT - indicates values are alphanumeric text + * strings. BINARY - indicates values are encoded using HBase Bytes.toBytes family of functions. 'encoding' can also be set at the column family level. + * However, the setting at this level takes precedence if 'encoding' is set at both levels. + */ + encoding?: string; + /** + * [Optional] If the qualifier is not a valid BigQuery field identifier i.e. does not match [a-zA-Z][a-zA-Z0-9_]*, a valid identifier must be provided as + * the column field name and is used as field name in queries. + */ + fieldName?: string; + /** + * [Optional] If this is set, only the latest version of value in this column are exposed. 'onlyReadLatest' can also be set at the column family level. + * However, the setting at this level takes precedence if 'onlyReadLatest' is set at both levels. + */ + onlyReadLatest?: boolean; + /** + * [Required] Qualifier of the column. Columns in the parent column family that has this exact qualifier are exposed as . field. If the qualifier is valid + * UTF-8 string, it can be specified in the qualifier_string field. Otherwise, a base-64 encoded value must be set to qualifier_encoded. The column field + * name is the same as the column qualifier. However, if the qualifier is not a valid BigQuery field identifier i.e. does not match [a-zA-Z][a-zA-Z0-9_]*, + * a valid identifier must be provided as field_name. + */ + qualifierEncoded?: string; + qualifierString?: string; + /** + * [Optional] The type to convert the value in cells of this column. The values are expected to be encoded using HBase Bytes.toBytes function when using + * the BINARY encoding value. Following BigQuery types are allowed (case-sensitive) - BYTES STRING INTEGER FLOAT BOOLEAN Default type is BYTES. 'type' can + * also be set at the column family level. However, the setting at this level takes precedence if 'type' is set at both levels. + */ + type?: string; + } + interface BigtableColumnFamily { + /** + * [Optional] Lists of columns that should be exposed as individual fields as opposed to a list of (column name, value) pairs. All columns whose qualifier + * matches a qualifier in this list can be accessed as .. Other columns can be accessed as a list through .Column field. + */ + columns?: BigtableColumn[]; + /** + * [Optional] The encoding of the values when the type is not STRING. Acceptable encoding values are: TEXT - indicates values are alphanumeric text + * strings. BINARY - indicates values are encoded using HBase Bytes.toBytes family of functions. This can be overridden for a specific column by listing + * that column in 'columns' and specifying an encoding for it. + */ + encoding?: string; + /** Identifier of the column family. */ + familyId?: string; + /** + * [Optional] If this is set only the latest version of value are exposed for all columns in this column family. This can be overridden for a specific + * column by listing that column in 'columns' and specifying a different setting for that column. + */ + onlyReadLatest?: boolean; + /** + * [Optional] The type to convert the value in cells of this column family. The values are expected to be encoded using HBase Bytes.toBytes function when + * using the BINARY encoding value. Following BigQuery types are allowed (case-sensitive) - BYTES STRING INTEGER FLOAT BOOLEAN Default type is BYTES. This + * can be overridden for a specific column by listing that column in 'columns' and specifying a type for it. + */ + type?: string; + } + interface BigtableOptions { + /** + * [Optional] List of column families to expose in the table schema along with their types. This list restricts the column families that can be referenced + * in queries and specifies their value types. You can use this list to do type conversions - see the 'type' field for more details. If you leave this + * list empty, all column families are present in the table schema and their values are read as BYTES. During a query only the column families referenced + * in that query are read from Bigtable. + */ + columnFamilies?: BigtableColumnFamily[]; + /** + * [Optional] If field is true, then the column families that are not specified in columnFamilies list are not exposed in the table schema. Otherwise, + * they are read with BYTES type values. The default value is false. + */ + ignoreUnspecifiedColumnFamilies?: boolean; + /** + * [Optional] If field is true, then the rowkey column families will be read and converted to string. Otherwise they are read with BYTES type values and + * users need to manually cast them with CAST if necessary. The default value is false. + */ + readRowkeyAsString?: boolean; + } + interface CsvOptions { + /** + * [Optional] Indicates if BigQuery should accept rows that are missing trailing optional columns. If true, BigQuery treats missing trailing columns as + * null values. If false, records with missing trailing columns are treated as bad records, and if there are too many bad records, an invalid error is + * returned in the job result. The default value is false. + */ + allowJaggedRows?: boolean; + /** [Optional] Indicates if BigQuery should allow quoted data sections that contain newline characters in a CSV file. The default value is false. */ + allowQuotedNewlines?: boolean; + /** + * [Optional] The character encoding of the data. The supported values are UTF-8 or ISO-8859-1. The default value is UTF-8. BigQuery decodes the data + * after the raw, binary data has been split using the values of the quote and fieldDelimiter properties. + */ + encoding?: string; + /** + * [Optional] The separator for fields in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded + * string to split the data in its raw, binary state. BigQuery also supports the escape sequence "\t" to specify a tab separator. The default value is a + * comma (','). + */ + fieldDelimiter?: string; + /** + * [Optional] The value that is used to quote data sections in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first + * byte of the encoded string to split the data in its raw, binary state. The default value is a double-quote ('"'). If your data does not contain quoted + * sections, set the property value to an empty string. If your data contains quoted newline characters, you must also set the allowQuotedNewlines + * property to true. + */ + quote?: string; + /** + * [Optional] The number of rows at the top of a CSV file that BigQuery will skip when reading the data. The default value is 0. This property is useful + * if you have header rows in the file that should be skipped. + */ + skipLeadingRows?: string; + } + interface Dataset { + /** + * [Optional] An array of objects that define dataset access for one or more entities. You can set this property when inserting or updating a dataset in + * order to control who is allowed to access the data. If unspecified at dataset creation time, BigQuery adds default dataset access for the following + * entities: access.specialGroup: projectReaders; access.role: READER; access.specialGroup: projectWriters; access.role: WRITER; access.specialGroup: + * projectOwners; access.role: OWNER; access.userByEmail: [dataset creator email]; access.role: OWNER; + */ + access?: Array<{ + /** [Pick one] A domain to grant access to. Any users signed in with the domain specified will be granted the specified access. Example: "example.com". */ + domain?: string; + /** [Pick one] An email address of a Google Group to grant access to. */ + groupByEmail?: string; + /** + * [Required] Describes the rights granted to the user specified by the other member of the access object. The following string values are supported: + * READER, WRITER, OWNER. + */ + role?: string; + /** + * [Pick one] A special group to grant access to. Possible values include: projectOwners: Owners of the enclosing project. projectReaders: Readers of the + * enclosing project. projectWriters: Writers of the enclosing project. allAuthenticatedUsers: All authenticated BigQuery users. + */ + specialGroup?: string; + /** [Pick one] An email address of a user to grant access to. For example: fred@example.com. */ + userByEmail?: string; + /** + * [Pick one] A view from a different dataset to grant access to. Queries executed against that view will have read access to tables in this dataset. The + * role field is not required when this field is set. If that view is updated by any user, access to the view needs to be granted again via an update + * operation. + */ + view?: TableReference; + }>; + /** [Output-only] The time when this dataset was created, in milliseconds since the epoch. */ + creationTime?: string; + /** [Required] A reference that identifies the dataset. */ + datasetReference?: DatasetReference; + /** + * [Optional] The default lifetime of all tables in the dataset, in milliseconds. The minimum value is 3600000 milliseconds (one hour). Once this property + * is set, all newly-created tables in the dataset will have an expirationTime property set to the creation time plus the value in this property, and + * changing the value will only affect new tables, not existing ones. When the expirationTime for a given table is reached, that table will be deleted + * automatically. If a table's expirationTime is modified or removed before the table expires, or if you provide an explicit expirationTime when creating + * a table, that value takes precedence over the default expiration time indicated by this property. + */ + defaultTableExpirationMs?: string; + /** [Optional] A user-friendly description of the dataset. */ + description?: string; + /** [Output-only] A hash of the resource. */ + etag?: string; + /** [Optional] A descriptive name for the dataset. */ + friendlyName?: string; + /** + * [Output-only] The fully-qualified unique name of the dataset in the format projectId:datasetId. The dataset name without the project name is given in + * the datasetId field. When creating a new dataset, leave this field blank, and instead specify the datasetId field. + */ + id?: string; + /** [Output-only] The resource type. */ + kind?: string; + /** + * The labels associated with this dataset. You can use these to organize and group your datasets. You can set this property when inserting or updating a + * dataset. See Labeling Datasets for more information. + */ + labels?: Record; + /** [Output-only] The date when this dataset or any of its tables was last modified, in milliseconds since the epoch. */ + lastModifiedTime?: string; + /** The geographic location where the dataset should reside. Possible values include EU and US. The default value is US. */ + location?: string; + /** [Output-only] A URL that can be used to access the resource again. You can use this URL in Get or Update requests to the resource. */ + selfLink?: string; + } + interface DatasetList { + /** + * An array of the dataset resources in the project. Each resource contains basic information. For full information about a particular dataset resource, + * use the Datasets: get method. This property is omitted when there are no datasets in the project. + */ + datasets?: Array<{ + /** The dataset reference. Use this property to access specific parts of the dataset's ID, such as project ID or dataset ID. */ + datasetReference?: DatasetReference; + /** A descriptive name for the dataset, if one exists. */ + friendlyName?: string; + /** The fully-qualified, unique, opaque ID of the dataset. */ + id?: string; + /** The resource type. This property always returns the value "bigquery#dataset". */ + kind?: string; + /** The labels associated with this dataset. You can use these to organize and group your datasets. */ + labels?: Record; + }>; + /** A hash value of the results page. You can use this property to determine if the page has changed since the last request. */ + etag?: string; + /** The list type. This property always returns the value "bigquery#datasetList". */ + kind?: string; + /** A token that can be used to request the next results page. This property is omitted on the final results page. */ + nextPageToken?: string; + } + interface DatasetReference { + /** + * [Required] A unique ID for this dataset, without the project name. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The + * maximum length is 1,024 characters. + */ + datasetId?: string; + /** [Optional] The ID of the project containing this dataset. */ + projectId?: string; + } + interface EncryptionConfiguration { + /** + * [Optional] Describes the Cloud KMS encryption key that will be used to protect destination BigQuery table. The BigQuery Service Account associated with + * your project requires access to this encryption key. + */ + kmsKeyName?: string; + } + interface ErrorProto { + /** Debugging information. This property is internal to Google and should not be used. */ + debugInfo?: string; + /** Specifies where the error occurred, if present. */ + location?: string; + /** A human-readable description of the error. */ + message?: string; + /** A short error code that summarizes the error. */ + reason?: string; + } + interface ExplainQueryStage { + /** Milliseconds the average shard spent on CPU-bound tasks. */ + computeMsAvg?: string; + /** Milliseconds the slowest shard spent on CPU-bound tasks. */ + computeMsMax?: string; + /** Relative amount of time the average shard spent on CPU-bound tasks. */ + computeRatioAvg?: number; + /** Relative amount of time the slowest shard spent on CPU-bound tasks. */ + computeRatioMax?: number; + /** Unique ID for stage within plan. */ + id?: string; + /** Human-readable name for stage. */ + name?: string; + /** Milliseconds the average shard spent reading input. */ + readMsAvg?: string; + /** Milliseconds the slowest shard spent reading input. */ + readMsMax?: string; + /** Relative amount of time the average shard spent reading input. */ + readRatioAvg?: number; + /** Relative amount of time the slowest shard spent reading input. */ + readRatioMax?: number; + /** Number of records read into the stage. */ + recordsRead?: string; + /** Number of records written by the stage. */ + recordsWritten?: string; + /** Total number of bytes written to shuffle. */ + shuffleOutputBytes?: string; + /** Total number of bytes written to shuffle and spilled to disk. */ + shuffleOutputBytesSpilled?: string; + /** Current status for the stage. */ + status?: string; + /** List of operations within the stage in dependency order (approximately chronological). */ + steps?: ExplainQueryStep[]; + /** Milliseconds the average shard spent waiting to be scheduled. */ + waitMsAvg?: string; + /** Milliseconds the slowest shard spent waiting to be scheduled. */ + waitMsMax?: string; + /** Relative amount of time the average shard spent waiting to be scheduled. */ + waitRatioAvg?: number; + /** Relative amount of time the slowest shard spent waiting to be scheduled. */ + waitRatioMax?: number; + /** Milliseconds the average shard spent on writing output. */ + writeMsAvg?: string; + /** Milliseconds the slowest shard spent on writing output. */ + writeMsMax?: string; + /** Relative amount of time the average shard spent on writing output. */ + writeRatioAvg?: number; + /** Relative amount of time the slowest shard spent on writing output. */ + writeRatioMax?: number; + } + interface ExplainQueryStep { + /** Machine-readable operation type. */ + kind?: string; + /** Human-readable stage descriptions. */ + substeps?: string[]; + } + interface ExternalDataConfiguration { + /** Try to detect schema and format options automatically. Any option specified explicitly will be honored. */ + autodetect?: boolean; + /** [Optional] Additional options if sourceFormat is set to BIGTABLE. */ + bigtableOptions?: BigtableOptions; + /** + * [Optional] The compression type of the data source. Possible values include GZIP and NONE. The default value is NONE. This setting is ignored for + * Google Cloud Bigtable, Google Cloud Datastore backups and Avro formats. + */ + compression?: string; + /** Additional properties to set if sourceFormat is set to CSV. */ + csvOptions?: CsvOptions; + /** [Optional] Additional options if sourceFormat is set to GOOGLE_SHEETS. */ + googleSheetsOptions?: GoogleSheetsOptions; + /** + * [Optional] Indicates if BigQuery should allow extra values that are not represented in the table schema. If true, the extra values are ignored. If + * false, records with extra columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. + * The default value is false. The sourceFormat property determines what BigQuery treats as an extra value: CSV: Trailing columns JSON: Named values that + * don't match any column names Google Cloud Bigtable: This setting is ignored. Google Cloud Datastore backups: This setting is ignored. Avro: This + * setting is ignored. + */ + ignoreUnknownValues?: boolean; + /** + * [Optional] The maximum number of bad records that BigQuery can ignore when reading data. If the number of bad records exceeds this value, an invalid + * error is returned in the job result. The default value is 0, which requires that all records are valid. This setting is ignored for Google Cloud + * Bigtable, Google Cloud Datastore backups and Avro formats. + */ + maxBadRecords?: number; + /** + * [Optional] The schema for the data. Schema is required for CSV and JSON formats. Schema is disallowed for Google Cloud Bigtable, Cloud Datastore + * backups, and Avro formats. + */ + schema?: TableSchema; + /** + * [Required] The data format. For CSV files, specify "CSV". For Google sheets, specify "GOOGLE_SHEETS". For newline-delimited JSON, specify + * "NEWLINE_DELIMITED_JSON". For Avro files, specify "AVRO". For Google Cloud Datastore backups, specify "DATASTORE_BACKUP". [Beta] For Google Cloud + * Bigtable, specify "BIGTABLE". + */ + sourceFormat?: string; + /** + * [Required] The fully-qualified URIs that point to your data in Google Cloud. For Google Cloud Storage URIs: Each URI can contain one '*' wildcard + * character and it must come after the 'bucket' name. Size limits related to load jobs apply to external data sources. For Google Cloud Bigtable URIs: + * Exactly one URI can be specified and it has be a fully specified and valid HTTPS URL for a Google Cloud Bigtable table. For Google Cloud Datastore + * backups, exactly one URI can be specified. Also, the '*' wildcard character is not allowed. + */ + sourceUris?: string[]; + } + interface GetQueryResultsResponse { + /** Whether the query result was fetched from the query cache. */ + cacheHit?: boolean; + /** + * [Output-only] The first errors or warnings encountered during the running of the job. The final message includes the number of errors that caused the + * process to stop. Errors here do not necessarily mean that the job has completed or was unsuccessful. + */ + errors?: ErrorProto[]; + /** A hash of this response. */ + etag?: string; + /** Whether the query has completed or not. If rows or totalRows are present, this will always be true. If this is false, totalRows will not be available. */ + jobComplete?: boolean; + /** + * Reference to the BigQuery Job that was created to run the query. This field will be present even if the original request timed out, in which case + * GetQueryResults can be used to read the results once the query has completed. Since this API only returns the first page of results, subsequent pages + * can be fetched via the same mechanism (GetQueryResults). + */ + jobReference?: JobReference; + /** The resource type of the response. */ + kind?: string; + /** [Output-only] The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE. */ + numDmlAffectedRows?: string; + /** A token used for paging results. */ + pageToken?: string; + /** + * An object with as many results as can be contained within the maximum permitted reply size. To get any additional rows, you can call GetQueryResults + * and specify the jobReference returned above. Present only when the query completes successfully. + */ + rows?: TableRow[]; + /** The schema of the results. Present only when the query completes successfully. */ + schema?: TableSchema; + /** The total number of bytes processed for this query. */ + totalBytesProcessed?: string; + /** + * The total number of rows in the complete query result set, which can be more than the number of rows in this single page of results. Present only when + * the query completes successfully. + */ + totalRows?: string; + } + interface GetServiceAccountResponse { + /** The service account email address. */ + email?: string; + /** The resource type of the response. */ + kind?: string; + } + interface GoogleSheetsOptions { + /** + * [Optional] The number of rows at the top of a sheet that BigQuery will skip when reading the data. The default value is 0. This property is useful if + * you have header rows that should be skipped. When autodetect is on, behavior is the following: * skipLeadingRows unspecified - Autodetect tries to + * detect headers in the first row. If they are not detected, the row is read as data. Otherwise data is read starting from the second row. * + * skipLeadingRows is 0 - Instructs autodetect that there are no headers and data should be read starting from the first row. * skipLeadingRows = N > 0 - + * Autodetect skips N-1 rows and tries to detect headers in row N. If headers are not detected, row N is just skipped. Otherwise row N is used to extract + * column names for the detected schema. + */ + skipLeadingRows?: string; + } + interface Job { + /** [Required] Describes the job configuration. */ + configuration?: JobConfiguration; + /** [Output-only] A hash of this resource. */ + etag?: string; + /** [Output-only] Opaque ID field of the job */ + id?: string; + /** [Optional] Reference describing the unique-per-user name of the job. */ + jobReference?: JobReference; + /** [Output-only] The type of the resource. */ + kind?: string; + /** [Output-only] A URL that can be used to access this resource again. */ + selfLink?: string; + /** [Output-only] Information about the job, including starting time and ending time of the job. */ + statistics?: JobStatistics; + /** [Output-only] The status of this job. Examine this value when polling an asynchronous job to see if the job is complete. */ + status?: JobStatus; + /** [Output-only] Email address of the user who ran the job. */ + user_email?: string; + } + interface JobCancelResponse { + /** The final state of the job. */ + job?: Job; + /** The resource type of the response. */ + kind?: string; + } + interface JobConfiguration { + /** [Pick one] Copies a table. */ + copy?: JobConfigurationTableCopy; + /** + * [Optional] If set, don't actually run this job. A valid query will return a mostly empty response with some processing statistics, while an invalid + * query will return the same error it would if it wasn't a dry run. Behavior of non-query jobs is undefined. + */ + dryRun?: boolean; + /** [Pick one] Configures an extract job. */ + extract?: JobConfigurationExtract; + /** + * [Experimental] The labels associated with this job. You can use these to organize and group your jobs. Label keys and values can be no longer than 63 + * characters, can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are + * optional. Label keys must start with a letter and each label in the list must have a different key. + */ + labels?: Record; + /** [Pick one] Configures a load job. */ + load?: JobConfigurationLoad; + /** [Pick one] Configures a query job. */ + query?: JobConfigurationQuery; + } + interface JobConfigurationExtract { + /** [Optional] The compression type to use for exported files. Possible values include GZIP and NONE. The default value is NONE. */ + compression?: string; + /** + * [Optional] The exported file format. Possible values include CSV, NEWLINE_DELIMITED_JSON and AVRO. The default value is CSV. Tables with nested or + * repeated fields cannot be exported as CSV. + */ + destinationFormat?: string; + /** + * [Pick one] DEPRECATED: Use destinationUris instead, passing only one URI as necessary. The fully-qualified Google Cloud Storage URI where the extracted + * table should be written. + */ + destinationUri?: string; + /** [Pick one] A list of fully-qualified Google Cloud Storage URIs where the extracted table should be written. */ + destinationUris?: string[]; + /** [Optional] Delimiter to use between fields in the exported data. Default is ',' */ + fieldDelimiter?: string; + /** [Optional] Whether to print out a header row in the results. Default is true. */ + printHeader?: boolean; + /** [Required] A reference to the table being exported. */ + sourceTable?: TableReference; + } + interface JobConfigurationLoad { + /** + * [Optional] Accept rows that are missing trailing optional columns. The missing values are treated as nulls. If false, records with missing trailing + * columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. The default value is false. + * Only applicable to CSV, ignored for other formats. + */ + allowJaggedRows?: boolean; + /** Indicates if BigQuery should allow quoted data sections that contain newline characters in a CSV file. The default value is false. */ + allowQuotedNewlines?: boolean; + /** Indicates if we should automatically infer the options and schema for CSV and JSON sources. */ + autodetect?: boolean; + /** + * [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not + * exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The + * default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion. + */ + createDisposition?: string; + /** [Experimental] Custom encryption configuration (e.g., Cloud KMS keys). */ + destinationEncryptionConfiguration?: EncryptionConfiguration; + /** [Required] The destination table to load the data into. */ + destinationTable?: TableReference; + /** + * [Optional] The character encoding of the data. The supported values are UTF-8 or ISO-8859-1. The default value is UTF-8. BigQuery decodes the data + * after the raw, binary data has been split using the values of the quote and fieldDelimiter properties. + */ + encoding?: string; + /** + * [Optional] The separator for fields in a CSV file. The separator can be any ISO-8859-1 single-byte character. To use a character in the range 128-255, + * you must encode the character as UTF8. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split + * the data in its raw, binary state. BigQuery also supports the escape sequence "\t" to specify a tab separator. The default value is a comma (','). + */ + fieldDelimiter?: string; + /** + * [Optional] Indicates if BigQuery should allow extra values that are not represented in the table schema. If true, the extra values are ignored. If + * false, records with extra columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. + * The default value is false. The sourceFormat property determines what BigQuery treats as an extra value: CSV: Trailing columns JSON: Named values that + * don't match any column names + */ + ignoreUnknownValues?: boolean; + /** + * [Optional] The maximum number of bad records that BigQuery can ignore when running the job. If the number of bad records exceeds this value, an invalid + * error is returned in the job result. The default value is 0, which requires that all records are valid. + */ + maxBadRecords?: number; + /** + * [Optional] Specifies a string that represents a null value in a CSV file. For example, if you specify "\N", BigQuery interprets "\N" as a null value + * when loading a CSV file. The default value is the empty string. If you set this property to a custom value, BigQuery throws an error if an empty string + * is present for all data types except for STRING and BYTE. For STRING and BYTE columns, BigQuery interprets the empty string as an empty value. + */ + nullMarker?: string; + /** + * If sourceFormat is set to "DATASTORE_BACKUP", indicates which entity properties to load into BigQuery from a Cloud Datastore backup. Property names are + * case sensitive and must be top-level properties. If no properties are specified, BigQuery loads all properties. If any named property isn't found in + * the Cloud Datastore backup, an invalid error is returned in the job result. + */ + projectionFields?: string[]; + /** + * [Optional] The value that is used to quote data sections in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first + * byte of the encoded string to split the data in its raw, binary state. The default value is a double-quote ('"'). If your data does not contain quoted + * sections, set the property value to an empty string. If your data contains quoted newline characters, you must also set the allowQuotedNewlines + * property to true. + */ + quote?: string; + /** + * [Optional] The schema for the destination table. The schema can be omitted if the destination table already exists, or if you're loading data from + * Google Cloud Datastore. + */ + schema?: TableSchema; + /** [Deprecated] The inline schema. For CSV schemas, specify as "Field1:Type1[,Field2:Type2]*". For example, "foo:STRING, bar:INTEGER, baz:FLOAT". */ + schemaInline?: string; + /** [Deprecated] The format of the schemaInline property. */ + schemaInlineFormat?: string; + /** + * [Experimental] Allows the schema of the desitination table to be updated as a side effect of the load job if a schema is autodetected or supplied in + * the job configuration. Schema update options are supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE + * and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the + * schema. One or more of the following values are specified: ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. ALLOW_FIELD_RELAXATION: + * allow relaxing a required field in the original schema to nullable. + */ + schemaUpdateOptions?: string[]; + /** + * [Optional] The number of rows at the top of a CSV file that BigQuery will skip when loading the data. The default value is 0. This property is useful + * if you have header rows in the file that should be skipped. + */ + skipLeadingRows?: number; + /** + * [Optional] The format of the data files. For CSV files, specify "CSV". For datastore backups, specify "DATASTORE_BACKUP". For newline-delimited JSON, + * specify "NEWLINE_DELIMITED_JSON". For Avro, specify "AVRO". The default value is CSV. + */ + sourceFormat?: string; + /** + * [Required] The fully-qualified URIs that point to your data in Google Cloud. For Google Cloud Storage URIs: Each URI can contain one '*' wildcard + * character and it must come after the 'bucket' name. Size limits related to load jobs apply to external data sources. For Google Cloud Bigtable URIs: + * Exactly one URI can be specified and it has be a fully specified and valid HTTPS URL for a Google Cloud Bigtable table. For Google Cloud Datastore + * backups: Exactly one URI can be specified. Also, the '*' wildcard character is not allowed. + */ + sourceUris?: string[]; + /** [Experimental] If specified, configures time-based partitioning for the destination table. */ + timePartitioning?: TimePartitioning; + /** + * [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table + * already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If + * the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_APPEND. Each action is atomic + * and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job + * completion. + */ + writeDisposition?: string; + } + interface JobConfigurationQuery { + /** + * [Optional] If true and query uses legacy SQL dialect, allows the query to produce arbitrarily large result tables at a slight cost in performance. + * Requires destinationTable to be set. For standard SQL queries, this flag is ignored and large results are always allowed. However, you must still set + * destinationTable when result size exceeds the allowed maximum response size. + */ + allowLargeResults?: boolean; + /** + * [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not + * exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The + * default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion. + */ + createDisposition?: string; + /** [Optional] Specifies the default dataset to use for unqualified table names in the query. */ + defaultDataset?: DatasetReference; + /** [Experimental] Custom encryption configuration (e.g., Cloud KMS keys). */ + destinationEncryptionConfiguration?: EncryptionConfiguration; + /** + * [Optional] Describes the table where the query results should be stored. If not present, a new table will be created to store the results. This + * property must be set for large results that exceed the maximum response size. + */ + destinationTable?: TableReference; + /** + * [Optional] If true and query uses legacy SQL dialect, flattens all nested and repeated fields in the query results. allowLargeResults must be true if + * this is set to false. For standard SQL queries, this flag is ignored and results are never flattened. + */ + flattenResults?: boolean; + /** + * [Optional] Limits the billing tier for this job. Queries that have resource usage beyond this tier will fail (without incurring a charge). If + * unspecified, this will be set to your project default. + */ + maximumBillingTier?: number; + /** + * [Optional] Limits the bytes billed for this job. Queries that will have bytes billed beyond this limit will fail (without incurring a charge). If + * unspecified, this will be set to your project default. + */ + maximumBytesBilled?: string; + /** Standard SQL only. Set to POSITIONAL to use positional (?) query parameters or to NAMED to use named (@myparam) query parameters in this query. */ + parameterMode?: string; + /** [Deprecated] This property is deprecated. */ + preserveNulls?: boolean; + /** [Optional] Specifies a priority for the query. Possible values include INTERACTIVE and BATCH. The default value is INTERACTIVE. */ + priority?: string; + /** [Required] SQL query text to execute. The useLegacySql field can be used to indicate whether the query uses legacy SQL or standard SQL. */ + query?: string; + /** Query parameters for standard SQL queries. */ + queryParameters?: QueryParameter[]; + /** + * [Experimental] Allows the schema of the destination table to be updated as a side effect of the query job. Schema update options are supported in two + * cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by + * partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema. One or more of the following values are specified: + * ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original schema to + * nullable. + */ + schemaUpdateOptions?: string[]; + /** + * [Optional] If querying an external data source outside of BigQuery, describes the data format, location and other properties of the data source. By + * defining these properties, the data source can then be queried as if it were a standard BigQuery table. + */ + tableDefinitions?: Record; + /** [Experimental] If specified, configures time-based partitioning for the destination table. */ + timePartitioning?: TimePartitioning; + /** + * Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery's + * standard SQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the value of flattenResults is ignored; query will be + * run as if flattenResults is false. + */ + useLegacySql?: boolean; + /** + * [Optional] Whether to look for the result in the query cache. The query cache is a best-effort cache that will be flushed whenever tables in the query + * are modified. Moreover, the query cache is only available when a query does not have a destination table specified. The default value is true. + */ + useQueryCache?: boolean; + /** Describes user-defined function resources used in the query. */ + userDefinedFunctionResources?: UserDefinedFunctionResource[]; + /** + * [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table + * already exists, BigQuery overwrites the table data and uses the schema from the query result. WRITE_APPEND: If the table already exists, BigQuery + * appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The + * default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and + * append actions occur as one atomic update upon job completion. + */ + writeDisposition?: string; + } + interface JobConfigurationTableCopy { + /** + * [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not + * exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The + * default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion. + */ + createDisposition?: string; + /** [Experimental] Custom encryption configuration (e.g., Cloud KMS keys). */ + destinationEncryptionConfiguration?: EncryptionConfiguration; + /** [Required] The destination table */ + destinationTable?: TableReference; + /** [Pick one] Source table to copy. */ + sourceTable?: TableReference; + /** [Pick one] Source tables to copy. */ + sourceTables?: TableReference[]; + /** + * [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table + * already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If + * the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic + * and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job + * completion. + */ + writeDisposition?: string; + } + interface JobList { + /** A hash of this page of results. */ + etag?: string; + /** List of jobs that were requested. */ + jobs?: Array<{ + /** [Full-projection-only] Specifies the job configuration. */ + configuration?: JobConfiguration; + /** A result object that will be present only if the job has failed. */ + errorResult?: ErrorProto; + /** Unique opaque ID of the job. */ + id?: string; + /** Job reference uniquely identifying the job. */ + jobReference?: JobReference; + /** The resource type. */ + kind?: string; + /** Running state of the job. When the state is DONE, errorResult can be checked to determine whether the job succeeded or failed. */ + state?: string; + /** [Output-only] Information about the job, including starting time and ending time of the job. */ + statistics?: JobStatistics; + /** [Full-projection-only] Describes the state of the job. */ + status?: JobStatus; + /** [Full-projection-only] Email address of the user who ran the job. */ + user_email?: string; + }>; + /** The resource type of the response. */ + kind?: string; + /** A token to request the next page of results. */ + nextPageToken?: string; + } + interface JobReference { + /** + * [Required] The ID of the job. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). The maximum length is 1,024 + * characters. + */ + jobId?: string; + /** [Required] The ID of the project containing this job. */ + projectId?: string; + } + interface JobStatistics { + /** [Output-only] Creation time of this job, in milliseconds since the epoch. This field will be present on all jobs. */ + creationTime?: string; + /** [Output-only] End time of this job, in milliseconds since the epoch. This field will be present whenever a job is in the DONE state. */ + endTime?: string; + /** [Output-only] Statistics for an extract job. */ + extract?: JobStatistics4; + /** [Output-only] Statistics for a load job. */ + load?: JobStatistics3; + /** [Output-only] Statistics for a query job. */ + query?: JobStatistics2; + /** + * [Output-only] Start time of this job, in milliseconds since the epoch. This field will be present when the job transitions from the PENDING state to + * either RUNNING or DONE. + */ + startTime?: string; + /** [Output-only] [Deprecated] Use the bytes processed in the query statistics instead. */ + totalBytesProcessed?: string; + } + interface JobStatistics2 { + /** [Output-only] Billing tier for the job. */ + billingTier?: number; + /** [Output-only] Whether the query result was fetched from the query cache. */ + cacheHit?: boolean; + /** [Output-only] The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE. */ + numDmlAffectedRows?: string; + /** [Output-only] Describes execution plan for the query. */ + queryPlan?: ExplainQueryStage[]; + /** [Output-only, Experimental] Referenced tables for the job. Queries that reference more than 50 tables will not have a complete list. */ + referencedTables?: TableReference[]; + /** [Output-only, Experimental] The schema of the results. Present only for successful dry run of non-legacy SQL queries. */ + schema?: TableSchema; + /** [Output-only, Experimental] The type of query statement, if valid. */ + statementType?: string; + /** [Output-only] Total bytes billed for the job. */ + totalBytesBilled?: string; + /** [Output-only] Total bytes processed for the job. */ + totalBytesProcessed?: string; + /** [Output-only] Slot-milliseconds for the job. */ + totalSlotMs?: string; + /** [Output-only, Experimental] Standard SQL only: list of undeclared query parameters detected during a dry run validation. */ + undeclaredQueryParameters?: QueryParameter[]; + } + interface JobStatistics3 { + /** + * [Output-only] The number of bad records encountered. Note that if the job has failed because of more bad records encountered than the maximum allowed + * in the load job configuration, then this number can be less than the total number of bad records present in the input data. + */ + badRecords?: string; + /** [Output-only] Number of bytes of source data in a load job. */ + inputFileBytes?: string; + /** [Output-only] Number of source files in a load job. */ + inputFiles?: string; + /** [Output-only] Size of the loaded data in bytes. Note that while a load job is in the running state, this value may change. */ + outputBytes?: string; + /** [Output-only] Number of rows imported in a load job. Note that while an import job is in the running state, this value may change. */ + outputRows?: string; + } + interface JobStatistics4 { + /** + * [Output-only] Number of files per destination URI or URI pattern specified in the extract configuration. These values will be in the same order as the + * URIs specified in the 'destinationUris' field. + */ + destinationUriFileCounts?: string[]; + } + interface JobStatus { + /** [Output-only] Final error result of the job. If present, indicates that the job has completed and was unsuccessful. */ + errorResult?: ErrorProto; + /** + * [Output-only] The first errors encountered during the running of the job. The final message includes the number of errors that caused the process to + * stop. Errors here do not necessarily mean that the job has completed or was unsuccessful. + */ + errors?: ErrorProto[]; + /** [Output-only] Running state of the job. */ + state?: string; + } + interface JsonObject { + [key: string]: any; + } + interface ProjectList { + /** A hash of the page of results */ + etag?: string; + /** The type of list. */ + kind?: string; + /** A token to request the next page of results. */ + nextPageToken?: string; + /** Projects to which you have at least READ access. */ + projects?: Array<{ + /** A descriptive name for this project. */ + friendlyName?: string; + /** An opaque ID of this project. */ + id?: string; + /** The resource type. */ + kind?: string; + /** The numeric ID of this project. */ + numericId?: string; + /** A unique reference to this project. */ + projectReference?: ProjectReference; + }>; + /** The total number of projects in the list. */ + totalItems?: number; + } + interface ProjectReference { + /** [Required] ID of the project. Can be either the numeric ID or the assigned ID of the project. */ + projectId?: string; + } + interface QueryParameter { + /** [Optional] If unset, this is a positional parameter. Otherwise, should be unique within a query. */ + name?: string; + /** [Required] The type of this parameter. */ + parameterType?: QueryParameterType; + /** [Required] The value of this parameter. */ + parameterValue?: QueryParameterValue; + } + interface QueryParameterType { + /** [Optional] The type of the array's elements, if this is an array. */ + arrayType?: QueryParameterType; + /** [Optional] The types of the fields of this struct, in order, if this is a struct. */ + structTypes?: Array<{ + /** [Optional] Human-oriented description of the field. */ + description?: string; + /** [Optional] The name of this field. */ + name?: string; + /** [Required] The type of this field. */ + type?: QueryParameterType; + }>; + /** [Required] The top level type of this field. */ + type?: string; + } + interface QueryParameterValue { + /** [Optional] The array values, if this is an array type. */ + arrayValues?: QueryParameterValue[]; + /** [Optional] The struct field values, in order of the struct type's declaration. */ + structValues?: Record; + /** [Optional] The value of this value, if a simple scalar type. */ + value?: string; + } + interface QueryRequest { + /** + * [Optional] Specifies the default datasetId and projectId to assume for any unqualified table names in the query. If not set, all table names in the + * query string must be qualified in the format 'datasetId.tableId'. + */ + defaultDataset?: DatasetReference; + /** + * [Optional] If set to true, BigQuery doesn't run the job. Instead, if the query is valid, BigQuery returns statistics about the job such as how many + * bytes would be processed. If the query is invalid, an error returns. The default value is false. + */ + dryRun?: boolean; + /** The resource type of the request. */ + kind?: string; + /** + * [Optional] The maximum number of rows of data to return per page of results. Setting this flag to a small value such as 1000 and then paging through + * results might improve reliability when the query result set is large. In addition to this limit, responses are also limited to 10 MB. By default, there + * is no maximum row count, and only the byte limit applies. + */ + maxResults?: number; + /** Standard SQL only. Set to POSITIONAL to use positional (?) query parameters or to NAMED to use named (@myparam) query parameters in this query. */ + parameterMode?: string; + /** [Deprecated] This property is deprecated. */ + preserveNulls?: boolean; + /** + * [Required] A query string, following the BigQuery query syntax, of the query to execute. Example: "SELECT count(f1) FROM + * [myProjectId:myDatasetId.myTableId]". + */ + query?: string; + /** Query parameters for Standard SQL queries. */ + queryParameters?: QueryParameter[]; + /** + * [Optional] How long to wait for the query to complete, in milliseconds, before the request times out and returns. Note that this is only a timeout for + * the request, not the query. If the query takes longer to run than the timeout value, the call returns without any results and with the 'jobComplete' + * flag set to false. You can call GetQueryResults() to wait for the query to complete and read the results. The default value is 10000 milliseconds (10 + * seconds). + */ + timeoutMs?: number; + /** + * Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery's + * standard SQL: https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set to false, the value of flattenResults is ignored; query will be + * run as if flattenResults is false. + */ + useLegacySql?: boolean; + /** + * [Optional] Whether to look for the result in the query cache. The query cache is a best-effort cache that will be flushed whenever tables in the query + * are modified. The default value is true. + */ + useQueryCache?: boolean; + } + interface QueryResponse { + /** Whether the query result was fetched from the query cache. */ + cacheHit?: boolean; + /** + * [Output-only] The first errors or warnings encountered during the running of the job. The final message includes the number of errors that caused the + * process to stop. Errors here do not necessarily mean that the job has completed or was unsuccessful. + */ + errors?: ErrorProto[]; + /** Whether the query has completed or not. If rows or totalRows are present, this will always be true. If this is false, totalRows will not be available. */ + jobComplete?: boolean; + /** + * Reference to the Job that was created to run the query. This field will be present even if the original request timed out, in which case + * GetQueryResults can be used to read the results once the query has completed. Since this API only returns the first page of results, subsequent pages + * can be fetched via the same mechanism (GetQueryResults). + */ + jobReference?: JobReference; + /** The resource type. */ + kind?: string; + /** [Output-only] The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE. */ + numDmlAffectedRows?: string; + /** A token used for paging results. */ + pageToken?: string; + /** + * An object with as many results as can be contained within the maximum permitted reply size. To get any additional rows, you can call GetQueryResults + * and specify the jobReference returned above. + */ + rows?: TableRow[]; + /** The schema of the results. Present only when the query completes successfully. */ + schema?: TableSchema; + /** + * The total number of bytes processed for this query. If this query was a dry run, this is the number of bytes that would be processed if the query were + * run. + */ + totalBytesProcessed?: string; + /** The total number of rows in the complete query result set, which can be more than the number of rows in this single page of results. */ + totalRows?: string; + } + interface Streamingbuffer { + /** [Output-only] A lower-bound estimate of the number of bytes currently in the streaming buffer. */ + estimatedBytes?: string; + /** [Output-only] A lower-bound estimate of the number of rows currently in the streaming buffer. */ + estimatedRows?: string; + /** + * [Output-only] Contains the timestamp of the oldest entry in the streaming buffer, in milliseconds since the epoch, if the streaming buffer is + * available. + */ + oldestEntryTime?: string; + } + interface Table { + /** [Output-only] The time when this table was created, in milliseconds since the epoch. */ + creationTime?: string; + /** [Optional] A user-friendly description of this table. */ + description?: string; + /** [Experimental] Custom encryption configuration (e.g., Cloud KMS keys). */ + encryptionConfiguration?: EncryptionConfiguration; + /** [Output-only] A hash of this resource. */ + etag?: string; + /** + * [Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will + * be deleted and their storage reclaimed. + */ + expirationTime?: string; + /** + * [Optional] Describes the data format, location, and other properties of a table stored outside of BigQuery. By defining these properties, the data + * source can then be queried as if it were a standard BigQuery table. + */ + externalDataConfiguration?: ExternalDataConfiguration; + /** [Optional] A descriptive name for this table. */ + friendlyName?: string; + /** [Output-only] An opaque ID uniquely identifying the table. */ + id?: string; + /** [Output-only] The type of the resource. */ + kind?: string; + /** + * [Experimental] The labels associated with this table. You can use these to organize and group your tables. Label keys and values can be no longer than + * 63 characters, can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are + * optional. Label keys must start with a letter and each label in the list must have a different key. + */ + labels?: Record; + /** [Output-only] The time when this table was last modified, in milliseconds since the epoch. */ + lastModifiedTime?: string; + /** [Output-only] The geographic location where the table resides. This value is inherited from the dataset. */ + location?: string; + /** [Output-only] The size of this table in bytes, excluding any data in the streaming buffer. */ + numBytes?: string; + /** [Output-only] The number of bytes in the table that are considered "long-term storage". */ + numLongTermBytes?: string; + /** [Output-only] The number of rows of data in this table, excluding any data in the streaming buffer. */ + numRows?: string; + /** [Optional] Describes the schema of this table. */ + schema?: TableSchema; + /** [Output-only] A URL that can be used to access this resource again. */ + selfLink?: string; + /** + * [Output-only] Contains information regarding this table's streaming buffer, if one is present. This field will be absent if the table is not being + * streamed to or if there is no data in the streaming buffer. + */ + streamingBuffer?: Streamingbuffer; + /** [Required] Reference describing the ID of this table. */ + tableReference?: TableReference; + /** [Experimental] If specified, configures time-based partitioning for this table. */ + timePartitioning?: TimePartitioning; + /** + * [Output-only] Describes the table type. The following values are supported: TABLE: A normal BigQuery table. VIEW: A virtual table defined by a SQL + * query. EXTERNAL: A table that references data stored in an external storage system, such as Google Cloud Storage. The default value is TABLE. + */ + type?: string; + /** [Optional] The view definition. */ + view?: ViewDefinition; + } + interface TableCell { + v?: any; + } + interface TableDataInsertAllRequest { + /** + * [Optional] Accept rows that contain values that do not match the schema. The unknown values are ignored. Default is false, which treats unknown values + * as errors. + */ + ignoreUnknownValues?: boolean; + /** The resource type of the response. */ + kind?: string; + /** The rows to insert. */ + rows?: Array<{ + /** [Optional] A unique ID for each row. BigQuery uses this property to detect duplicate insertion requests on a best-effort basis. */ + insertId?: string; + /** [Required] A JSON object that contains a row of data. The object's properties and values must match the destination table's schema. */ + json?: JsonObject; + }>; + /** + * [Optional] Insert all valid rows of a request, even if invalid rows exist. The default value is false, which causes the entire request to fail if any + * invalid rows exist. + */ + skipInvalidRows?: boolean; + /** + * [Experimental] If specified, treats the destination table as a base template, and inserts the rows into an instance table named + * "{destination}{templateSuffix}". BigQuery will manage creation of the instance table, using the schema of the base template table. See + * https://cloud.google.com/bigquery/streaming-data-into-bigquery#template-tables for considerations when working with templates tables. + */ + templateSuffix?: string; + } + interface TableDataInsertAllResponse { + /** An array of errors for rows that were not inserted. */ + insertErrors?: Array<{ + /** Error information for the row indicated by the index property. */ + errors?: ErrorProto[]; + /** The index of the row that error applies to. */ + index?: number; + }>; + /** The resource type of the response. */ + kind?: string; + } + interface TableDataList { + /** A hash of this page of results. */ + etag?: string; + /** The resource type of the response. */ + kind?: string; + /** + * A token used for paging results. Providing this token instead of the startIndex parameter can help you retrieve stable results when an underlying table + * is changing. + */ + pageToken?: string; + /** Rows of results. */ + rows?: TableRow[]; + /** The total number of rows in the complete table. */ + totalRows?: string; + } + interface TableFieldSchema { + /** [Optional] The field description. The maximum length is 1,024 characters. */ + description?: string; + /** [Optional] Describes the nested schema fields if the type property is set to RECORD. */ + fields?: TableFieldSchema[]; + /** [Optional] The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE. */ + mode?: string; + /** + * [Required] The field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or + * underscore. The maximum length is 128 characters. + */ + name?: string; + /** + * [Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), BOOLEAN, BOOL + * (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD). + */ + type?: string; + } + interface TableList { + /** A hash of this page of results. */ + etag?: string; + /** The type of list. */ + kind?: string; + /** A token to request the next page of results. */ + nextPageToken?: string; + /** Tables in the requested dataset. */ + tables?: Array<{ + /** The time when this table was created, in milliseconds since the epoch. */ + creationTime?: string; + /** + * [Optional] The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will + * be deleted and their storage reclaimed. + */ + expirationTime?: string; + /** The user-friendly name for this table. */ + friendlyName?: string; + /** An opaque ID of the table */ + id?: string; + /** The resource type. */ + kind?: string; + /** [Experimental] The labels associated with this table. You can use these to organize and group your tables. */ + labels?: Record; + /** A reference uniquely identifying the table. */ + tableReference?: TableReference; + /** [Experimental] The time-based partitioning for this table. */ + timePartitioning?: TimePartitioning; + /** The type of table. Possible values are: TABLE, VIEW. */ + type?: string; + /** Additional details for a view. */ + view?: { + /** True if view is defined in legacy SQL dialect, false if in standard SQL. */ + useLegacySql?: boolean; + }; + }>; + /** The total number of tables in the dataset. */ + totalItems?: number; + } + interface TableReference { + /** [Required] The ID of the dataset containing this table. */ + datasetId?: string; + /** [Required] The ID of the project containing this table. */ + projectId?: string; + /** [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters. */ + tableId?: string; + } + interface TableRow { + /** Represents a single row in the result set, consisting of one or more fields. */ + f?: TableCell[]; + } + interface TableSchema { + /** Describes the fields in a table. */ + fields?: TableFieldSchema[]; + } + interface TimePartitioning { + /** [Optional] Number of milliseconds for which to keep the storage for a partition. */ + expirationMs?: string; + /** + * [Experimental] [Optional] If not set, the table is partitioned by pseudo column '_PARTITIONTIME'; if set, the table is partitioned by this field. The + * field must be a top-level TIMESTAMP or DATE field. Its mode must be NULLABLE or REQUIRED. + */ + field?: string; + /** [Required] The only type supported is DAY, which will generate one partition per day. */ + type?: string; + } + interface UserDefinedFunctionResource { + /** + * [Pick one] An inline resource that contains code for a user-defined function (UDF). Providing a inline code resource is equivalent to providing a URI + * for a file containing the same code. + */ + inlineCode?: string; + /** [Pick one] A code resource to load from a Google Cloud Storage URI (gs://bucket/path). */ + resourceUri?: string; + } + interface ViewDefinition { + /** [Required] A query that BigQuery executes when the view is referenced. */ + query?: string; + /** + * Specifies whether to use BigQuery's legacy SQL for this view. The default value is true. If set to false, the view will use BigQuery's standard SQL: + * https://cloud.google.com/bigquery/sql-reference/ Queries and views that reference this view must use the same flag value. + */ + useLegacySql?: boolean; + /** Describes user-defined function resources used in the query. */ + userDefinedFunctionResources?: UserDefinedFunctionResource[]; + } + interface DatasetsResource { + /** + * Deletes the dataset specified by the datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying + * deleteContents. Immediately after deletion, you can create another dataset with the same name. + */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Dataset ID of dataset being deleted */ + datasetId: string; + /** If True, delete all the tables in the dataset. If False and the dataset contains tables, the request will fail. Default is False */ + deleteContents?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the dataset being deleted */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the dataset specified by datasetID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Dataset ID of the requested dataset */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the requested dataset */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a new empty dataset. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the new dataset */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all datasets in the specified project to which you have been granted the READER dataset role. */ + list(request: { + /** Whether to list all datasets, including hidden ones */ + all?: boolean; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * An expression for filtering the results of the request by label. The syntax is "labels.[:]". Multiple filters can be ANDed together by + * connecting with a space. Example: "labels.department:receiving labels.active". See Filtering datasets using labels for details. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of results to return */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page token, returned by a previous call, to request the next page of results */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the datasets to be listed */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that + * are provided in the submitted dataset resource. This method supports patch semantics. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Dataset ID of the dataset being updated */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the dataset being updated */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that + * are provided in the submitted dataset resource. + */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Dataset ID of the dataset being updated */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the dataset being updated */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface JobsResource { + /** + * Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed + * successfully. Cancelled jobs may still incur costs. + */ + cancel(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** [Required] Job ID of the job to cancel */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** [Required] Project ID of the job to cancel */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran + * the job, or have the Is Owner project role. + */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** [Required] Job ID of the requested job */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** [Required] Project ID of the requested job */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the results of a query job. */ + getQueryResults(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** [Required] Job ID of the query job */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to read */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page token, returned by a previous call, to request the next page of results */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** [Required] Project ID of the query job */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Zero-based index of the starting row */ + startIndex?: string; + /** + * How long to wait for the query to complete, in milliseconds, before returning. Default is 10 seconds. If the timeout passes before the job completes, + * the 'jobComplete' field in the response will be false + */ + timeoutMs?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Starts a new asynchronous job. Requires the Can View project role. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the project that will be billed for the job */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Lists all jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in + * reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property. + */ + list(request: { + /** Whether to display jobs owned by all users in the project. Default false */ + allUsers?: boolean; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page token, returned by a previous call, to request the next page of results */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the jobs to list */ + projectId: string; + /** Restrict information returned to a set of selected fields */ + projection?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Filter for job state */ + stateFilter?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout. */ + query(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the project billed for the query */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ProjectsResource { + /** Returns the email address of the service account for your project used for interactions with Google Cloud KMS. */ + getServiceAccount(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for which the service account is requested. */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all projects to which you have been granted any project role. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page token, returned by a previous call, to request the next page of results */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TabledataResource { + /** Streams data into BigQuery one record at a time without needing to run a load job. Requires the WRITER dataset role. */ + insertAll(request: { + /** Data format for the response. */ + alt?: string; + /** Dataset ID of the destination table. */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the destination table. */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table ID of the destination table. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves table data from a specified set of rows. Requires the READER dataset role. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Dataset ID of the table to read */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page token, returned by a previous call, identifying the result set */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the table to read */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** List of fields to return (comma-separated). If unspecified, all fields are returned */ + selectedFields?: string; + /** Zero-based index of the starting row to read */ + startIndex?: string; + /** Table ID of the table to read */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TablesResource { + /** Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Dataset ID of the table to delete */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the table to delete */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table ID of the table to delete */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes + * the structure of this table. + */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Dataset ID of the requested table */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the requested table */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** List of fields to return (comma-separated). If unspecified, all fields are returned */ + selectedFields?: string; + /** Table ID of the requested table */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a new, empty table in the dataset. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Dataset ID of the new table */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the new table */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request
    ; + /** Lists all tables in the specified dataset. Requires the READER dataset role. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Dataset ID of the tables to list */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page token, returned by a previous call, to request the next page of results */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the tables to list */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are + * provided in the submitted table resource. This method supports patch semantics. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Dataset ID of the table to update */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the table to update */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table ID of the table to update */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request
    ; + /** + * Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are + * provided in the submitted table resource. + */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Dataset ID of the table to update */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID of the table to update */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table ID of the table to update */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request
    ; + } + } +} diff --git a/types/gapi.client.bigquery/readme.md b/types/gapi.client.bigquery/readme.md new file mode 100644 index 0000000000..4a76f83277 --- /dev/null +++ b/types/gapi.client.bigquery/readme.md @@ -0,0 +1,182 @@ +# TypeScript typings for BigQuery API v2 +A data platform for customers to create, manage, share and query data. +For detailed description please check [documentation](https://cloud.google.com/bigquery/). + +## Installing + +Install typings for BigQuery API: +``` +npm install @types/gapi.client.bigquery@v2 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('bigquery', 'v2', () => { + // now we can use gapi.client.bigquery + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data in Google BigQuery + 'https://www.googleapis.com/auth/bigquery', + + // Insert data into Google BigQuery + 'https://www.googleapis.com/auth/bigquery.insertdata', + + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform.read-only', + + // Manage your data and permissions in Google Cloud Storage + 'https://www.googleapis.com/auth/devstorage.full_control', + + // View your data in Google Cloud Storage + 'https://www.googleapis.com/auth/devstorage.read_only', + + // Manage your data in Google Cloud Storage + 'https://www.googleapis.com/auth/devstorage.read_write', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use BigQuery API resources: + +```typescript + +/* +Deletes the dataset specified by the datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying deleteContents. Immediately after deletion, you can create another dataset with the same name. +*/ +await gapi.client.datasets.delete({ datasetId: "datasetId", projectId: "projectId", }); + +/* +Returns the dataset specified by datasetID. +*/ +await gapi.client.datasets.get({ datasetId: "datasetId", projectId: "projectId", }); + +/* +Creates a new empty dataset. +*/ +await gapi.client.datasets.insert({ projectId: "projectId", }); + +/* +Lists all datasets in the specified project to which you have been granted the READER dataset role. +*/ +await gapi.client.datasets.list({ projectId: "projectId", }); + +/* +Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource. This method supports patch semantics. +*/ +await gapi.client.datasets.patch({ datasetId: "datasetId", projectId: "projectId", }); + +/* +Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource. +*/ +await gapi.client.datasets.update({ datasetId: "datasetId", projectId: "projectId", }); + +/* +Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully. Cancelled jobs may still incur costs. +*/ +await gapi.client.jobs.cancel({ jobId: "jobId", projectId: "projectId", }); + +/* +Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran the job, or have the Is Owner project role. +*/ +await gapi.client.jobs.get({ jobId: "jobId", projectId: "projectId", }); + +/* +Retrieves the results of a query job. +*/ +await gapi.client.jobs.getQueryResults({ jobId: "jobId", projectId: "projectId", }); + +/* +Starts a new asynchronous job. Requires the Can View project role. +*/ +await gapi.client.jobs.insert({ projectId: "projectId", }); + +/* +Lists all jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property. +*/ +await gapi.client.jobs.list({ projectId: "projectId", }); + +/* +Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout. +*/ +await gapi.client.jobs.query({ projectId: "projectId", }); + +/* +Returns the email address of the service account for your project used for interactions with Google Cloud KMS. +*/ +await gapi.client.projects.getServiceAccount({ projectId: "projectId", }); + +/* +Lists all projects to which you have been granted any project role. +*/ +await gapi.client.projects.list({ }); + +/* +Streams data into BigQuery one record at a time without needing to run a load job. Requires the WRITER dataset role. +*/ +await gapi.client.tabledata.insertAll({ datasetId: "datasetId", projectId: "projectId", tableId: "tableId", }); + +/* +Retrieves table data from a specified set of rows. Requires the READER dataset role. +*/ +await gapi.client.tabledata.list({ datasetId: "datasetId", projectId: "projectId", tableId: "tableId", }); + +/* +Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted. +*/ +await gapi.client.tables.delete({ datasetId: "datasetId", projectId: "projectId", tableId: "tableId", }); + +/* +Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table. +*/ +await gapi.client.tables.get({ datasetId: "datasetId", projectId: "projectId", tableId: "tableId", }); + +/* +Creates a new, empty table in the dataset. +*/ +await gapi.client.tables.insert({ datasetId: "datasetId", projectId: "projectId", }); + +/* +Lists all tables in the specified dataset. Requires the READER dataset role. +*/ +await gapi.client.tables.list({ datasetId: "datasetId", projectId: "projectId", }); + +/* +Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. This method supports patch semantics. +*/ +await gapi.client.tables.patch({ datasetId: "datasetId", projectId: "projectId", tableId: "tableId", }); + +/* +Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. +*/ +await gapi.client.tables.update({ datasetId: "datasetId", projectId: "projectId", tableId: "tableId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.bigquery/tsconfig.json b/types/gapi.client.bigquery/tsconfig.json new file mode 100644 index 0000000000..23f55a96a4 --- /dev/null +++ b/types/gapi.client.bigquery/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.bigquery-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.bigquery/tslint.json b/types/gapi.client.bigquery/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.bigquery/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.bigquerydatatransfer/gapi.client.bigquerydatatransfer-tests.ts b/types/gapi.client.bigquerydatatransfer/gapi.client.bigquerydatatransfer-tests.ts new file mode 100644 index 0000000000..2b3fcba3be --- /dev/null +++ b/types/gapi.client.bigquerydatatransfer/gapi.client.bigquerydatatransfer-tests.ts @@ -0,0 +1,36 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('bigquerydatatransfer', 'v1', () => { + /** now we can use gapi.client.bigquerydatatransfer */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data in Google BigQuery */ + 'https://www.googleapis.com/auth/bigquery', + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + } +}); diff --git a/types/gapi.client.bigquerydatatransfer/index.d.ts b/types/gapi.client.bigquerydatatransfer/index.d.ts new file mode 100644 index 0000000000..0bc090fdf5 --- /dev/null +++ b/types/gapi.client.bigquerydatatransfer/index.d.ts @@ -0,0 +1,1579 @@ +// Type definitions for Google BigQuery Data Transfer API v1 1.0 +// Project: https://cloud.google.com/bigquery/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://bigquerydatatransfer.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load BigQuery Data Transfer API v1 */ + function load(name: "bigquerydatatransfer", version: "v1"): PromiseLike; + function load(name: "bigquerydatatransfer", version: "v1", callback: () => any): void; + + const projects: bigquerydatatransfer.ProjectsResource; + + namespace bigquerydatatransfer { + interface CheckValidCredsResponse { + /** If set to `true`, the credentials exist and are valid. */ + hasValidCreds?: boolean; + } + interface DataSource { + /** Indicates the type of authorization. */ + authorizationType?: string; + /** + * Data source client id which should be used to receive refresh token. + * When not supplied, no offline credentials are populated for data transfer. + */ + clientId?: string; + /** + * Specifies whether the data source supports automatic data refresh for the + * past few days, and how it's supported. + * For some data sources, data might not be complete until a few days later, + * so it's useful to refresh data automatically. + */ + dataRefreshType?: string; + /** Data source id. */ + dataSourceId?: string; + /** + * Default data refresh window on days. + * Only meaningful when `data_refresh_type` = `SLIDING_WINDOW`. + */ + defaultDataRefreshWindowDays?: number; + /** + * Default data transfer schedule. + * Examples of valid schedules include: + * `1st,3rd monday of month 15:30`, + * `every wed,fri of jan,jun 13:15`, and + * `first sunday of quarter 00:00`. + */ + defaultSchedule?: string; + /** User friendly data source description string. */ + description?: string; + /** User friendly data source name. */ + displayName?: string; + /** Url for the help document for this data source. */ + helpUrl?: string; + /** + * Disables backfilling and manual run scheduling + * for the data source. + */ + manualRunsDisabled?: boolean; + /** The minimum interval between two consecutive scheduled runs. */ + minimumScheduleInterval?: string; + /** Data source resource name. */ + name?: string; + /** Data source parameters. */ + parameters?: DataSourceParameter[]; + /** + * Api auth scopes for which refresh token needs to be obtained. Only valid + * when `client_id` is specified. Ignored otherwise. These are scopes needed + * by a data source to prepare data and ingest them into BigQuery, + * e.g., https://www.googleapis.com/auth/bigquery + */ + scopes?: string[]; + /** + * Specifies whether the data source supports a user defined schedule, or + * operates on the default schedule. + * When set to `true`, user can override default schedule. + */ + supportsCustomSchedule?: boolean; + /** + * Indicates whether the data source supports multiple transfers + * to different BigQuery targets. + */ + supportsMultipleTransfers?: boolean; + /** + * Transfer type. Currently supports only batch transfers, + * which are transfers that use the BigQuery batch APIs (load or + * query) to ingest the data. + */ + transferType?: string; + /** + * The number of seconds to wait for an update from the data source + * before BigQuery marks the transfer as failed. + */ + updateDeadlineSeconds?: number; + } + interface DataSourceParameter { + /** All possible values for the parameter. */ + allowedValues?: string[]; + /** Parameter description. */ + description?: string; + /** Parameter display name in the user interface. */ + displayName?: string; + /** When parameter is a record, describes child fields. */ + fields?: DataSourceParameter[]; + /** Cannot be changed after initial creation. */ + immutable?: boolean; + /** For integer and double values specifies maxminum allowed value. */ + maxValue?: number; + /** For integer and double values specifies minimum allowed value. */ + minValue?: number; + /** Parameter identifier. */ + paramId?: string; + /** + * If set to true, schema should be taken from the parent with the same + * parameter_id. Only applicable when parameter type is RECORD. + */ + recurse?: boolean; + /** Can parameter have multiple values. */ + repeated?: boolean; + /** Is parameter required. */ + required?: boolean; + /** Parameter type. */ + type?: string; + /** + * Description of the requirements for this field, in case the user input does + * not fulfill the regex pattern or min/max values. + */ + validationDescription?: string; + /** URL to a help document to further explain the naming requirements. */ + validationHelpUrl?: string; + /** Regular expression which can be used for parameter validation. */ + validationRegex?: string; + } + interface ListDataSourcesResponse { + /** List of supported data sources and their transfer settings. */ + dataSources?: DataSource[]; + /** + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the + * `ListDataSourcesRequest.page_token` + * to request the next page of list results. + */ + nextPageToken?: string; + } + interface ListLocationsResponse { + /** A list of locations that matches the specified filter in the request. */ + locations?: Location[]; + /** The standard List next-page token. */ + nextPageToken?: string; + } + interface ListTransferConfigsResponse { + /** + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the + * `ListTransferConfigsRequest.page_token` + * to request the next page of list results. + */ + nextPageToken?: string; + /** Output only. The stored pipeline transfer configurations. */ + transferConfigs?: TransferConfig[]; + } + interface ListTransferLogsResponse { + /** + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the + * `GetTransferRunLogRequest.page_token` + * to request the next page of list results. + */ + nextPageToken?: string; + /** Output only. The stored pipeline transfer messages. */ + transferMessages?: TransferMessage[]; + } + interface ListTransferRunsResponse { + /** + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the + * `ListTransferRunsRequest.page_token` + * to request the next page of list results. + */ + nextPageToken?: string; + /** Output only. The stored pipeline transfer runs. */ + transferRuns?: TransferRun[]; + } + interface Location { + /** + * Cross-service attributes for the location. For example + * + * {"cloud.googleapis.com/region": "us-east1"} + */ + labels?: Record; + /** The canonical id for this location. For example: `"us-east1"`. */ + locationId?: string; + /** + * Service-specific metadata. For example the available capacity at the given + * location. + */ + metadata?: Record; + /** + * Resource name for the location, which may vary between implementations. + * For example: `"projects/example-project/locations/us-east1"` + */ + name?: string; + } + interface ScheduleTransferRunsRequest { + /** + * End time of the range of transfer runs. For example, + * `"2017-05-30T00:00:00+00:00"`. + */ + endTime?: string; + /** + * Start time of the range of transfer runs. For example, + * `"2017-05-25T00:00:00+00:00"`. + */ + startTime?: string; + } + interface ScheduleTransferRunsResponse { + /** The transfer runs that were scheduled. */ + runs?: TransferRun[]; + } + interface TransferConfig { + /** + * The number of days to look back to automatically refresh the data. + * For example, if `data_refresh_window_days = 10`, then every day + * BigQuery reingests data for [today-10, today-1], rather than ingesting data + * for just [today-1]. + * Only valid if the data source supports the feature. Set the value to 0 + * to use the default value. + */ + dataRefreshWindowDays?: number; + /** Data source id. Cannot be changed once data transfer is created. */ + dataSourceId?: string; + /** Output only. Region in which BigQuery dataset is located. */ + datasetRegion?: string; + /** The BigQuery target dataset id. */ + destinationDatasetId?: string; + /** + * Is this config disabled. When set to true, no runs are scheduled + * for a given transfer. + */ + disabled?: boolean; + /** User specified display name for the data transfer. */ + displayName?: string; + /** + * The resource name of the transfer config. + * Transfer config names have the form + * `projects/{project_id}/transferConfigs/{config_id}`. + * Where `config_id` is usually a uuid, even though it is not + * guaranteed or required. The name is ignored when creating a transfer + * config. + */ + name?: string; + /** Output only. Next time when data transfer will run. */ + nextRunTime?: string; + /** Data transfer specific parameters. */ + params?: Record; + /** + * Data transfer schedule. + * If the data source does not support a custom schedule, this should be + * empty. If it is empty, the default value for the data source will be + * used. + * The specified times are in UTC. + * Examples of valid format: + * `1st,3rd monday of month 15:30`, + * `every wed,fri of jan,jun 13:15`, and + * `first sunday of quarter 00:00`. + * See more explanation about the format here: + * https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format + * NOTE: the granularity should be at least 8 hours, or less frequent. + */ + schedule?: string; + /** Output only. State of the most recently updated transfer run. */ + state?: string; + /** Output only. Data transfer modification time. Ignored by server on input. */ + updateTime?: string; + /** + * Output only. Unique ID of the user on whose behalf transfer is done. + * Applicable only to data sources that do not support service accounts. + * When set to 0, the data source service account credentials are used. + */ + userId?: string; + } + interface TransferMessage { + /** Message text. */ + messageText?: string; + /** Time when message was logged. */ + messageTime?: string; + /** Message severity. */ + severity?: string; + } + interface TransferRun { + /** Output only. Data source id. */ + dataSourceId?: string; + /** Output only. Region in which BigQuery dataset is located. */ + datasetRegion?: string; + /** The BigQuery target dataset id. */ + destinationDatasetId?: string; + /** + * Output only. Time when transfer run ended. + * Parameter ignored by server for input requests. + */ + endTime?: string; + /** + * The resource name of the transfer run. + * Transfer run names have the form + * `projects/{project_id}/locations/{location}/transferConfigs/{config_id}/runs/{run_id}`. + * The name is ignored when creating a transfer run. + */ + name?: string; + /** Data transfer specific parameters. */ + params?: Record; + /** + * For batch transfer runs, specifies the date and time that + * data should be ingested. + */ + runTime?: string; + /** + * Output only. Describes the schedule of this transfer run if it was + * created as part of a regular schedule. For batch transfer runs that are + * scheduled manually, this is empty. + * NOTE: the system might choose to delay the schedule depending on the + * current load, so `schedule_time` doesn't always matches this. + */ + schedule?: string; + /** Minimum time after which a transfer run can be started. */ + scheduleTime?: string; + /** + * Output only. Time when transfer run was started. + * Parameter ignored by server for input requests. + */ + startTime?: string; + /** Output only. Data transfer run state. Ignored for input requests. */ + state?: string; + /** Output only. Last time the data transfer run state was updated. */ + updateTime?: string; + /** + * Output only. Unique ID of the user on whose behalf transfer is done. + * Applicable only to data sources that do not support service accounts. + * When set to 0, the data source service account credentials are used. + */ + userId?: string; + } + interface DataSourcesResource { + /** + * Returns true if valid credentials exist for the given data source and + * requesting user. + * Some data sources doesn't support service account, so we need to talk to + * them on behalf of the end user. This API just checks whether we have OAuth + * token for the particular user, which is a pre-requisite before user can + * create a transfer config. + */ + checkValidCreds(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The data source in the form: + * `projects/{project_id}/dataSources/{data_source_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Retrieves a supported data source and returns its settings, + * which can be used for UI rendering. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The field will contain name of the resource requested, for example: + * `projects/{project_id}/dataSources/{data_source_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists supported data sources and returns their settings, + * which can be used for UI rendering. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page size. The default page size is the maximum value of 1000 results. */ + pageSize?: number; + /** + * Pagination token, which can be used to request a specific page + * of `ListDataSourcesRequest` list results. For multiple-page + * results, `ListDataSourcesResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + */ + pageToken?: string; + /** + * The BigQuery project id for which data sources should be returned. + * Must be in the form: `projects/{project_id}` + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface DataSourcesResource { + /** + * Returns true if valid credentials exist for the given data source and + * requesting user. + * Some data sources doesn't support service account, so we need to talk to + * them on behalf of the end user. This API just checks whether we have OAuth + * token for the particular user, which is a pre-requisite before user can + * create a transfer config. + */ + checkValidCreds(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The data source in the form: + * `projects/{project_id}/dataSources/{data_source_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Retrieves a supported data source and returns its settings, + * which can be used for UI rendering. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The field will contain name of the resource requested, for example: + * `projects/{project_id}/dataSources/{data_source_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists supported data sources and returns their settings, + * which can be used for UI rendering. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page size. The default page size is the maximum value of 1000 results. */ + pageSize?: number; + /** + * Pagination token, which can be used to request a specific page + * of `ListDataSourcesRequest` list results. For multiple-page + * results, `ListDataSourcesResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + */ + pageToken?: string; + /** + * The BigQuery project id for which data sources should be returned. + * Must be in the form: `projects/{project_id}` + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface TransferLogsResource { + /** Returns user facing log messages for the data transfer run. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Message types to return. If not populated - INFO, WARNING and ERROR + * messages are returned. + */ + messageTypes?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page size. The default page size is the maximum value of 1000 results. */ + pageSize?: number; + /** + * Pagination token, which can be used to request a specific page + * of `ListTransferLogsRequest` list results. For multiple-page + * results, `ListTransferLogsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + */ + pageToken?: string; + /** + * Transfer run name in the form: + * `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface RunsResource { + /** Deletes the specified transfer run. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Returns information about the particular transfer run. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Returns information about running and completed jobs. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page size. The default page size is the maximum value of 1000 results. */ + pageSize?: number; + /** + * Pagination token, which can be used to request a specific page + * of `ListTransferRunsRequest` list results. For multiple-page + * results, `ListTransferRunsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + */ + pageToken?: string; + /** + * Name of transfer configuration for which transfer runs should be retrieved. + * Format of transfer configuration resource name is: + * `projects/{project_id}/transferConfigs/{config_id}`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Indicates how run attempts are to be pulled. */ + runAttempt?: string; + /** When specified, only transfer runs with requested states are returned. */ + states?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + transferLogs: TransferLogsResource; + } + interface TransferConfigsResource { + /** Creates a new data transfer configuration. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** + * Optional OAuth2 authorization code to use with this transfer configuration. + * This is required if new credentials are needed, as indicated by + * `CheckValidCreds`. + * In order to obtain authorization_code, please make a + * request to + * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + * + * * client_id should be OAuth client_id of BigQuery DTS API for the given + * data source returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources method. + * * redirect_uri is an optional parameter. If not specified, then + * authorization code is posted to the opener of authorization flow window. + * Otherwise it will be sent to the redirect uri. A special value of + * urn:ietf:wg:oauth:2.0:oob means that authorization code should be + * returned in the title bar of the browser, with the page text prompting + * the user to copy the code and paste it in the application. + */ + authorizationCode?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The BigQuery project id where the transfer configuration should be created. + * Must be in the format /projects/{project_id}/locations/{location_id} + * or + * /projects/{project_id}/locations/- + * In case when '-' is specified as location_id, location is infered from + * the destination dataset region. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes a data transfer configuration, + * including any associated transfer runs and logs. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Returns information about a data transfer config. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Returns information about all data transfers in the project. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** When specified, only configurations of requested data sources are returned. */ + dataSourceIds?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page size. The default page size is the maximum value of 1000 results. */ + pageSize?: number; + /** + * Pagination token, which can be used to request a specific page + * of `ListTransfersRequest` list results. For multiple-page + * results, `ListTransfersResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + */ + pageToken?: string; + /** + * The BigQuery project id for which data sources + * should be returned: `projects/{project_id}`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates a data transfer configuration. + * All fields must be set, even if they are not updated. + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** + * Optional OAuth2 authorization code to use with this transfer configuration. + * If it is provided, the transfer configuration will be associated with the + * gaia id of the authorizing user. + * In order to obtain authorization_code, please make a + * request to + * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + * + * * client_id should be OAuth client_id of BigQuery DTS API for the given + * data source returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources method. + * * redirect_uri is an optional parameter. If not specified, then + * authorization code is posted to the opener of authorization flow window. + * Otherwise it will be sent to the redirect uri. A special value of + * urn:ietf:wg:oauth:2.0:oob means that authorization code should be + * returned in the title bar of the browser, with the page text prompting + * the user to copy the code and paste it in the application. + */ + authorizationCode?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The resource name of the transfer config. + * Transfer config names have the form + * `projects/{project_id}/transferConfigs/{config_id}`. + * Where `config_id` is usually a uuid, even though it is not + * guaranteed or required. The name is ignored when creating a transfer + * config. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required list of fields to be updated in this request. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Creates transfer runs for a time range [range_start_time, range_end_time]. + * For each date - or whatever granularity the data source supports - in the + * range, one transfer run is created. + * Note that runs are created per UTC time in the time range. + */ + scheduleRuns(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Transfer configuration name in the form: + * `projects/{project_id}/transferConfigs/{config_id}`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + runs: RunsResource; + } + interface LocationsResource { + /** Get information about a location. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Resource name for the location. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists information about the supported locations for this service. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The standard list filter. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The resource that owns the locations collection, if applicable. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The standard list page size. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + dataSources: DataSourcesResource; + transferConfigs: TransferConfigsResource; + } + interface TransferLogsResource { + /** Returns user facing log messages for the data transfer run. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Message types to return. If not populated - INFO, WARNING and ERROR + * messages are returned. + */ + messageTypes?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page size. The default page size is the maximum value of 1000 results. */ + pageSize?: number; + /** + * Pagination token, which can be used to request a specific page + * of `ListTransferLogsRequest` list results. For multiple-page + * results, `ListTransferLogsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + */ + pageToken?: string; + /** + * Transfer run name in the form: + * `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface RunsResource { + /** Deletes the specified transfer run. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Returns information about the particular transfer run. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Returns information about running and completed jobs. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page size. The default page size is the maximum value of 1000 results. */ + pageSize?: number; + /** + * Pagination token, which can be used to request a specific page + * of `ListTransferRunsRequest` list results. For multiple-page + * results, `ListTransferRunsResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + */ + pageToken?: string; + /** + * Name of transfer configuration for which transfer runs should be retrieved. + * Format of transfer configuration resource name is: + * `projects/{project_id}/transferConfigs/{config_id}`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Indicates how run attempts are to be pulled. */ + runAttempt?: string; + /** When specified, only transfer runs with requested states are returned. */ + states?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + transferLogs: TransferLogsResource; + } + interface TransferConfigsResource { + /** Creates a new data transfer configuration. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** + * Optional OAuth2 authorization code to use with this transfer configuration. + * This is required if new credentials are needed, as indicated by + * `CheckValidCreds`. + * In order to obtain authorization_code, please make a + * request to + * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + * + * * client_id should be OAuth client_id of BigQuery DTS API for the given + * data source returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources method. + * * redirect_uri is an optional parameter. If not specified, then + * authorization code is posted to the opener of authorization flow window. + * Otherwise it will be sent to the redirect uri. A special value of + * urn:ietf:wg:oauth:2.0:oob means that authorization code should be + * returned in the title bar of the browser, with the page text prompting + * the user to copy the code and paste it in the application. + */ + authorizationCode?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The BigQuery project id where the transfer configuration should be created. + * Must be in the format /projects/{project_id}/locations/{location_id} + * or + * /projects/{project_id}/locations/- + * In case when '-' is specified as location_id, location is infered from + * the destination dataset region. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes a data transfer configuration, + * including any associated transfer runs and logs. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Returns information about a data transfer config. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The field will contain name of the resource requested, for example: + * `projects/{project_id}/transferConfigs/{config_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Returns information about all data transfers in the project. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** When specified, only configurations of requested data sources are returned. */ + dataSourceIds?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Page size. The default page size is the maximum value of 1000 results. */ + pageSize?: number; + /** + * Pagination token, which can be used to request a specific page + * of `ListTransfersRequest` list results. For multiple-page + * results, `ListTransfersResponse` outputs + * a `next_page` token, which can be used as the + * `page_token` value to request the next page of list results. + */ + pageToken?: string; + /** + * The BigQuery project id for which data sources + * should be returned: `projects/{project_id}`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates a data transfer configuration. + * All fields must be set, even if they are not updated. + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** + * Optional OAuth2 authorization code to use with this transfer configuration. + * If it is provided, the transfer configuration will be associated with the + * gaia id of the authorizing user. + * In order to obtain authorization_code, please make a + * request to + * https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + * + * * client_id should be OAuth client_id of BigQuery DTS API for the given + * data source returned by ListDataSources method. + * * data_source_scopes are the scopes returned by ListDataSources method. + * * redirect_uri is an optional parameter. If not specified, then + * authorization code is posted to the opener of authorization flow window. + * Otherwise it will be sent to the redirect uri. A special value of + * urn:ietf:wg:oauth:2.0:oob means that authorization code should be + * returned in the title bar of the browser, with the page text prompting + * the user to copy the code and paste it in the application. + */ + authorizationCode?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The resource name of the transfer config. + * Transfer config names have the form + * `projects/{project_id}/transferConfigs/{config_id}`. + * Where `config_id` is usually a uuid, even though it is not + * guaranteed or required. The name is ignored when creating a transfer + * config. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required list of fields to be updated in this request. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Creates transfer runs for a time range [range_start_time, range_end_time]. + * For each date - or whatever granularity the data source supports - in the + * range, one transfer run is created. + * Note that runs are created per UTC time in the time range. + */ + scheduleRuns(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Transfer configuration name in the form: + * `projects/{project_id}/transferConfigs/{config_id}`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + runs: RunsResource; + } + interface ProjectsResource { + dataSources: DataSourcesResource; + locations: LocationsResource; + transferConfigs: TransferConfigsResource; + } + } +} diff --git a/types/gapi.client.bigquerydatatransfer/readme.md b/types/gapi.client.bigquerydatatransfer/readme.md new file mode 100644 index 0000000000..539a25cecc --- /dev/null +++ b/types/gapi.client.bigquerydatatransfer/readme.md @@ -0,0 +1,60 @@ +# TypeScript typings for BigQuery Data Transfer API v1 +Transfers data from partner SaaS applications to Google BigQuery on a scheduled, managed basis. +For detailed description please check [documentation](https://cloud.google.com/bigquery/). + +## Installing + +Install typings for BigQuery Data Transfer API: +``` +npm install @types/gapi.client.bigquerydatatransfer@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('bigquerydatatransfer', 'v1', () => { + // now we can use gapi.client.bigquerydatatransfer + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data in Google BigQuery + 'https://www.googleapis.com/auth/bigquery', + + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use BigQuery Data Transfer API resources: + +```typescript +``` \ No newline at end of file diff --git a/types/gapi.client.bigquerydatatransfer/tsconfig.json b/types/gapi.client.bigquerydatatransfer/tsconfig.json new file mode 100644 index 0000000000..312df37f3f --- /dev/null +++ b/types/gapi.client.bigquerydatatransfer/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.bigquerydatatransfer-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.bigquerydatatransfer/tslint.json b/types/gapi.client.bigquerydatatransfer/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.bigquerydatatransfer/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.blogger/gapi.client.blogger-tests.ts b/types/gapi.client.blogger/gapi.client.blogger-tests.ts new file mode 100644 index 0000000000..09f3da8912 --- /dev/null +++ b/types/gapi.client.blogger/gapi.client.blogger-tests.ts @@ -0,0 +1,277 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('blogger', 'v3', () => { + /** now we can use gapi.client.blogger */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** Manage your Blogger account */ + 'https://www.googleapis.com/auth/blogger', + /** View your Blogger account */ + 'https://www.googleapis.com/auth/blogger.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Gets one blog and user info pair by blogId and userId. */ + await gapi.client.blogUserInfos.get({ + blogId: "blogId", + maxPosts: 2, + userId: "userId", + }); + /** Gets one blog by ID. */ + await gapi.client.blogs.get({ + blogId: "blogId", + maxPosts: 2, + view: "view", + }); + /** Retrieve a Blog by URL. */ + await gapi.client.blogs.getByUrl({ + url: "url", + view: "view", + }); + /** Retrieves a list of blogs, possibly filtered. */ + await gapi.client.blogs.listByUser({ + fetchUserInfo: true, + role: "role", + status: "status", + userId: "userId", + view: "view", + }); + /** Marks a comment as not spam. */ + await gapi.client.comments.approve({ + blogId: "blogId", + commentId: "commentId", + postId: "postId", + }); + /** Delete a comment by ID. */ + await gapi.client.comments.delete({ + blogId: "blogId", + commentId: "commentId", + postId: "postId", + }); + /** Gets one comment by ID. */ + await gapi.client.comments.get({ + blogId: "blogId", + commentId: "commentId", + postId: "postId", + view: "view", + }); + /** Retrieves the comments for a post, possibly filtered. */ + await gapi.client.comments.list({ + blogId: "blogId", + endDate: "endDate", + fetchBodies: true, + maxResults: 4, + pageToken: "pageToken", + postId: "postId", + startDate: "startDate", + status: "status", + view: "view", + }); + /** Retrieves the comments for a blog, across all posts, possibly filtered. */ + await gapi.client.comments.listByBlog({ + blogId: "blogId", + endDate: "endDate", + fetchBodies: true, + maxResults: 4, + pageToken: "pageToken", + startDate: "startDate", + status: "status", + }); + /** Marks a comment as spam. */ + await gapi.client.comments.markAsSpam({ + blogId: "blogId", + commentId: "commentId", + postId: "postId", + }); + /** Removes the content of a comment. */ + await gapi.client.comments.removeContent({ + blogId: "blogId", + commentId: "commentId", + postId: "postId", + }); + /** Retrieve pageview stats for a Blog. */ + await gapi.client.pageViews.get({ + blogId: "blogId", + range: "range", + }); + /** Delete a page by ID. */ + await gapi.client.pages.delete({ + blogId: "blogId", + pageId: "pageId", + }); + /** Gets one blog page by ID. */ + await gapi.client.pages.get({ + blogId: "blogId", + pageId: "pageId", + view: "view", + }); + /** Add a page. */ + await gapi.client.pages.insert({ + blogId: "blogId", + isDraft: true, + }); + /** Retrieves the pages for a blog, optionally including non-LIVE statuses. */ + await gapi.client.pages.list({ + blogId: "blogId", + fetchBodies: true, + maxResults: 3, + pageToken: "pageToken", + status: "status", + view: "view", + }); + /** Update a page. This method supports patch semantics. */ + await gapi.client.pages.patch({ + blogId: "blogId", + pageId: "pageId", + publish: true, + revert: true, + }); + /** Publishes a draft page. */ + await gapi.client.pages.publish({ + blogId: "blogId", + pageId: "pageId", + }); + /** Revert a published or scheduled page to draft state. */ + await gapi.client.pages.revert({ + blogId: "blogId", + pageId: "pageId", + }); + /** Update a page. */ + await gapi.client.pages.update({ + blogId: "blogId", + pageId: "pageId", + publish: true, + revert: true, + }); + /** + * Gets one post and user info pair, by post ID and user ID. The post user info contains per-user information about the post, such as access rights, + * specific to the user. + */ + await gapi.client.postUserInfos.get({ + blogId: "blogId", + maxComments: 2, + postId: "postId", + userId: "userId", + }); + /** + * Retrieves a list of post and post user info pairs, possibly filtered. The post user info contains per-user information about the post, such as access + * rights, specific to the user. + */ + await gapi.client.postUserInfos.list({ + blogId: "blogId", + endDate: "endDate", + fetchBodies: true, + labels: "labels", + maxResults: 5, + orderBy: "orderBy", + pageToken: "pageToken", + startDate: "startDate", + status: "status", + userId: "userId", + view: "view", + }); + /** Delete a post by ID. */ + await gapi.client.posts.delete({ + blogId: "blogId", + postId: "postId", + }); + /** Get a post by ID. */ + await gapi.client.posts.get({ + blogId: "blogId", + fetchBody: true, + fetchImages: true, + maxComments: 4, + postId: "postId", + view: "view", + }); + /** Retrieve a Post by Path. */ + await gapi.client.posts.getByPath({ + blogId: "blogId", + maxComments: 2, + path: "path", + view: "view", + }); + /** Add a post. */ + await gapi.client.posts.insert({ + blogId: "blogId", + fetchBody: true, + fetchImages: true, + isDraft: true, + }); + /** Retrieves a list of posts, possibly filtered. */ + await gapi.client.posts.list({ + blogId: "blogId", + endDate: "endDate", + fetchBodies: true, + fetchImages: true, + labels: "labels", + maxResults: 6, + orderBy: "orderBy", + pageToken: "pageToken", + startDate: "startDate", + status: "status", + view: "view", + }); + /** Update a post. This method supports patch semantics. */ + await gapi.client.posts.patch({ + blogId: "blogId", + fetchBody: true, + fetchImages: true, + maxComments: 4, + postId: "postId", + publish: true, + revert: true, + }); + /** Publishes a draft post, optionally at the specific time of the given publishDate parameter. */ + await gapi.client.posts.publish({ + blogId: "blogId", + postId: "postId", + publishDate: "publishDate", + }); + /** Revert a published or scheduled post to draft state. */ + await gapi.client.posts.revert({ + blogId: "blogId", + postId: "postId", + }); + /** Search for a post. */ + await gapi.client.posts.search({ + blogId: "blogId", + fetchBodies: true, + orderBy: "orderBy", + q: "q", + }); + /** Update a post. */ + await gapi.client.posts.update({ + blogId: "blogId", + fetchBody: true, + fetchImages: true, + maxComments: 4, + postId: "postId", + publish: true, + revert: true, + }); + /** Gets one user by ID. */ + await gapi.client.users.get({ + userId: "userId", + }); + } +}); diff --git a/types/gapi.client.blogger/index.d.ts b/types/gapi.client.blogger/index.d.ts new file mode 100644 index 0000000000..85240dfee5 --- /dev/null +++ b/types/gapi.client.blogger/index.d.ts @@ -0,0 +1,1346 @@ +// Type definitions for Google Blogger API v3 3.0 +// Project: https://developers.google.com/blogger/docs/3.0/getting_started +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/blogger/v3/rest + +/// + +declare namespace gapi.client { + /** Load Blogger API v3 */ + function load(name: "blogger", version: "v3"): PromiseLike; + function load(name: "blogger", version: "v3", callback: () => any): void; + + const blogUserInfos: blogger.BlogUserInfosResource; + + const blogs: blogger.BlogsResource; + + const comments: blogger.CommentsResource; + + const pageViews: blogger.PageViewsResource; + + const pages: blogger.PagesResource; + + const postUserInfos: blogger.PostUserInfosResource; + + const posts: blogger.PostsResource; + + const users: blogger.UsersResource; + + namespace blogger { + interface Blog { + /** The JSON custom meta-data for the Blog */ + customMetaData?: string; + /** The description of this blog. This is displayed underneath the title. */ + description?: string; + /** The identifier for this resource. */ + id?: string; + /** The kind of this entry. Always blogger#blog */ + kind?: string; + /** The locale this Blog is set to. */ + locale?: { + /** The country this blog's locale is set to. */ + country?: string; + /** The language this blog is authored in. */ + language?: string; + /** The language variant this blog is authored in. */ + variant?: string; + }; + /** The name of this blog. This is displayed as the title. */ + name?: string; + /** The container of pages in this blog. */ + pages?: { + /** The URL of the container for pages in this blog. */ + selfLink?: string; + /** The count of pages in this blog. */ + totalItems?: number; + }; + /** The container of posts in this blog. */ + posts?: { + /** The List of Posts for this Blog. */ + items?: Post[]; + /** The URL of the container for posts in this blog. */ + selfLink?: string; + /** The count of posts in this blog. */ + totalItems?: number; + }; + /** RFC 3339 date-time when this blog was published. */ + published?: string; + /** The API REST URL to fetch this resource from. */ + selfLink?: string; + /** The status of the blog. */ + status?: string; + /** RFC 3339 date-time when this blog was last updated. */ + updated?: string; + /** The URL where this blog is published. */ + url?: string; + } + interface BlogList { + /** Admin level list of blog per-user information */ + blogUserInfos?: BlogUserInfo[]; + /** The list of Blogs this user has Authorship or Admin rights over. */ + items?: Blog[]; + /** The kind of this entity. Always blogger#blogList */ + kind?: string; + } + interface BlogPerUserInfo { + /** ID of the Blog resource */ + blogId?: string; + /** True if the user has Admin level access to the blog. */ + hasAdminAccess?: boolean; + /** The kind of this entity. Always blogger#blogPerUserInfo */ + kind?: string; + /** The Photo Album Key for the user when adding photos to the blog */ + photosAlbumKey?: string; + /** Access permissions that the user has for the blog (ADMIN, AUTHOR, or READER). */ + role?: string; + /** ID of the User */ + userId?: string; + } + interface BlogUserInfo { + /** The Blog resource. */ + blog?: Blog; + /** Information about a User for the Blog. */ + blog_user_info?: BlogPerUserInfo; + /** The kind of this entity. Always blogger#blogUserInfo */ + kind?: string; + } + interface Comment { + /** The author of this Comment. */ + author?: { + /** The display name. */ + displayName?: string; + /** The identifier of the Comment creator. */ + id?: string; + /** The comment creator's avatar. */ + image?: { + /** The comment creator's avatar URL. */ + url?: string; + }; + /** The URL of the Comment creator's Profile page. */ + url?: string; + }; + /** Data about the blog containing this comment. */ + blog?: { + /** The identifier of the blog containing this comment. */ + id?: string; + }; + /** The actual content of the comment. May include HTML markup. */ + content?: string; + /** The identifier for this resource. */ + id?: string; + /** Data about the comment this is in reply to. */ + inReplyTo?: { + /** The identified of the parent of this comment. */ + id?: string; + }; + /** The kind of this entry. Always blogger#comment */ + kind?: string; + /** Data about the post containing this comment. */ + post?: { + /** The identifier of the post containing this comment. */ + id?: string; + }; + /** RFC 3339 date-time when this comment was published. */ + published?: string; + /** The API REST URL to fetch this resource from. */ + selfLink?: string; + /** The status of the comment (only populated for admin users) */ + status?: string; + /** RFC 3339 date-time when this comment was last updated. */ + updated?: string; + } + interface CommentList { + /** Etag of the response. */ + etag?: string; + /** The List of Comments for a Post. */ + items?: Comment[]; + /** The kind of this entry. Always blogger#commentList */ + kind?: string; + /** Pagination token to fetch the next page, if one exists. */ + nextPageToken?: string; + /** Pagination token to fetch the previous page, if one exists. */ + prevPageToken?: string; + } + interface Page { + /** The author of this Page. */ + author?: { + /** The display name. */ + displayName?: string; + /** The identifier of the Page creator. */ + id?: string; + /** The page author's avatar. */ + image?: { + /** The page author's avatar URL. */ + url?: string; + }; + /** The URL of the Page creator's Profile page. */ + url?: string; + }; + /** Data about the blog containing this Page. */ + blog?: { + /** The identifier of the blog containing this page. */ + id?: string; + }; + /** The body content of this Page, in HTML. */ + content?: string; + /** Etag of the resource. */ + etag?: string; + /** The identifier for this resource. */ + id?: string; + /** The kind of this entity. Always blogger#page */ + kind?: string; + /** RFC 3339 date-time when this Page was published. */ + published?: string; + /** The API REST URL to fetch this resource from. */ + selfLink?: string; + /** The status of the page for admin resources (either LIVE or DRAFT). */ + status?: string; + /** The title of this entity. This is the name displayed in the Admin user interface. */ + title?: string; + /** RFC 3339 date-time when this Page was last updated. */ + updated?: string; + /** The URL that this Page is displayed at. */ + url?: string; + } + interface PageList { + /** Etag of the response. */ + etag?: string; + /** The list of Pages for a Blog. */ + items?: Page[]; + /** The kind of this entity. Always blogger#pageList */ + kind?: string; + /** Pagination token to fetch the next page, if one exists. */ + nextPageToken?: string; + } + interface Pageviews { + /** Blog Id */ + blogId?: string; + /** The container of posts in this blog. */ + counts?: Array<{ + /** Count of page views for the given time range */ + count?: string; + /** Time range the given count applies to */ + timeRange?: string; + }>; + /** The kind of this entry. Always blogger#page_views */ + kind?: string; + } + interface Post { + /** The author of this Post. */ + author?: { + /** The display name. */ + displayName?: string; + /** The identifier of the Post creator. */ + id?: string; + /** The Post author's avatar. */ + image?: { + /** The Post author's avatar URL. */ + url?: string; + }; + /** The URL of the Post creator's Profile page. */ + url?: string; + }; + /** Data about the blog containing this Post. */ + blog?: { + /** The identifier of the Blog that contains this Post. */ + id?: string; + }; + /** The content of the Post. May contain HTML markup. */ + content?: string; + /** The JSON meta-data for the Post. */ + customMetaData?: string; + /** Etag of the resource. */ + etag?: string; + /** The identifier of this Post. */ + id?: string; + /** Display image for the Post. */ + images?: Array<{ + url?: string; + }>; + /** The kind of this entity. Always blogger#post */ + kind?: string; + /** The list of labels this Post was tagged with. */ + labels?: string[]; + /** The location for geotagged posts. */ + location?: { + /** Location's latitude. */ + lat?: number; + /** Location's longitude. */ + lng?: number; + /** Location name. */ + name?: string; + /** Location's viewport span. Can be used when rendering a map preview. */ + span?: string; + }; + /** RFC 3339 date-time when this Post was published. */ + published?: string; + /** Comment control and display setting for readers of this post. */ + readerComments?: string; + /** The container of comments on this Post. */ + replies?: { + /** The List of Comments for this Post. */ + items?: Comment[]; + /** The URL of the comments on this post. */ + selfLink?: string; + /** The count of comments on this post. */ + totalItems?: string; + }; + /** The API REST URL to fetch this resource from. */ + selfLink?: string; + /** Status of the post. Only set for admin-level requests */ + status?: string; + /** The title of the Post. */ + title?: string; + /** The title link URL, similar to atom's related link. */ + titleLink?: string; + /** RFC 3339 date-time when this Post was last updated. */ + updated?: string; + /** The URL where this Post is displayed. */ + url?: string; + } + interface PostList { + /** Etag of the response. */ + etag?: string; + /** The list of Posts for this Blog. */ + items?: Post[]; + /** The kind of this entity. Always blogger#postList */ + kind?: string; + /** Pagination token to fetch the next page, if one exists. */ + nextPageToken?: string; + } + interface PostPerUserInfo { + /** ID of the Blog that the post resource belongs to. */ + blogId?: string; + /** True if the user has Author level access to the post. */ + hasEditAccess?: boolean; + /** The kind of this entity. Always blogger#postPerUserInfo */ + kind?: string; + /** ID of the Post resource. */ + postId?: string; + /** ID of the User. */ + userId?: string; + } + interface PostUserInfo { + /** The kind of this entity. Always blogger#postUserInfo */ + kind?: string; + /** The Post resource. */ + post?: Post; + /** Information about a User for the Post. */ + post_user_info?: PostPerUserInfo; + } + interface PostUserInfosList { + /** The list of Posts with User information for the post, for this Blog. */ + items?: PostUserInfo[]; + /** The kind of this entity. Always blogger#postList */ + kind?: string; + /** Pagination token to fetch the next page, if one exists. */ + nextPageToken?: string; + } + interface User { + /** Profile summary information. */ + about?: string; + /** The container of blogs for this user. */ + blogs?: { + /** The URL of the Blogs for this user. */ + selfLink?: string; + }; + /** The timestamp of when this profile was created, in seconds since epoch. */ + created?: string; + /** The display name. */ + displayName?: string; + /** The identifier for this User. */ + id?: string; + /** The kind of this entity. Always blogger#user */ + kind?: string; + /** This user's locale */ + locale?: { + /** The user's country setting. */ + country?: string; + /** The user's language setting. */ + language?: string; + /** The user's language variant setting. */ + variant?: string; + }; + /** The API REST URL to fetch this resource from. */ + selfLink?: string; + /** The user's profile page. */ + url?: string; + } + interface BlogUserInfosResource { + /** Gets one blog and user info pair by blogId and userId. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the blog to get. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of posts to pull back with the blog. */ + maxPosts?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface BlogsResource { + /** Gets one blog by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the blog to get. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of posts to pull back with the blog. */ + maxPosts?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Access level with which to view the blog. Note that some fields require elevated access. */ + view?: string; + }): Request; + /** Retrieve a Blog by URL. */ + getByUrl(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The URL of the blog to retrieve. */ + url: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Access level with which to view the blog. Note that some fields require elevated access. */ + view?: string; + }): Request; + /** Retrieves a list of blogs, possibly filtered. */ + listByUser(request: { + /** Data format for the response. */ + alt?: string; + /** Whether the response is a list of blogs with per-user information instead of just blogs. */ + fetchUserInfo?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * User access types for blogs to include in the results, e.g. AUTHOR will return blogs where the user has author level access. If no roles are specified, + * defaults to ADMIN and AUTHOR roles. + */ + role?: string; + /** Blog statuses to include in the result (default: Live blogs only). Note that ADMIN access is required to view deleted blogs. */ + status?: string; + /** ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Access level with which to view the blogs. Note that some fields require elevated access. */ + view?: string; + }): Request; + } + interface CommentsResource { + /** Marks a comment as not spam. */ + approve(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the Blog. */ + blogId: string; + /** The ID of the comment to mark as not spam. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the Post. */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Delete a comment by ID. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the Blog. */ + blogId: string; + /** The ID of the comment to delete. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the Post. */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets one comment by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** ID of the blog to containing the comment. */ + blogId: string; + /** The ID of the comment to get. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** ID of the post to fetch posts from. */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** + * Access level for the requested comment (default: READER). Note that some comments will require elevated permissions, for example comments where the + * parent posts which is in a draft state, or comments that are pending moderation. + */ + view?: string; + }): Request; + /** Retrieves the comments for a post, possibly filtered. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** ID of the blog to fetch comments from. */ + blogId: string; + /** Latest date of comment to fetch, a date-time with RFC 3339 formatting. */ + endDate?: string; + /** Whether the body content of the comments is included. */ + fetchBodies?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of comments to include in the result. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Continuation token if request is paged. */ + pageToken?: string; + /** ID of the post to fetch posts from. */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Earliest date of comment to fetch, a date-time with RFC 3339 formatting. */ + startDate?: string; + status?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Access level with which to view the returned result. Note that some fields require elevated access. */ + view?: string; + }): Request; + /** Retrieves the comments for a blog, across all posts, possibly filtered. */ + listByBlog(request: { + /** Data format for the response. */ + alt?: string; + /** ID of the blog to fetch comments from. */ + blogId: string; + /** Latest date of comment to fetch, a date-time with RFC 3339 formatting. */ + endDate?: string; + /** Whether the body content of the comments is included. */ + fetchBodies?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of comments to include in the result. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Continuation token if request is paged. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Earliest date of comment to fetch, a date-time with RFC 3339 formatting. */ + startDate?: string; + status?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Marks a comment as spam. */ + markAsSpam(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the Blog. */ + blogId: string; + /** The ID of the comment to mark as spam. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the Post. */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Removes the content of a comment. */ + removeContent(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the Blog. */ + blogId: string; + /** The ID of the comment to delete content from. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the Post. */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PageViewsResource { + /** Retrieve pageview stats for a Blog. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the blog to get. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + range?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PagesResource { + /** Delete a page by ID. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the Blog. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the Page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets one blog page by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** ID of the blog containing the page. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page to get. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + view?: string; + }): Request; + /** Add a page. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** ID of the blog to add the page to. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Whether to create the page as a draft (default: false). */ + isDraft?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the pages for a blog, optionally including non-LIVE statuses. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** ID of the blog to fetch Pages from. */ + blogId: string; + /** Whether to retrieve the Page bodies. */ + fetchBodies?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of Pages to fetch. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Continuation token if the request is paged. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + status?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Access level with which to view the returned result. Note that some fields require elevated access. */ + view?: string; + }): Request; + /** Update a page. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the Blog. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the Page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Whether a publish action should be performed when the page is updated (default: false). */ + publish?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether a revert action should be performed when the page is updated (default: false). */ + revert?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Publishes a draft page. */ + publish(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the blog. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Revert a published or scheduled page to draft state. */ + revert(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the blog. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Update a page. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the Blog. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the Page. */ + pageId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Whether a publish action should be performed when the page is updated (default: false). */ + publish?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether a revert action should be performed when the page is updated (default: false). */ + revert?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PostUserInfosResource { + /** + * Gets one post and user info pair, by post ID and user ID. The post user info contains per-user information about the post, such as access rights, + * specific to the user. + */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the blog. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of comments to pull back on a post. */ + maxComments?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the post to get. */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Retrieves a list of post and post user info pairs, possibly filtered. The post user info contains per-user information about the post, such as access + * rights, specific to the user. + */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** ID of the blog to fetch posts from. */ + blogId: string; + /** Latest post date to fetch, a date-time with RFC 3339 formatting. */ + endDate?: string; + /** Whether the body content of posts is included. Default is false. */ + fetchBodies?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Comma-separated list of labels to search for. */ + labels?: string; + /** Maximum number of posts to fetch. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Sort order applied to search results. Default is published. */ + orderBy?: string; + /** Continuation token if the request is paged. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Earliest post date to fetch, a date-time with RFC 3339 formatting. */ + startDate?: string; + status?: string; + /** ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Access level with which to view the returned result. Note that some fields require elevated access. */ + view?: string; + }): Request; + } + interface PostsResource { + /** Delete a post by ID. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the Blog. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the Post. */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Get a post by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** ID of the blog to fetch the post from. */ + blogId: string; + /** + * Whether the body content of the post is included (default: true). This should be set to false when the post bodies are not required, to help minimize + * traffic. + */ + fetchBody?: boolean; + /** Whether image URL metadata for each post is included (default: false). */ + fetchImages?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of comments to pull back on a post. */ + maxComments?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the post */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Access level with which to view the returned result. Note that some fields require elevated access. */ + view?: string; + }): Request; + /** Retrieve a Post by Path. */ + getByPath(request: { + /** Data format for the response. */ + alt?: string; + /** ID of the blog to fetch the post from. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of comments to pull back on a post. */ + maxComments?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Path of the Post to retrieve. */ + path: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Access level with which to view the returned result. Note that some fields require elevated access. */ + view?: string; + }): Request; + /** Add a post. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** ID of the blog to add the post to. */ + blogId: string; + /** Whether the body content of the post is included with the result (default: true). */ + fetchBody?: boolean; + /** Whether image URL metadata for each post is included in the returned result (default: false). */ + fetchImages?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Whether to create the post as a draft (default: false). */ + isDraft?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of posts, possibly filtered. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** ID of the blog to fetch posts from. */ + blogId: string; + /** Latest post date to fetch, a date-time with RFC 3339 formatting. */ + endDate?: string; + /** + * Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize + * traffic. + */ + fetchBodies?: boolean; + /** Whether image URL metadata for each post is included. */ + fetchImages?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Comma-separated list of labels to search for. */ + labels?: string; + /** Maximum number of posts to fetch. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Sort search results */ + orderBy?: string; + /** Continuation token if the request is paged. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Earliest post date to fetch, a date-time with RFC 3339 formatting. */ + startDate?: string; + /** Statuses to include in the results. */ + status?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Access level with which to view the returned result. Note that some fields require escalated access. */ + view?: string; + }): Request; + /** Update a post. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the Blog. */ + blogId: string; + /** Whether the body content of the post is included with the result (default: true). */ + fetchBody?: boolean; + /** Whether image URL metadata for each post is included in the returned result (default: false). */ + fetchImages?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of comments to retrieve with the returned post. */ + maxComments?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the Post. */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Whether a publish action should be performed when the post is updated (default: false). */ + publish?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether a revert action should be performed when the post is updated (default: false). */ + revert?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Publishes a draft post, optionally at the specific time of the given publishDate parameter. */ + publish(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the Blog. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the Post. */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Optional date and time to schedule the publishing of the Blog. If no publishDate parameter is given, the post is either published at the a previously + * saved schedule date (if present), or the current time. If a future date is given, the post will be scheduled to be published. + */ + publishDate?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Revert a published or scheduled post to draft state. */ + revert(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the Blog. */ + blogId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the Post. */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Search for a post. */ + search(request: { + /** Data format for the response. */ + alt?: string; + /** ID of the blog to fetch the post from. */ + blogId: string; + /** + * Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize + * traffic. + */ + fetchBodies?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Sort search results */ + orderBy?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Query terms to search this blog for matching posts. */ + q: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Update a post. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the Blog. */ + blogId: string; + /** Whether the body content of the post is included with the result (default: true). */ + fetchBody?: boolean; + /** Whether image URL metadata for each post is included in the returned result (default: false). */ + fetchImages?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of comments to retrieve with the returned post. */ + maxComments?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the Post. */ + postId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Whether a publish action should be performed when the post is updated (default: false). */ + publish?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether a revert action should be performed when the post is updated (default: false). */ + revert?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UsersResource { + /** Gets one user by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the user to get. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.blogger/readme.md b/types/gapi.client.blogger/readme.md new file mode 100644 index 0000000000..7356d1e034 --- /dev/null +++ b/types/gapi.client.blogger/readme.md @@ -0,0 +1,222 @@ +# TypeScript typings for Blogger API v3 +API for access to the data within Blogger. +For detailed description please check [documentation](https://developers.google.com/blogger/docs/3.0/getting_started). + +## Installing + +Install typings for Blogger API: +``` +npm install @types/gapi.client.blogger@v3 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('blogger', 'v3', () => { + // now we can use gapi.client.blogger + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // Manage your Blogger account + 'https://www.googleapis.com/auth/blogger', + + // View your Blogger account + 'https://www.googleapis.com/auth/blogger.readonly', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Blogger API resources: + +```typescript + +/* +Gets one blog and user info pair by blogId and userId. +*/ +await gapi.client.blogUserInfos.get({ blogId: "blogId", userId: "userId", }); + +/* +Gets one blog by ID. +*/ +await gapi.client.blogs.get({ blogId: "blogId", }); + +/* +Retrieve a Blog by URL. +*/ +await gapi.client.blogs.getByUrl({ url: "url", }); + +/* +Retrieves a list of blogs, possibly filtered. +*/ +await gapi.client.blogs.listByUser({ userId: "userId", }); + +/* +Marks a comment as not spam. +*/ +await gapi.client.comments.approve({ blogId: "blogId", commentId: "commentId", postId: "postId", }); + +/* +Delete a comment by ID. +*/ +await gapi.client.comments.delete({ blogId: "blogId", commentId: "commentId", postId: "postId", }); + +/* +Gets one comment by ID. +*/ +await gapi.client.comments.get({ blogId: "blogId", commentId: "commentId", postId: "postId", }); + +/* +Retrieves the comments for a post, possibly filtered. +*/ +await gapi.client.comments.list({ blogId: "blogId", postId: "postId", }); + +/* +Retrieves the comments for a blog, across all posts, possibly filtered. +*/ +await gapi.client.comments.listByBlog({ blogId: "blogId", }); + +/* +Marks a comment as spam. +*/ +await gapi.client.comments.markAsSpam({ blogId: "blogId", commentId: "commentId", postId: "postId", }); + +/* +Removes the content of a comment. +*/ +await gapi.client.comments.removeContent({ blogId: "blogId", commentId: "commentId", postId: "postId", }); + +/* +Retrieve pageview stats for a Blog. +*/ +await gapi.client.pageViews.get({ blogId: "blogId", }); + +/* +Delete a page by ID. +*/ +await gapi.client.pages.delete({ blogId: "blogId", pageId: "pageId", }); + +/* +Gets one blog page by ID. +*/ +await gapi.client.pages.get({ blogId: "blogId", pageId: "pageId", }); + +/* +Add a page. +*/ +await gapi.client.pages.insert({ blogId: "blogId", }); + +/* +Retrieves the pages for a blog, optionally including non-LIVE statuses. +*/ +await gapi.client.pages.list({ blogId: "blogId", }); + +/* +Update a page. This method supports patch semantics. +*/ +await gapi.client.pages.patch({ blogId: "blogId", pageId: "pageId", }); + +/* +Publishes a draft page. +*/ +await gapi.client.pages.publish({ blogId: "blogId", pageId: "pageId", }); + +/* +Revert a published or scheduled page to draft state. +*/ +await gapi.client.pages.revert({ blogId: "blogId", pageId: "pageId", }); + +/* +Update a page. +*/ +await gapi.client.pages.update({ blogId: "blogId", pageId: "pageId", }); + +/* +Gets one post and user info pair, by post ID and user ID. The post user info contains per-user information about the post, such as access rights, specific to the user. +*/ +await gapi.client.postUserInfos.get({ blogId: "blogId", postId: "postId", userId: "userId", }); + +/* +Retrieves a list of post and post user info pairs, possibly filtered. The post user info contains per-user information about the post, such as access rights, specific to the user. +*/ +await gapi.client.postUserInfos.list({ blogId: "blogId", userId: "userId", }); + +/* +Delete a post by ID. +*/ +await gapi.client.posts.delete({ blogId: "blogId", postId: "postId", }); + +/* +Get a post by ID. +*/ +await gapi.client.posts.get({ blogId: "blogId", postId: "postId", }); + +/* +Retrieve a Post by Path. +*/ +await gapi.client.posts.getByPath({ blogId: "blogId", path: "path", }); + +/* +Add a post. +*/ +await gapi.client.posts.insert({ blogId: "blogId", }); + +/* +Retrieves a list of posts, possibly filtered. +*/ +await gapi.client.posts.list({ blogId: "blogId", }); + +/* +Update a post. This method supports patch semantics. +*/ +await gapi.client.posts.patch({ blogId: "blogId", postId: "postId", }); + +/* +Publishes a draft post, optionally at the specific time of the given publishDate parameter. +*/ +await gapi.client.posts.publish({ blogId: "blogId", postId: "postId", }); + +/* +Revert a published or scheduled post to draft state. +*/ +await gapi.client.posts.revert({ blogId: "blogId", postId: "postId", }); + +/* +Search for a post. +*/ +await gapi.client.posts.search({ blogId: "blogId", q: "q", }); + +/* +Update a post. +*/ +await gapi.client.posts.update({ blogId: "blogId", postId: "postId", }); + +/* +Gets one user by ID. +*/ +await gapi.client.users.get({ userId: "userId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.blogger/tsconfig.json b/types/gapi.client.blogger/tsconfig.json new file mode 100644 index 0000000000..1b5be0ad2b --- /dev/null +++ b/types/gapi.client.blogger/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.blogger-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.blogger/tslint.json b/types/gapi.client.blogger/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.blogger/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.books/gapi.client.books-tests.ts b/types/gapi.client.books/gapi.client.books-tests.ts new file mode 100644 index 0000000000..c7f57f61d7 --- /dev/null +++ b/types/gapi.client.books/gapi.client.books-tests.ts @@ -0,0 +1,193 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('books', 'v1', () => { + /** now we can use gapi.client.books */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** Manage your books */ + 'https://www.googleapis.com/auth/books', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Retrieves metadata for a specific bookshelf for the specified user. */ + await gapi.client.bookshelves.get({ + shelf: "shelf", + source: "source", + userId: "userId", + }); + /** Retrieves a list of public bookshelves for the specified user. */ + await gapi.client.bookshelves.list({ + source: "source", + userId: "userId", + }); + await gapi.client.cloudloading.addBook({ + drive_document_id: "drive_document_id", + mime_type: "mime_type", + name: "name", + upload_client_token: "upload_client_token", + }); + /** Remove the book and its contents */ + await gapi.client.cloudloading.deleteBook({ + volumeId: "volumeId", + }); + await gapi.client.cloudloading.updateBook({ + }); + /** Returns a list of offline dictionary metadata available */ + await gapi.client.dictionary.listOfflineMetadata({ + cpksver: "cpksver", + }); + /** Gets the layer summary for a volume. */ + await gapi.client.layers.get({ + contentVersion: "contentVersion", + source: "source", + summaryId: "summaryId", + volumeId: "volumeId", + }); + /** List the layer summaries for a volume. */ + await gapi.client.layers.list({ + contentVersion: "contentVersion", + maxResults: 2, + pageToken: "pageToken", + source: "source", + volumeId: "volumeId", + }); + /** Gets the current settings for the user. */ + await gapi.client.myconfig.getUserSettings({ + }); + /** Release downloaded content access restriction. */ + await gapi.client.myconfig.releaseDownloadAccess({ + cpksver: "cpksver", + locale: "locale", + source: "source", + volumeIds: "volumeIds", + }); + /** Request concurrent and download access restrictions. */ + await gapi.client.myconfig.requestAccess({ + cpksver: "cpksver", + licenseTypes: "licenseTypes", + locale: "locale", + nonce: "nonce", + source: "source", + volumeId: "volumeId", + }); + /** Request downloaded content access for specified volumes on the My eBooks shelf. */ + await gapi.client.myconfig.syncVolumeLicenses({ + cpksver: "cpksver", + features: "features", + includeNonComicsSeries: true, + locale: "locale", + nonce: "nonce", + showPreorders: true, + source: "source", + volumeIds: "volumeIds", + }); + /** + * Sets the settings for the user. If a sub-object is specified, it will overwrite the existing sub-object stored in the server. Unspecified sub-objects + * will retain the existing value. + */ + await gapi.client.myconfig.updateUserSettings({ + }); + /** Returns notification details for a given notification id. */ + await gapi.client.notification.get({ + locale: "locale", + notification_id: "notification_id", + source: "source", + }); + /** List categories for onboarding experience. */ + await gapi.client.onboarding.listCategories({ + locale: "locale", + }); + /** List available volumes under categories for onboarding experience. */ + await gapi.client.onboarding.listCategoryVolumes({ + categoryId: "categoryId", + locale: "locale", + maxAllowedMaturityRating: "maxAllowedMaturityRating", + pageSize: 4, + pageToken: "pageToken", + }); + /** Returns a stream of personalized book clusters */ + await gapi.client.personalizedstream.get({ + locale: "locale", + maxAllowedMaturityRating: "maxAllowedMaturityRating", + source: "source", + }); + await gapi.client.promooffer.accept({ + androidId: "androidId", + device: "device", + manufacturer: "manufacturer", + model: "model", + offerId: "offerId", + product: "product", + serial: "serial", + volumeId: "volumeId", + }); + await gapi.client.promooffer.dismiss({ + androidId: "androidId", + device: "device", + manufacturer: "manufacturer", + model: "model", + offerId: "offerId", + product: "product", + serial: "serial", + }); + /** Returns a list of promo offers available to the user */ + await gapi.client.promooffer.get({ + androidId: "androidId", + device: "device", + manufacturer: "manufacturer", + model: "model", + product: "product", + serial: "serial", + }); + /** Returns Series metadata for the given series ids. */ + await gapi.client.series.get({ + series_id: "series_id", + }); + /** Gets volume information for a single volume. */ + await gapi.client.volumes.get({ + country: "country", + includeNonComicsSeries: true, + partner: "partner", + projection: "projection", + source: "source", + user_library_consistent_read: true, + volumeId: "volumeId", + }); + /** Performs a book search. */ + await gapi.client.volumes.list({ + download: "download", + filter: "filter", + langRestrict: "langRestrict", + libraryRestrict: "libraryRestrict", + maxAllowedMaturityRating: "maxAllowedMaturityRating", + maxResults: 6, + orderBy: "orderBy", + partner: "partner", + printType: "printType", + projection: "projection", + q: "q", + showPreorders: true, + source: "source", + startIndex: 14, + }); + } +}); diff --git a/types/gapi.client.books/index.d.ts b/types/gapi.client.books/index.d.ts new file mode 100644 index 0000000000..e0ca0a63af --- /dev/null +++ b/types/gapi.client.books/index.d.ts @@ -0,0 +1,2447 @@ +// Type definitions for Google Books API v1 1.0 +// Project: https://developers.google.com/books/docs/v1/getting_started +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/books/v1/rest + +/// + +declare namespace gapi.client { + /** Load Books API v1 */ + function load(name: "books", version: "v1"): PromiseLike; + function load(name: "books", version: "v1", callback: () => any): void; + + const bookshelves: books.BookshelvesResource; + + const cloudloading: books.CloudloadingResource; + + const dictionary: books.DictionaryResource; + + const layers: books.LayersResource; + + const myconfig: books.MyconfigResource; + + const mylibrary: books.MylibraryResource; + + const notification: books.NotificationResource; + + const onboarding: books.OnboardingResource; + + const personalizedstream: books.PersonalizedstreamResource; + + const promooffer: books.PromoofferResource; + + const series: books.SeriesResource; + + const volumes: books.VolumesResource; + + namespace books { + interface Annotation { + /** Anchor text after excerpt. For requests, if the user bookmarked a screen that has no flowing text on it, then this field should be empty. */ + afterSelectedText?: string; + /** Anchor text before excerpt. For requests, if the user bookmarked a screen that has no flowing text on it, then this field should be empty. */ + beforeSelectedText?: string; + /** Selection ranges sent from the client. */ + clientVersionRanges?: { + /** Range in CFI format for this annotation sent by client. */ + cfiRange?: BooksAnnotationsRange; + /** Content version the client sent in. */ + contentVersion?: string; + /** Range in GB image format for this annotation sent by client. */ + gbImageRange?: BooksAnnotationsRange; + /** Range in GB text format for this annotation sent by client. */ + gbTextRange?: BooksAnnotationsRange; + /** Range in image CFI format for this annotation sent by client. */ + imageCfiRange?: BooksAnnotationsRange; + }; + /** Timestamp for the created time of this annotation. */ + created?: string; + /** Selection ranges for the most recent content version. */ + currentVersionRanges?: { + /** Range in CFI format for this annotation for version above. */ + cfiRange?: BooksAnnotationsRange; + /** Content version applicable to ranges below. */ + contentVersion?: string; + /** Range in GB image format for this annotation for version above. */ + gbImageRange?: BooksAnnotationsRange; + /** Range in GB text format for this annotation for version above. */ + gbTextRange?: BooksAnnotationsRange; + /** Range in image CFI format for this annotation for version above. */ + imageCfiRange?: BooksAnnotationsRange; + }; + /** User-created data for this annotation. */ + data?: string; + /** Indicates that this annotation is deleted. */ + deleted?: boolean; + /** The highlight style for this annotation. */ + highlightStyle?: string; + /** Id of this annotation, in the form of a GUID. */ + id?: string; + /** Resource type. */ + kind?: string; + /** The layer this annotation is for. */ + layerId?: string; + layerSummary?: { + /** Maximum allowed characters on this layer, especially for the "copy" layer. */ + allowedCharacterCount?: number; + /** Type of limitation on this layer. "limited" or "unlimited" for the "copy" layer. */ + limitType?: string; + /** Remaining allowed characters on this layer, especially for the "copy" layer. */ + remainingCharacterCount?: number; + }; + /** Pages that this annotation spans. */ + pageIds?: string[]; + /** Excerpt from the volume. */ + selectedText?: string; + /** URL to this resource. */ + selfLink?: string; + /** Timestamp for the last time this annotation was modified. */ + updated?: string; + /** The volume that this annotation belongs to. */ + volumeId?: string; + } + interface Annotationdata { + /** The type of annotation this data is for. */ + annotationType?: string; + data?: any; + /** Base64 encoded data for this annotation data. */ + encoded_data?: string; + /** Unique id for this annotation data. */ + id?: string; + /** Resource Type */ + kind?: string; + /** The Layer id for this data. * */ + layerId?: string; + /** URL for this resource. * */ + selfLink?: string; + /** Timestamp for the last time this data was updated. (RFC 3339 UTC date-time format). */ + updated?: string; + /** The volume id for this data. * */ + volumeId?: string; + } + interface Annotations { + /** A list of annotations. */ + items?: Annotation[]; + /** Resource type. */ + kind?: string; + /** Token to pass in for pagination for the next page. This will not be present if this request does not have more results. */ + nextPageToken?: string; + /** Total number of annotations found. This may be greater than the number of notes returned in this response if results have been paginated. */ + totalItems?: number; + } + interface AnnotationsSummary { + kind?: string; + layers?: Array<{ + allowedCharacterCount?: number; + layerId?: string; + limitType?: string; + remainingCharacterCount?: number; + updated?: string; + }>; + } + interface Annotationsdata { + /** A list of Annotation Data. */ + items?: Annotationdata[]; + /** Resource type */ + kind?: string; + /** Token to pass in for pagination for the next page. This will not be present if this request does not have more results. */ + nextPageToken?: string; + /** The total number of volume annotations found. */ + totalItems?: number; + } + interface BooksAnnotationsRange { + /** The offset from the ending position. */ + endOffset?: string; + /** The ending position for the range. */ + endPosition?: string; + /** The offset from the starting position. */ + startOffset?: string; + /** The starting position for the range. */ + startPosition?: string; + } + interface BooksCloudloadingResource { + author?: string; + processingState?: string; + title?: string; + volumeId?: string; + } + interface BooksVolumesRecommendedRateResponse { + consistency_token?: string; + } + interface Bookshelf { + /** Whether this bookshelf is PUBLIC or PRIVATE. */ + access?: string; + /** Created time for this bookshelf (formatted UTC timestamp with millisecond resolution). */ + created?: string; + /** Description of this bookshelf. */ + description?: string; + /** Id of this bookshelf, only unique by user. */ + id?: number; + /** Resource type for bookshelf metadata. */ + kind?: string; + /** URL to this resource. */ + selfLink?: string; + /** Title of this bookshelf. */ + title?: string; + /** Last modified time of this bookshelf (formatted UTC timestamp with millisecond resolution). */ + updated?: string; + /** Number of volumes in this bookshelf. */ + volumeCount?: number; + /** Last time a volume was added or removed from this bookshelf (formatted UTC timestamp with millisecond resolution). */ + volumesLastUpdated?: string; + } + interface Bookshelves { + /** A list of bookshelves. */ + items?: Bookshelf[]; + /** Resource type. */ + kind?: string; + } + interface Category { + /** A list of onboarding categories. */ + items?: Array<{ + badgeUrl?: string; + categoryId?: string; + name?: string; + }>; + /** Resource type. */ + kind?: string; + } + interface ConcurrentAccessRestriction { + /** Whether access is granted for this (user, device, volume). */ + deviceAllowed?: boolean; + /** Resource type. */ + kind?: string; + /** The maximum number of concurrent access licenses for this volume. */ + maxConcurrentDevices?: number; + /** Error/warning message. */ + message?: string; + /** Client nonce for verification. Download access and client-validation only. */ + nonce?: string; + /** Error/warning reason code. */ + reasonCode?: string; + /** Whether this volume has any concurrent access restrictions. */ + restricted?: boolean; + /** Response signature. */ + signature?: string; + /** Client app identifier for verification. Download access and client-validation only. */ + source?: string; + /** Time in seconds for license auto-expiration. */ + timeWindowSeconds?: number; + /** Identifies the volume for which this entry applies. */ + volumeId?: string; + } + interface Dictlayerdata { + common?: { + /** The display title and localized canonical name to use when searching for this entity on Google search. */ + title?: string; + }; + dict?: { + /** The source, url and attribution for this dictionary data. */ + source?: { + attribution?: string; + url?: string; + }; + words?: Array<{ + derivatives?: Array<{ + source?: { + attribution?: string; + url?: string; + }; + text?: string; + }>; + examples?: Array<{ + source?: { + attribution?: string; + url?: string; + }; + text?: string; + }>; + senses?: Array<{ + conjugations?: Array<{ + type?: string; + value?: string; + }>; + definitions?: Array<{ + definition?: string; + examples?: Array<{ + source?: { + attribution?: string; + url?: string; + }; + text?: string; + }>; + }>; + partOfSpeech?: string; + pronunciation?: string; + pronunciationUrl?: string; + source?: { + attribution?: string; + url?: string; + }; + syllabification?: string; + synonyms?: Array<{ + source?: { + attribution?: string; + url?: string; + }; + text?: string; + }>; + }>; + /** The words with different meanings but not related words, e.g. "go" (game) and "go" (verb). */ + source?: { + attribution?: string; + url?: string; + }; + }>; + }; + kind?: string; + } + interface Discoveryclusters { + clusters?: Array<{ + banner_with_content_container?: { + fillColorArgb?: string; + imageUrl?: string; + maskColorArgb?: string; + moreButtonText?: string; + moreButtonUrl?: string; + textColorArgb?: string; + }; + subTitle?: string; + title?: string; + totalVolumes?: number; + uid?: string; + volumes?: Volume[]; + }>; + /** Resorce type. */ + kind?: string; + totalClusters?: number; + } + interface DownloadAccessRestriction { + /** If restricted, whether access is granted for this (user, device, volume). */ + deviceAllowed?: boolean; + /** If restricted, the number of content download licenses already acquired (including the requesting client, if licensed). */ + downloadsAcquired?: number; + /** If deviceAllowed, whether access was just acquired with this request. */ + justAcquired?: boolean; + /** Resource type. */ + kind?: string; + /** If restricted, the maximum number of content download licenses for this volume. */ + maxDownloadDevices?: number; + /** Error/warning message. */ + message?: string; + /** Client nonce for verification. Download access and client-validation only. */ + nonce?: string; + /** + * Error/warning reason code. Additional codes may be added in the future. 0 OK 100 ACCESS_DENIED_PUBLISHER_LIMIT 101 ACCESS_DENIED_LIMIT 200 + * WARNING_USED_LAST_ACCESS + */ + reasonCode?: string; + /** Whether this volume has any download access restrictions. */ + restricted?: boolean; + /** Response signature. */ + signature?: string; + /** Client app identifier for verification. Download access and client-validation only. */ + source?: string; + /** Identifies the volume for which this entry applies. */ + volumeId?: string; + } + interface DownloadAccesses { + /** A list of download access responses. */ + downloadAccessList?: DownloadAccessRestriction[]; + /** Resource type. */ + kind?: string; + } + interface Geolayerdata { + common?: { + /** The language of the information url and description. */ + lang?: string; + /** The URL for the preview image information. */ + previewImageUrl?: string; + /** The description for this location. */ + snippet?: string; + /** The URL for information for this location. Ex: wikipedia link. */ + snippetUrl?: string; + /** The display title and localized canonical name to use when searching for this entity on Google search. */ + title?: string; + }; + geo?: { + /** The boundary of the location as a set of loops containing pairs of latitude, longitude coordinates. */ + boundary?: Array>; + /** The cache policy active for this data. EX: UNRESTRICTED, RESTRICTED, NEVER */ + cachePolicy?: string; + /** The country code of the location. */ + countryCode?: string; + /** The latitude of the location. */ + latitude?: number; + /** The longitude of the location. */ + longitude?: number; + /** The type of map that should be used for this location. EX: HYBRID, ROADMAP, SATELLITE, TERRAIN */ + mapType?: string; + /** The viewport for showing this location. This is a latitude, longitude rectangle. */ + viewport?: { + hi?: { + latitude?: number; + longitude?: number; + }; + lo?: { + latitude?: number; + longitude?: number; + }; + }; + /** + * The Zoom level to use for the map. Zoom levels between 0 (the lowest zoom level, in which the entire world can be seen on one map) to 21+ (down to + * individual buildings). See: https://developers.google.com/maps/documentation/staticmaps/#Zoomlevels + */ + zoom?: number; + }; + kind?: string; + } + interface Layersummaries { + /** A list of layer summary items. */ + items?: Layersummary[]; + /** Resource type. */ + kind?: string; + /** The total number of layer summaries found. */ + totalItems?: number; + } + interface Layersummary { + /** The number of annotations for this layer. */ + annotationCount?: number; + /** The list of annotation types contained for this layer. */ + annotationTypes?: string[]; + /** Link to get data for this annotation. */ + annotationsDataLink?: string; + /** The link to get the annotations for this layer. */ + annotationsLink?: string; + /** The content version this resource is for. */ + contentVersion?: string; + /** The number of data items for this layer. */ + dataCount?: number; + /** Unique id of this layer summary. */ + id?: string; + /** Resource Type */ + kind?: string; + /** The layer id for this summary. */ + layerId?: string; + /** URL to this resource. */ + selfLink?: string; + /** Timestamp for the last time an item in this layer was updated. (RFC 3339 UTC date-time format). */ + updated?: string; + /** + * The current version of this layer's volume annotations. Note that this version applies only to the data in the books.layers.volumeAnnotations.* + * responses. The actual annotation data is versioned separately. + */ + volumeAnnotationsVersion?: string; + /** The volume id this resource is for. */ + volumeId?: string; + } + interface Metadata { + /** A list of offline dictionary metadata. */ + items?: Array<{ + download_url?: string; + encrypted_key?: string; + language?: string; + size?: string; + version?: string; + }>; + /** Resource type. */ + kind?: string; + } + interface Notification { + body?: string; + /** The list of crm experiment ids. */ + crmExperimentIds?: string[]; + doc_id?: string; + doc_type?: string; + dont_show_notification?: boolean; + iconUrl?: string; + /** Resource type. */ + kind?: string; + notificationGroup?: string; + notification_type?: string; + pcampaign_id?: string; + reason?: string; + show_notification_settings_action?: boolean; + targetUrl?: string; + title?: string; + } + interface Offers { + /** A list of offers. */ + items?: Array<{ + artUrl?: string; + gservicesKey?: string; + id?: string; + items?: Array<{ + author?: string; + canonicalVolumeLink?: string; + coverUrl?: string; + description?: string; + title?: string; + volumeId?: string; + }>; + }>; + /** Resource type. */ + kind?: string; + } + interface ReadingPosition { + /** Position in an EPUB as a CFI. */ + epubCfiPosition?: string; + /** Position in a volume for image-based content. */ + gbImagePosition?: string; + /** Position in a volume for text-based content. */ + gbTextPosition?: string; + /** Resource type for a reading position. */ + kind?: string; + /** Position in a PDF file. */ + pdfPosition?: string; + /** Timestamp when this reading position was last updated (formatted UTC timestamp with millisecond resolution). */ + updated?: string; + /** Volume id associated with this reading position. */ + volumeId?: string; + } + interface RequestAccess { + /** A concurrent access response. */ + concurrentAccess?: ConcurrentAccessRestriction; + /** A download access response. */ + downloadAccess?: DownloadAccessRestriction; + /** Resource type. */ + kind?: string; + } + interface Review { + /** Author of this review. */ + author?: { + /** Name of this person. */ + displayName?: string; + }; + /** Review text. */ + content?: string; + /** Date of this review. */ + date?: string; + /** URL for the full review text, for reviews gathered from the web. */ + fullTextUrl?: string; + /** Resource type for a review. */ + kind?: string; + /** Star rating for this review. Possible values are ONE, TWO, THREE, FOUR, FIVE or NOT_RATED. */ + rating?: string; + /** Information regarding the source of this review, when the review is not from a Google Books user. */ + source?: { + /** Name of the source. */ + description?: string; + /** Extra text about the source of the review. */ + extraDescription?: string; + /** URL of the source of the review. */ + url?: string; + }; + /** Title for this review. */ + title?: string; + /** Source type for this review. Possible values are EDITORIAL, WEB_USER or GOOGLE_USER. */ + type?: string; + /** Volume that this review is for. */ + volumeId?: string; + } + interface Series { + /** Resource type. */ + kind?: string; + series?: Array<{ + bannerImageUrl?: string; + imageUrl?: string; + seriesId?: string; + seriesType?: string; + title?: string; + }>; + } + interface Seriesmembership { + /** Resorce type. */ + kind?: string; + member?: Volume[]; + nextPageToken?: string; + } + interface Usersettings { + /** Resource type. */ + kind?: string; + /** User settings in sub-objects, each for different purposes. */ + notesExport?: { + folderName?: string; + isEnabled?: boolean; + }; + notification?: { + moreFromAuthors?: { + opted_state?: string; + }; + moreFromSeries?: { + opted_state?: string; + }; + rewardExpirations?: { + opted_state?: string; + }; + }; + } + interface Volume { + /** + * Any information about a volume related to reading or obtaining that volume text. This information can depend on country (books may be public domain in + * one country but not in another, e.g.). + */ + accessInfo?: { + /** + * Combines the access and viewability of this volume into a single status field for this user. Values can be FULL_PURCHASED, FULL_PUBLIC_DOMAIN, SAMPLE + * or NONE. (In LITE projection.) + */ + accessViewStatus?: string; + /** The two-letter ISO_3166-1 country code for which this access information is valid. (In LITE projection.) */ + country?: string; + /** Information about a volume's download license access restrictions. */ + downloadAccess?: DownloadAccessRestriction; + /** URL to the Google Drive viewer if this volume is uploaded by the user by selecting the file from Google Drive. */ + driveImportedContentLink?: string; + /** Whether this volume can be embedded in a viewport using the Embedded Viewer API. */ + embeddable?: boolean; + /** Information about epub content. (In LITE projection.) */ + epub?: { + /** URL to retrieve ACS token for epub download. (In LITE projection.) */ + acsTokenLink?: string; + /** URL to download epub. (In LITE projection.) */ + downloadLink?: string; + /** Is a flowing text epub available either as public domain or for purchase. (In LITE projection.) */ + isAvailable?: boolean; + }; + /** + * Whether this volume requires that the client explicitly request offline download license rather than have it done automatically when loading the + * content, if the client supports it. + */ + explicitOfflineLicenseManagement?: boolean; + /** Information about pdf content. (In LITE projection.) */ + pdf?: { + /** URL to retrieve ACS token for pdf download. (In LITE projection.) */ + acsTokenLink?: string; + /** URL to download pdf. (In LITE projection.) */ + downloadLink?: string; + /** Is a scanned image pdf available either as public domain or for purchase. (In LITE projection.) */ + isAvailable?: boolean; + }; + /** Whether or not this book is public domain in the country listed above. */ + publicDomain?: boolean; + /** Whether quote sharing is allowed for this volume. */ + quoteSharingAllowed?: boolean; + /** Whether text-to-speech is permitted for this volume. Values can be ALLOWED, ALLOWED_FOR_ACCESSIBILITY, or NOT_ALLOWED. */ + textToSpeechPermission?: string; + /** For ordered but not yet processed orders, we give a URL that can be used to go to the appropriate Google Wallet page. */ + viewOrderUrl?: string; + /** + * The read access of a volume. Possible values are PARTIAL, ALL_PAGES, NO_PAGES or UNKNOWN. This value depends on the country listed above. A value of + * PARTIAL means that the publisher has allowed some portion of the volume to be viewed publicly, without purchase. This can apply to eBooks as well as + * non-eBooks. Public domain books will always have a value of ALL_PAGES. + */ + viewability?: string; + /** URL to read this volume on the Google Books site. Link will not allow users to read non-viewable volumes. */ + webReaderLink?: string; + }; + /** Opaque identifier for a specific version of a volume resource. (In LITE projection) */ + etag?: string; + /** Unique identifier for a volume. (In LITE projection.) */ + id?: string; + /** Resource type for a volume. (In LITE projection.) */ + kind?: string; + /** What layers exist in this volume and high level information about them. */ + layerInfo?: { + /** A layer should appear here if and only if the layer exists for this book. */ + layers?: Array<{ + /** The layer id of this layer (e.g. "geo"). */ + layerId?: string; + /** + * The current version of this layer's volume annotations. Note that this version applies only to the data in the books.layers.volumeAnnotations.* + * responses. The actual annotation data is versioned separately. + */ + volumeAnnotationsVersion?: string; + }>; + }; + /** Recommendation related information for this volume. */ + recommendedInfo?: { + /** A text explaining why this volume is recommended. */ + explanation?: string; + }; + /** + * Any information about a volume related to the eBookstore and/or purchaseability. This information can depend on the country where the request + * originates from (i.e. books may not be for sale in certain countries). + */ + saleInfo?: { + /** URL to purchase this volume on the Google Books site. (In LITE projection) */ + buyLink?: string; + /** The two-letter ISO_3166-1 country code for which this sale information is valid. (In LITE projection.) */ + country?: string; + /** Whether or not this volume is an eBook (can be added to the My eBooks shelf). */ + isEbook?: boolean; + /** Suggested retail price. (In LITE projection.) */ + listPrice?: { + /** Amount in the currency listed below. (In LITE projection.) */ + amount?: number; + /** An ISO 4217, three-letter currency code. (In LITE projection.) */ + currencyCode?: string; + }; + /** Offers available for this volume (sales and rentals). */ + offers?: Array<{ + /** The finsky offer type (e.g., PURCHASE=0 RENTAL=3) */ + finskyOfferType?: number; + /** Indicates whether the offer is giftable. */ + giftable?: boolean; + /** Offer list (=undiscounted) price in Micros. */ + listPrice?: { + amountInMicros?: number; + currencyCode?: string; + }; + /** The rental duration (for rental offers only). */ + rentalDuration?: { + count?: number; + unit?: string; + }; + /** Offer retail (=discounted) price in Micros */ + retailPrice?: { + amountInMicros?: number; + currencyCode?: string; + }; + }>; + /** The date on which this book is available for sale. */ + onSaleDate?: string; + /** + * The actual selling price of the book. This is the same as the suggested retail or list price unless there are offers or discounts on this volume. (In + * LITE projection.) + */ + retailPrice?: { + /** Amount in the currency listed below. (In LITE projection.) */ + amount?: number; + /** An ISO 4217, three-letter currency code. (In LITE projection.) */ + currencyCode?: string; + }; + /** + * Whether or not this book is available for sale or offered for free in the Google eBookstore for the country listed above. Possible values are FOR_SALE, + * FOR_RENTAL_ONLY, FOR_SALE_AND_RENTAL, FREE, NOT_FOR_SALE, or FOR_PREORDER. + */ + saleability?: string; + }; + /** Search result information related to this volume. */ + searchInfo?: { + /** A text snippet containing the search query. */ + textSnippet?: string; + }; + /** URL to this resource. (In LITE projection.) */ + selfLink?: string; + /** User specific information related to this volume. (e.g. page this user last read or whether they purchased this book) */ + userInfo?: { + /** + * Timestamp when this volume was acquired by the user. (RFC 3339 UTC date-time format) Acquiring includes purchase, user upload, receiving family + * sharing, etc. + */ + acquiredTime?: string; + /** How this volume was acquired. */ + acquisitionType?: number; + /** Copy/Paste accounting information. */ + copy?: { + allowedCharacterCount?: number; + limitType?: string; + remainingCharacterCount?: number; + updated?: string; + }; + /** Whether this volume is purchased, sample, pd download etc. */ + entitlementType?: number; + /** Information on the ability to share with the family. */ + familySharing?: { + /** The role of the user in the family. */ + familyRole?: string; + /** + * Whether or not this volume can be shared with the family by the user. This includes sharing eligibility of both the volume and the user. If the value + * is true, the user can initiate a family sharing action. + */ + isSharingAllowed?: boolean; + /** Whether or not sharing this volume is temporarily disabled due to issues with the Family Wallet. */ + isSharingDisabledByFop?: boolean; + }; + /** Whether or not the user shared this volume with the family. */ + isFamilySharedFromUser?: boolean; + /** Whether or not the user received this volume through family sharing. */ + isFamilySharedToUser?: boolean; + /** Deprecated: Replaced by familySharing. */ + isFamilySharingAllowed?: boolean; + /** Deprecated: Replaced by familySharing. */ + isFamilySharingDisabledByFop?: boolean; + /** Whether or not this volume is currently in "my books." */ + isInMyBooks?: boolean; + /** Whether or not this volume was pre-ordered by the authenticated user making the request. (In LITE projection.) */ + isPreordered?: boolean; + /** Whether or not this volume was purchased by the authenticated user making the request. (In LITE projection.) */ + isPurchased?: boolean; + /** Whether or not this volume was user uploaded. */ + isUploaded?: boolean; + /** The user's current reading position in the volume, if one is available. (In LITE projection.) */ + readingPosition?: ReadingPosition; + /** Period during this book is/was a valid rental. */ + rentalPeriod?: { + endUtcSec?: string; + startUtcSec?: string; + }; + /** Whether this book is an active or an expired rental. */ + rentalState?: string; + /** This user's review of this volume, if one exists. */ + review?: Review; + /** + * Timestamp when this volume was last modified by a user action, such as a reading position update, volume purchase or writing a review. (RFC 3339 UTC + * date-time format). + */ + updated?: string; + userUploadedVolumeInfo?: { + processingState?: string; + }; + }; + /** General volume information. */ + volumeInfo?: { + /** Whether anonymous logging should be allowed. */ + allowAnonLogging?: boolean; + /** The names of the authors and/or editors for this volume. (In LITE projection) */ + authors?: string[]; + /** The mean review rating for this volume. (min = 1.0, max = 5.0) */ + averageRating?: number; + /** Canonical URL for a volume. (In LITE projection.) */ + canonicalVolumeLink?: string; + /** A list of subject categories, such as "Fiction", "Suspense", etc. */ + categories?: string[]; + /** An identifier for the version of the volume content (text & images). (In LITE projection) */ + contentVersion?: string; + /** + * A synopsis of the volume. The text of the description is formatted in HTML and includes simple formatting elements, such as b, i, and br tags. (In LITE + * projection.) + */ + description?: string; + /** Physical dimensions of this volume. */ + dimensions?: { + /** Height or length of this volume (in cm). */ + height?: string; + /** Thickness of this volume (in cm). */ + thickness?: string; + /** Width of this volume (in cm). */ + width?: string; + }; + /** A list of image links for all the sizes that are available. (In LITE projection.) */ + imageLinks?: { + /** Image link for extra large size (width of ~1280 pixels). (In LITE projection) */ + extraLarge?: string; + /** Image link for large size (width of ~800 pixels). (In LITE projection) */ + large?: string; + /** Image link for medium size (width of ~575 pixels). (In LITE projection) */ + medium?: string; + /** Image link for small size (width of ~300 pixels). (In LITE projection) */ + small?: string; + /** Image link for small thumbnail size (width of ~80 pixels). (In LITE projection) */ + smallThumbnail?: string; + /** Image link for thumbnail size (width of ~128 pixels). (In LITE projection) */ + thumbnail?: string; + }; + /** Industry standard identifiers for this volume. */ + industryIdentifiers?: Array<{ + /** Industry specific volume identifier. */ + identifier?: string; + /** Identifier type. Possible values are ISBN_10, ISBN_13, ISSN and OTHER. */ + type?: string; + }>; + /** URL to view information about this volume on the Google Books site. (In LITE projection) */ + infoLink?: string; + /** Best language for this volume (based on content). It is the two-letter ISO 639-1 code such as 'fr', 'en', etc. */ + language?: string; + /** The main category to which this volume belongs. It will be the category from the categories list returned below that has the highest weight. */ + mainCategory?: string; + maturityRating?: string; + /** Total number of pages as per publisher metadata. */ + pageCount?: number; + /** A top-level summary of the panelization info in this volume. */ + panelizationSummary?: { + containsEpubBubbles?: boolean; + containsImageBubbles?: boolean; + epubBubbleVersion?: string; + imageBubbleVersion?: string; + }; + /** URL to preview this volume on the Google Books site. */ + previewLink?: string; + /** Type of publication of this volume. Possible values are BOOK or MAGAZINE. */ + printType?: string; + /** Total number of printed pages in generated pdf representation. */ + printedPageCount?: number; + /** Date of publication. (In LITE projection.) */ + publishedDate?: string; + /** Publisher of this volume. (In LITE projection.) */ + publisher?: string; + /** The number of review ratings for this volume. */ + ratingsCount?: number; + /** The reading modes available for this volume. */ + readingModes?: any; + /** Total number of sample pages as per publisher metadata. */ + samplePageCount?: number; + seriesInfo?: Volumeseriesinfo; + /** Volume subtitle. (In LITE projection.) */ + subtitle?: string; + /** Volume title. (In LITE projection.) */ + title?: string; + }; + } + interface Volume2 { + /** A list of volumes. */ + items?: Volume[]; + /** Resource type. */ + kind?: string; + nextPageToken?: string; + } + interface Volumeannotation { + /** The annotation data id for this volume annotation. */ + annotationDataId?: string; + /** Link to get data for this annotation. */ + annotationDataLink?: string; + /** The type of annotation this is. */ + annotationType?: string; + /** The content ranges to identify the selected text. */ + contentRanges?: { + /** Range in CFI format for this annotation for version above. */ + cfiRange?: BooksAnnotationsRange; + /** Content version applicable to ranges below. */ + contentVersion?: string; + /** Range in GB image format for this annotation for version above. */ + gbImageRange?: BooksAnnotationsRange; + /** Range in GB text format for this annotation for version above. */ + gbTextRange?: BooksAnnotationsRange; + }; + /** Data for this annotation. */ + data?: string; + /** Indicates that this annotation is deleted. */ + deleted?: boolean; + /** Unique id of this volume annotation. */ + id?: string; + /** Resource Type */ + kind?: string; + /** The Layer this annotation is for. */ + layerId?: string; + /** Pages the annotation spans. */ + pageIds?: string[]; + /** Excerpt from the volume. */ + selectedText?: string; + /** URL to this resource. */ + selfLink?: string; + /** Timestamp for the last time this anntoation was updated. (RFC 3339 UTC date-time format). */ + updated?: string; + /** The Volume this annotation is for. */ + volumeId?: string; + } + interface Volumeannotations { + /** A list of volume annotations. */ + items?: Volumeannotation[]; + /** Resource type */ + kind?: string; + /** Token to pass in for pagination for the next page. This will not be present if this request does not have more results. */ + nextPageToken?: string; + /** The total number of volume annotations found. */ + totalItems?: number; + /** + * The version string for all of the volume annotations in this layer (not just the ones in this response). Note: the version string doesn't apply to the + * annotation data, just the information in this response (e.g. the location of annotations in the book). + */ + version?: string; + } + interface Volumes { + /** A list of volumes. */ + items?: Volume[]; + /** Resource type. */ + kind?: string; + /** Total number of volumes found. This might be greater than the number of volumes returned in this response if results have been paginated. */ + totalItems?: number; + } + interface Volumeseriesinfo { + /** The display number string. This should be used only for display purposes and the actual sequence should be inferred from the below orderNumber. */ + bookDisplayNumber?: string; + /** Resource type. */ + kind?: string; + /** Short book title in the context of the series. */ + shortSeriesBookTitle?: string; + volumeSeries?: Array<{ + /** List of issues. Applicable only for Collection Edition and Omnibus. */ + issue?: Array<{ + issueDisplayNumber?: string; + issueOrderNumber?: number; + }>; + /** The book order number in the series. */ + orderNumber?: number; + /** The book type in the context of series. Examples - Single Issue, Collection Edition, etc. */ + seriesBookType?: string; + /** The series id. */ + seriesId?: string; + }>; + } + interface VolumesResource { + /** Retrieves volumes in a specific bookshelf for the specified user. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ID of bookshelf to retrieve volumes. */ + shelf: string; + /** Set to true to show pre-ordered books. Defaults to false. */ + showPreorders?: boolean; + /** String to identify the originator of this request. */ + source?: string; + /** Index of the first element to return (starts at 0) */ + startIndex?: number; + /** ID of user for whom to retrieve bookshelf volumes. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface BookshelvesResource { + /** Retrieves metadata for a specific bookshelf for the specified user. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ID of bookshelf to retrieve. */ + shelf: string; + /** String to identify the originator of this request. */ + source?: string; + /** ID of user for whom to retrieve bookshelves. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of public bookshelves for the specified user. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** ID of user for whom to retrieve bookshelves. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + volumes: VolumesResource; + } + interface CloudloadingResource { + addBook(request: { + /** Data format for the response. */ + alt?: string; + /** A drive document id. The upload_client_token must not be set. */ + drive_document_id?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The document MIME type. It can be set only if the drive_document_id is set. */ + mime_type?: string; + /** The document name. It can be set only if the drive_document_id is set. */ + name?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + upload_client_token?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Remove the book and its contents */ + deleteBook(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The id of the book to be removed. */ + volumeId: string; + }): Request; + updateBook(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DictionaryResource { + /** Returns a list of offline dictionary metadata available */ + listOfflineMetadata(request: { + /** Data format for the response. */ + alt?: string; + /** The device/version ID from which to request the data. */ + cpksver: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AnnotationDataResource { + /** Gets the annotation data. */ + get(request: { + /** For the dictionary layer. Whether or not to allow web definitions. */ + allowWebDefinitions?: boolean; + /** Data format for the response. */ + alt?: string; + /** The ID of the annotation data to retrieve. */ + annotationDataId: string; + /** The content version for the volume you are trying to retrieve. */ + contentVersion: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The requested pixel height for any images. If height is provided width must also be provided. */ + h?: number; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID for the layer to get the annotations. */ + layerId: string; + /** The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. */ + locale?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The requested scale for the image. */ + scale?: number; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The volume to retrieve annotations for. */ + volumeId: string; + /** The requested pixel width for any images. If width is provided height must also be provided. */ + w?: number; + }): Request; + /** Gets the annotation data for a volume and layer. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The list of Annotation Data Ids to retrieve. Pagination is ignored if this is set. */ + annotationDataId?: string; + /** The content version for the requested volume. */ + contentVersion: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The requested pixel height for any images. If height is provided width must also be provided. */ + h?: number; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID for the layer to get the annotation data. */ + layerId: string; + /** The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. */ + locale?: string; + /** Maximum number of results to return */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The value of the nextToken from the previous page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The requested scale for the image. */ + scale?: number; + /** String to identify the originator of this request. */ + source?: string; + /** RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). */ + updatedMax?: string; + /** RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). */ + updatedMin?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The volume to retrieve annotation data for. */ + volumeId: string; + /** The requested pixel width for any images. If width is provided height must also be provided. */ + w?: number; + }): Request; + } + interface VolumeAnnotationsResource { + /** Gets the volume annotation. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the volume annotation to retrieve. */ + annotationId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID for the layer to get the annotations. */ + layerId: string; + /** The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. */ + locale?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The volume to retrieve annotations for. */ + volumeId: string; + }): Request; + /** Gets the volume annotations for a volume and layer. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The content version for the requested volume. */ + contentVersion: string; + /** The end offset to end retrieving data from. */ + endOffset?: string; + /** The end position to end retrieving data from. */ + endPosition?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID for the layer to get the annotations. */ + layerId: string; + /** The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. */ + locale?: string; + /** Maximum number of results to return */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The value of the nextToken from the previous page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false. */ + showDeleted?: boolean; + /** String to identify the originator of this request. */ + source?: string; + /** The start offset to start retrieving data from. */ + startOffset?: string; + /** The start position to start retrieving data from. */ + startPosition?: string; + /** RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). */ + updatedMax?: string; + /** RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). */ + updatedMin?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The version of the volume annotations that you are requesting. */ + volumeAnnotationsVersion?: string; + /** The volume to retrieve annotations for. */ + volumeId: string; + }): Request; + } + interface LayersResource { + /** Gets the layer summary for a volume. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The content version for the requested volume. */ + contentVersion?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** The ID for the layer to get the summary for. */ + summaryId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The volume to retrieve layers for. */ + volumeId: string; + }): Request; + /** List the layer summaries for a volume. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The content version for the requested volume. */ + contentVersion?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The value of the nextToken from the previous page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The volume to retrieve layers for. */ + volumeId: string; + }): Request; + annotationData: AnnotationDataResource; + volumeAnnotations: VolumeAnnotationsResource; + } + interface MyconfigResource { + /** Gets the current settings for the user. */ + getUserSettings(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Release downloaded content access restriction. */ + releaseDownloadAccess(request: { + /** Data format for the response. */ + alt?: string; + /** The device/version ID from which to release the restriction. */ + cpksver: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. */ + locale?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The volume(s) to release restrictions for. */ + volumeIds: string; + }): Request; + /** Request concurrent and download access restrictions. */ + requestAccess(request: { + /** Data format for the response. */ + alt?: string; + /** The device/version ID from which to request the restrictions. */ + cpksver: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The type of access license to request. If not specified, the default is BOTH. */ + licenseTypes?: string; + /** ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. */ + locale?: string; + /** The client nonce value. */ + nonce: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The volume to request concurrent/download restrictions for. */ + volumeId: string; + }): Request; + /** Request downloaded content access for specified volumes on the My eBooks shelf. */ + syncVolumeLicenses(request: { + /** Data format for the response. */ + alt?: string; + /** The device/version ID from which to release the restriction. */ + cpksver: string; + /** List of features supported by the client, i.e., 'RENTALS' */ + features?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Set to true to include non-comics series. Defaults to false. */ + includeNonComicsSeries?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. */ + locale?: string; + /** The client nonce value. */ + nonce: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Set to true to show pre-ordered books. Defaults to false. */ + showPreorders?: boolean; + /** String to identify the originator of this request. */ + source: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The volume(s) to request download restrictions for. */ + volumeIds?: string; + }): Request; + /** + * Sets the settings for the user. If a sub-object is specified, it will overwrite the existing sub-object stored in the server. Unspecified sub-objects + * will retain the existing value. + */ + updateUserSettings(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AnnotationsResource { + /** Deletes an annotation. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID for the annotation to delete. */ + annotationId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new annotation. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** The ID for the annotation to insert. */ + annotationId?: string; + /** ISO-3166-1 code to override the IP-based location. */ + country?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Requests that only the summary of the specified layer be provided in the response. */ + showOnlySummaryInResponse?: boolean; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of annotations, possibly filtered. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The content version for the requested volume. */ + contentVersion?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The layer ID to limit annotation by. */ + layerId?: string; + /** The layer ID(s) to limit annotation by. */ + layerIds?: string; + /** Maximum number of results to return */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The value of the nextToken from the previous page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false. */ + showDeleted?: boolean; + /** String to identify the originator of this request. */ + source?: string; + /** RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). */ + updatedMax?: string; + /** RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). */ + updatedMin?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The volume to restrict annotations to. */ + volumeId?: string; + }): Request; + /** Gets the summary of specified layers. */ + summary(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Array of layer IDs to get the summary for. */ + layerIds: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Volume id to get the summary for. */ + volumeId: string; + }): Request; + /** Updates an existing annotation. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The ID for the annotation to update. */ + annotationId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface VolumesResource { + /** Gets volume information for volumes on a bookshelf. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** ISO-3166-1 code to override the IP-based location. */ + country?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Restrict information returned to a set of selected fields. */ + projection?: string; + /** Full-text search query string in this bookshelf. */ + q?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The bookshelf ID or name retrieve volumes for. */ + shelf: string; + /** Set to true to show pre-ordered books. Defaults to false. */ + showPreorders?: boolean; + /** String to identify the originator of this request. */ + source?: string; + /** Index of the first element to return (starts at 0) */ + startIndex?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface BookshelvesResource { + /** Adds a volume to a bookshelf. */ + addVolume(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The reason for which the book is added to the library. */ + reason?: string; + /** ID of bookshelf to which to add a volume. */ + shelf: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** ID of volume to add. */ + volumeId: string; + }): Request; + /** Clears all volumes from a bookshelf. */ + clearVolumes(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ID of bookshelf from which to remove a volume. */ + shelf: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves metadata for a specific bookshelf belonging to the authenticated user. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ID of bookshelf to retrieve. */ + shelf: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of bookshelves belonging to the authenticated user. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Moves a volume within a bookshelf. */ + moveVolume(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ID of bookshelf with the volume. */ + shelf: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** ID of volume to move. */ + volumeId: string; + /** Position on shelf to move the item (0 puts the item before the current first item, 1 puts it between the first and the second and so on.) */ + volumePosition: number; + }): Request; + /** Removes a volume from a bookshelf. */ + removeVolume(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The reason for which the book is removed from the library. */ + reason?: string; + /** ID of bookshelf from which to remove a volume. */ + shelf: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** ID of volume to remove. */ + volumeId: string; + }): Request; + volumes: VolumesResource; + } + interface ReadingpositionsResource { + /** Retrieves my reading position information for a volume. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Volume content version for which this reading position is requested. */ + contentVersion?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** ID of volume for which to retrieve a reading position. */ + volumeId: string; + }): Request; + /** Sets my reading position information for a volume. */ + setPosition(request: { + /** Action that caused this reading position to be set. */ + action?: string; + /** Data format for the response. */ + alt?: string; + /** Volume content version for which this reading position applies. */ + contentVersion?: string; + /** Random persistent device cookie optional on set position. */ + deviceCookie?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Position string for the new volume reading position. */ + position: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** RFC 3339 UTC format timestamp associated with this reading position. */ + timestamp: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** ID of volume for which to update the reading position. */ + volumeId: string; + }): Request; + } + interface MylibraryResource { + annotations: AnnotationsResource; + bookshelves: BookshelvesResource; + readingpositions: ReadingpositionsResource; + } + interface NotificationResource { + /** Returns notification details for a given notification id. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating notification title and body. */ + locale?: string; + /** String to identify the notification. */ + notification_id: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface OnboardingResource { + /** List categories for onboarding experience. */ + listCategories(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset. */ + locale?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List available volumes under categories for onboarding experience. */ + listCategoryVolumes(request: { + /** Data format for the response. */ + alt?: string; + /** List of category ids requested. */ + categoryId?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset. */ + locale?: string; + /** The maximum allowed maturity rating of returned volumes. Books with a higher maturity rating are filtered out. */ + maxAllowedMaturityRating?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Number of maximum results per page to be included in the response. */ + pageSize?: number; + /** The value of the nextToken from the previous page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PersonalizedstreamResource { + /** Returns a stream of personalized book clusters */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. */ + locale?: string; + /** The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. */ + maxAllowedMaturityRating?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PromoofferResource { + accept(request: { + /** Data format for the response. */ + alt?: string; + /** device android_id */ + androidId?: string; + /** device device */ + device?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** device manufacturer */ + manufacturer?: string; + /** device model */ + model?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + offerId?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** device product */ + product?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** device serial */ + serial?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Volume id to exercise the offer */ + volumeId?: string; + }): Request; + dismiss(request: { + /** Data format for the response. */ + alt?: string; + /** device android_id */ + androidId?: string; + /** device device */ + device?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** device manufacturer */ + manufacturer?: string; + /** device model */ + model?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Offer to dimiss */ + offerId?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** device product */ + product?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** device serial */ + serial?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns a list of promo offers available to the user */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** device android_id */ + androidId?: string; + /** device device */ + device?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** device manufacturer */ + manufacturer?: string; + /** device model */ + model?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** device product */ + product?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** device serial */ + serial?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface MembershipResource { + /** Returns Series membership data given the series id. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Number of maximum results per page to be included in the response. */ + page_size?: number; + /** The value of the nextToken from the previous page. */ + page_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String that identifies the series */ + series_id: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SeriesResource { + /** Returns Series metadata for the given series ids. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String that identifies the series */ + series_id: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + membership: MembershipResource; + } + interface AssociatedResource { + /** Return a list of associated books. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Association type. */ + association?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. */ + locale?: string; + /** The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. */ + maxAllowedMaturityRating?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** ID of the source volume. */ + volumeId: string; + }): Request; + } + interface MybooksResource { + /** Return a list of books in My Library. */ + list(request: { + /** How the book was acquired */ + acquireMethod?: string; + /** Data format for the response. */ + alt?: string; + /** ISO-3166-1 code to override the IP-based location. */ + country?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ISO-639-1 language and ISO-3166-1 country code. Ex:'en_US'. Used for generating recommendations. */ + locale?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The processing state of the user uploaded volumes to be returned. Applicable only if the UPLOADED is specified in the acquireMethod. */ + processingState?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** Index of the first result to return (starts at 0) */ + startIndex?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RecommendedResource { + /** Return a list of recommended books for the current user. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. */ + locale?: string; + /** The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. */ + maxAllowedMaturityRating?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Rate a recommended book for the current user. */ + rate(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. */ + locale?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Rating to be given to the volume. */ + rating: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** ID of the source volume. */ + volumeId: string; + }): Request; + } + interface UseruploadedResource { + /** Return a list of books uploaded by the current user. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. */ + locale?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The processing state of the user uploaded volumes to be returned. */ + processingState?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** Index of the first result to return (starts at 0) */ + startIndex?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The ids of the volumes to be returned. If not specified all that match the processingState are returned. */ + volumeId?: string; + }): Request; + } + interface VolumesResource { + /** Gets volume information for a single volume. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** ISO-3166-1 code to override the IP-based location. */ + country?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Set to true to include non-comics series. Defaults to false. */ + includeNonComicsSeries?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Brand results for partner ID. */ + partner?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Restrict information returned to a set of selected fields. */ + projection?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** String to identify the originator of this request. */ + source?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + user_library_consistent_read?: boolean; + /** ID of volume to retrieve. */ + volumeId: string; + }): Request; + /** Performs a book search. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Restrict to volumes by download availability. */ + download?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Filter search results. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Restrict results to books with this language code. */ + langRestrict?: string; + /** Restrict search to this user's library. */ + libraryRestrict?: string; + /** The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. */ + maxAllowedMaturityRating?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Sort search results. */ + orderBy?: string; + /** Restrict and brand results for partner ID. */ + partner?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Restrict to books or magazines. */ + printType?: string; + /** Restrict information returned to a set of selected fields. */ + projection?: string; + /** Full-text search query string. */ + q: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Set to true to show books available for preorder. Defaults to false. */ + showPreorders?: boolean; + /** String to identify the originator of this request. */ + source?: string; + /** Index of the first result to return (starts at 0) */ + startIndex?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + associated: AssociatedResource; + mybooks: MybooksResource; + recommended: RecommendedResource; + useruploaded: UseruploadedResource; + } + } +} diff --git a/types/gapi.client.books/readme.md b/types/gapi.client.books/readme.md new file mode 100644 index 0000000000..1e708d44d0 --- /dev/null +++ b/types/gapi.client.books/readme.md @@ -0,0 +1,169 @@ +# TypeScript typings for Books API v1 +Searches for books and manages your Google Books library. +For detailed description please check [documentation](https://developers.google.com/books/docs/v1/getting_started). + +## Installing + +Install typings for Books API: +``` +npm install @types/gapi.client.books@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('books', 'v1', () => { + // now we can use gapi.client.books + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // Manage your books + 'https://www.googleapis.com/auth/books', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Books API resources: + +```typescript + +/* +Retrieves metadata for a specific bookshelf for the specified user. +*/ +await gapi.client.bookshelves.get({ shelf: "shelf", userId: "userId", }); + +/* +Retrieves a list of public bookshelves for the specified user. +*/ +await gapi.client.bookshelves.list({ userId: "userId", }); + +/* + +*/ +await gapi.client.cloudloading.addBook({ }); + +/* +Remove the book and its contents +*/ +await gapi.client.cloudloading.deleteBook({ volumeId: "volumeId", }); + +/* + +*/ +await gapi.client.cloudloading.updateBook({ }); + +/* +Returns a list of offline dictionary metadata available +*/ +await gapi.client.dictionary.listOfflineMetadata({ cpksver: "cpksver", }); + +/* +Gets the layer summary for a volume. +*/ +await gapi.client.layers.get({ summaryId: "summaryId", volumeId: "volumeId", }); + +/* +List the layer summaries for a volume. +*/ +await gapi.client.layers.list({ volumeId: "volumeId", }); + +/* +Gets the current settings for the user. +*/ +await gapi.client.myconfig.getUserSettings({ }); + +/* +Release downloaded content access restriction. +*/ +await gapi.client.myconfig.releaseDownloadAccess({ cpksver: "cpksver", volumeIds: "volumeIds", }); + +/* +Request concurrent and download access restrictions. +*/ +await gapi.client.myconfig.requestAccess({ cpksver: "cpksver", nonce: "nonce", source: "source", volumeId: "volumeId", }); + +/* +Request downloaded content access for specified volumes on the My eBooks shelf. +*/ +await gapi.client.myconfig.syncVolumeLicenses({ cpksver: "cpksver", nonce: "nonce", source: "source", }); + +/* +Sets the settings for the user. If a sub-object is specified, it will overwrite the existing sub-object stored in the server. Unspecified sub-objects will retain the existing value. +*/ +await gapi.client.myconfig.updateUserSettings({ }); + +/* +Returns notification details for a given notification id. +*/ +await gapi.client.notification.get({ notification_id: "notification_id", }); + +/* +List categories for onboarding experience. +*/ +await gapi.client.onboarding.listCategories({ }); + +/* +List available volumes under categories for onboarding experience. +*/ +await gapi.client.onboarding.listCategoryVolumes({ }); + +/* +Returns a stream of personalized book clusters +*/ +await gapi.client.personalizedstream.get({ }); + +/* + +*/ +await gapi.client.promooffer.accept({ }); + +/* + +*/ +await gapi.client.promooffer.dismiss({ }); + +/* +Returns a list of promo offers available to the user +*/ +await gapi.client.promooffer.get({ }); + +/* +Returns Series metadata for the given series ids. +*/ +await gapi.client.series.get({ series_id: "series_id", }); + +/* +Gets volume information for a single volume. +*/ +await gapi.client.volumes.get({ volumeId: "volumeId", }); + +/* +Performs a book search. +*/ +await gapi.client.volumes.list({ q: "q", }); +``` \ No newline at end of file diff --git a/types/gapi.client.books/tsconfig.json b/types/gapi.client.books/tsconfig.json new file mode 100644 index 0000000000..d011bdcf5c --- /dev/null +++ b/types/gapi.client.books/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.books-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.books/tslint.json b/types/gapi.client.books/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.books/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.calendar/gapi.client.calendar-tests.ts b/types/gapi.client.calendar/gapi.client.calendar-tests.ts new file mode 100644 index 0000000000..807816b26f --- /dev/null +++ b/types/gapi.client.calendar/gapi.client.calendar-tests.ts @@ -0,0 +1,275 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('calendar', 'v3', () => { + /** now we can use gapi.client.calendar */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** Manage your calendars */ + 'https://www.googleapis.com/auth/calendar', + /** View your calendars */ + 'https://www.googleapis.com/auth/calendar.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Deletes an access control rule. */ + await gapi.client.acl.delete({ + calendarId: "calendarId", + ruleId: "ruleId", + }); + /** Returns an access control rule. */ + await gapi.client.acl.get({ + calendarId: "calendarId", + ruleId: "ruleId", + }); + /** Creates an access control rule. */ + await gapi.client.acl.insert({ + calendarId: "calendarId", + }); + /** Returns the rules in the access control list for the calendar. */ + await gapi.client.acl.list({ + calendarId: "calendarId", + maxResults: 2, + pageToken: "pageToken", + showDeleted: true, + syncToken: "syncToken", + }); + /** Updates an access control rule. This method supports patch semantics. */ + await gapi.client.acl.patch({ + calendarId: "calendarId", + ruleId: "ruleId", + }); + /** Updates an access control rule. */ + await gapi.client.acl.update({ + calendarId: "calendarId", + ruleId: "ruleId", + }); + /** Watch for changes to ACL resources. */ + await gapi.client.acl.watch({ + calendarId: "calendarId", + maxResults: 2, + pageToken: "pageToken", + showDeleted: true, + syncToken: "syncToken", + }); + /** Deletes an entry on the user's calendar list. */ + await gapi.client.calendarList.delete({ + calendarId: "calendarId", + }); + /** Returns an entry on the user's calendar list. */ + await gapi.client.calendarList.get({ + calendarId: "calendarId", + }); + /** Adds an entry to the user's calendar list. */ + await gapi.client.calendarList.insert({ + colorRgbFormat: true, + }); + /** Returns entries on the user's calendar list. */ + await gapi.client.calendarList.list({ + maxResults: 1, + minAccessRole: "minAccessRole", + pageToken: "pageToken", + showDeleted: true, + showHidden: true, + syncToken: "syncToken", + }); + /** Updates an entry on the user's calendar list. This method supports patch semantics. */ + await gapi.client.calendarList.patch({ + calendarId: "calendarId", + colorRgbFormat: true, + }); + /** Updates an entry on the user's calendar list. */ + await gapi.client.calendarList.update({ + calendarId: "calendarId", + colorRgbFormat: true, + }); + /** Watch for changes to CalendarList resources. */ + await gapi.client.calendarList.watch({ + maxResults: 1, + minAccessRole: "minAccessRole", + pageToken: "pageToken", + showDeleted: true, + showHidden: true, + syncToken: "syncToken", + }); + /** Clears a primary calendar. This operation deletes all events associated with the primary calendar of an account. */ + await gapi.client.calendars.clear({ + calendarId: "calendarId", + }); + /** Deletes a secondary calendar. Use calendars.clear for clearing all events on primary calendars. */ + await gapi.client.calendars.delete({ + calendarId: "calendarId", + }); + /** Returns metadata for a calendar. */ + await gapi.client.calendars.get({ + calendarId: "calendarId", + }); + /** Creates a secondary calendar. */ + await gapi.client.calendars.insert({ + }); + /** Updates metadata for a calendar. This method supports patch semantics. */ + await gapi.client.calendars.patch({ + calendarId: "calendarId", + }); + /** Updates metadata for a calendar. */ + await gapi.client.calendars.update({ + calendarId: "calendarId", + }); + /** Stop watching resources through this channel */ + await gapi.client.channels.stop({ + }); + /** Returns the color definitions for calendars and events. */ + await gapi.client.colors.get({ + }); + /** Deletes an event. */ + await gapi.client.events.delete({ + calendarId: "calendarId", + eventId: "eventId", + sendNotifications: true, + }); + /** Returns an event. */ + await gapi.client.events.get({ + alwaysIncludeEmail: true, + calendarId: "calendarId", + eventId: "eventId", + maxAttendees: 4, + timeZone: "timeZone", + }); + /** Imports an event. This operation is used to add a private copy of an existing event to a calendar. */ + await gapi.client.events.import({ + calendarId: "calendarId", + supportsAttachments: true, + }); + /** Creates an event. */ + await gapi.client.events.insert({ + calendarId: "calendarId", + maxAttendees: 2, + sendNotifications: true, + supportsAttachments: true, + }); + /** Returns instances of the specified recurring event. */ + await gapi.client.events.instances({ + alwaysIncludeEmail: true, + calendarId: "calendarId", + eventId: "eventId", + maxAttendees: 4, + maxResults: 5, + originalStart: "originalStart", + pageToken: "pageToken", + showDeleted: true, + timeMax: "timeMax", + timeMin: "timeMin", + timeZone: "timeZone", + }); + /** Returns events on the specified calendar. */ + await gapi.client.events.list({ + alwaysIncludeEmail: true, + calendarId: "calendarId", + iCalUID: "iCalUID", + maxAttendees: 4, + maxResults: 5, + orderBy: "orderBy", + pageToken: "pageToken", + privateExtendedProperty: "privateExtendedProperty", + q: "q", + sharedExtendedProperty: "sharedExtendedProperty", + showDeleted: true, + showHiddenInvitations: true, + singleEvents: true, + syncToken: "syncToken", + timeMax: "timeMax", + timeMin: "timeMin", + timeZone: "timeZone", + updatedMin: "updatedMin", + }); + /** Moves an event to another calendar, i.e. changes an event's organizer. */ + await gapi.client.events.move({ + calendarId: "calendarId", + destination: "destination", + eventId: "eventId", + sendNotifications: true, + }); + /** Updates an event. This method supports patch semantics. */ + await gapi.client.events.patch({ + alwaysIncludeEmail: true, + calendarId: "calendarId", + eventId: "eventId", + maxAttendees: 4, + sendNotifications: true, + supportsAttachments: true, + }); + /** Creates an event based on a simple text string. */ + await gapi.client.events.quickAdd({ + calendarId: "calendarId", + sendNotifications: true, + text: "text", + }); + /** Updates an event. */ + await gapi.client.events.update({ + alwaysIncludeEmail: true, + calendarId: "calendarId", + eventId: "eventId", + maxAttendees: 4, + sendNotifications: true, + supportsAttachments: true, + }); + /** Watch for changes to Events resources. */ + await gapi.client.events.watch({ + alwaysIncludeEmail: true, + calendarId: "calendarId", + iCalUID: "iCalUID", + maxAttendees: 4, + maxResults: 5, + orderBy: "orderBy", + pageToken: "pageToken", + privateExtendedProperty: "privateExtendedProperty", + q: "q", + sharedExtendedProperty: "sharedExtendedProperty", + showDeleted: true, + showHiddenInvitations: true, + singleEvents: true, + syncToken: "syncToken", + timeMax: "timeMax", + timeMin: "timeMin", + timeZone: "timeZone", + updatedMin: "updatedMin", + }); + /** Returns free/busy information for a set of calendars. */ + await gapi.client.freebusy.query({ + }); + /** Returns a single user setting. */ + await gapi.client.settings.get({ + setting: "setting", + }); + /** Returns all user settings for the authenticated user. */ + await gapi.client.settings.list({ + maxResults: 1, + pageToken: "pageToken", + syncToken: "syncToken", + }); + /** Watch for changes to Settings resources. */ + await gapi.client.settings.watch({ + maxResults: 1, + pageToken: "pageToken", + syncToken: "syncToken", + }); + } +}); diff --git a/types/gapi.client.calendar/index.d.ts b/types/gapi.client.calendar/index.d.ts new file mode 100644 index 0000000000..72196ee150 --- /dev/null +++ b/types/gapi.client.calendar/index.d.ts @@ -0,0 +1,1946 @@ +// Type definitions for Google Calendar API v3 3.0 +// Project: https://developers.google.com/google-apps/calendar/firstapp +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest + +/// + +declare namespace gapi.client { + /** Load Calendar API v3 */ + function load(name: "calendar", version: "v3"): PromiseLike; + function load(name: "calendar", version: "v3", callback: () => any): void; + + const acl: calendar.AclResource; + + const calendarList: calendar.CalendarListResource; + + const calendars: calendar.CalendarsResource; + + const channels: calendar.ChannelsResource; + + const colors: calendar.ColorsResource; + + const events: calendar.EventsResource; + + const freebusy: calendar.FreebusyResource; + + const settings: calendar.SettingsResource; + + namespace calendar { + interface Acl { + /** ETag of the collection. */ + etag?: string; + /** List of rules on the access control list. */ + items?: AclRule[]; + /** Type of the collection ("calendar#acl"). */ + kind?: string; + /** Token used to access the next page of this result. Omitted if no further results are available, in which case nextSyncToken is provided. */ + nextPageToken?: string; + /** + * Token used at a later point in time to retrieve only the entries that have changed since this result was returned. Omitted if further results are + * available, in which case nextPageToken is provided. + */ + nextSyncToken?: string; + } + interface AclRule { + /** ETag of the resource. */ + etag?: string; + /** Identifier of the ACL rule. */ + id?: string; + /** Type of the resource ("calendar#aclRule"). */ + kind?: string; + /** + * The role assigned to the scope. Possible values are: + * - "none" - Provides no access. + * - "freeBusyReader" - Provides read access to free/busy information. + * - "reader" - Provides read access to the calendar. Private events will appear to users with reader access, but event details will be hidden. + * - "writer" - Provides read and write access to the calendar. Private events will appear to users with writer access, and event details will be visible. + * + * - "owner" - Provides ownership of the calendar. This role has all of the permissions of the writer role with the additional ability to see and + * manipulate ACLs. + */ + role?: string; + /** The scope of the rule. */ + scope?: { + /** + * The type of the scope. Possible values are: + * - "default" - The public scope. This is the default value. + * - "user" - Limits the scope to a single user. + * - "group" - Limits the scope to a group. + * - "domain" - Limits the scope to a domain. Note: The permissions granted to the "default", or public, scope apply to any user, authenticated or not. + */ + type?: string; + /** The email address of a user or group, or the name of a domain, depending on the scope type. Omitted for type "default". */ + value?: string; + }; + } + interface Calendar { + /** Description of the calendar. Optional. */ + description?: string; + /** ETag of the resource. */ + etag?: string; + /** Identifier of the calendar. To retrieve IDs call the calendarList.list() method. */ + id?: string; + /** Type of the resource ("calendar#calendar"). */ + kind?: string; + /** Geographic location of the calendar as free-form text. Optional. */ + location?: string; + /** Title of the calendar. */ + summary?: string; + /** The time zone of the calendar. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) Optional. */ + timeZone?: string; + } + interface CalendarList { + /** ETag of the collection. */ + etag?: string; + /** Calendars that are present on the user's calendar list. */ + items?: CalendarListEntry[]; + /** Type of the collection ("calendar#calendarList"). */ + kind?: string; + /** Token used to access the next page of this result. Omitted if no further results are available, in which case nextSyncToken is provided. */ + nextPageToken?: string; + /** + * Token used at a later point in time to retrieve only the entries that have changed since this result was returned. Omitted if further results are + * available, in which case nextPageToken is provided. + */ + nextSyncToken?: string; + } + interface CalendarListEntry { + /** + * The effective access role that the authenticated user has on the calendar. Read-only. Possible values are: + * - "freeBusyReader" - Provides read access to free/busy information. + * - "reader" - Provides read access to the calendar. Private events will appear to users with reader access, but event details will be hidden. + * - "writer" - Provides read and write access to the calendar. Private events will appear to users with writer access, and event details will be visible. + * + * - "owner" - Provides ownership of the calendar. This role has all of the permissions of the writer role with the additional ability to see and + * manipulate ACLs. + */ + accessRole?: string; + /** + * The main color of the calendar in the hexadecimal format "#0088aa". This property supersedes the index-based colorId property. To set or change this + * property, you need to specify colorRgbFormat=true in the parameters of the insert, update and patch methods. Optional. + */ + backgroundColor?: string; + /** + * The color of the calendar. This is an ID referring to an entry in the calendar section of the colors definition (see the colors endpoint). This + * property is superseded by the backgroundColor and foregroundColor properties and can be ignored when using these properties. Optional. + */ + colorId?: string; + /** The default reminders that the authenticated user has for this calendar. */ + defaultReminders?: EventReminder[]; + /** Whether this calendar list entry has been deleted from the calendar list. Read-only. Optional. The default is False. */ + deleted?: boolean; + /** Description of the calendar. Optional. Read-only. */ + description?: string; + /** ETag of the resource. */ + etag?: string; + /** + * The foreground color of the calendar in the hexadecimal format "#ffffff". This property supersedes the index-based colorId property. To set or change + * this property, you need to specify colorRgbFormat=true in the parameters of the insert, update and patch methods. Optional. + */ + foregroundColor?: string; + /** Whether the calendar has been hidden from the list. Optional. The default is False. */ + hidden?: boolean; + /** Identifier of the calendar. */ + id?: string; + /** Type of the resource ("calendar#calendarListEntry"). */ + kind?: string; + /** Geographic location of the calendar as free-form text. Optional. Read-only. */ + location?: string; + /** The notifications that the authenticated user is receiving for this calendar. */ + notificationSettings?: { + /** The list of notifications set for this calendar. */ + notifications?: CalendarNotification[]; + }; + /** Whether the calendar is the primary calendar of the authenticated user. Read-only. Optional. The default is False. */ + primary?: boolean; + /** Whether the calendar content shows up in the calendar UI. Optional. The default is False. */ + selected?: boolean; + /** Title of the calendar. Read-only. */ + summary?: string; + /** The summary that the authenticated user has set for this calendar. Optional. */ + summaryOverride?: string; + /** The time zone of the calendar. Optional. Read-only. */ + timeZone?: string; + } + interface CalendarNotification { + /** + * The method used to deliver the notification. Possible values are: + * - "email" - Reminders are sent via email. + * - "sms" - Reminders are sent via SMS. This value is read-only and is ignored on inserts and updates. SMS reminders are only available for G Suite + * customers. + */ + method?: string; + /** + * The type of notification. Possible values are: + * - "eventCreation" - Notification sent when a new event is put on the calendar. + * - "eventChange" - Notification sent when an event is changed. + * - "eventCancellation" - Notification sent when an event is cancelled. + * - "eventResponse" - Notification sent when an event is changed. + * - "agenda" - An agenda with the events of the day (sent out in the morning). + */ + type?: string; + } + interface Channel { + /** The address where notifications are delivered for this channel. */ + address?: string; + /** Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. */ + expiration?: string; + /** A UUID or similar unique string that identifies this channel. */ + id?: string; + /** Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel". */ + kind?: string; + /** Additional parameters controlling delivery channel behavior. Optional. */ + params?: Record; + /** A Boolean value to indicate whether payload is wanted. Optional. */ + payload?: boolean; + /** An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. */ + resourceId?: string; + /** A version-specific identifier for the watched resource. */ + resourceUri?: string; + /** An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. */ + token?: string; + /** The type of delivery mechanism used for this channel. */ + type?: string; + } + interface ColorDefinition { + /** The background color associated with this color definition. */ + background?: string; + /** The foreground color that can be used to write on top of a background with 'background' color. */ + foreground?: string; + } + interface Colors { + /** + * A global palette of calendar colors, mapping from the color ID to its definition. A calendarListEntry resource refers to one of these color IDs in its + * color field. Read-only. + */ + calendar?: Record; + /** + * A global palette of event colors, mapping from the color ID to its definition. An event resource may refer to one of these color IDs in its color + * field. Read-only. + */ + event?: Record; + /** Type of the resource ("calendar#colors"). */ + kind?: string; + /** Last modification time of the color palette (as a RFC3339 timestamp). Read-only. */ + updated?: string; + } + interface Error { + /** Domain, or broad category, of the error. */ + domain?: string; + /** + * Specific reason for the error. Some of the possible values are: + * - "groupTooBig" - The group of users requested is too large for a single query. + * - "tooManyCalendarsRequested" - The number of calendars requested is too large for a single query. + * - "notFound" - The requested resource was not found. + * - "internalError" - The API service has encountered an internal error. Additional error types may be added in the future, so clients should gracefully + * handle additional error statuses not included in this list. + */ + reason?: string; + } + interface Event { + /** Whether anyone can invite themselves to the event (currently works for Google+ events only). Optional. The default is False. */ + anyoneCanAddSelf?: boolean; + /** + * File attachments for the event. Currently only Google Drive attachments are supported. + * In order to modify attachments the supportsAttachments request parameter should be set to true. + * There can be at most 25 attachments per event, + */ + attachments?: EventAttachment[]; + /** The attendees of the event. See the Events with attendees guide for more information on scheduling events with other calendar users. */ + attendees?: EventAttendee[]; + /** + * Whether attendees may have been omitted from the event's representation. When retrieving an event, this may be due to a restriction specified by the + * maxAttendee query parameter. When updating an event, this can be used to only update the participant's response. Optional. The default is False. + */ + attendeesOmitted?: boolean; + /** The color of the event. This is an ID referring to an entry in the event section of the colors definition (see the colors endpoint). Optional. */ + colorId?: string; + /** Creation time of the event (as a RFC3339 timestamp). Read-only. */ + created?: string; + /** The creator of the event. Read-only. */ + creator?: { + /** The creator's name, if available. */ + displayName?: string; + /** The creator's email address, if available. */ + email?: string; + /** The creator's Profile ID, if available. It corresponds to theid field in the People collection of the Google+ API */ + id?: string; + /** Whether the creator corresponds to the calendar on which this copy of the event appears. Read-only. The default is False. */ + self?: boolean; + }; + /** Description of the event. Optional. */ + description?: string; + /** The (exclusive) end time of the event. For a recurring event, this is the end time of the first instance. */ + end?: EventDateTime; + /** + * Whether the end time is actually unspecified. An end time is still provided for compatibility reasons, even if this attribute is set to True. The + * default is False. + */ + endTimeUnspecified?: boolean; + /** ETag of the resource. */ + etag?: string; + /** Extended properties of the event. */ + extendedProperties?: { + /** Properties that are private to the copy of the event that appears on this calendar. */ + private?: Record; + /** Properties that are shared between copies of the event on other attendees' calendars. */ + shared?: Record; + }; + /** A gadget that extends this event. */ + gadget?: { + /** + * The gadget's display mode. Optional. Possible values are: + * - "icon" - The gadget displays next to the event's title in the calendar view. + * - "chip" - The gadget displays when the event is clicked. + */ + display?: string; + /** The gadget's height in pixels. The height must be an integer greater than 0. Optional. */ + height?: number; + /** The gadget's icon URL. The URL scheme must be HTTPS. */ + iconLink?: string; + /** The gadget's URL. The URL scheme must be HTTPS. */ + link?: string; + /** Preferences. */ + preferences?: Record; + /** The gadget's title. */ + title?: string; + /** The gadget's type. */ + type?: string; + /** The gadget's width in pixels. The width must be an integer greater than 0. Optional. */ + width?: number; + }; + /** Whether attendees other than the organizer can invite others to the event. Optional. The default is True. */ + guestsCanInviteOthers?: boolean; + /** Whether attendees other than the organizer can modify the event. Optional. The default is False. */ + guestsCanModify?: boolean; + /** Whether attendees other than the organizer can see who the event's attendees are. Optional. The default is True. */ + guestsCanSeeOtherGuests?: boolean; + /** An absolute link to the Google+ hangout associated with this event. Read-only. */ + hangoutLink?: string; + /** An absolute link to this event in the Google Calendar Web UI. Read-only. */ + htmlLink?: string; + /** + * Event unique identifier as defined in RFC5545. It is used to uniquely identify events accross calendaring systems and must be supplied when importing + * events via the import method. + * Note that the icalUID and the id are not identical and only one of them should be supplied at event creation time. One difference in their semantics is + * that in recurring events, all occurrences of one event have different ids while they all share the same icalUIDs. + */ + iCalUID?: string; + /** + * Opaque identifier of the event. When creating new single or recurring events, you can specify their IDs. Provided IDs must follow these rules: + * - characters allowed in the ID are those used in base32hex encoding, i.e. lowercase letters a-v and digits 0-9, see section 3.1.2 in RFC2938 + * - the length of the ID must be between 5 and 1024 characters + * - the ID must be unique per calendar Due to the globally distributed nature of the system, we cannot guarantee that ID collisions will be detected at + * event creation time. To minimize the risk of collisions we recommend using an established UUID algorithm such as one described in RFC4122. + * If you do not specify an ID, it will be automatically generated by the server. + * Note that the icalUID and the id are not identical and only one of them should be supplied at event creation time. One difference in their semantics is + * that in recurring events, all occurrences of one event have different ids while they all share the same icalUIDs. + */ + id?: string; + /** Type of the resource ("calendar#event"). */ + kind?: string; + /** Geographic location of the event as free-form text. Optional. */ + location?: string; + /** + * Whether this is a locked event copy where no changes can be made to the main event fields "summary", "description", "location", "start", "end" or + * "recurrence". The default is False. Read-Only. + */ + locked?: boolean; + /** + * The organizer of the event. If the organizer is also an attendee, this is indicated with a separate entry in attendees with the organizer field set to + * True. To change the organizer, use the move operation. Read-only, except when importing an event. + */ + organizer?: { + /** The organizer's name, if available. */ + displayName?: string; + /** The organizer's email address, if available. It must be a valid email address as per RFC5322. */ + email?: string; + /** The organizer's Profile ID, if available. It corresponds to theid field in the People collection of the Google+ API */ + id?: string; + /** Whether the organizer corresponds to the calendar on which this copy of the event appears. Read-only. The default is False. */ + self?: boolean; + }; + /** + * For an instance of a recurring event, this is the time at which this event would start according to the recurrence data in the recurring event + * identified by recurringEventId. Immutable. + */ + originalStartTime?: EventDateTime; + /** Whether this is a private event copy where changes are not shared with other copies on other calendars. Optional. Immutable. The default is False. */ + privateCopy?: boolean; + /** + * List of RRULE, EXRULE, RDATE and EXDATE lines for a recurring event, as specified in RFC5545. Note that DTSTART and DTEND lines are not allowed in this + * field; event start and end times are specified in the start and end fields. This field is omitted for single events or instances of recurring events. + */ + recurrence?: string[]; + /** For an instance of a recurring event, this is the id of the recurring event to which this instance belongs. Immutable. */ + recurringEventId?: string; + /** Information about the event's reminders for the authenticated user. */ + reminders?: { + /** + * If the event doesn't use the default reminders, this lists the reminders specific to the event, or, if not set, indicates that no reminders are set for + * this event. The maximum number of override reminders is 5. + */ + overrides?: EventReminder[]; + /** Whether the default reminders of the calendar apply to the event. */ + useDefault?: boolean; + }; + /** Sequence number as per iCalendar. */ + sequence?: number; + /** + * Source from which the event was created. For example, a web page, an email message or any document identifiable by an URL with HTTP or HTTPS scheme. + * Can only be seen or modified by the creator of the event. + */ + source?: { + /** Title of the source; for example a title of a web page or an email subject. */ + title?: string; + /** URL of the source pointing to a resource. The URL scheme must be HTTP or HTTPS. */ + url?: string; + }; + /** The (inclusive) start time of the event. For a recurring event, this is the start time of the first instance. */ + start?: EventDateTime; + /** + * Status of the event. Optional. Possible values are: + * - "confirmed" - The event is confirmed. This is the default status. + * - "tentative" - The event is tentatively confirmed. + * - "cancelled" - The event is cancelled. + */ + status?: string; + /** Title of the event. */ + summary?: string; + /** + * Whether the event blocks time on the calendar. Optional. Possible values are: + * - "opaque" - Default value. The event does block time on the calendar. This is equivalent to setting Show me as to Busy in the Calendar UI. + * - "transparent" - The event does not block time on the calendar. This is equivalent to setting Show me as to Available in the Calendar UI. + */ + transparency?: string; + /** Last modification time of the event (as a RFC3339 timestamp). Read-only. */ + updated?: string; + /** + * Visibility of the event. Optional. Possible values are: + * - "default" - Uses the default visibility for events on the calendar. This is the default value. + * - "public" - The event is public and event details are visible to all readers of the calendar. + * - "private" - The event is private and only event attendees may view event details. + * - "confidential" - The event is private. This value is provided for compatibility reasons. + */ + visibility?: string; + } + interface EventAttachment { + /** + * ID of the attached file. Read-only. + * For Google Drive files, this is the ID of the corresponding Files resource entry in the Drive API. + */ + fileId?: string; + /** + * URL link to the attachment. + * For adding Google Drive file attachments use the same format as in alternateLink property of the Files resource in the Drive API. + */ + fileUrl?: string; + /** URL link to the attachment's icon. Read-only. */ + iconLink?: string; + /** Internet media type (MIME type) of the attachment. */ + mimeType?: string; + /** Attachment title. */ + title?: string; + } + interface EventAttendee { + /** Number of additional guests. Optional. The default is 0. */ + additionalGuests?: number; + /** The attendee's response comment. Optional. */ + comment?: string; + /** The attendee's name, if available. Optional. */ + displayName?: string; + /** The attendee's email address, if available. This field must be present when adding an attendee. It must be a valid email address as per RFC5322. */ + email?: string; + /** The attendee's Profile ID, if available. It corresponds to theid field in the People collection of the Google+ API */ + id?: string; + /** Whether this is an optional attendee. Optional. The default is False. */ + optional?: boolean; + /** Whether the attendee is the organizer of the event. Read-only. The default is False. */ + organizer?: boolean; + /** Whether the attendee is a resource. Read-only. The default is False. */ + resource?: boolean; + /** + * The attendee's response status. Possible values are: + * - "needsAction" - The attendee has not responded to the invitation. + * - "declined" - The attendee has declined the invitation. + * - "tentative" - The attendee has tentatively accepted the invitation. + * - "accepted" - The attendee has accepted the invitation. + */ + responseStatus?: string; + /** Whether this entry represents the calendar on which this copy of the event appears. Read-only. The default is False. */ + self?: boolean; + } + interface EventDateTime { + /** The date, in the format "yyyy-mm-dd", if this is an all-day event. */ + date?: string; + /** + * The time, as a combined date-time value (formatted according to RFC3339). A time zone offset is required unless a time zone is explicitly specified in + * timeZone. + */ + dateTime?: string; + /** + * The time zone in which the time is specified. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) For recurring events this field is + * required and specifies the time zone in which the recurrence is expanded. For single events this field is optional and indicates a custom time zone for + * the event start/end. + */ + timeZone?: string; + } + interface EventReminder { + /** + * The method used by this reminder. Possible values are: + * - "email" - Reminders are sent via email. + * - "sms" - Reminders are sent via SMS. These are only available for G Suite customers. Requests to set SMS reminders for other account types are + * ignored. + * - "popup" - Reminders are sent via a UI popup. + */ + method?: string; + /** Number of minutes before the start of the event when the reminder should trigger. Valid values are between 0 and 40320 (4 weeks in minutes). */ + minutes?: number; + } + interface Events { + /** + * The user's access role for this calendar. Read-only. Possible values are: + * - "none" - The user has no access. + * - "freeBusyReader" - The user has read access to free/busy information. + * - "reader" - The user has read access to the calendar. Private events will appear to users with reader access, but event details will be hidden. + * - "writer" - The user has read and write access to the calendar. Private events will appear to users with writer access, and event details will be + * visible. + * - "owner" - The user has ownership of the calendar. This role has all of the permissions of the writer role with the additional ability to see and + * manipulate ACLs. + */ + accessRole?: string; + /** + * The default reminders on the calendar for the authenticated user. These reminders apply to all events on this calendar that do not explicitly override + * them (i.e. do not have reminders.useDefault set to True). + */ + defaultReminders?: EventReminder[]; + /** Description of the calendar. Read-only. */ + description?: string; + /** ETag of the collection. */ + etag?: string; + /** List of events on the calendar. */ + items?: Event[]; + /** Type of the collection ("calendar#events"). */ + kind?: string; + /** Token used to access the next page of this result. Omitted if no further results are available, in which case nextSyncToken is provided. */ + nextPageToken?: string; + /** + * Token used at a later point in time to retrieve only the entries that have changed since this result was returned. Omitted if further results are + * available, in which case nextPageToken is provided. + */ + nextSyncToken?: string; + /** Title of the calendar. Read-only. */ + summary?: string; + /** The time zone of the calendar. Read-only. */ + timeZone?: string; + /** Last modification time of the calendar (as a RFC3339 timestamp). Read-only. */ + updated?: string; + } + interface FreeBusyCalendar { + /** List of time ranges during which this calendar should be regarded as busy. */ + busy?: TimePeriod[]; + /** Optional error(s) (if computation for the calendar failed). */ + errors?: Error[]; + } + interface FreeBusyGroup { + /** List of calendars' identifiers within a group. */ + calendars?: string[]; + /** Optional error(s) (if computation for the group failed). */ + errors?: Error[]; + } + interface FreeBusyRequest { + /** Maximal number of calendars for which FreeBusy information is to be provided. Optional. */ + calendarExpansionMax?: number; + /** + * Maximal number of calendar identifiers to be provided for a single group. Optional. An error will be returned for a group with more members than this + * value. + */ + groupExpansionMax?: number; + /** List of calendars and/or groups to query. */ + items?: FreeBusyRequestItem[]; + /** The end of the interval for the query. */ + timeMax?: string; + /** The start of the interval for the query. */ + timeMin?: string; + /** Time zone used in the response. Optional. The default is UTC. */ + timeZone?: string; + } + interface FreeBusyRequestItem { + /** The identifier of a calendar or a group. */ + id?: string; + } + interface FreeBusyResponse { + /** List of free/busy information for calendars. */ + calendars?: Record; + /** Expansion of groups. */ + groups?: Record; + /** Type of the resource ("calendar#freeBusy"). */ + kind?: string; + /** The end of the interval. */ + timeMax?: string; + /** The start of the interval. */ + timeMin?: string; + } + interface Setting { + /** ETag of the resource. */ + etag?: string; + /** The id of the user setting. */ + id?: string; + /** Type of the resource ("calendar#setting"). */ + kind?: string; + /** Value of the user setting. The format of the value depends on the ID of the setting. It must always be a UTF-8 string of length up to 1024 characters. */ + value?: string; + } + interface Settings { + /** Etag of the collection. */ + etag?: string; + /** List of user settings. */ + items?: Setting[]; + /** Type of the collection ("calendar#settings"). */ + kind?: string; + /** Token used to access the next page of this result. Omitted if no further results are available, in which case nextSyncToken is provided. */ + nextPageToken?: string; + /** + * Token used at a later point in time to retrieve only the entries that have changed since this result was returned. Omitted if further results are + * available, in which case nextPageToken is provided. + */ + nextSyncToken?: string; + } + interface TimePeriod { + /** The (exclusive) end of the time period. */ + end?: string; + /** The (inclusive) start of the time period. */ + start?: string; + } + interface AclResource { + /** Deletes an access control rule. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ACL rule identifier. */ + ruleId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns an access control rule. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ACL rule identifier. */ + ruleId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates an access control rule. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the rules in the access control list for the calendar. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. + * Optional. + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Token specifying which result page to return. Optional. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Whether to include deleted ACLs in the result. Deleted ACLs are represented by role equal to "none". Deleted ACLs will always be included if syncToken + * is provided. Optional. The default is False. + */ + showDeleted?: boolean; + /** + * Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list + * request contain only entries that have changed since then. All entries deleted since the previous list request will always be in the result set and it + * is not allowed to set showDeleted to False. + * If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full + * synchronization without any syncToken. + * Learn more about incremental synchronization. + * Optional. The default is to return all entries. + */ + syncToken?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an access control rule. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ACL rule identifier. */ + ruleId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an access control rule. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ACL rule identifier. */ + ruleId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Watch for changes to ACL resources. */ + watch(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. + * Optional. + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Token specifying which result page to return. Optional. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Whether to include deleted ACLs in the result. Deleted ACLs are represented by role equal to "none". Deleted ACLs will always be included if syncToken + * is provided. Optional. The default is False. + */ + showDeleted?: boolean; + /** + * Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list + * request contain only entries that have changed since then. All entries deleted since the previous list request will always be in the result set and it + * is not allowed to set showDeleted to False. + * If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full + * synchronization without any syncToken. + * Learn more about incremental synchronization. + * Optional. The default is to return all entries. + */ + syncToken?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CalendarListResource { + /** Deletes an entry on the user's calendar list. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns an entry on the user's calendar list. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Adds an entry to the user's calendar list. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** + * Whether to use the foregroundColor and backgroundColor fields to write the calendar colors (RGB). If this feature is used, the index-based colorId + * field will be set to the best matching option automatically. Optional. The default is False. + */ + colorRgbFormat?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns entries on the user's calendar list. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. + * Optional. + */ + maxResults?: number; + /** The minimum access role for the user in the returned entries. Optional. The default is no restriction. */ + minAccessRole?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Token specifying which result page to return. Optional. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether to include deleted calendar list entries in the result. Optional. The default is False. */ + showDeleted?: boolean; + /** Whether to show hidden entries. Optional. The default is False. */ + showHidden?: boolean; + /** + * Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list + * request contain only entries that have changed since then. If only read-only fields such as calendar properties or ACLs have changed, the entry won't + * be returned. All entries deleted and hidden since the previous list request will always be in the result set and it is not allowed to set showDeleted + * neither showHidden to False. + * To ensure client state consistency minAccessRole query parameter cannot be specified together with nextSyncToken. + * If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full + * synchronization without any syncToken. + * Learn more about incremental synchronization. + * Optional. The default is to return all entries. + */ + syncToken?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an entry on the user's calendar list. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** + * Whether to use the foregroundColor and backgroundColor fields to write the calendar colors (RGB). If this feature is used, the index-based colorId + * field will be set to the best matching option automatically. Optional. The default is False. + */ + colorRgbFormat?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an entry on the user's calendar list. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** + * Whether to use the foregroundColor and backgroundColor fields to write the calendar colors (RGB). If this feature is used, the index-based colorId + * field will be set to the best matching option automatically. Optional. The default is False. + */ + colorRgbFormat?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Watch for changes to CalendarList resources. */ + watch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. + * Optional. + */ + maxResults?: number; + /** The minimum access role for the user in the returned entries. Optional. The default is no restriction. */ + minAccessRole?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Token specifying which result page to return. Optional. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether to include deleted calendar list entries in the result. Optional. The default is False. */ + showDeleted?: boolean; + /** Whether to show hidden entries. Optional. The default is False. */ + showHidden?: boolean; + /** + * Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list + * request contain only entries that have changed since then. If only read-only fields such as calendar properties or ACLs have changed, the entry won't + * be returned. All entries deleted and hidden since the previous list request will always be in the result set and it is not allowed to set showDeleted + * neither showHidden to False. + * To ensure client state consistency minAccessRole query parameter cannot be specified together with nextSyncToken. + * If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full + * synchronization without any syncToken. + * Learn more about incremental synchronization. + * Optional. The default is to return all entries. + */ + syncToken?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CalendarsResource { + /** Clears a primary calendar. This operation deletes all events associated with the primary calendar of an account. */ + clear(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes a secondary calendar. Use calendars.clear for clearing all events on primary calendars. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns metadata for a calendar. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a secondary calendar. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates metadata for a calendar. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates metadata for a calendar. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ChannelsResource { + /** Stop watching resources through this channel */ + stop(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ColorsResource { + /** Returns the color definitions for calendars and events. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface EventsResource { + /** Deletes an event. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Event identifier. */ + eventId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether to send notifications about the deletion of the event. Optional. The default is False. */ + sendNotifications?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns an event. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** + * Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, + * non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an + * email address value in the mentioned places. Optional. The default is False. + */ + alwaysIncludeEmail?: boolean; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Event identifier. */ + eventId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. + * Optional. + */ + maxAttendees?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Time zone used in the response. Optional. The default is the time zone of the calendar. */ + timeZone?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Imports an event. This operation is used to add a private copy of an existing event to a calendar. */ + import(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether API client performing operation supports event attachments. Optional. The default is False. */ + supportsAttachments?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates an event. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. + * Optional. + */ + maxAttendees?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether to send notifications about the creation of the new event. Optional. The default is False. */ + sendNotifications?: boolean; + /** Whether API client performing operation supports event attachments. Optional. The default is False. */ + supportsAttachments?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns instances of the specified recurring event. */ + instances(request: { + /** Data format for the response. */ + alt?: string; + /** + * Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, + * non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an + * email address value in the mentioned places. Optional. The default is False. + */ + alwaysIncludeEmail?: boolean; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Recurring event identifier. */ + eventId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. + * Optional. + */ + maxAttendees?: number; + /** Maximum number of events returned on one result page. By default the value is 250 events. The page size can never be larger than 2500 events. Optional. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The original start time of the instance in the result. Optional. */ + originalStart?: string; + /** Token specifying which result page to return. Optional. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Whether to include deleted events (with status equals "cancelled") in the result. Cancelled instances of recurring events will still be included if + * singleEvents is False. Optional. The default is False. + */ + showDeleted?: boolean; + /** + * Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with + * mandatory time zone offset. + */ + timeMax?: string; + /** + * Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with + * mandatory time zone offset. + */ + timeMin?: string; + /** Time zone used in the response. Optional. The default is the time zone of the calendar. */ + timeZone?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns events on the specified calendar. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** + * Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, + * non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an + * email address value in the mentioned places. Optional. The default is False. + */ + alwaysIncludeEmail?: boolean; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Specifies event ID in the iCalendar format to be included in the response. Optional. */ + iCalUID?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. + * Optional. + */ + maxAttendees?: number; + /** + * Maximum number of events returned on one result page. The number of events in the resulting page may be less than this value, or none at all, even if + * there are more events matching the query. Incomplete pages can be detected by a non-empty nextPageToken field in the response. By default the value is + * 250 events. The page size can never be larger than 2500 events. Optional. + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The order of the events returned in the result. Optional. The default is an unspecified, stable order. */ + orderBy?: string; + /** Token specifying which result page to return. Optional. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Extended properties constraint specified as propertyName=value. Matches only private properties. This parameter might be repeated multiple times to + * return events that match all given constraints. + */ + privateExtendedProperty?: string; + /** Free text search terms to find events that match these terms in any field, except for extended properties. Optional. */ + q?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Extended properties constraint specified as propertyName=value. Matches only shared properties. This parameter might be repeated multiple times to + * return events that match all given constraints. + */ + sharedExtendedProperty?: string; + /** + * Whether to include deleted events (with status equals "cancelled") in the result. Cancelled instances of recurring events (but not the underlying + * recurring event) will still be included if showDeleted and singleEvents are both False. If showDeleted and singleEvents are both True, only single + * instances of deleted events (but not the underlying recurring events) are returned. Optional. The default is False. + */ + showDeleted?: boolean; + /** Whether to include hidden invitations in the result. Optional. The default is False. */ + showHiddenInvitations?: boolean; + /** + * Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying + * recurring events themselves. Optional. The default is False. + */ + singleEvents?: boolean; + /** + * Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list + * request contain only entries that have changed since then. All events deleted since the previous list request will always be in the result set and it + * is not allowed to set showDeleted to False. + * There are several query parameters that cannot be specified together with nextSyncToken to ensure consistency of the client state. + * + * These are: + * - iCalUID + * - orderBy + * - privateExtendedProperty + * - q + * - sharedExtendedProperty + * - timeMin + * - timeMax + * - updatedMin If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full + * synchronization without any syncToken. + * Learn more about incremental synchronization. + * Optional. The default is to return all entries. + */ + syncToken?: string; + /** + * Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with + * mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMin is set, + * timeMax must be greater than timeMin. + */ + timeMax?: string; + /** + * Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with + * mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMax is set, + * timeMin must be smaller than timeMax. + */ + timeMin?: string; + /** Time zone used in the response. Optional. The default is the time zone of the calendar. */ + timeZone?: string; + /** + * Lower bound for an event's last modification time (as a RFC3339 timestamp) to filter by. When specified, entries deleted since this time will always be + * included regardless of showDeleted. Optional. The default is not to filter by last modification time. + */ + updatedMin?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Moves an event to another calendar, i.e. changes an event's organizer. */ + move(request: { + /** Data format for the response. */ + alt?: string; + /** Calendar identifier of the source calendar where the event currently is on. */ + calendarId: string; + /** Calendar identifier of the target calendar where the event is to be moved to. */ + destination: string; + /** Event identifier. */ + eventId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether to send notifications about the change of the event's organizer. Optional. The default is False. */ + sendNotifications?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an event. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** + * Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, + * non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an + * email address value in the mentioned places. Optional. The default is False. + */ + alwaysIncludeEmail?: boolean; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Event identifier. */ + eventId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. + * Optional. + */ + maxAttendees?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether to send notifications about the event update (e.g. attendee's responses, title changes, etc.). Optional. The default is False. */ + sendNotifications?: boolean; + /** Whether API client performing operation supports event attachments. Optional. The default is False. */ + supportsAttachments?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates an event based on a simple text string. */ + quickAdd(request: { + /** Data format for the response. */ + alt?: string; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether to send notifications about the creation of the event. Optional. The default is False. */ + sendNotifications?: boolean; + /** The text describing the event to be created. */ + text: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an event. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** + * Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, + * non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an + * email address value in the mentioned places. Optional. The default is False. + */ + alwaysIncludeEmail?: boolean; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Event identifier. */ + eventId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. + * Optional. + */ + maxAttendees?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether to send notifications about the event update (e.g. attendee's responses, title changes, etc.). Optional. The default is False. */ + sendNotifications?: boolean; + /** Whether API client performing operation supports event attachments. Optional. The default is False. */ + supportsAttachments?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Watch for changes to Events resources. */ + watch(request: { + /** Data format for the response. */ + alt?: string; + /** + * Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, + * non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an + * email address value in the mentioned places. Optional. The default is False. + */ + alwaysIncludeEmail?: boolean; + /** + * Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in + * user, use the "primary" keyword. + */ + calendarId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Specifies event ID in the iCalendar format to be included in the response. Optional. */ + iCalUID?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. + * Optional. + */ + maxAttendees?: number; + /** + * Maximum number of events returned on one result page. The number of events in the resulting page may be less than this value, or none at all, even if + * there are more events matching the query. Incomplete pages can be detected by a non-empty nextPageToken field in the response. By default the value is + * 250 events. The page size can never be larger than 2500 events. Optional. + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The order of the events returned in the result. Optional. The default is an unspecified, stable order. */ + orderBy?: string; + /** Token specifying which result page to return. Optional. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Extended properties constraint specified as propertyName=value. Matches only private properties. This parameter might be repeated multiple times to + * return events that match all given constraints. + */ + privateExtendedProperty?: string; + /** Free text search terms to find events that match these terms in any field, except for extended properties. Optional. */ + q?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Extended properties constraint specified as propertyName=value. Matches only shared properties. This parameter might be repeated multiple times to + * return events that match all given constraints. + */ + sharedExtendedProperty?: string; + /** + * Whether to include deleted events (with status equals "cancelled") in the result. Cancelled instances of recurring events (but not the underlying + * recurring event) will still be included if showDeleted and singleEvents are both False. If showDeleted and singleEvents are both True, only single + * instances of deleted events (but not the underlying recurring events) are returned. Optional. The default is False. + */ + showDeleted?: boolean; + /** Whether to include hidden invitations in the result. Optional. The default is False. */ + showHiddenInvitations?: boolean; + /** + * Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying + * recurring events themselves. Optional. The default is False. + */ + singleEvents?: boolean; + /** + * Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list + * request contain only entries that have changed since then. All events deleted since the previous list request will always be in the result set and it + * is not allowed to set showDeleted to False. + * There are several query parameters that cannot be specified together with nextSyncToken to ensure consistency of the client state. + * + * These are: + * - iCalUID + * - orderBy + * - privateExtendedProperty + * - q + * - sharedExtendedProperty + * - timeMin + * - timeMax + * - updatedMin If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full + * synchronization without any syncToken. + * Learn more about incremental synchronization. + * Optional. The default is to return all entries. + */ + syncToken?: string; + /** + * Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with + * mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMin is set, + * timeMax must be greater than timeMin. + */ + timeMax?: string; + /** + * Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with + * mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMax is set, + * timeMin must be smaller than timeMax. + */ + timeMin?: string; + /** Time zone used in the response. Optional. The default is the time zone of the calendar. */ + timeZone?: string; + /** + * Lower bound for an event's last modification time (as a RFC3339 timestamp) to filter by. When specified, entries deleted since this time will always be + * included regardless of showDeleted. Optional. The default is not to filter by last modification time. + */ + updatedMin?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface FreebusyResource { + /** Returns free/busy information for a set of calendars. */ + query(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SettingsResource { + /** Returns a single user setting. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The id of the user setting. */ + setting: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns all user settings for the authenticated user. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. + * Optional. + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Token specifying which result page to return. Optional. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list + * request contain only entries that have changed since then. + * If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full + * synchronization without any syncToken. + * Learn more about incremental synchronization. + * Optional. The default is to return all entries. + */ + syncToken?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Watch for changes to Settings resources. */ + watch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. + * Optional. + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Token specifying which result page to return. Optional. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list + * request contain only entries that have changed since then. + * If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full + * synchronization without any syncToken. + * Learn more about incremental synchronization. + * Optional. The default is to return all entries. + */ + syncToken?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.calendar/readme.md b/types/gapi.client.calendar/readme.md new file mode 100644 index 0000000000..cc864bd556 --- /dev/null +++ b/types/gapi.client.calendar/readme.md @@ -0,0 +1,242 @@ +# TypeScript typings for Calendar API v3 +Manipulates events and other calendar data. +For detailed description please check [documentation](https://developers.google.com/google-apps/calendar/firstapp). + +## Installing + +Install typings for Calendar API: +``` +npm install @types/gapi.client.calendar@v3 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('calendar', 'v3', () => { + // now we can use gapi.client.calendar + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // Manage your calendars + 'https://www.googleapis.com/auth/calendar', + + // View your calendars + 'https://www.googleapis.com/auth/calendar.readonly', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Calendar API resources: + +```typescript + +/* +Deletes an access control rule. +*/ +await gapi.client.acl.delete({ calendarId: "calendarId", ruleId: "ruleId", }); + +/* +Returns an access control rule. +*/ +await gapi.client.acl.get({ calendarId: "calendarId", ruleId: "ruleId", }); + +/* +Creates an access control rule. +*/ +await gapi.client.acl.insert({ calendarId: "calendarId", }); + +/* +Returns the rules in the access control list for the calendar. +*/ +await gapi.client.acl.list({ calendarId: "calendarId", }); + +/* +Updates an access control rule. This method supports patch semantics. +*/ +await gapi.client.acl.patch({ calendarId: "calendarId", ruleId: "ruleId", }); + +/* +Updates an access control rule. +*/ +await gapi.client.acl.update({ calendarId: "calendarId", ruleId: "ruleId", }); + +/* +Watch for changes to ACL resources. +*/ +await gapi.client.acl.watch({ calendarId: "calendarId", }); + +/* +Deletes an entry on the user's calendar list. +*/ +await gapi.client.calendarList.delete({ calendarId: "calendarId", }); + +/* +Returns an entry on the user's calendar list. +*/ +await gapi.client.calendarList.get({ calendarId: "calendarId", }); + +/* +Adds an entry to the user's calendar list. +*/ +await gapi.client.calendarList.insert({ }); + +/* +Returns entries on the user's calendar list. +*/ +await gapi.client.calendarList.list({ }); + +/* +Updates an entry on the user's calendar list. This method supports patch semantics. +*/ +await gapi.client.calendarList.patch({ calendarId: "calendarId", }); + +/* +Updates an entry on the user's calendar list. +*/ +await gapi.client.calendarList.update({ calendarId: "calendarId", }); + +/* +Watch for changes to CalendarList resources. +*/ +await gapi.client.calendarList.watch({ }); + +/* +Clears a primary calendar. This operation deletes all events associated with the primary calendar of an account. +*/ +await gapi.client.calendars.clear({ calendarId: "calendarId", }); + +/* +Deletes a secondary calendar. Use calendars.clear for clearing all events on primary calendars. +*/ +await gapi.client.calendars.delete({ calendarId: "calendarId", }); + +/* +Returns metadata for a calendar. +*/ +await gapi.client.calendars.get({ calendarId: "calendarId", }); + +/* +Creates a secondary calendar. +*/ +await gapi.client.calendars.insert({ }); + +/* +Updates metadata for a calendar. This method supports patch semantics. +*/ +await gapi.client.calendars.patch({ calendarId: "calendarId", }); + +/* +Updates metadata for a calendar. +*/ +await gapi.client.calendars.update({ calendarId: "calendarId", }); + +/* +Stop watching resources through this channel +*/ +await gapi.client.channels.stop({ }); + +/* +Returns the color definitions for calendars and events. +*/ +await gapi.client.colors.get({ }); + +/* +Deletes an event. +*/ +await gapi.client.events.delete({ calendarId: "calendarId", eventId: "eventId", }); + +/* +Returns an event. +*/ +await gapi.client.events.get({ calendarId: "calendarId", eventId: "eventId", }); + +/* +Imports an event. This operation is used to add a private copy of an existing event to a calendar. +*/ +await gapi.client.events.import({ calendarId: "calendarId", }); + +/* +Creates an event. +*/ +await gapi.client.events.insert({ calendarId: "calendarId", }); + +/* +Returns instances of the specified recurring event. +*/ +await gapi.client.events.instances({ calendarId: "calendarId", eventId: "eventId", }); + +/* +Returns events on the specified calendar. +*/ +await gapi.client.events.list({ calendarId: "calendarId", }); + +/* +Moves an event to another calendar, i.e. changes an event's organizer. +*/ +await gapi.client.events.move({ calendarId: "calendarId", destination: "destination", eventId: "eventId", }); + +/* +Updates an event. This method supports patch semantics. +*/ +await gapi.client.events.patch({ calendarId: "calendarId", eventId: "eventId", }); + +/* +Creates an event based on a simple text string. +*/ +await gapi.client.events.quickAdd({ calendarId: "calendarId", text: "text", }); + +/* +Updates an event. +*/ +await gapi.client.events.update({ calendarId: "calendarId", eventId: "eventId", }); + +/* +Watch for changes to Events resources. +*/ +await gapi.client.events.watch({ calendarId: "calendarId", }); + +/* +Returns free/busy information for a set of calendars. +*/ +await gapi.client.freebusy.query({ }); + +/* +Returns a single user setting. +*/ +await gapi.client.settings.get({ setting: "setting", }); + +/* +Returns all user settings for the authenticated user. +*/ +await gapi.client.settings.list({ }); + +/* +Watch for changes to Settings resources. +*/ +await gapi.client.settings.watch({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.calendar/tsconfig.json b/types/gapi.client.calendar/tsconfig.json new file mode 100644 index 0000000000..5d44c3d92a --- /dev/null +++ b/types/gapi.client.calendar/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.calendar-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.calendar/tslint.json b/types/gapi.client.calendar/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.calendar/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.civicinfo/gapi.client.civicinfo-tests.ts b/types/gapi.client.civicinfo/gapi.client.civicinfo-tests.ts new file mode 100644 index 0000000000..7a6270dfa5 --- /dev/null +++ b/types/gapi.client.civicinfo/gapi.client.civicinfo-tests.ts @@ -0,0 +1,44 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('civicinfo', 'v2', () => { + /** now we can use gapi.client.civicinfo */ + + run(); + }); + + async function run() { + /** Searches for political divisions by their natural name or OCD ID. */ + await gapi.client.divisions.search({ + query: "query", + }); + /** List of available elections to query. */ + await gapi.client.elections.electionQuery({ + }); + /** Looks up information relevant to a voter based on the voter's registered address. */ + await gapi.client.elections.voterInfoQuery({ + address: "address", + electionId: "electionId", + officialOnly: true, + returnAllAvailableData: true, + }); + /** Looks up political geography and representative information for a single address. */ + await gapi.client.representatives.representativeInfoByAddress({ + address: "address", + includeOffices: true, + levels: "levels", + roles: "roles", + }); + /** Looks up representative information for a single geographic division. */ + await gapi.client.representatives.representativeInfoByDivision({ + levels: "levels", + ocdId: "ocdId", + recursive: true, + roles: "roles", + }); + } +}); diff --git a/types/gapi.client.civicinfo/index.d.ts b/types/gapi.client.civicinfo/index.d.ts new file mode 100644 index 0000000000..efa9098f8e --- /dev/null +++ b/types/gapi.client.civicinfo/index.d.ts @@ -0,0 +1,599 @@ +// Type definitions for Google Google Civic Information API v2 2.0 +// Project: https://developers.google.com/civic-information +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/civicinfo/v2/rest + +/// + +declare namespace gapi.client { + /** Load Google Civic Information API v2 */ + function load(name: "civicinfo", version: "v2"): PromiseLike; + function load(name: "civicinfo", version: "v2", callback: () => any): void; + + const divisions: civicinfo.DivisionsResource; + + const elections: civicinfo.ElectionsResource; + + const representatives: civicinfo.RepresentativesResource; + + namespace civicinfo { + interface AdministrationRegion { + /** The election administration body for this area. */ + electionAdministrationBody?: AdministrativeBody; + /** + * An ID for this object. IDs may change in future requests and should not be cached. Access to this field requires special access that can be requested + * from the Request more link on the Quotas page. + */ + id?: string; + /** The city or county that provides election information for this voter. This object can have the same elements as state. */ + local_jurisdiction?: AdministrationRegion; + /** The name of the jurisdiction. */ + name?: string; + /** A list of sources for this area. If multiple sources are listed the data has been aggregated from those sources. */ + sources?: Source[]; + } + interface AdministrativeBody { + /** A URL provided by this administrative body for information on absentee voting. */ + absenteeVotingInfoUrl?: string; + addressLines?: string[]; + /** A URL provided by this administrative body to give contest information to the voter. */ + ballotInfoUrl?: string; + /** The mailing address of this administrative body. */ + correspondenceAddress?: SimpleAddressType; + /** A URL provided by this administrative body for looking up general election information. */ + electionInfoUrl?: string; + /** The election officials for this election administrative body. */ + electionOfficials?: ElectionOfficial[]; + /** A URL provided by this administrative body for confirming that the voter is registered to vote. */ + electionRegistrationConfirmationUrl?: string; + /** A URL provided by this administrative body for looking up how to register to vote. */ + electionRegistrationUrl?: string; + /** A URL provided by this administrative body describing election rules to the voter. */ + electionRulesUrl?: string; + /** A description of the hours of operation for this administrative body. */ + hoursOfOperation?: string; + /** The name of this election administrative body. */ + name?: string; + /** The physical address of this administrative body. */ + physicalAddress?: SimpleAddressType; + /** A description of the services this administrative body may provide. */ + voter_services?: string[]; + /** A URL provided by this administrative body for looking up where to vote. */ + votingLocationFinderUrl?: string; + } + interface Candidate { + /** The URL for the candidate's campaign web site. */ + candidateUrl?: string; + /** A list of known (social) media channels for this candidate. */ + channels?: Channel[]; + /** The email address for the candidate's campaign. */ + email?: string; + /** + * The candidate's name. If this is a joint ticket it will indicate the name of the candidate at the top of a ticket followed by a / and that name of + * candidate at the bottom of the ticket. e.g. "Mitt Romney / Paul Ryan" + */ + name?: string; + /** The order the candidate appears on the ballot for this contest. */ + orderOnBallot?: string; + /** The full name of the party the candidate is a member of. */ + party?: string; + /** The voice phone number for the candidate's campaign office. */ + phone?: string; + /** A URL for a photo of the candidate. */ + photoUrl?: string; + } + interface Channel { + /** The unique public identifier for the candidate's channel. */ + id?: string; + /** + * The type of channel. The following is a list of types of channels, but is not exhaustive. More channel types may be added at a later time. One of: + * GooglePlus, YouTube, Facebook, Twitter + */ + type?: string; + } + interface Contest { + /** A number specifying the position of this contest on the voter's ballot. */ + ballotPlacement?: string; + /** The candidate choices for this contest. */ + candidates?: Candidate[]; + /** Information about the electoral district that this contest is in. */ + district?: ElectoralDistrict; + /** A description of any additional eligibility requirements for voting in this contest. */ + electorateSpecifications?: string; + /** + * An ID for this object. IDs may change in future requests and should not be cached. Access to this field requires special access that can be requested + * from the Request more link on the Quotas page. + */ + id?: string; + /** + * The levels of government of the office for this contest. There may be more than one in cases where a jurisdiction effectively acts at two different + * levels of government; for example, the mayor of the District of Columbia acts at "locality" level, but also effectively at both "administrative-area-2" + * and "administrative-area-1". + */ + level?: string[]; + /** The number of candidates that will be elected to office in this contest. */ + numberElected?: string; + /** The number of candidates that a voter may vote for in this contest. */ + numberVotingFor?: string; + /** The name of the office for this contest. */ + office?: string; + /** If this is a partisan election, the name of the party it is for. */ + primaryParty?: string; + /** + * The set of ballot responses for the referendum. A ballot response represents a line on the ballot. Common examples might include "yes" or "no" for + * referenda. This field is only populated for contests of type 'Referendum'. + */ + referendumBallotResponses?: string[]; + /** + * Specifies a short summary of the referendum that is typically on the ballot below the title but above the text. This field is only populated for + * contests of type 'Referendum'. + */ + referendumBrief?: string; + /** + * A statement in opposition to the referendum. It does not necessarily appear on the ballot. This field is only populated for contests of type + * 'Referendum'. + */ + referendumConStatement?: string; + /** + * Specifies what effect abstaining (not voting) on the proposition will have (i.e. whether abstaining is considered a vote against it). This field is + * only populated for contests of type 'Referendum'. + */ + referendumEffectOfAbstain?: string; + /** The threshold of votes that the referendum needs in order to pass, e.g. "two-thirds". This field is only populated for contests of type 'Referendum'. */ + referendumPassageThreshold?: string; + /** A statement in favor of the referendum. It does not necessarily appear on the ballot. This field is only populated for contests of type 'Referendum'. */ + referendumProStatement?: string; + /** A brief description of the referendum. This field is only populated for contests of type 'Referendum'. */ + referendumSubtitle?: string; + /** The full text of the referendum. This field is only populated for contests of type 'Referendum'. */ + referendumText?: string; + /** The title of the referendum (e.g. 'Proposition 42'). This field is only populated for contests of type 'Referendum'. */ + referendumTitle?: string; + /** A link to the referendum. This field is only populated for contests of type 'Referendum'. */ + referendumUrl?: string; + /** The roles which this office fulfills. */ + roles?: string[]; + /** A list of sources for this contest. If multiple sources are listed, the data has been aggregated from those sources. */ + sources?: Source[]; + /** "Yes" or "No" depending on whether this a contest being held outside the normal election cycle. */ + special?: string; + /** + * The type of contest. Usually this will be 'General', 'Primary', or 'Run-off' for contests with candidates. For referenda this will be 'Referendum'. For + * Retention contests this will typically be 'Retention'. + */ + type?: string; + } + interface ContextParams { + clientProfile?: string; + } + interface DivisionRepresentativeInfoRequest { + contextParams?: ContextParams; + } + interface DivisionSearchRequest { + contextParams?: ContextParams; + } + interface DivisionSearchResponse { + /** Identifies what kind of resource this is. Value: the fixed string "civicinfo#divisionSearchResponse". */ + kind?: string; + results?: DivisionSearchResult[]; + } + interface DivisionSearchResult { + /** + * Other Open Civic Data identifiers that refer to the same division -- for example, those that refer to other political divisions whose boundaries are + * defined to be coterminous with this one. For example, ocd-division/country:us/state:wy will include an alias of ocd-division/country:us/state:wy/cd:1, + * since Wyoming has only one Congressional district. + */ + aliases?: string[]; + /** The name of the division. */ + name?: string; + /** The unique Open Civic Data identifier for this division. */ + ocdId?: string; + } + interface Election { + /** Day of the election in YYYY-MM-DD format. */ + electionDay?: string; + /** The unique ID of this election. */ + id?: string; + /** A displayable name for the election. */ + name?: string; + /** + * The political division of the election. Represented as an OCD Division ID. Voters within these political jurisdictions are covered by this election. + * This is typically a state such as ocd-division/country:us/state:ca or for the midterms or general election the entire US (i.e. + * ocd-division/country:us). + */ + ocdDivisionId?: string; + } + interface ElectionOfficial { + /** The email address of the election official. */ + emailAddress?: string; + /** The fax number of the election official. */ + faxNumber?: string; + /** The full name of the election official. */ + name?: string; + /** The office phone number of the election official. */ + officePhoneNumber?: string; + /** The title of the election official. */ + title?: string; + } + interface ElectionsQueryRequest { + contextParams?: ContextParams; + } + interface ElectionsQueryResponse { + /** A list of available elections */ + elections?: Election[]; + /** Identifies what kind of resource this is. Value: the fixed string "civicinfo#electionsQueryResponse". */ + kind?: string; + } + interface ElectoralDistrict { + /** An identifier for this district, relative to its scope. For example, the 34th State Senate district would have id "34" and a scope of stateUpper. */ + id?: string; + kgForeignKey?: string; + /** The name of the district. */ + name?: string; + /** + * The geographic scope of this district. If unspecified the district's geography is not known. One of: national, statewide, congressional, stateUpper, + * stateLower, countywide, judicial, schoolBoard, cityWide, township, countyCouncil, cityCouncil, ward, special + */ + scope?: string; + } + interface GeographicDivision { + /** + * Any other valid OCD IDs that refer to the same division. + * + * Because OCD IDs are meant to be human-readable and at least somewhat predictable, there are occasionally several identifiers for a single division. + * These identifiers are defined to be equivalent to one another, and one is always indicated as the primary identifier. The primary identifier will be + * returned in ocd_id above, and any other equivalent valid identifiers will be returned in this list. + * + * For example, if this division's OCD ID is ocd-division/country:us/district:dc, this will contain ocd-division/country:us/state:dc. + */ + alsoKnownAs?: string[]; + /** The name of the division. */ + name?: string; + /** + * List of indices in the offices array, one for each office elected from this division. Will only be present if includeOffices was true (or absent) in + * the request. + */ + officeIndices?: number[]; + } + interface Office { + /** The OCD ID of the division with which this office is associated. */ + divisionId?: string; + /** + * The levels of government of which this office is part. There may be more than one in cases where a jurisdiction effectively acts at two different + * levels of government; for example, the mayor of the District of Columbia acts at "locality" level, but also effectively at both "administrative-area-2" + * and "administrative-area-1". + */ + levels?: string[]; + /** The human-readable name of the office. */ + name?: string; + /** List of indices in the officials array of people who presently hold this office. */ + officialIndices?: number[]; + /** + * The roles which this office fulfills. Roles are not meant to be exhaustive, or to exactly specify the entire set of responsibilities of a given office, + * but are meant to be rough categories that are useful for general selection from or sorting of a list of offices. + */ + roles?: string[]; + /** A list of sources for this office. If multiple sources are listed, the data has been aggregated from those sources. */ + sources?: Source[]; + } + interface Official { + /** Addresses at which to contact the official. */ + address?: SimpleAddressType[]; + /** A list of known (social) media channels for this official. */ + channels?: Channel[]; + /** The direct email addresses for the official. */ + emails?: string[]; + /** The official's name. */ + name?: string; + /** The full name of the party the official belongs to. */ + party?: string; + /** The official's public contact phone numbers. */ + phones?: string[]; + /** A URL for a photo of the official. */ + photoUrl?: string; + /** The official's public website URLs. */ + urls?: string[]; + } + interface PollingLocation { + /** The address of the location. */ + address?: SimpleAddressType; + /** The last date that this early vote site or drop off location may be used. This field is not populated for polling locations. */ + endDate?: string; + /** + * An ID for this object. IDs may change in future requests and should not be cached. Access to this field requires special access that can be requested + * from the Request more link on the Quotas page. + */ + id?: string; + /** The name of the early vote site or drop off location. This field is not populated for polling locations. */ + name?: string; + /** Notes about this location (e.g. accessibility ramp or entrance to use). */ + notes?: string; + /** A description of when this location is open. */ + pollingHours?: string; + /** A list of sources for this location. If multiple sources are listed the data has been aggregated from those sources. */ + sources?: Source[]; + /** The first date that this early vote site or drop off location may be used. This field is not populated for polling locations. */ + startDate?: string; + /** The services provided by this early vote site or drop off location. This field is not populated for polling locations. */ + voterServices?: string; + } + interface PostalAddress { + addressLines?: string[]; + administrativeAreaName?: string; + countryName?: string; + countryNameCode?: string; + dependentLocalityName?: string; + dependentThoroughfareLeadingType?: string; + dependentThoroughfareName?: string; + dependentThoroughfarePostDirection?: string; + dependentThoroughfarePreDirection?: string; + dependentThoroughfareTrailingType?: string; + dependentThoroughfaresConnector?: string; + dependentThoroughfaresIndicator?: string; + dependentThoroughfaresType?: string; + firmName?: string; + isDisputed?: boolean; + languageCode?: string; + localityName?: string; + postBoxNumber?: string; + postalCodeNumber?: string; + postalCodeNumberExtension?: string; + premiseName?: string; + recipientName?: string; + sortingCode?: string; + subAdministrativeAreaName?: string; + subPremiseName?: string; + thoroughfareLeadingType?: string; + thoroughfareName?: string; + thoroughfareNumber?: string; + thoroughfarePostDirection?: string; + thoroughfarePreDirection?: string; + thoroughfareTrailingType?: string; + } + interface RepresentativeInfoData { + /** Political geographic divisions that contain the requested address. */ + divisions?: Record; + /** Elected offices referenced by the divisions listed above. Will only be present if includeOffices was true in the request. */ + offices?: Office[]; + /** Officials holding the offices listed above. Will only be present if includeOffices was true in the request. */ + officials?: Official[]; + } + interface RepresentativeInfoRequest { + contextParams?: ContextParams; + } + interface RepresentativeInfoResponse { + /** Political geographic divisions that contain the requested address. */ + divisions?: Record; + /** Identifies what kind of resource this is. Value: the fixed string "civicinfo#representativeInfoResponse". */ + kind?: string; + /** The normalized version of the requested address */ + normalizedInput?: SimpleAddressType; + /** Elected offices referenced by the divisions listed above. Will only be present if includeOffices was true in the request. */ + offices?: Office[]; + /** Officials holding the offices listed above. Will only be present if includeOffices was true in the request. */ + officials?: Official[]; + } + interface SimpleAddressType { + /** The city or town for the address. */ + city?: string; + /** The street name and number of this address. */ + line1?: string; + /** The second line the address, if needed. */ + line2?: string; + /** The third line of the address, if needed. */ + line3?: string; + /** The name of the location. */ + locationName?: string; + /** The US two letter state abbreviation of the address. */ + state?: string; + /** The US Postal Zip Code of the address. */ + zip?: string; + } + interface Source { + /** The name of the data source. */ + name?: string; + /** Whether this data comes from an official government source. */ + official?: boolean; + } + interface VoterInfoRequest { + contextParams?: ContextParams; + voterInfoSegmentResult?: VoterInfoSegmentResult; + } + interface VoterInfoResponse { + /** Contests that will appear on the voter's ballot. */ + contests?: Contest[]; + /** + * Locations where a voter is eligible to drop off a completed ballot. The voter must have received and completed a ballot prior to arriving at the + * location. The location may not have ballots available on the premises. These locations could be open on or before election day as indicated in the + * pollingHours field. + */ + dropOffLocations?: PollingLocation[]; + /** Locations where the voter is eligible to vote early, prior to election day. */ + earlyVoteSites?: PollingLocation[]; + /** The election that was queried. */ + election?: Election; + /** Identifies what kind of resource this is. Value: the fixed string "civicinfo#voterInfoResponse". */ + kind?: string; + /** Specifies whether voters in the precinct vote only by mailing their ballots (with the possible option of dropping off their ballots as well). */ + mailOnly?: boolean; + /** The normalized version of the requested address */ + normalizedInput?: SimpleAddressType; + /** + * If no election ID was specified in the query, and there was more than one election with data for the given voter, this will contain information about + * the other elections that could apply. + */ + otherElections?: Election[]; + /** Locations where the voter is eligible to vote on election day. */ + pollingLocations?: PollingLocation[]; + precinctId?: string; + /** Local Election Information for the state that the voter votes in. For the US, there will only be one element in this array. */ + state?: AdministrationRegion[]; + } + interface VoterInfoSegmentResult { + generatedMillis?: string; + postalAddress?: PostalAddress; + request?: VoterInfoRequest; + response?: VoterInfoResponse; + } + interface DivisionsResource { + /** Searches for political divisions by their natural name or OCD ID. */ + search(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The search query. Queries can cover any parts of a OCD ID or a human readable division name. All words given in the query are treated as required + * patterns. In addition to that, most query operators of the Apache Lucene library are supported. See + * http://lucene.apache.org/core/2_9_4/queryparsersyntax.html + */ + query?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ElectionsResource { + /** List of available elections to query. */ + electionQuery(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Looks up information relevant to a voter based on the voter's registered address. */ + voterInfoQuery(request: { + /** The registered address of the voter to look up. */ + address: string; + /** Data format for the response. */ + alt?: string; + /** The unique ID of the election to look up. A list of election IDs can be obtained at https://www.googleapis.com/civicinfo/{version}/elections */ + electionId?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** If set to true, only data from official state sources will be returned. */ + officialOnly?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * If set to true, the query will return the success codeand include any partial information when it is unable to determine a matching address or unable + * to determine the election for electionId=0 queries. + */ + returnAllAvailableData?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RepresentativesResource { + /** Looks up political geography and representative information for a single address. */ + representativeInfoByAddress(request: { + /** The address to look up. May only be specified if the field ocdId is not given in the URL. */ + address?: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Whether to return information about offices and officials. If false, only the top-level district information will be returned. */ + includeOffices?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * A list of office levels to filter by. Only offices that serve at least one of these levels will be returned. Divisions that don't contain a matching + * office will not be returned. + */ + levels?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * A list of office roles to filter by. Only offices fulfilling one of these roles will be returned. Divisions that don't contain a matching office will + * not be returned. + */ + roles?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Looks up representative information for a single geographic division. */ + representativeInfoByDivision(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * A list of office levels to filter by. Only offices that serve at least one of these levels will be returned. Divisions that don't contain a matching + * office will not be returned. + */ + levels?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The Open Civic Data division identifier of the division to look up. */ + ocdId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * If true, information about all divisions contained in the division requested will be included as well. For example, if querying + * ocd-division/country:us/district:dc, this would also return all DC's wards and ANCs. + */ + recursive?: boolean; + /** + * A list of office roles to filter by. Only offices fulfilling one of these roles will be returned. Divisions that don't contain a matching office will + * not be returned. + */ + roles?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.civicinfo/readme.md b/types/gapi.client.civicinfo/readme.md new file mode 100644 index 0000000000..a423c2345f --- /dev/null +++ b/types/gapi.client.civicinfo/readme.md @@ -0,0 +1,60 @@ +# TypeScript typings for Google Civic Information API v2 +Provides polling places, early vote locations, contest data, election officials, and government representatives for U.S. residential addresses. +For detailed description please check [documentation](https://developers.google.com/civic-information). + +## Installing + +Install typings for Google Civic Information API: +``` +npm install @types/gapi.client.civicinfo@v2 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('civicinfo', 'v2', () => { + // now we can use gapi.client.civicinfo + // ... +}); +``` + + + +After that you can use Google Civic Information API resources: + +```typescript + +/* +Searches for political divisions by their natural name or OCD ID. +*/ +await gapi.client.divisions.search({ }); + +/* +List of available elections to query. +*/ +await gapi.client.elections.electionQuery({ }); + +/* +Looks up information relevant to a voter based on the voter's registered address. +*/ +await gapi.client.elections.voterInfoQuery({ address: "address", }); + +/* +Looks up political geography and representative information for a single address. +*/ +await gapi.client.representatives.representativeInfoByAddress({ }); + +/* +Looks up representative information for a single geographic division. +*/ +await gapi.client.representatives.representativeInfoByDivision({ ocdId: "ocdId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.civicinfo/tsconfig.json b/types/gapi.client.civicinfo/tsconfig.json new file mode 100644 index 0000000000..6c3ced88c9 --- /dev/null +++ b/types/gapi.client.civicinfo/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.civicinfo-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.civicinfo/tslint.json b/types/gapi.client.civicinfo/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.civicinfo/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.classroom/gapi.client.classroom-tests.ts b/types/gapi.client.classroom/gapi.client.classroom-tests.ts new file mode 100644 index 0000000000..08cbd4f585 --- /dev/null +++ b/types/gapi.client.classroom/gapi.client.classroom-tests.ts @@ -0,0 +1,286 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('classroom', 'v1', () => { + /** now we can use gapi.client.classroom */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage announcements in Google Classroom */ + 'https://www.googleapis.com/auth/classroom.announcements', + /** View announcements in Google Classroom */ + 'https://www.googleapis.com/auth/classroom.announcements.readonly', + /** Manage your Google Classroom classes */ + 'https://www.googleapis.com/auth/classroom.courses', + /** View your Google Classroom classes */ + 'https://www.googleapis.com/auth/classroom.courses.readonly', + /** Manage your course work and view your grades in Google Classroom */ + 'https://www.googleapis.com/auth/classroom.coursework.me', + /** View your course work and grades in Google Classroom */ + 'https://www.googleapis.com/auth/classroom.coursework.me.readonly', + /** Manage course work and grades for students in the Google Classroom classes you teach and view the course work and grades for classes you administer */ + 'https://www.googleapis.com/auth/classroom.coursework.students', + /** View course work and grades for students in the Google Classroom classes you teach or administer */ + 'https://www.googleapis.com/auth/classroom.coursework.students.readonly', + /** View your Google Classroom guardians */ + 'https://www.googleapis.com/auth/classroom.guardianlinks.me.readonly', + /** View and manage guardians for students in your Google Classroom classes */ + 'https://www.googleapis.com/auth/classroom.guardianlinks.students', + /** View guardians for students in your Google Classroom classes */ + 'https://www.googleapis.com/auth/classroom.guardianlinks.students.readonly', + /** View the email addresses of people in your classes */ + 'https://www.googleapis.com/auth/classroom.profile.emails', + /** View the profile photos of people in your classes */ + 'https://www.googleapis.com/auth/classroom.profile.photos', + /** Manage your Google Classroom class rosters */ + 'https://www.googleapis.com/auth/classroom.rosters', + /** View your Google Classroom class rosters */ + 'https://www.googleapis.com/auth/classroom.rosters.readonly', + /** View your course work and grades in Google Classroom */ + 'https://www.googleapis.com/auth/classroom.student-submissions.me.readonly', + /** View course work and grades for students in the Google Classroom classes you teach or administer */ + 'https://www.googleapis.com/auth/classroom.student-submissions.students.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** + * Creates a course. + * + * The user specified in `ownerId` is the owner of the created course + * and added as a teacher. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to create + * courses or for access errors. + * * `NOT_FOUND` if the primary teacher is not a valid user. + * * `FAILED_PRECONDITION` if the course owner's account is disabled or for + * the following request errors: + * * UserGroupsMembershipLimitReached + * * `ALREADY_EXISTS` if an alias was specified in the `id` and + * already exists. + */ + await gapi.client.courses.create({ + }); + /** + * Deletes a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to delete the + * requested course or for access errors. + * * `NOT_FOUND` if no course exists with the requested ID. + */ + await gapi.client.courses.delete({ + id: "id", + }); + /** + * Returns a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course or for access errors. + * * `NOT_FOUND` if no course exists with the requested ID. + */ + await gapi.client.courses.get({ + id: "id", + }); + /** + * Returns a list of courses that the requesting user is permitted to view, + * restricted to those that match the request. Returned courses are ordered by + * creation time, with the most recently created coming first. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` for access errors. + * * `INVALID_ARGUMENT` if the query argument is malformed. + * * `NOT_FOUND` if any users specified in the query arguments do not exist. + */ + await gapi.client.courses.list({ + courseStates: "courseStates", + pageSize: 2, + pageToken: "pageToken", + studentId: "studentId", + teacherId: "teacherId", + }); + /** + * Updates one or more fields in a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to modify the + * requested course or for access errors. + * * `NOT_FOUND` if no course exists with the requested ID. + * * `INVALID_ARGUMENT` if invalid fields are specified in the update mask or + * if no update mask is supplied. + * * `FAILED_PRECONDITION` for the following request errors: + * * CourseNotModifiable + */ + await gapi.client.courses.patch({ + id: "id", + updateMask: "updateMask", + }); + /** + * Updates a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to modify the + * requested course or for access errors. + * * `NOT_FOUND` if no course exists with the requested ID. + * * `FAILED_PRECONDITION` for the following request errors: + * * CourseNotModifiable + */ + await gapi.client.courses.update({ + id: "id", + }); + /** + * Accepts an invitation, removing it and adding the invited user to the + * teachers or students (as appropriate) of the specified course. Only the + * invited user may accept an invitation. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to accept the + * requested invitation or for access errors. + * * `FAILED_PRECONDITION` for the following request errors: + * * CourseMemberLimitReached + * * CourseNotModifiable + * * CourseTeacherLimitReached + * * UserGroupsMembershipLimitReached + * * `NOT_FOUND` if no invitation exists with the requested ID. + */ + await gapi.client.invitations.accept({ + id: "id", + }); + /** + * Creates an invitation. Only one invitation for a user and course may exist + * at a time. Delete and re-create an invitation to make changes. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to create + * invitations for this course or for access errors. + * * `NOT_FOUND` if the course or the user does not exist. + * * `FAILED_PRECONDITION` if the requested user's account is disabled or if + * the user already has this role or a role with greater permissions. + * * `ALREADY_EXISTS` if an invitation for the specified user and course + * already exists. + */ + await gapi.client.invitations.create({ + }); + /** + * Deletes an invitation. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to delete the + * requested invitation or for access errors. + * * `NOT_FOUND` if no invitation exists with the requested ID. + */ + await gapi.client.invitations.delete({ + id: "id", + }); + /** + * Returns an invitation. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to view the + * requested invitation or for access errors. + * * `NOT_FOUND` if no invitation exists with the requested ID. + */ + await gapi.client.invitations.get({ + id: "id", + }); + /** + * Returns a list of invitations that the requesting user is permitted to + * view, restricted to those that match the list request. + * + * *Note:* At least one of `user_id` or `course_id` must be supplied. Both + * fields can be supplied. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` for access errors. + */ + await gapi.client.invitations.list({ + courseId: "courseId", + pageSize: 2, + pageToken: "pageToken", + userId: "userId", + }); + /** + * Creates a `Registration`, causing Classroom to start sending notifications + * from the provided `feed` to the provided `destination`. + * + * Returns the created `Registration`. Currently, this will be the same as + * the argument, but with server-assigned fields such as `expiry_time` and + * `id` filled in. + * + * Note that any value specified for the `expiry_time` or `id` fields will be + * ignored. + * + * While Classroom may validate the `destination` and return errors on a best + * effort basis, it is the caller's responsibility to ensure that it exists + * and that Classroom has permission to publish to it. + * + * This method may return the following error codes: + * + * * `PERMISSION_DENIED` if: + * * the authenticated user does not have permission to receive + * notifications from the requested field; or + * * the credential provided does not include the appropriate scope for the + * requested feed. + * * another access error is encountered. + * * `INVALID_ARGUMENT` if: + * * no `destination` is specified, or the specified `destination` is not + * valid; or + * * no `feed` is specified, or the specified `feed` is not valid. + * * `NOT_FOUND` if: + * * the specified `feed` cannot be located, or the requesting user does not + * have permission to determine whether or not it exists; or + * * the specified `destination` cannot be located, or Classroom has not + * been granted permission to publish to it. + */ + await gapi.client.registrations.create({ + }); + /** + * Deletes a `Registration`, causing Classroom to stop sending notifications + * for that `Registration`. + */ + await gapi.client.registrations.delete({ + registrationId: "registrationId", + }); + /** + * Returns a user profile. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access + * this user profile, if no profile exists with the requested ID, or for + * access errors. + */ + await gapi.client.userProfiles.get({ + userId: "userId", + }); + } +}); diff --git a/types/gapi.client.classroom/index.d.ts b/types/gapi.client.classroom/index.d.ts new file mode 100644 index 0000000000..68e2679cad --- /dev/null +++ b/types/gapi.client.classroom/index.d.ts @@ -0,0 +1,4039 @@ +// Type definitions for Google Google Classroom API v1 1.0 +// Project: https://developers.google.com/classroom/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://classroom.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Google Classroom API v1 */ + function load(name: "classroom", version: "v1"): PromiseLike; + function load(name: "classroom", version: "v1", callback: () => any): void; + + const courses: classroom.CoursesResource; + + const invitations: classroom.InvitationsResource; + + const registrations: classroom.RegistrationsResource; + + const userProfiles: classroom.UserProfilesResource; + + namespace classroom { + interface Announcement { + /** + * Absolute link to this announcement in the Classroom web UI. + * This is only populated if `state` is `PUBLISHED`. + * + * Read-only. + */ + alternateLink?: string; + /** + * Assignee mode of the announcement. + * If unspecified, the default value is `ALL_STUDENTS`. + */ + assigneeMode?: string; + /** + * Identifier of the course. + * + * Read-only. + */ + courseId?: string; + /** + * Timestamp when this announcement was created. + * + * Read-only. + */ + creationTime?: string; + /** + * Identifier for the user that created the announcement. + * + * Read-only. + */ + creatorUserId?: string; + /** + * Classroom-assigned identifier of this announcement, unique per course. + * + * Read-only. + */ + id?: string; + /** + * Identifiers of students with access to the announcement. + * This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. + * If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students specified in this + * field will be able to see the announcement. + */ + individualStudentsOptions?: IndividualStudentsOptions; + /** + * Additional materials. + * + * Announcements must have no more than 20 material items. + */ + materials?: Material[]; + /** Optional timestamp when this announcement is scheduled to be published. */ + scheduledTime?: string; + /** + * Status of this announcement. + * If unspecified, the default state is `DRAFT`. + */ + state?: string; + /** + * Description of this announcement. + * The text must be a valid UTF-8 string containing no more + * than 30,000 characters. + */ + text?: string; + /** + * Timestamp of the most recent change to this announcement. + * + * Read-only. + */ + updateTime?: string; + } + interface Assignment { + /** + * Drive folder where attachments from student submissions are placed. + * This is only populated for course teachers and administrators. + */ + studentWorkFolder?: DriveFolder; + } + interface AssignmentSubmission { + /** + * Attachments added by the student. + * Drive files that correspond to materials with a share mode of + * STUDENT_COPY may not exist yet if the student has not accessed the + * assignment in Classroom. + * + * Some attachment metadata is only populated if the requesting user has + * permission to access it. Identifier and alternate_link fields are always + * available, but others (e.g. title) may not be. + */ + attachments?: Attachment[]; + } + interface Attachment { + /** Google Drive file attachment. */ + driveFile?: DriveFile; + /** Google Forms attachment. */ + form?: Form; + /** Link attachment. */ + link?: Link; + /** Youtube video attachment. */ + youTubeVideo?: YouTubeVideo; + } + interface CloudPubsubTopic { + /** + * The `name` field of a Cloud Pub/Sub + * [Topic](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics#Topic). + */ + topicName?: string; + } + interface Course { + /** + * Absolute link to this course in the Classroom web UI. + * + * Read-only. + */ + alternateLink?: string; + /** + * The Calendar ID for a calendar that all course members can see, to which + * Classroom adds events for course work and announcements in the course. + * + * Read-only. + */ + calendarId?: string; + /** + * The email address of a Google group containing all members of the course. + * This group does not accept email and can only be used for permissions. + * + * Read-only. + */ + courseGroupEmail?: string; + /** + * Sets of materials that appear on the "about" page of this course. + * + * Read-only. + */ + courseMaterialSets?: CourseMaterialSet[]; + /** + * State of the course. + * If unspecified, the default state is `PROVISIONED`. + */ + courseState?: string; + /** + * Creation time of the course. + * Specifying this field in a course update mask results in an error. + * + * Read-only. + */ + creationTime?: string; + /** + * Optional description. + * For example, "We'll be learning about the structure of living + * creatures from a combination of textbooks, guest lectures, and lab work. + * Expect to be excited!" + * If set, this field must be a valid UTF-8 string and no longer than 30,000 + * characters. + */ + description?: string; + /** + * Optional heading for the description. + * For example, "Welcome to 10th Grade Biology." + * If set, this field must be a valid UTF-8 string and no longer than 3600 + * characters. + */ + descriptionHeading?: string; + /** + * Enrollment code to use when joining this course. + * Specifying this field in a course update mask results in an error. + * + * Read-only. + */ + enrollmentCode?: string; + /** + * Whether or not guardian notifications are enabled for this course. + * + * Read-only. + */ + guardiansEnabled?: boolean; + /** + * Identifier for this course assigned by Classroom. + * + * When + * creating a course, + * you may optionally set this identifier to an + * alias string in the + * request to create a corresponding alias. The `id` is still assigned by + * Classroom and cannot be updated after the course is created. + * + * Specifying this field in a course update mask results in an error. + */ + id?: string; + /** + * Name of the course. + * For example, "10th Grade Biology". + * The name is required. It must be between 1 and 750 characters and a valid + * UTF-8 string. + */ + name?: string; + /** + * The identifier of the owner of a course. + * + * When specified as a parameter of a + * create course request, this + * field is required. + * The identifier can be one of the following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + * + * This must be set in a create request. Admins can also specify this field + * in a patch course request to + * transfer ownership. In other contexts, it is read-only. + */ + ownerId?: string; + /** + * Optional room location. + * For example, "301". + * If set, this field must be a valid UTF-8 string and no longer than 650 + * characters. + */ + room?: string; + /** + * Section of the course. + * For example, "Period 2". + * If set, this field must be a valid UTF-8 string and no longer than 2800 + * characters. + */ + section?: string; + /** + * Information about a Drive Folder that is shared with all teachers of the + * course. + * + * This field will only be set for teachers of the course and domain administrators. + * + * Read-only. + */ + teacherFolder?: DriveFolder; + /** + * The email address of a Google group containing all teachers of the course. + * This group does not accept email and can only be used for permissions. + * + * Read-only. + */ + teacherGroupEmail?: string; + /** + * Time of the most recent update to this course. + * Specifying this field in a course update mask results in an error. + * + * Read-only. + */ + updateTime?: string; + } + interface CourseAlias { + /** + * Alias string. The format of the string indicates the desired alias scoping. + * + * * `d:` indicates a domain-scoped alias. + * Example: `d:math_101` + * * `p:` indicates a project-scoped alias. + * Example: `p:abc123` + * + * This field has a maximum length of 256 characters. + */ + alias?: string; + } + interface CourseMaterial { + /** Google Drive file attachment. */ + driveFile?: DriveFile; + /** Google Forms attachment. */ + form?: Form; + /** Link atatchment. */ + link?: Link; + /** Youtube video attachment. */ + youTubeVideo?: YouTubeVideo; + } + interface CourseMaterialSet { + /** Materials attached to this set. */ + materials?: CourseMaterial[]; + /** Title for this set. */ + title?: string; + } + interface CourseRosterChangesInfo { + /** The `course_id` of the course to subscribe to roster changes for. */ + courseId?: string; + } + interface CourseWork { + /** + * Absolute link to this course work in the Classroom web UI. + * This is only populated if `state` is `PUBLISHED`. + * + * Read-only. + */ + alternateLink?: string; + /** + * Assignee mode of the coursework. + * If unspecified, the default value is `ALL_STUDENTS`. + */ + assigneeMode?: string; + /** + * Assignment details. + * This is populated only when `work_type` is `ASSIGNMENT`. + * + * Read-only. + */ + assignment?: Assignment; + /** + * Whether this course work item is associated with the Developer Console + * project making the request. + * + * See google.classroom.Work.CreateCourseWork for more + * details. + * + * Read-only. + */ + associatedWithDeveloper?: boolean; + /** + * Identifier of the course. + * + * Read-only. + */ + courseId?: string; + /** + * Timestamp when this course work was created. + * + * Read-only. + */ + creationTime?: string; + /** + * Identifier for the user that created the coursework. + * + * Read-only. + */ + creatorUserId?: string; + /** + * Optional description of this course work. + * If set, the description must be a valid UTF-8 string containing no more + * than 30,000 characters. + */ + description?: string; + /** + * Optional date, in UTC, that submissions for this this course work are due. + * This must be specified if `due_time` is specified. + */ + dueDate?: Date; + /** + * Optional time of day, in UTC, that submissions for this this course work + * are due. + * This must be specified if `due_date` is specified. + */ + dueTime?: TimeOfDay; + /** + * Classroom-assigned identifier of this course work, unique per course. + * + * Read-only. + */ + id?: string; + /** + * Identifiers of students with access to the coursework. + * This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. + * If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students + * specified in this field will be assigned the coursework. + */ + individualStudentsOptions?: IndividualStudentsOptions; + /** + * Additional materials. + * + * CourseWork must have no more than 20 material items. + */ + materials?: Material[]; + /** + * Maximum grade for this course work. + * If zero or unspecified, this assignment is considered ungraded. + * This must be a non-negative integer value. + */ + maxPoints?: number; + /** + * Multiple choice question details. + * For read operations, this field is populated only when `work_type` is + * `MULTIPLE_CHOICE_QUESTION`. + * For write operations, this field must be specified when creating course + * work with a `work_type` of `MULTIPLE_CHOICE_QUESTION`, and it must not be + * set otherwise. + */ + multipleChoiceQuestion?: MultipleChoiceQuestion; + /** Optional timestamp when this course work is scheduled to be published. */ + scheduledTime?: string; + /** + * Status of this course work. + * If unspecified, the default state is `DRAFT`. + */ + state?: string; + /** + * Setting to determine when students are allowed to modify submissions. + * If unspecified, the default value is `MODIFIABLE_UNTIL_TURNED_IN`. + */ + submissionModificationMode?: string; + /** + * Title of this course work. + * The title must be a valid UTF-8 string containing between 1 and 3000 + * characters. + */ + title?: string; + /** + * Timestamp of the most recent change to this course work. + * + * Read-only. + */ + updateTime?: string; + /** + * Type of this course work. + * + * The type is set when the course work is created and cannot be changed. + */ + workType?: string; + } + interface Date { + /** + * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 + * if specifying a year/month where the day is not significant. + */ + day?: number; + /** Month of year. Must be from 1 to 12. */ + month?: number; + /** + * Year of date. Must be from 1 to 9999, or 0 if specifying a date without + * a year. + */ + year?: number; + } + interface DriveFile { + /** + * URL that can be used to access the Drive item. + * + * Read-only. + */ + alternateLink?: string; + /** Drive API resource ID. */ + id?: string; + /** + * URL of a thumbnail image of the Drive item. + * + * Read-only. + */ + thumbnailUrl?: string; + /** + * Title of the Drive item. + * + * Read-only. + */ + title?: string; + } + interface DriveFolder { + /** + * URL that can be used to access the Drive folder. + * + * Read-only. + */ + alternateLink?: string; + /** Drive API resource ID. */ + id?: string; + /** + * Title of the Drive folder. + * + * Read-only. + */ + title?: string; + } + interface Feed { + /** + * Information about a `Feed` with a `feed_type` of `COURSE_ROSTER_CHANGES`. + * This field must be specified if `feed_type` is `COURSE_ROSTER_CHANGES`. + */ + courseRosterChangesInfo?: CourseRosterChangesInfo; + /** The type of feed. */ + feedType?: string; + } + interface Form { + /** URL of the form. */ + formUrl?: string; + /** + * URL of the form responses document. + * Only set if respsonses have been recorded and only when the + * requesting user is an editor of the form. + * + * Read-only. + */ + responseUrl?: string; + /** + * URL of a thumbnail image of the Form. + * + * Read-only. + */ + thumbnailUrl?: string; + /** + * Title of the Form. + * + * Read-only. + */ + title?: string; + } + interface GlobalPermission { + /** Permission value. */ + permission?: string; + } + interface GradeHistory { + /** The teacher who made the grade change. */ + actorUserId?: string; + /** The type of grade change at this time in the submission grade history. */ + gradeChangeType?: string; + /** When the grade of the submission was changed. */ + gradeTimestamp?: string; + /** + * The denominator of the grade at this time in the submission grade + * history. + */ + maxPoints?: number; + /** The numerator of the grade at this time in the submission grade history. */ + pointsEarned?: number; + } + interface Guardian { + /** Identifier for the guardian. */ + guardianId?: string; + /** User profile for the guardian. */ + guardianProfile?: UserProfile; + /** + * The email address to which the initial guardian invitation was sent. + * This field is only visible to domain administrators. + */ + invitedEmailAddress?: string; + /** Identifier for the student to whom the guardian relationship applies. */ + studentId?: string; + } + interface GuardianInvitation { + /** + * The time that this invitation was created. + * + * Read-only. + */ + creationTime?: string; + /** + * Unique identifier for this invitation. + * + * Read-only. + */ + invitationId?: string; + /** + * Email address that the invitation was sent to. + * This field is only visible to domain administrators. + */ + invitedEmailAddress?: string; + /** The state that this invitation is in. */ + state?: string; + /** ID of the student (in standard format) */ + studentId?: string; + } + interface IndividualStudentsOptions { + /** + * Identifiers for the students that have access to the + * coursework/announcement. + */ + studentIds?: string[]; + } + interface Invitation { + /** Identifier of the course to invite the user to. */ + courseId?: string; + /** + * Identifier assigned by Classroom. + * + * Read-only. + */ + id?: string; + /** + * Role to invite the user to have. + * Must not be `COURSE_ROLE_UNSPECIFIED`. + */ + role?: string; + /** + * Identifier of the invited user. + * + * When specified as a parameter of a request, this identifier can be set to + * one of the following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + userId?: string; + } + interface Link { + /** + * URL of a thumbnail image of the target URL. + * + * Read-only. + */ + thumbnailUrl?: string; + /** + * Title of the target of the URL. + * + * Read-only. + */ + title?: string; + /** + * URL to link to. + * This must be a valid UTF-8 string containing between 1 and 2024 characters. + */ + url?: string; + } + interface ListAnnouncementsResponse { + /** Announcement items that match the request. */ + announcements?: Announcement[]; + /** + * Token identifying the next page of results to return. If empty, no further + * results are available. + */ + nextPageToken?: string; + } + interface ListCourseAliasesResponse { + /** The course aliases. */ + aliases?: CourseAlias[]; + /** + * Token identifying the next page of results to return. If empty, no further + * results are available. + */ + nextPageToken?: string; + } + interface ListCourseWorkResponse { + /** Course work items that match the request. */ + courseWork?: CourseWork[]; + /** + * Token identifying the next page of results to return. If empty, no further + * results are available. + */ + nextPageToken?: string; + } + interface ListCoursesResponse { + /** Courses that match the list request. */ + courses?: Course[]; + /** + * Token identifying the next page of results to return. If empty, no further + * results are available. + */ + nextPageToken?: string; + } + interface ListGuardianInvitationsResponse { + /** Guardian invitations that matched the list request. */ + guardianInvitations?: GuardianInvitation[]; + /** + * Token identifying the next page of results to return. If empty, no further + * results are available. + */ + nextPageToken?: string; + } + interface ListGuardiansResponse { + /** + * Guardians on this page of results that met the criteria specified in + * the request. + */ + guardians?: Guardian[]; + /** + * Token identifying the next page of results to return. If empty, no further + * results are available. + */ + nextPageToken?: string; + } + interface ListInvitationsResponse { + /** Invitations that match the list request. */ + invitations?: Invitation[]; + /** + * Token identifying the next page of results to return. If empty, no further + * results are available. + */ + nextPageToken?: string; + } + interface ListStudentSubmissionsResponse { + /** + * Token identifying the next page of results to return. If empty, no further + * results are available. + */ + nextPageToken?: string; + /** Student work that matches the request. */ + studentSubmissions?: StudentSubmission[]; + } + interface ListStudentsResponse { + /** + * Token identifying the next page of results to return. If empty, no further + * results are available. + */ + nextPageToken?: string; + /** Students who match the list request. */ + students?: Student[]; + } + interface ListTeachersResponse { + /** + * Token identifying the next page of results to return. If empty, no further + * results are available. + */ + nextPageToken?: string; + /** Teachers who match the list request. */ + teachers?: Teacher[]; + } + interface Material { + /** Google Drive file material. */ + driveFile?: SharedDriveFile; + /** Google Forms material. */ + form?: Form; + /** + * Link material. On creation, will be upgraded to a more appropriate type + * if possible, and this will be reflected in the response. + */ + link?: Link; + /** YouTube video material. */ + youtubeVideo?: YouTubeVideo; + } + interface ModifyAnnouncementAssigneesRequest { + /** + * Mode of the announcement describing whether it will be accessible by all + * students or specified individual students. + */ + assigneeMode?: string; + /** + * Set which students can view or cannot view the announcement. + * Must be specified only when `assigneeMode` is `INDIVIDUAL_STUDENTS`. + */ + modifyIndividualStudentsOptions?: ModifyIndividualStudentsOptions; + } + interface ModifyAttachmentsRequest { + /** + * Attachments to add. + * A student submission may not have more than 20 attachments. + * + * Form attachments are not supported. + */ + addAttachments?: Attachment[]; + } + interface ModifyCourseWorkAssigneesRequest { + /** + * Mode of the coursework describing whether it will be assigned to all + * students or specified individual students. + */ + assigneeMode?: string; + /** + * Set which students are assigned or not assigned to the coursework. + * Must be specified only when `assigneeMode` is `INDIVIDUAL_STUDENTS`. + */ + modifyIndividualStudentsOptions?: ModifyIndividualStudentsOptions; + } + interface ModifyIndividualStudentsOptions { + /** + * Ids of students to be added as having access to this + * coursework/announcement. + */ + addStudentIds?: string[]; + /** + * Ids of students to be removed from having access to this + * coursework/announcement. + */ + removeStudentIds?: string[]; + } + interface MultipleChoiceQuestion { + /** Possible choices. */ + choices?: string[]; + } + interface MultipleChoiceSubmission { + /** Student's select choice. */ + answer?: string; + } + interface Name { + /** + * The user's last name. + * + * Read-only. + */ + familyName?: string; + /** + * The user's full name formed by concatenating the first and last name + * values. + * + * Read-only. + */ + fullName?: string; + /** + * The user's first name. + * + * Read-only. + */ + givenName?: string; + } + interface Registration { + /** The Cloud Pub/Sub topic that notifications are to be sent to. */ + cloudPubsubTopic?: CloudPubsubTopic; + /** + * The time until which the `Registration` is effective. + * + * This is a read-only field assigned by the server. + */ + expiryTime?: string; + /** + * Specification for the class of notifications that Classroom should deliver + * to the `destination`. + */ + feed?: Feed; + /** + * A server-generated unique identifier for this `Registration`. + * + * Read-only. + */ + registrationId?: string; + } + interface SharedDriveFile { + /** Drive file details. */ + driveFile?: DriveFile; + /** Mechanism by which students access the Drive item. */ + shareMode?: string; + } + interface ShortAnswerSubmission { + /** Student response to a short-answer question. */ + answer?: string; + } + interface StateHistory { + /** The teacher or student who made the change */ + actorUserId?: string; + /** The workflow pipeline stage. */ + state?: string; + /** When the submission entered this state. */ + stateTimestamp?: string; + } + interface Student { + /** + * Identifier of the course. + * + * Read-only. + */ + courseId?: string; + /** + * Global user information for the student. + * + * Read-only. + */ + profile?: UserProfile; + /** + * Information about a Drive Folder for this student's work in this course. + * Only visible to the student and domain administrators. + * + * Read-only. + */ + studentWorkFolder?: DriveFolder; + /** + * Identifier of the user. + * + * When specified as a parameter of a request, this identifier can be one of + * the following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + userId?: string; + } + interface StudentSubmission { + /** + * Absolute link to the submission in the Classroom web UI. + * + * Read-only. + */ + alternateLink?: string; + /** + * Optional grade. If unset, no grade was set. + * This value must be non-negative. Decimal (i.e. non-integer) values are + * allowed, but will be rounded to two decimal places. + * + * This may be modified only by course teachers. + */ + assignedGrade?: number; + /** + * Submission content when course_work_type is ASSIGNMENT. + * + * Students can modify this content using + * google.classroom.Work.ModifyAttachments. + */ + assignmentSubmission?: AssignmentSubmission; + /** + * Whether this student submission is associated with the Developer Console + * project making the request. + * + * See google.classroom.Work.CreateCourseWork for more + * details. + * + * Read-only. + */ + associatedWithDeveloper?: boolean; + /** + * Identifier of the course. + * + * Read-only. + */ + courseId?: string; + /** + * Identifier for the course work this corresponds to. + * + * Read-only. + */ + courseWorkId?: string; + /** + * Type of course work this submission is for. + * + * Read-only. + */ + courseWorkType?: string; + /** + * Creation time of this submission. + * This may be unset if the student has not accessed this item. + * + * Read-only. + */ + creationTime?: string; + /** + * Optional pending grade. If unset, no grade was set. + * This value must be non-negative. Decimal (i.e. non-integer) values are + * allowed, but will be rounded to two decimal places. + * + * This is only visible to and modifiable by course teachers. + */ + draftGrade?: number; + /** + * Classroom-assigned Identifier for the student submission. + * This is unique among submissions for the relevant course work. + * + * Read-only. + */ + id?: string; + /** + * Whether this submission is late. + * + * Read-only. + */ + late?: boolean; + /** Submission content when course_work_type is MULTIPLE_CHOICE_QUESTION. */ + multipleChoiceSubmission?: MultipleChoiceSubmission; + /** Submission content when course_work_type is SHORT_ANSWER_QUESTION. */ + shortAnswerSubmission?: ShortAnswerSubmission; + /** + * State of this submission. + * + * Read-only. + */ + state?: string; + /** + * The history of the submission (includes state and grade histories). + * + * Read-only. + */ + submissionHistory?: SubmissionHistory[]; + /** + * Last update time of this submission. + * This may be unset if the student has not accessed this item. + * + * Read-only. + */ + updateTime?: string; + /** + * Identifier for the student that owns this submission. + * + * Read-only. + */ + userId?: string; + } + interface SubmissionHistory { + /** The grade history information of the submission, if present. */ + gradeHistory?: GradeHistory; + /** The state history information of the submission, if present. */ + stateHistory?: StateHistory; + } + interface Teacher { + /** + * Identifier of the course. + * + * Read-only. + */ + courseId?: string; + /** + * Global user information for the teacher. + * + * Read-only. + */ + profile?: UserProfile; + /** + * Identifier of the user. + * + * When specified as a parameter of a request, this identifier can be one of + * the following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + userId?: string; + } + interface TimeOfDay { + /** + * Hours of day in 24 hour format. Should be from 0 to 23. An API may choose + * to allow the value "24:00:00" for scenarios like business closing time. + */ + hours?: number; + /** Minutes of hour of day. Must be from 0 to 59. */ + minutes?: number; + /** Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. */ + nanos?: number; + /** + * Seconds of minutes of the time. Must normally be from 0 to 59. An API may + * allow the value 60 if it allows leap-seconds. + */ + seconds?: number; + } + interface UserProfile { + /** + * Email address of the user. + * + * Read-only. + */ + emailAddress?: string; + /** + * Identifier of the user. + * + * Read-only. + */ + id?: string; + /** + * Name of the user. + * + * Read-only. + */ + name?: Name; + /** + * Global permissions of the user. + * + * Read-only. + */ + permissions?: GlobalPermission[]; + /** + * URL of user's profile photo. + * + * Read-only. + */ + photoUrl?: string; + /** + * Represents whether a G Suite for Education user's domain administrator has + * explicitly verified them as being a teacher. If the user is not a member of + * a G Suite for Education domain, than this field will always be false. + * + * Read-only + */ + verifiedTeacher?: boolean; + } + interface YouTubeVideo { + /** + * URL that can be used to view the YouTube video. + * + * Read-only. + */ + alternateLink?: string; + /** YouTube API resource ID. */ + id?: string; + /** + * URL of a thumbnail image of the YouTube video. + * + * Read-only. + */ + thumbnailUrl?: string; + /** + * Title of the YouTube video. + * + * Read-only. + */ + title?: string; + } + interface AliasesResource { + /** + * Creates an alias for a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to create the + * alias or for access errors. + * * `NOT_FOUND` if the course does not exist. + * * `ALREADY_EXISTS` if the alias already exists. + * * `FAILED_PRECONDITION` if the alias requested does not make sense for the + * requesting user or course (for example, if a user not in a domain + * attempts to access a domain-scoped alias). + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course to alias. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes an alias of a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to remove the + * alias or for access errors. + * * `NOT_FOUND` if the alias does not exist. + * * `FAILED_PRECONDITION` if the alias requested does not make sense for the + * requesting user or course (for example, if a user not in a domain + * attempts to delete a domain-scoped alias). + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** + * Alias to delete. + * This may not be the Classroom-assigned identifier. + */ + alias: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course whose alias should be deleted. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Returns a list of aliases for a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * course or for access errors. + * * `NOT_FOUND` if the course does not exist. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Maximum number of items to return. Zero or unspecified indicates that the + * server may assign a maximum. + * + * The server may return fewer than the specified number of results. + */ + pageSize?: number; + /** + * nextPageToken + * value returned from a previous + * list call, + * indicating that the subsequent page of results should be returned. + * + * The list request + * must be otherwise identical to the one that resulted in this token. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface AnnouncementsResource { + /** + * Creates an announcement. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course, create announcements in the requested course, share a + * Drive attachment, or for access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course does not exist. + * * `FAILED_PRECONDITION` for the following request error: + * * AttachmentNotVisible + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes an announcement. + * + * This request must be made by the Developer Console project of the + * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + * create the corresponding announcement item. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting developer project did not create + * the corresponding announcement, if the requesting user is not permitted + * to delete the requested course or for access errors. + * * `FAILED_PRECONDITION` if the requested announcement has already been + * deleted. + * * `NOT_FOUND` if no course exists with the requested ID. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Identifier of the announcement to delete. + * This identifier is a Classroom-assigned identifier. + */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Returns an announcement. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course or announcement, or for access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course or announcement does not exist. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the announcement. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns a list of announcements that the requester is permitted to view. + * + * Course students may only view `PUBLISHED` announcements. Course teachers + * and domain administrators may view all announcements. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access + * the requested course or for access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course does not exist. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** + * Restriction on the `state` of announcements returned. + * If this argument is left unspecified, the default value is `PUBLISHED`. + */ + announcementStates?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Optional sort ordering for results. A comma-separated list of fields with + * an optional sort direction keyword. Supported field is `updateTime`. + * Supported direction keywords are `asc` and `desc`. + * If not specified, `updateTime desc` is the default behavior. + * Examples: `updateTime asc`, `updateTime` + */ + orderBy?: string; + /** + * Maximum number of items to return. Zero or unspecified indicates that the + * server may assign a maximum. + * + * The server may return fewer than the specified number of results. + */ + pageSize?: number; + /** + * nextPageToken + * value returned from a previous + * list call, + * indicating that the subsequent page of results should be returned. + * + * The list request + * must be otherwise identical to the one that resulted in this token. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Modifies assignee mode and options of an announcement. + * + * Only a teacher of the course that contains the announcement may + * call this method. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course or course work or for access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course or course work does not exist. + */ + modifyAssignees(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the announcement. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates one or more fields of an announcement. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting developer project did not create + * the corresponding announcement or for access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `FAILED_PRECONDITION` if the requested announcement has already been + * deleted. + * * `NOT_FOUND` if the requested course or announcement does not exist + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the announcement. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Mask that identifies which fields on the announcement to update. + * This field is required to do an update. The update fails if invalid + * fields are specified. If a field supports empty values, it can be cleared + * by specifying it in the update mask and not in the Announcement object. If + * a field that does not support empty values is included in the update mask + * and not set in the Announcement object, an `INVALID_ARGUMENT` error will be + * returned. + * + * The following fields may be specified by teachers: + * + * * `text` + * * `state` + * * `scheduled_time` + */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface StudentSubmissionsResource { + /** + * Returns a student submission. + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course, course work, or student submission or for + * access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course, course work, or student submission + * does not exist. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Identifier of the course work. */ + courseWorkId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the student submission. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns a list of student submissions that the requester is permitted to + * view, factoring in the OAuth scopes of the request. + * `-` may be specified as the `course_work_id` to include student + * submissions for multiple course work items. + * + * Course students may only view their own work. Course teachers + * and domain administrators may view all student submissions. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course or course work, or for access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course does not exist. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** + * Identifier of the student work to request. + * This may be set to the string literal `"-"` to request student work for + * all course work in the specified course. + */ + courseWorkId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Requested lateness value. If specified, returned student submissions are + * restricted by the requested value. + * If unspecified, submissions are returned regardless of `late` value. + */ + late?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Maximum number of items to return. Zero or unspecified indicates that the + * server may assign a maximum. + * + * The server may return fewer than the specified number of results. + */ + pageSize?: number; + /** + * nextPageToken + * value returned from a previous + * list call, + * indicating that the subsequent page of results should be returned. + * + * The list request + * must be otherwise identical to the one that resulted in this token. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Requested submission states. If specified, returned student submissions + * match one of the specified submission states. + */ + states?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * Optional argument to restrict returned student work to those owned by the + * student with the specified identifier. The identifier can be one of the + * following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + userId?: string; + }): Request; + /** + * Modifies attachments of student submission. + * + * Attachments may only be added to student submissions belonging to course + * work objects with a `workType` of `ASSIGNMENT`. + * + * This request must be made by the Developer Console project of the + * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + * create the corresponding course work item. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course or course work, if the user is not permitted to modify + * attachments on the requested student submission, or for + * access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course, course work, or student submission + * does not exist. + */ + modifyAttachments(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Identifier of the course work. */ + courseWorkId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the student submission. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates one or more fields of a student submission. + * + * See google.classroom.v1.StudentSubmission for details + * of which fields may be updated and who may change them. + * + * This request must be made by the Developer Console project of the + * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + * create the corresponding course work item. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting developer project did not create + * the corresponding course work, if the user is not permitted to make the + * requested modification to the student submission, or for + * access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course, course work, or student submission + * does not exist. + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Identifier of the course work. */ + courseWorkId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the student submission. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Mask that identifies which fields on the student submission to update. + * This field is required to do an update. The update fails if invalid + * fields are specified. + * + * The following fields may be specified by teachers: + * + * * `draft_grade` + * * `assigned_grade` + */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Reclaims a student submission on behalf of the student that owns it. + * + * Reclaiming a student submission transfers ownership of attached Drive + * files to the student and update the submission state. + * + * Only the student that owns the requested student submission may call this + * method, and only for a student submission that has been turned in. + * + * This request must be made by the Developer Console project of the + * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + * create the corresponding course work item. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course or course work, unsubmit the requested student submission, + * or for access errors. + * * `FAILED_PRECONDITION` if the student submission has not been turned in. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course, course work, or student submission + * does not exist. + */ + reclaim(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Identifier of the course work. */ + courseWorkId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the student submission. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Returns a student submission. + * + * Returning a student submission transfers ownership of attached Drive + * files to the student and may also update the submission state. + * Unlike the Classroom application, returning a student submission does not + * set assignedGrade to the draftGrade value. + * + * Only a teacher of the course that contains the requested student submission + * may call this method. + * + * This request must be made by the Developer Console project of the + * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + * create the corresponding course work item. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course or course work, return the requested student submission, + * or for access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course, course work, or student submission + * does not exist. + */ + return(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Identifier of the course work. */ + courseWorkId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the student submission. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Turns in a student submission. + * + * Turning in a student submission transfers ownership of attached Drive + * files to the teacher and may also update the submission state. + * + * This may only be called by the student that owns the specified student + * submission. + * + * This request must be made by the Developer Console project of the + * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + * create the corresponding course work item. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course or course work, turn in the requested student submission, + * or for access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course, course work, or student submission + * does not exist. + */ + turnIn(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Identifier of the course work. */ + courseWorkId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the student submission. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + } + interface CourseWorkResource { + /** + * Creates course work. + * + * The resulting course work (and corresponding student submissions) are + * associated with the Developer Console project of the + * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + * make the request. Classroom API requests to modify course work and student + * submissions must be made with an OAuth client ID from the associated + * Developer Console project. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course, create course work in the requested course, share a + * Drive attachment, or for access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course does not exist. + * * `FAILED_PRECONDITION` for the following request error: + * * AttachmentNotVisible + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes a course work. + * + * This request must be made by the Developer Console project of the + * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + * create the corresponding course work item. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting developer project did not create + * the corresponding course work, if the requesting user is not permitted + * to delete the requested course or for access errors. + * * `FAILED_PRECONDITION` if the requested course work has already been + * deleted. + * * `NOT_FOUND` if no course exists with the requested ID. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Identifier of the course work to delete. + * This identifier is a Classroom-assigned identifier. + */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Returns course work. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course or course work, or for access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course or course work does not exist. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the course work. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns a list of course work that the requester is permitted to view. + * + * Course students may only view `PUBLISHED` course work. Course teachers + * and domain administrators may view all course work. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access + * the requested course or for access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course does not exist. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** + * Restriction on the work status to return. Only courseWork that matches + * is returned. If unspecified, items with a work status of `PUBLISHED` + * is returned. + */ + courseWorkStates?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Optional sort ordering for results. A comma-separated list of fields with + * an optional sort direction keyword. Supported fields are `updateTime` + * and `dueDate`. Supported direction keywords are `asc` and `desc`. + * If not specified, `updateTime desc` is the default behavior. + * Examples: `dueDate asc,updateTime desc`, `updateTime,dueDate desc` + */ + orderBy?: string; + /** + * Maximum number of items to return. Zero or unspecified indicates that the + * server may assign a maximum. + * + * The server may return fewer than the specified number of results. + */ + pageSize?: number; + /** + * nextPageToken + * value returned from a previous + * list call, + * indicating that the subsequent page of results should be returned. + * + * The list request + * must be otherwise identical to the one that resulted in this token. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Modifies assignee mode and options of a coursework. + * + * Only a teacher of the course that contains the coursework may + * call this method. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course or course work or for access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `NOT_FOUND` if the requested course or course work does not exist. + */ + modifyAssignees(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the coursework. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates one or more fields of a course work. + * + * See google.classroom.v1.CourseWork for details + * of which fields may be updated and who may change them. + * + * This request must be made by the Developer Console project of the + * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + * create the corresponding course work item. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting developer project did not create + * the corresponding course work, if the user is not permitted to make the + * requested modification to the student submission, or for + * access errors. + * * `INVALID_ARGUMENT` if the request is malformed. + * * `FAILED_PRECONDITION` if the requested course work has already been + * deleted. + * * `NOT_FOUND` if the requested course, course work, or student submission + * does not exist. + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the course work. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Mask that identifies which fields on the course work to update. + * This field is required to do an update. The update fails if invalid + * fields are specified. If a field supports empty values, it can be cleared + * by specifying it in the update mask and not in the CourseWork object. If a + * field that does not support empty values is included in the update mask and + * not set in the CourseWork object, an `INVALID_ARGUMENT` error will be + * returned. + * + * The following fields may be specified by teachers: + * + * * `title` + * * `description` + * * `state` + * * `due_date` + * * `due_time` + * * `max_points` + * * `scheduled_time` + * * `submission_modification_mode` + */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + studentSubmissions: StudentSubmissionsResource; + } + interface StudentsResource { + /** + * Adds a user as a student of a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to create + * students in this course or for access errors. + * * `NOT_FOUND` if the requested course ID does not exist. + * * `FAILED_PRECONDITION` if the requested user's account is disabled, + * for the following request errors: + * * CourseMemberLimitReached + * * CourseNotModifiable + * * UserGroupsMembershipLimitReached + * * `ALREADY_EXISTS` if the user is already a student or teacher in the + * course. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course to create the student in. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** + * Enrollment code of the course to create the student in. + * This code is required if userId + * corresponds to the requesting user; it may be omitted if the requesting + * user has administrative permissions to create students for any user. + */ + enrollmentCode?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes a student of a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to delete + * students of this course or for access errors. + * * `NOT_FOUND` if no student of this course has the requested ID or if the + * course does not exist. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * Identifier of the student to delete. The identifier can be one of the + * following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + userId: string; + }): Request<{}>; + /** + * Returns a student of a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to view + * students of this course or for access errors. + * * `NOT_FOUND` if no student of this course has the requested ID or if the + * course does not exist. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * Identifier of the student to return. The identifier can be one of the + * following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + userId: string; + }): Request; + /** + * Returns a list of students of this course that the requester + * is permitted to view. + * + * This method returns the following error codes: + * + * * `NOT_FOUND` if the course does not exist. + * * `PERMISSION_DENIED` for access errors. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Maximum number of items to return. Zero means no maximum. + * + * The server may return fewer than the specified number of results. + */ + pageSize?: number; + /** + * nextPageToken + * value returned from a previous + * list call, indicating that + * the subsequent page of results should be returned. + * + * The list request must be + * otherwise identical to the one that resulted in this token. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface TeachersResource { + /** + * Creates a teacher of a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to create + * teachers in this course or for access errors. + * * `NOT_FOUND` if the requested course ID does not exist. + * * `FAILED_PRECONDITION` if the requested user's account is disabled, + * for the following request errors: + * * CourseMemberLimitReached + * * CourseNotModifiable + * * CourseTeacherLimitReached + * * UserGroupsMembershipLimitReached + * * `ALREADY_EXISTS` if the user is already a teacher or student in the + * course. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes a teacher of a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to delete + * teachers of this course or for access errors. + * * `NOT_FOUND` if no teacher of this course has the requested ID or if the + * course does not exist. + * * `FAILED_PRECONDITION` if the requested ID belongs to the primary teacher + * of this course. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * Identifier of the teacher to delete. The identifier can be one of the + * following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + userId: string; + }): Request<{}>; + /** + * Returns a teacher of a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to view + * teachers of this course or for access errors. + * * `NOT_FOUND` if no teacher of this course has the requested ID or if the + * course does not exist. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * Identifier of the teacher to return. The identifier can be one of the + * following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + userId: string; + }): Request; + /** + * Returns a list of teachers of this course that the requester + * is permitted to view. + * + * This method returns the following error codes: + * + * * `NOT_FOUND` if the course does not exist. + * * `PERMISSION_DENIED` for access errors. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Identifier of the course. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + courseId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Maximum number of items to return. Zero means no maximum. + * + * The server may return fewer than the specified number of results. + */ + pageSize?: number; + /** + * nextPageToken + * value returned from a previous + * list call, indicating that + * the subsequent page of results should be returned. + * + * The list request must be + * otherwise identical to the one that resulted in this token. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface CoursesResource { + /** + * Creates a course. + * + * The user specified in `ownerId` is the owner of the created course + * and added as a teacher. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to create + * courses or for access errors. + * * `NOT_FOUND` if the primary teacher is not a valid user. + * * `FAILED_PRECONDITION` if the course owner's account is disabled or for + * the following request errors: + * * UserGroupsMembershipLimitReached + * * `ALREADY_EXISTS` if an alias was specified in the `id` and + * already exists. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to delete the + * requested course or for access errors. + * * `NOT_FOUND` if no course exists with the requested ID. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Identifier of the course to delete. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Returns a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course or for access errors. + * * `NOT_FOUND` if no course exists with the requested ID. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Identifier of the course to return. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns a list of courses that the requesting user is permitted to view, + * restricted to those that match the request. Returned courses are ordered by + * creation time, with the most recently created coming first. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` for access errors. + * * `INVALID_ARGUMENT` if the query argument is malformed. + * * `NOT_FOUND` if any users specified in the query arguments do not exist. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Restricts returned courses to those in one of the specified states + * The default value is ACTIVE, ARCHIVED, PROVISIONED, DECLINED. + */ + courseStates?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Maximum number of items to return. Zero or unspecified indicates that the + * server may assign a maximum. + * + * The server may return fewer than the specified number of results. + */ + pageSize?: number; + /** + * nextPageToken + * value returned from a previous + * list call, + * indicating that the subsequent page of results should be returned. + * + * The list request must be + * otherwise identical to the one that resulted in this token. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Restricts returned courses to those having a student with the specified + * identifier. The identifier can be one of the following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + studentId?: string; + /** + * Restricts returned courses to those having a teacher with the specified + * identifier. The identifier can be one of the following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + teacherId?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates one or more fields in a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to modify the + * requested course or for access errors. + * * `NOT_FOUND` if no course exists with the requested ID. + * * `INVALID_ARGUMENT` if invalid fields are specified in the update mask or + * if no update mask is supplied. + * * `FAILED_PRECONDITION` for the following request errors: + * * CourseNotModifiable + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Identifier of the course to update. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Mask that identifies which fields on the course to update. + * This field is required to do an update. The update will fail if invalid + * fields are specified. The following fields are valid: + * + * * `name` + * * `section` + * * `descriptionHeading` + * * `description` + * * `room` + * * `courseState` + * * `ownerId` + * + * Note: patches to ownerId are treated as being effective immediately, but in + * practice it may take some time for the ownership transfer of all affected + * resources to complete. + * + * When set in a query parameter, this field should be specified as + * + * `updateMask=,,...` + */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates a course. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to modify the + * requested course or for access errors. + * * `NOT_FOUND` if no course exists with the requested ID. + * * `FAILED_PRECONDITION` for the following request errors: + * * CourseNotModifiable + */ + update(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Identifier of the course to update. + * This identifier can be either the Classroom-assigned identifier or an + * alias. + */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + aliases: AliasesResource; + announcements: AnnouncementsResource; + courseWork: CourseWorkResource; + students: StudentsResource; + teachers: TeachersResource; + } + interface InvitationsResource { + /** + * Accepts an invitation, removing it and adding the invited user to the + * teachers or students (as appropriate) of the specified course. Only the + * invited user may accept an invitation. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to accept the + * requested invitation or for access errors. + * * `FAILED_PRECONDITION` for the following request errors: + * * CourseMemberLimitReached + * * CourseNotModifiable + * * CourseTeacherLimitReached + * * UserGroupsMembershipLimitReached + * * `NOT_FOUND` if no invitation exists with the requested ID. + */ + accept(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the invitation to accept. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Creates an invitation. Only one invitation for a user and course may exist + * at a time. Delete and re-create an invitation to make changes. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to create + * invitations for this course or for access errors. + * * `NOT_FOUND` if the course or the user does not exist. + * * `FAILED_PRECONDITION` if the requested user's account is disabled or if + * the user already has this role or a role with greater permissions. + * * `ALREADY_EXISTS` if an invitation for the specified user and course + * already exists. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes an invitation. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to delete the + * requested invitation or for access errors. + * * `NOT_FOUND` if no invitation exists with the requested ID. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the invitation to delete. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Returns an invitation. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to view the + * requested invitation or for access errors. + * * `NOT_FOUND` if no invitation exists with the requested ID. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifier of the invitation to return. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns a list of invitations that the requesting user is permitted to + * view, restricted to those that match the list request. + * + * *Note:* At least one of `user_id` or `course_id` must be supplied. Both + * fields can be supplied. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` for access errors. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Restricts returned invitations to those for a course with the specified + * identifier. + */ + courseId?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Maximum number of items to return. Zero means no maximum. + * + * The server may return fewer than the specified number of results. + */ + pageSize?: number; + /** + * nextPageToken + * value returned from a previous + * list call, indicating + * that the subsequent page of results should be returned. + * + * The list request must be + * otherwise identical to the one that resulted in this token. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * Restricts returned invitations to those for a specific user. The identifier + * can be one of the following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + userId?: string; + }): Request; + } + interface RegistrationsResource { + /** + * Creates a `Registration`, causing Classroom to start sending notifications + * from the provided `feed` to the provided `destination`. + * + * Returns the created `Registration`. Currently, this will be the same as + * the argument, but with server-assigned fields such as `expiry_time` and + * `id` filled in. + * + * Note that any value specified for the `expiry_time` or `id` fields will be + * ignored. + * + * While Classroom may validate the `destination` and return errors on a best + * effort basis, it is the caller's responsibility to ensure that it exists + * and that Classroom has permission to publish to it. + * + * This method may return the following error codes: + * + * * `PERMISSION_DENIED` if: + * * the authenticated user does not have permission to receive + * notifications from the requested field; or + * * the credential provided does not include the appropriate scope for the + * requested feed. + * * another access error is encountered. + * * `INVALID_ARGUMENT` if: + * * no `destination` is specified, or the specified `destination` is not + * valid; or + * * no `feed` is specified, or the specified `feed` is not valid. + * * `NOT_FOUND` if: + * * the specified `feed` cannot be located, or the requesting user does not + * have permission to determine whether or not it exists; or + * * the specified `destination` cannot be located, or Classroom has not + * been granted permission to publish to it. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes a `Registration`, causing Classroom to stop sending notifications + * for that `Registration`. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** The `registration_id` of the `Registration` to be deleted. */ + registrationId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + } + interface GuardianInvitationsResource { + /** + * Creates a guardian invitation, and sends an email to the guardian asking + * them to confirm that they are the student's guardian. + * + * Once the guardian accepts the invitation, their `state` will change to + * `COMPLETED` and they will start receiving guardian notifications. A + * `Guardian` resource will also be created to represent the active guardian. + * + * The request object must have the `student_id` and + * `invited_email_address` fields set. Failing to set these fields, or + * setting any other fields in the request, will result in an error. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the current user does not have permission to + * manage guardians, if the guardian in question has already rejected + * too many requests for that student, if guardians are not enabled for the + * domain in question, or for other access errors. + * * `RESOURCE_EXHAUSTED` if the student or guardian has exceeded the guardian + * link limit. + * * `INVALID_ARGUMENT` if the guardian email address is not valid (for + * example, if it is too long), or if the format of the student ID provided + * cannot be recognized (it is not an email address, nor a `user_id` from + * this API). This error will also be returned if read-only fields are set, + * or if the `state` field is set to to a value other than `PENDING`. + * * `NOT_FOUND` if the student ID provided is a valid student ID, but + * Classroom has no record of that student. + * * `ALREADY_EXISTS` if there is already a pending guardian invitation for + * the student and `invited_email_address` provided, or if the provided + * `invited_email_address` matches the Google account of an existing + * `Guardian` for this user. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** ID of the student (in standard format) */ + studentId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns a specific guardian invitation. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to view + * guardian invitations for the student identified by the `student_id`, if + * guardians are not enabled for the domain in question, or for other + * access errors. + * * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot + * be recognized (it is not an email address, nor a `student_id` from the + * API, nor the literal string `me`). + * * `NOT_FOUND` if Classroom cannot find any record of the given student or + * `invitation_id`. May also be returned if the student exists, but the + * requesting user does not have access to see that student. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The `id` field of the `GuardianInvitation` being requested. */ + invitationId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** The ID of the student whose guardian invitation is being requested. */ + studentId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns a list of guardian invitations that the requesting user is + * permitted to view, filtered by the parameters provided. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting + * user is not permitted to view guardian invitations for that student, if + * `"-"` is specified as the `student_id` and the user is not a domain + * administrator, if guardians are not enabled for the domain in question, + * or for other access errors. + * * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot + * be recognized (it is not an email address, nor a `student_id` from the + * API, nor the literal string `me`). May also be returned if an invalid + * `page_token` or `state` is provided. + * * `NOT_FOUND` if a `student_id` is specified, and its format can be + * recognized, but Classroom has no record of that student. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * If specified, only results with the specified `invited_email_address` + * will be returned. + */ + invitedEmailAddress?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Maximum number of items to return. Zero or unspecified indicates that the + * server may assign a maximum. + * + * The server may return fewer than the specified number of results. + */ + pageSize?: number; + /** + * nextPageToken + * value returned from a previous + * list call, + * indicating that the subsequent page of results should be returned. + * + * The list request + * must be otherwise identical to the one that resulted in this token. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * If specified, only results with the specified `state` values will be + * returned. Otherwise, results with a `state` of `PENDING` will be returned. + */ + states?: string; + /** + * The ID of the student whose guardian invitations are to be returned. + * The identifier can be one of the following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + * * the string literal `"-"`, indicating that results should be returned for + * all students that the requesting user is permitted to view guardian + * invitations. + */ + studentId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Modifies a guardian invitation. + * + * Currently, the only valid modification is to change the `state` from + * `PENDING` to `COMPLETE`. This has the effect of withdrawing the invitation. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the current user does not have permission to + * manage guardians, if guardians are not enabled for the domain in question + * or for other access errors. + * * `FAILED_PRECONDITION` if the guardian link is not in the `PENDING` state. + * * `INVALID_ARGUMENT` if the format of the student ID provided + * cannot be recognized (it is not an email address, nor a `user_id` from + * this API), or if the passed `GuardianInvitation` has a `state` other than + * `COMPLETE`, or if it modifies fields other than `state`. + * * `NOT_FOUND` if the student ID provided is a valid student ID, but + * Classroom has no record of that student, or if the `id` field does not + * refer to a guardian invitation known to Classroom. + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The `id` field of the `GuardianInvitation` to be modified. */ + invitationId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** The ID of the student whose guardian invitation is to be modified. */ + studentId: string; + /** + * Mask that identifies which fields on the course to update. + * This field is required to do an update. The update will fail if invalid + * fields are specified. The following fields are valid: + * + * * `state` + * + * When set in a query parameter, this field should be specified as + * + * `updateMask=,,...` + */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface GuardiansResource { + /** + * Deletes a guardian. + * + * The guardian will no longer receive guardian notifications and the guardian + * will no longer be accessible via the API. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if no user that matches the provided `student_id` + * is visible to the requesting user, if the requesting user is not + * permitted to manage guardians for the student identified by the + * `student_id`, if guardians are not enabled for the domain in question, + * or for other access errors. + * * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot + * be recognized (it is not an email address, nor a `student_id` from the + * API). + * * `NOT_FOUND` if the requesting user is permitted to modify guardians for + * the requested `student_id`, but no `Guardian` record exists for that + * student with the provided `guardian_id`. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The `id` field from a `Guardian`. */ + guardianId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * The student whose guardian is to be deleted. One of the following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + studentId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Returns a specific guardian. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if no user that matches the provided `student_id` + * is visible to the requesting user, if the requesting user is not + * permitted to view guardian information for the student identified by the + * `student_id`, if guardians are not enabled for the domain in question, + * or for other access errors. + * * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot + * be recognized (it is not an email address, nor a `student_id` from the + * API, nor the literal string `me`). + * * `NOT_FOUND` if the requesting user is permitted to view guardians for + * the requested `student_id`, but no `Guardian` record exists for that + * student that matches the provided `guardian_id`. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The `id` field from a `Guardian`. */ + guardianId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * The student whose guardian is being requested. One of the following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + studentId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns a list of guardians that the requesting user is permitted to + * view, restricted to those that match the request. + * + * To list guardians for any student that the requesting user may view + * guardians for, use the literal character `-` for the student ID. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting + * user is not permitted to view guardian information for that student, if + * `"-"` is specified as the `student_id` and the user is not a domain + * administrator, if guardians are not enabled for the domain in question, + * if the `invited_email_address` filter is set by a user who is not a + * domain administrator, or for other access errors. + * * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot + * be recognized (it is not an email address, nor a `student_id` from the + * API, nor the literal string `me`). May also be returned if an invalid + * `page_token` is provided. + * * `NOT_FOUND` if a `student_id` is specified, and its format can be + * recognized, but Classroom has no record of that student. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Filter results by the email address that the original invitation was sent + * to, resulting in this guardian link. + * This filter can only be used by domain administrators. + */ + invitedEmailAddress?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Maximum number of items to return. Zero or unspecified indicates that the + * server may assign a maximum. + * + * The server may return fewer than the specified number of results. + */ + pageSize?: number; + /** + * nextPageToken + * value returned from a previous + * list call, + * indicating that the subsequent page of results should be returned. + * + * The list request + * must be otherwise identical to the one that resulted in this token. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Filter results by the student who the guardian is linked to. + * The identifier can be one of the following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + * * the string literal `"-"`, indicating that results should be returned for + * all students that the requesting user has access to view. + */ + studentId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface UserProfilesResource { + /** + * Returns a user profile. + * + * This method returns the following error codes: + * + * * `PERMISSION_DENIED` if the requesting user is not permitted to access + * this user profile, if no profile exists with the requested ID, or for + * access errors. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * Identifier of the profile to return. The identifier can be one of the + * following: + * + * * the numeric identifier for the user + * * the email address of the user + * * the string literal `"me"`, indicating the requesting user + */ + userId: string; + }): Request; + guardianInvitations: GuardianInvitationsResource; + guardians: GuardiansResource; + } + } +} diff --git a/types/gapi.client.classroom/readme.md b/types/gapi.client.classroom/readme.md new file mode 100644 index 0000000000..329be31c73 --- /dev/null +++ b/types/gapi.client.classroom/readme.md @@ -0,0 +1,305 @@ +# TypeScript typings for Google Classroom API v1 +Manages classes, rosters, and invitations in Google Classroom. +For detailed description please check [documentation](https://developers.google.com/classroom/). + +## Installing + +Install typings for Google Classroom API: +``` +npm install @types/gapi.client.classroom@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('classroom', 'v1', () => { + // now we can use gapi.client.classroom + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage announcements in Google Classroom + 'https://www.googleapis.com/auth/classroom.announcements', + + // View announcements in Google Classroom + 'https://www.googleapis.com/auth/classroom.announcements.readonly', + + // Manage your Google Classroom classes + 'https://www.googleapis.com/auth/classroom.courses', + + // View your Google Classroom classes + 'https://www.googleapis.com/auth/classroom.courses.readonly', + + // Manage your course work and view your grades in Google Classroom + 'https://www.googleapis.com/auth/classroom.coursework.me', + + // View your course work and grades in Google Classroom + 'https://www.googleapis.com/auth/classroom.coursework.me.readonly', + + // Manage course work and grades for students in the Google Classroom classes you teach and view the course work and grades for classes you administer + 'https://www.googleapis.com/auth/classroom.coursework.students', + + // View course work and grades for students in the Google Classroom classes you teach or administer + 'https://www.googleapis.com/auth/classroom.coursework.students.readonly', + + // View your Google Classroom guardians + 'https://www.googleapis.com/auth/classroom.guardianlinks.me.readonly', + + // View and manage guardians for students in your Google Classroom classes + 'https://www.googleapis.com/auth/classroom.guardianlinks.students', + + // View guardians for students in your Google Classroom classes + 'https://www.googleapis.com/auth/classroom.guardianlinks.students.readonly', + + // View the email addresses of people in your classes + 'https://www.googleapis.com/auth/classroom.profile.emails', + + // View the profile photos of people in your classes + 'https://www.googleapis.com/auth/classroom.profile.photos', + + // Manage your Google Classroom class rosters + 'https://www.googleapis.com/auth/classroom.rosters', + + // View your Google Classroom class rosters + 'https://www.googleapis.com/auth/classroom.rosters.readonly', + + // View your course work and grades in Google Classroom + 'https://www.googleapis.com/auth/classroom.student-submissions.me.readonly', + + // View course work and grades for students in the Google Classroom classes you teach or administer + 'https://www.googleapis.com/auth/classroom.student-submissions.students.readonly', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Classroom API resources: + +```typescript + +/* +Creates a course. + +The user specified in `ownerId` is the owner of the created course +and added as a teacher. + +This method returns the following error codes: + +* `PERMISSION_DENIED` if the requesting user is not permitted to create +courses or for access errors. +* `NOT_FOUND` if the primary teacher is not a valid user. +* `FAILED_PRECONDITION` if the course owner's account is disabled or for +the following request errors: + * UserGroupsMembershipLimitReached +* `ALREADY_EXISTS` if an alias was specified in the `id` and +already exists. +*/ +await gapi.client.courses.create({ }); + +/* +Deletes a course. + +This method returns the following error codes: + +* `PERMISSION_DENIED` if the requesting user is not permitted to delete the +requested course or for access errors. +* `NOT_FOUND` if no course exists with the requested ID. +*/ +await gapi.client.courses.delete({ id: "id", }); + +/* +Returns a course. + +This method returns the following error codes: + +* `PERMISSION_DENIED` if the requesting user is not permitted to access the +requested course or for access errors. +* `NOT_FOUND` if no course exists with the requested ID. +*/ +await gapi.client.courses.get({ id: "id", }); + +/* +Returns a list of courses that the requesting user is permitted to view, +restricted to those that match the request. Returned courses are ordered by +creation time, with the most recently created coming first. + +This method returns the following error codes: + +* `PERMISSION_DENIED` for access errors. +* `INVALID_ARGUMENT` if the query argument is malformed. +* `NOT_FOUND` if any users specified in the query arguments do not exist. +*/ +await gapi.client.courses.list({ }); + +/* +Updates one or more fields in a course. + +This method returns the following error codes: + +* `PERMISSION_DENIED` if the requesting user is not permitted to modify the +requested course or for access errors. +* `NOT_FOUND` if no course exists with the requested ID. +* `INVALID_ARGUMENT` if invalid fields are specified in the update mask or +if no update mask is supplied. +* `FAILED_PRECONDITION` for the following request errors: + * CourseNotModifiable +*/ +await gapi.client.courses.patch({ id: "id", }); + +/* +Updates a course. + +This method returns the following error codes: + +* `PERMISSION_DENIED` if the requesting user is not permitted to modify the +requested course or for access errors. +* `NOT_FOUND` if no course exists with the requested ID. +* `FAILED_PRECONDITION` for the following request errors: + * CourseNotModifiable +*/ +await gapi.client.courses.update({ id: "id", }); + +/* +Accepts an invitation, removing it and adding the invited user to the +teachers or students (as appropriate) of the specified course. Only the +invited user may accept an invitation. + +This method returns the following error codes: + +* `PERMISSION_DENIED` if the requesting user is not permitted to accept the +requested invitation or for access errors. +* `FAILED_PRECONDITION` for the following request errors: + * CourseMemberLimitReached + * CourseNotModifiable + * CourseTeacherLimitReached + * UserGroupsMembershipLimitReached +* `NOT_FOUND` if no invitation exists with the requested ID. +*/ +await gapi.client.invitations.accept({ id: "id", }); + +/* +Creates an invitation. Only one invitation for a user and course may exist +at a time. Delete and re-create an invitation to make changes. + +This method returns the following error codes: + +* `PERMISSION_DENIED` if the requesting user is not permitted to create +invitations for this course or for access errors. +* `NOT_FOUND` if the course or the user does not exist. +* `FAILED_PRECONDITION` if the requested user's account is disabled or if +the user already has this role or a role with greater permissions. +* `ALREADY_EXISTS` if an invitation for the specified user and course +already exists. +*/ +await gapi.client.invitations.create({ }); + +/* +Deletes an invitation. + +This method returns the following error codes: + +* `PERMISSION_DENIED` if the requesting user is not permitted to delete the +requested invitation or for access errors. +* `NOT_FOUND` if no invitation exists with the requested ID. +*/ +await gapi.client.invitations.delete({ id: "id", }); + +/* +Returns an invitation. + +This method returns the following error codes: + +* `PERMISSION_DENIED` if the requesting user is not permitted to view the +requested invitation or for access errors. +* `NOT_FOUND` if no invitation exists with the requested ID. +*/ +await gapi.client.invitations.get({ id: "id", }); + +/* +Returns a list of invitations that the requesting user is permitted to +view, restricted to those that match the list request. + +*Note:* At least one of `user_id` or `course_id` must be supplied. Both +fields can be supplied. + +This method returns the following error codes: + +* `PERMISSION_DENIED` for access errors. +*/ +await gapi.client.invitations.list({ }); + +/* +Creates a `Registration`, causing Classroom to start sending notifications +from the provided `feed` to the provided `destination`. + +Returns the created `Registration`. Currently, this will be the same as +the argument, but with server-assigned fields such as `expiry_time` and +`id` filled in. + +Note that any value specified for the `expiry_time` or `id` fields will be +ignored. + +While Classroom may validate the `destination` and return errors on a best +effort basis, it is the caller's responsibility to ensure that it exists +and that Classroom has permission to publish to it. + +This method may return the following error codes: + +* `PERMISSION_DENIED` if: + * the authenticated user does not have permission to receive + notifications from the requested field; or + * the credential provided does not include the appropriate scope for the + requested feed. + * another access error is encountered. +* `INVALID_ARGUMENT` if: + * no `destination` is specified, or the specified `destination` is not + valid; or + * no `feed` is specified, or the specified `feed` is not valid. +* `NOT_FOUND` if: + * the specified `feed` cannot be located, or the requesting user does not + have permission to determine whether or not it exists; or + * the specified `destination` cannot be located, or Classroom has not + been granted permission to publish to it. +*/ +await gapi.client.registrations.create({ }); + +/* +Deletes a `Registration`, causing Classroom to stop sending notifications +for that `Registration`. +*/ +await gapi.client.registrations.delete({ registrationId: "registrationId", }); + +/* +Returns a user profile. + +This method returns the following error codes: + +* `PERMISSION_DENIED` if the requesting user is not permitted to access +this user profile, if no profile exists with the requested ID, or for +access errors. +*/ +await gapi.client.userProfiles.get({ userId: "userId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.classroom/tsconfig.json b/types/gapi.client.classroom/tsconfig.json new file mode 100644 index 0000000000..4e1a97323a --- /dev/null +++ b/types/gapi.client.classroom/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.classroom-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.classroom/tslint.json b/types/gapi.client.classroom/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.classroom/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.cloudbilling/gapi.client.cloudbilling-tests.ts b/types/gapi.client.cloudbilling/gapi.client.cloudbilling-tests.ts new file mode 100644 index 0000000000..2b846c0c89 --- /dev/null +++ b/types/gapi.client.cloudbilling/gapi.client.cloudbilling-tests.ts @@ -0,0 +1,98 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('cloudbilling', 'v1', () => { + /** now we can use gapi.client.cloudbilling */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** + * Gets information about a billing account. The current authenticated user + * must be an [owner of the billing + * account](https://support.google.com/cloud/answer/4430947). + */ + await gapi.client.billingAccounts.get({ + name: "name", + }); + /** + * Lists the billing accounts that the current authenticated user + * [owns](https://support.google.com/cloud/answer/4430947). + */ + await gapi.client.billingAccounts.list({ + pageSize: 1, + pageToken: "pageToken", + }); + /** + * Gets the billing information for a project. The current authenticated user + * must have [permission to view the + * project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo + * ). + */ + await gapi.client.projects.getBillingInfo({ + name: "name", + }); + /** + * Sets or updates the billing account associated with a project. You specify + * the new billing account by setting the `billing_account_name` in the + * `ProjectBillingInfo` resource to the resource name of a billing account. + * Associating a project with an open billing account enables billing on the + * project and allows charges for resource usage. If the project already had a + * billing account, this method changes the billing account used for resource + * usage charges. + * + * *Note:* Incurred charges that have not yet been reported in the transaction + * history of the Google Cloud Console may be billed to the new billing + * account, even if the charge occurred before the new billing account was + * assigned to the project. + * + * The current authenticated user must have ownership privileges for both the + * [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo + * ) and the [billing + * account](https://support.google.com/cloud/answer/4430947). + * + * You can disable billing on the project by setting the + * `billing_account_name` field to empty. This action disassociates the + * current billing account from the project. Any billable activity of your + * in-use services will stop, and your application could stop functioning as + * expected. Any unbilled charges to date will be billed to the previously + * associated account. The current authenticated user must be either an owner + * of the project or an owner of the billing account for the project. + * + * Note that associating a project with a *closed* billing account will have + * much the same effect as disabling billing on the project: any paid + * resources used by the project will be shut down. Thus, unless you wish to + * disable billing, you should always call this method with the name of an + * *open* billing account. + */ + await gapi.client.projects.updateBillingInfo({ + name: "name", + }); + /** Lists all public cloud services. */ + await gapi.client.services.list({ + pageSize: 1, + pageToken: "pageToken", + }); + } +}); diff --git a/types/gapi.client.cloudbilling/index.d.ts b/types/gapi.client.cloudbilling/index.d.ts new file mode 100644 index 0000000000..cd09fa5e15 --- /dev/null +++ b/types/gapi.client.cloudbilling/index.d.ts @@ -0,0 +1,640 @@ +// Type definitions for Google Google Cloud Billing API v1 1.0 +// Project: https://cloud.google.com/billing/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://cloudbilling.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Google Cloud Billing API v1 */ + function load(name: "cloudbilling", version: "v1"): PromiseLike; + function load(name: "cloudbilling", version: "v1", callback: () => any): void; + + const billingAccounts: cloudbilling.BillingAccountsResource; + + const projects: cloudbilling.ProjectsResource; + + const services: cloudbilling.ServicesResource; + + namespace cloudbilling { + interface AggregationInfo { + /** + * The number of intervals to aggregate over. + * Example: If aggregation_level is "DAILY" and aggregation_count is 14, + * aggregation will be over 14 days. + */ + aggregationCount?: number; + aggregationInterval?: string; + aggregationLevel?: string; + } + interface BillingAccount { + /** + * The display name given to the billing account, such as `My Billing + * Account`. This name is displayed in the Google Cloud Console. + */ + displayName?: string; + /** + * The resource name of the billing account. The resource name has the form + * `billingAccounts/{billing_account_id}`. For example, + * `billingAccounts/012345-567890-ABCDEF` would be the resource name for + * billing account `012345-567890-ABCDEF`. + */ + name?: string; + /** + * True if the billing account is open, and will therefore be charged for any + * usage on associated projects. False if the billing account is closed, and + * therefore projects associated with it will be unable to use paid services. + */ + open?: boolean; + } + interface Category { + /** + * The type of product the SKU refers to. + * Example: "Compute", "Storage", "Network", "ApplicationServices" etc. + */ + resourceFamily?: string; + /** + * A group classification for related SKUs. + * Example: "RAM", "GPU", "Prediction", "Ops", "GoogleEgress" etc. + */ + resourceGroup?: string; + /** The display name of the service this SKU belongs to. */ + serviceDisplayName?: string; + /** + * Represents how the SKU is consumed. + * Example: "OnDemand", "Preemptible", "Commit1Mo", "Commit1Yr" etc. + */ + usageType?: string; + } + interface ListBillingAccountsResponse { + /** A list of billing accounts. */ + billingAccounts?: BillingAccount[]; + /** + * A token to retrieve the next page of results. To retrieve the next page, + * call `ListBillingAccounts` again with the `page_token` field set to this + * value. This field is empty if there are no more results to retrieve. + */ + nextPageToken?: string; + } + interface ListProjectBillingInfoResponse { + /** + * A token to retrieve the next page of results. To retrieve the next page, + * call `ListProjectBillingInfo` again with the `page_token` field set to this + * value. This field is empty if there are no more results to retrieve. + */ + nextPageToken?: string; + /** + * A list of `ProjectBillingInfo` resources representing the projects + * associated with the billing account. + */ + projectBillingInfo?: ProjectBillingInfo[]; + } + interface ListServicesResponse { + /** + * A token to retrieve the next page of results. To retrieve the next page, + * call `ListServices` again with the `page_token` field set to this + * value. This field is empty if there are no more results to retrieve. + */ + nextPageToken?: string; + /** A list of services. */ + services?: Service[]; + } + interface ListSkusResponse { + /** + * A token to retrieve the next page of results. To retrieve the next page, + * call `ListSkus` again with the `page_token` field set to this + * value. This field is empty if there are no more results to retrieve. + */ + nextPageToken?: string; + /** The list of public SKUs of the given service. */ + skus?: Sku[]; + } + interface Money { + /** The 3-letter currency code defined in ISO 4217. */ + currencyCode?: string; + /** + * Number of nano (10^-9) units of the amount. + * The value must be between -999,999,999 and +999,999,999 inclusive. + * If `units` is positive, `nanos` must be positive or zero. + * If `units` is zero, `nanos` can be positive, zero, or negative. + * If `units` is negative, `nanos` must be negative or zero. + * For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. + */ + nanos?: number; + /** + * The whole units of the amount. + * For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. + */ + units?: string; + } + interface PricingExpression { + /** + * The base unit for the SKU which is the unit used in usage exports. + * Example: "By" + */ + baseUnit?: string; + /** + * Conversion factor for converting from price per usage_unit to price per + * base_unit, and start_usage_amount to start_usage_amount in base_unit. + * unit_price / base_unit_conversion_factor = price per base_unit. + * start_usage_amount * base_unit_conversion_factor = start_usage_amount in + * base_unit. + */ + baseUnitConversionFactor?: number; + /** + * The base unit in human readable form. + * Example: "byte". + */ + baseUnitDescription?: string; + /** + * The recommended quantity of units for displaying pricing info. When + * displaying pricing info it is recommended to display: + * (unit_price * display_quantity) per display_quantity usage_unit. + * This field does not affect the pricing formula and is for display purposes + * only. + * Example: If the unit_price is "0.0001 USD", the usage_unit is "GB" and + * the display_quantity is "1000" then the recommended way of displaying the + * pricing info is "0.10 USD per 1000 GB" + */ + displayQuantity?: number; + /** + * The list of tiered rates for this pricing. The total cost is computed by + * applying each of the tiered rates on usage. This repeated list is sorted + * by ascending order of start_usage_amount. + */ + tieredRates?: TierRate[]; + /** + * The short hand for unit of usage this pricing is specified in. + * Example: usage_unit of "GiBy" means that usage is specified in "Gibi Byte". + */ + usageUnit?: string; + /** + * The unit of usage in human readable form. + * Example: "gibi byte". + */ + usageUnitDescription?: string; + } + interface PricingInfo { + /** + * Aggregation Info. This can be left unspecified if the pricing expression + * doesn't require aggregation. + */ + aggregationInfo?: AggregationInfo; + /** + * Conversion rate for currency conversion, from USD to the currency specified + * in the request. If the currency is not specified this defaults to 1.0. + * Example: USD * currency_conversion_rate = JPY + */ + currencyConversionRate?: number; + /** The timestamp from which this pricing was effective. */ + effectiveTime?: string; + /** Expresses the pricing formula. See `PricingExpression` for an example. */ + pricingExpression?: PricingExpression; + /** + * An optional human readable summary of the pricing information, has a + * maximum length of 256 characters. + */ + summary?: string; + } + interface ProjectBillingInfo { + /** + * The resource name of the billing account associated with the project, if + * any. For example, `billingAccounts/012345-567890-ABCDEF`. + */ + billingAccountName?: string; + /** + * True if the project is associated with an open billing account, to which + * usage on the project is charged. False if the project is associated with a + * closed billing account, or no billing account at all, and therefore cannot + * use paid services. This field is read-only. + */ + billingEnabled?: boolean; + /** + * The resource name for the `ProjectBillingInfo`; has the form + * `projects/{project_id}/billingInfo`. For example, the resource name for the + * billing information for project `tokyo-rain-123` would be + * `projects/tokyo-rain-123/billingInfo`. This field is read-only. + */ + name?: string; + /** + * The ID of the project that this `ProjectBillingInfo` represents, such as + * `tokyo-rain-123`. This is a convenience field so that you don't need to + * parse the `name` field to obtain a project ID. This field is read-only. + */ + projectId?: string; + } + interface Service { + /** A human readable display name for this service. */ + displayName?: string; + /** + * The resource name for the service. + * Example: "services/DA34-426B-A397" + */ + name?: string; + /** + * The identifier for the service. + * Example: "DA34-426B-A397" + */ + serviceId?: string; + } + interface Sku { + /** The category hierarchy of this SKU, purely for organizational purpose. */ + category?: Category; + /** + * A human readable description of the SKU, has a maximum length of 256 + * characters. + */ + description?: string; + /** + * The resource name for the SKU. + * Example: "services/DA34-426B-A397/skus/AA95-CD31-42FE" + */ + name?: string; + /** A timeline of pricing info for this SKU in chronological order. */ + pricingInfo?: PricingInfo[]; + /** + * Identifies the service provider. + * This is 'Google' for first party services in Google Cloud Platform. + */ + serviceProviderName?: string; + /** + * List of service regions this SKU is offered at. + * Example: "asia-east1" + * Service regions can be found at https://cloud.google.com/about/locations/ + */ + serviceRegions?: string[]; + /** + * The identifier for the SKU. + * Example: "AA95-CD31-42FE" + */ + skuId?: string; + } + interface TierRate { + /** + * Usage is priced at this rate only after this amount. + * Example: start_usage_amount of 10 indicates that the usage will be priced + * at the unit_price after the first 10 usage_units. + */ + startUsageAmount?: number; + /** + * The price per unit of usage. + * Example: unit_price of amount $10 indicates that each unit will cost $10. + */ + unitPrice?: Money; + } + interface ProjectsResource { + /** + * Lists the projects associated with a billing account. The current + * authenticated user must be an [owner of the billing + * account](https://support.google.com/cloud/answer/4430947). + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The resource name of the billing account associated with the projects that + * you want to list. For example, `billingAccounts/012345-567890-ABCDEF`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The maximum page size is 100; this is also the + * default. + */ + pageSize?: number; + /** + * A token identifying a page of results to be returned. This should be a + * `next_page_token` value returned from a previous `ListProjectBillingInfo` + * call. If unspecified, the first page of results is returned. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface BillingAccountsResource { + /** + * Gets information about a billing account. The current authenticated user + * must be an [owner of the billing + * account](https://support.google.com/cloud/answer/4430947). + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The resource name of the billing account to retrieve. For example, + * `billingAccounts/012345-567890-ABCDEF`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists the billing accounts that the current authenticated user + * [owns](https://support.google.com/cloud/answer/4430947). + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. The maximum page size is 100; this is also the + * default. + */ + pageSize?: number; + /** + * A token identifying a page of results to return. This should be a + * `next_page_token` value returned from a previous `ListBillingAccounts` + * call. If unspecified, the first page of results is returned. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + projects: ProjectsResource; + } + interface ProjectsResource { + /** + * Gets the billing information for a project. The current authenticated user + * must have [permission to view the + * project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo + * ). + */ + getBillingInfo(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The resource name of the project for which billing information is + * retrieved. For example, `projects/tokyo-rain-123`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Sets or updates the billing account associated with a project. You specify + * the new billing account by setting the `billing_account_name` in the + * `ProjectBillingInfo` resource to the resource name of a billing account. + * Associating a project with an open billing account enables billing on the + * project and allows charges for resource usage. If the project already had a + * billing account, this method changes the billing account used for resource + * usage charges. + * + * *Note:* Incurred charges that have not yet been reported in the transaction + * history of the Google Cloud Console may be billed to the new billing + * account, even if the charge occurred before the new billing account was + * assigned to the project. + * + * The current authenticated user must have ownership privileges for both the + * [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo + * ) and the [billing + * account](https://support.google.com/cloud/answer/4430947). + * + * You can disable billing on the project by setting the + * `billing_account_name` field to empty. This action disassociates the + * current billing account from the project. Any billable activity of your + * in-use services will stop, and your application could stop functioning as + * expected. Any unbilled charges to date will be billed to the previously + * associated account. The current authenticated user must be either an owner + * of the project or an owner of the billing account for the project. + * + * Note that associating a project with a *closed* billing account will have + * much the same effect as disabling billing on the project: any paid + * resources used by the project will be shut down. Thus, unless you wish to + * disable billing, you should always call this method with the name of an + * *open* billing account. + */ + updateBillingInfo(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The resource name of the project associated with the billing information + * that you want to update. For example, `projects/tokyo-rain-123`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface SkusResource { + /** Lists all publicly available SKUs for a given cloud service. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The ISO 4217 currency code for the pricing info in the response proto. + * Will use the conversion rate as of start_time. + * Optional. If not specified USD will be used. + */ + currencyCode?: string; + /** + * Optional exclusive end time of the time range for which the pricing + * versions will be returned. Timestamps in the future are not allowed. + * Maximum allowable time range is 1 month (31 days). Time range as a whole + * is optional. If not specified, the latest pricing will be returned (up to + * 12 hours old at most). + */ + endTime?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Requested page size. Defaults to 5000. */ + pageSize?: number; + /** + * A token identifying a page of results to return. This should be a + * `next_page_token` value returned from a previous `ListSkus` + * call. If unspecified, the first page of results is returned. + */ + pageToken?: string; + /** + * The name of the service. + * Example: "services/DA34-426B-A397" + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Optional inclusive start time of the time range for which the pricing + * versions will be returned. Timestamps in the future are not allowed. + * Maximum allowable time range is 1 month (31 days). Time range as a whole + * is optional. If not specified, the latest pricing will be returned (up to + * 12 hours old at most). + */ + startTime?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface ServicesResource { + /** Lists all public cloud services. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Requested page size. Defaults to 5000. */ + pageSize?: number; + /** + * A token identifying a page of results to return. This should be a + * `next_page_token` value returned from a previous `ListServices` + * call. If unspecified, the first page of results is returned. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + skus: SkusResource; + } + } +} diff --git a/types/gapi.client.cloudbilling/readme.md b/types/gapi.client.cloudbilling/readme.md new file mode 100644 index 0000000000..4c58940e5b --- /dev/null +++ b/types/gapi.client.cloudbilling/readme.md @@ -0,0 +1,116 @@ +# TypeScript typings for Google Cloud Billing API v1 +Allows developers to manage billing for their Google Cloud Platform projects + programmatically. +For detailed description please check [documentation](https://cloud.google.com/billing/). + +## Installing + +Install typings for Google Cloud Billing API: +``` +npm install @types/gapi.client.cloudbilling@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('cloudbilling', 'v1', () => { + // now we can use gapi.client.cloudbilling + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Cloud Billing API resources: + +```typescript + +/* +Gets information about a billing account. The current authenticated user +must be an [owner of the billing +account](https://support.google.com/cloud/answer/4430947). +*/ +await gapi.client.billingAccounts.get({ name: "name", }); + +/* +Lists the billing accounts that the current authenticated user +[owns](https://support.google.com/cloud/answer/4430947). +*/ +await gapi.client.billingAccounts.list({ }); + +/* +Gets the billing information for a project. The current authenticated user +must have [permission to view the +project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo +). +*/ +await gapi.client.projects.getBillingInfo({ name: "name", }); + +/* +Sets or updates the billing account associated with a project. You specify +the new billing account by setting the `billing_account_name` in the +`ProjectBillingInfo` resource to the resource name of a billing account. +Associating a project with an open billing account enables billing on the +project and allows charges for resource usage. If the project already had a +billing account, this method changes the billing account used for resource +usage charges. + +*Note:* Incurred charges that have not yet been reported in the transaction +history of the Google Cloud Console may be billed to the new billing +account, even if the charge occurred before the new billing account was +assigned to the project. + +The current authenticated user must have ownership privileges for both the +[project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo +) and the [billing +account](https://support.google.com/cloud/answer/4430947). + +You can disable billing on the project by setting the +`billing_account_name` field to empty. This action disassociates the +current billing account from the project. Any billable activity of your +in-use services will stop, and your application could stop functioning as +expected. Any unbilled charges to date will be billed to the previously +associated account. The current authenticated user must be either an owner +of the project or an owner of the billing account for the project. + +Note that associating a project with a *closed* billing account will have +much the same effect as disabling billing on the project: any paid +resources used by the project will be shut down. Thus, unless you wish to +disable billing, you should always call this method with the name of an +*open* billing account. +*/ +await gapi.client.projects.updateBillingInfo({ name: "name", }); + +/* +Lists all public cloud services. +*/ +await gapi.client.services.list({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.cloudbilling/tsconfig.json b/types/gapi.client.cloudbilling/tsconfig.json new file mode 100644 index 0000000000..66cfdbefe4 --- /dev/null +++ b/types/gapi.client.cloudbilling/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.cloudbilling-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.cloudbilling/tslint.json b/types/gapi.client.cloudbilling/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.cloudbilling/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.cloudbuild/gapi.client.cloudbuild-tests.ts b/types/gapi.client.cloudbuild/gapi.client.cloudbuild-tests.ts new file mode 100644 index 0000000000..a7b428a695 --- /dev/null +++ b/types/gapi.client.cloudbuild/gapi.client.cloudbuild-tests.ts @@ -0,0 +1,73 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('cloudbuild', 'v1', () => { + /** now we can use gapi.client.cloudbuild */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * Operations.GetOperation or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an Operation.error value with a google.rpc.Status.code of 1, + * corresponding to `Code.CANCELLED`. + */ + await gapi.client.operations.cancel({ + name: "name", + }); + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + */ + await gapi.client.operations.get({ + name: "name", + }); + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. + * + * NOTE: the `name` binding allows API services to override the binding + * to use different resource name schemes, such as `users/*/operations`. To + * override the binding, API services can add a binding such as + * `"/v1/{name=users/*}/operations"` to their service configuration. + * For backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding + * is the parent resource, without the operations collection id. + */ + await gapi.client.operations.list({ + filter: "filter", + name: "name", + pageSize: 3, + pageToken: "pageToken", + }); + } +}); diff --git a/types/gapi.client.cloudbuild/index.d.ts b/types/gapi.client.cloudbuild/index.d.ts new file mode 100644 index 0000000000..ca50422cfb --- /dev/null +++ b/types/gapi.client.cloudbuild/index.d.ts @@ -0,0 +1,899 @@ +// Type definitions for Google Google Cloud Container Builder API v1 1.0 +// Project: https://cloud.google.com/container-builder/docs/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://cloudbuild.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Google Cloud Container Builder API v1 */ + function load(name: "cloudbuild", version: "v1"): PromiseLike; + function load(name: "cloudbuild", version: "v1", callback: () => any): void; + + const operations: cloudbuild.OperationsResource; + + const projects: cloudbuild.ProjectsResource; + + namespace cloudbuild { + interface Build { + /** + * The ID of the BuildTrigger that triggered this build, if it was + * triggered automatically. + * @OutputOnly + */ + buildTriggerId?: string; + /** + * Time at which the request to create the build was received. + * @OutputOnly + */ + createTime?: string; + /** + * Time at which execution of the build was finished. + * + * The difference between finish_time and start_time is the duration of the + * build's execution. + * @OutputOnly + */ + finishTime?: string; + /** + * Unique identifier of the build. + * @OutputOnly + */ + id?: string; + /** + * A list of images to be pushed upon the successful completion of all build + * steps. + * + * The images will be pushed using the builder service account's credentials. + * + * The digests of the pushed images will be stored in the Build resource's + * results field. + * + * If any of the images fail to be pushed, the build is marked FAILURE. + */ + images?: string[]; + /** + * URL to logs for this build in Google Cloud Logging. + * @OutputOnly + */ + logUrl?: string; + /** + * Google Cloud Storage bucket where logs should be written (see + * [Bucket Name + * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + * Logs file names will be of the format `${logs_bucket}/log-${build_id}.txt`. + */ + logsBucket?: string; + /** Special options for this build. */ + options?: BuildOptions; + /** + * ID of the project. + * @OutputOnly. + */ + projectId?: string; + /** + * Results of the build. + * @OutputOnly + */ + results?: Results; + /** Secrets to decrypt using Cloud KMS. */ + secrets?: Secret[]; + /** Describes where to find the source files to build. */ + source?: Source; + /** + * A permanent fixed identifier for source. + * @OutputOnly + */ + sourceProvenance?: SourceProvenance; + /** + * Time at which execution of the build was started. + * @OutputOnly + */ + startTime?: string; + /** + * Status of the build. + * @OutputOnly + */ + status?: string; + /** + * Customer-readable message about the current status. + * @OutputOnly + */ + statusDetail?: string; + /** Describes the operations to be performed on the workspace. */ + steps?: BuildStep[]; + /** Substitutions data for Build resource. */ + substitutions?: Record; + /** Tags for annotation of a Build. These are not docker tags. */ + tags?: string[]; + /** + * Amount of time that this build should be allowed to run, to second + * granularity. If this amount of time elapses, work on the build will cease + * and the build status will be TIMEOUT. + * + * Default time is ten minutes. + */ + timeout?: string; + } + interface BuildOperationMetadata { + /** The build that the operation is tracking. */ + build?: Build; + } + interface BuildOptions { + /** Requested verifiability options. */ + requestedVerifyOption?: string; + /** Requested hash for SourceProvenance. */ + sourceProvenanceHash?: string[]; + /** SubstitutionOption to allow unmatch substitutions. */ + substitutionOption?: string; + } + interface BuildStep { + /** + * A list of arguments that will be presented to the step when it is started. + * + * If the image used to run the step's container has an entrypoint, these args + * will be used as arguments to that entrypoint. If the image does not define + * an entrypoint, the first element in args will be used as the entrypoint, + * and the remainder will be used as arguments. + */ + args?: string[]; + /** + * Working directory (relative to project source root) to use when running + * this operation's container. + */ + dir?: string; + /** + * Optional entrypoint to be used instead of the build step image's default + * If unset, the image's default will be used. + */ + entrypoint?: string; + /** + * A list of environment variable definitions to be used when running a step. + * + * The elements are of the form "KEY=VALUE" for the environment variable "KEY" + * being given the value "VALUE". + */ + env?: string[]; + /** + * Optional unique identifier for this build step, used in wait_for to + * reference this build step as a dependency. + */ + id?: string; + /** + * The name of the container image that will run this particular build step. + * + * If the image is already available in the host's Docker daemon's cache, it + * will be run directly. If not, the host will attempt to pull the image + * first, using the builder service account's credentials if necessary. + * + * The Docker daemon's cache will already have the latest versions of all of + * the officially supported build steps + * ([https://github.com/GoogleCloudPlatform/cloud-builders](https://github.com/GoogleCloudPlatform/cloud-builders)). + * The Docker daemon will also have cached many of the layers for some popular + * images, like "ubuntu", "debian", but they will be refreshed at the time you + * attempt to use them. + * + * If you built an image in a previous build step, it will be stored in the + * host's Docker daemon's cache and is available to use as the name for a + * later build step. + */ + name?: string; + /** + * A list of environment variables which are encrypted using a Cloud KMS + * crypto key. These values must be specified in the build's secrets. + */ + secretEnv?: string[]; + /** + * List of volumes to mount into the build step. + * + * Each volume will be created as an empty volume prior to execution of the + * build step. Upon completion of the build, volumes and their contents will + * be discarded. + * + * Using a named volume in only one step is not valid as it is indicative + * of a mis-configured build request. + */ + volumes?: Volume[]; + /** + * The ID(s) of the step(s) that this build step depends on. + * This build step will not start until all the build steps in wait_for + * have completed successfully. If wait_for is empty, this build step will + * start when all previous build steps in the Build.Steps list have completed + * successfully. + */ + waitFor?: string[]; + } + interface BuildTrigger { + /** Contents of the build template. */ + build?: Build; + /** + * Time when the trigger was created. + * + * @OutputOnly + */ + createTime?: string; + /** Human-readable description of this trigger. */ + description?: string; + /** If true, the trigger will never result in a build. */ + disabled?: boolean; + /** + * Path, from the source root, to a file whose contents is used for the + * template. + */ + filename?: string; + /** + * Unique identifier of the trigger. + * + * @OutputOnly + */ + id?: string; + /** Substitutions data for Build resource. */ + substitutions?: Record; + /** + * Template describing the types of source changes to trigger a build. + * + * Branch and tag names in trigger templates are interpreted as regular + * expressions. Any branch or tag change that matches that regular expression + * will trigger a build. + */ + triggerTemplate?: RepoSource; + } + interface BuiltImage { + /** Docker Registry 2.0 digest. */ + digest?: string; + /** + * Name used to push the container image to Google Container Registry, as + * presented to `docker push`. + */ + name?: string; + } + interface FileHashes { + /** Collection of file hashes. */ + fileHash?: Hash[]; + } + interface Hash { + /** The type of hash that was performed. */ + type?: string; + /** The hash value. */ + value?: string; + } + interface ListBuildTriggersResponse { + /** BuildTriggers for the project, sorted by create_time descending. */ + triggers?: BuildTrigger[]; + } + interface ListBuildsResponse { + /** Builds will be sorted by create_time, descending. */ + builds?: Build[]; + /** Token to receive the next page of results. */ + nextPageToken?: string; + } + interface ListOperationsResponse { + /** The standard List next-page token. */ + nextPageToken?: string; + /** A list of operations that matches the specified filter in the request. */ + operations?: Operation[]; + } + interface Operation { + /** + * If the value is `false`, it means the operation is still in progress. + * If `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done?: boolean; + /** The error result of the operation in case of failure or cancellation. */ + error?: Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata?: Record; + /** + * The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name?: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` + * is the original method name. For example, if the original method name + * is `TakeSnapshot()`, the inferred response type is + * `TakeSnapshotResponse`. + */ + response?: Record; + } + interface RepoSource { + /** Name of the branch to build. */ + branchName?: string; + /** Explicit commit SHA to build. */ + commitSha?: string; + /** + * ID of the project that owns the repo. If omitted, the project ID requesting + * the build is assumed. + */ + projectId?: string; + /** Name of the repo. If omitted, the name "default" is assumed. */ + repoName?: string; + /** Name of the tag to build. */ + tagName?: string; + } + interface Results { + /** List of build step digests, in order corresponding to build step indices. */ + buildStepImages?: string[]; + /** Images that were built as a part of the build. */ + images?: BuiltImage[]; + } + interface Secret { + /** Cloud KMS key name to use to decrypt these envs. */ + kmsKeyName?: string; + /** + * Map of environment variable name to its encrypted value. + * + * Secret environment variables must be unique across all of a build's + * secrets, and must be used by at least one build step. Values can be at most + * 1 KB in size. There can be at most ten secret values across all of a + * build's secrets. + */ + secretEnv?: Record; + } + interface Source { + /** If provided, get source from this location in a Cloud Repo. */ + repoSource?: RepoSource; + /** If provided, get the source from this location in Google Cloud Storage. */ + storageSource?: StorageSource; + } + interface SourceProvenance { + /** + * Hash(es) of the build source, which can be used to verify that the original + * source integrity was maintained in the build. Note that FileHashes will + * only be populated if BuildOptions has requested a SourceProvenanceHash. + * + * The keys to this map are file paths used as build source and the values + * contain the hash values for those files. + * + * If the build source came in a single package such as a gzipped tarfile + * (.tar.gz), the FileHash will be for the single path to that file. + * @OutputOnly + */ + fileHashes?: Record; + /** + * A copy of the build's source.repo_source, if exists, with any + * revisions resolved. + */ + resolvedRepoSource?: RepoSource; + /** + * A copy of the build's source.storage_source, if exists, with any + * generations resolved. + */ + resolvedStorageSource?: StorageSource; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface StorageSource { + /** + * Google Cloud Storage bucket containing source (see + * [Bucket Name + * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + */ + bucket?: string; + /** + * Google Cloud Storage generation for the object. If the generation is + * omitted, the latest generation will be used. + */ + generation?: string; + /** + * Google Cloud Storage object containing source. + * + * This object must be a gzipped archive file (.tar.gz) containing source to + * build. + */ + object?: string; + } + interface Volume { + /** + * Name of the volume to mount. + * + * Volume names must be unique per build step and must be valid names for + * Docker volumes. Each named volume must be used by at least two build steps. + */ + name?: string; + /** + * Path at which to mount the volume. + * + * Paths must be absolute and cannot conflict with other volume paths on the + * same build step or with certain reserved volume paths. + */ + path?: string; + } + interface OperationsResource { + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * Operations.GetOperation or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an Operation.error value with a google.rpc.Status.code of 1, + * corresponding to `Code.CANCELLED`. + */ + cancel(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource to be cancelled. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. + * + * NOTE: the `name` binding allows API services to override the binding + * to use different resource name schemes, such as `users/*/operations`. To + * override the binding, API services can add a binding such as + * `"/v1/{name=users/*}/operations"` to their service configuration. + * For backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding + * is the parent resource, without the operations collection id. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The standard list filter. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation's parent resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The standard list page size. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface BuildsResource { + /** Cancels a requested build in progress. */ + cancel(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** ID of the build. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** ID of the project. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Starts a build with the specified configuration. + * + * The long-running Operation returned by this method will include the ID of + * the build, which can be passed to GetBuild to determine its status (e.g., + * success or failure). + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** ID of the project. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns information about a previously requested build. + * + * The Build that is returned includes its status (e.g., success or failure, + * or in-progress), and timing information. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** ID of the build. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** ID of the project. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists previously requested builds. + * + * Previously requested builds may still be in-progress, or may have finished + * successfully or unsuccessfully. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The raw filter text to constrain the results. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Number of results to return in the list. */ + pageSize?: number; + /** Token to provide to skip to a particular spot in the list. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** ID of the project. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface TriggersResource { + /** + * Creates a new BuildTrigger. + * + * This API is experimental. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** ID of the project for which to configure automatic builds. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes an BuildTrigger by its project ID and trigger ID. + * + * This API is experimental. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** ID of the project that owns the trigger. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** ID of the BuildTrigger to delete. */ + triggerId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Gets information about a BuildTrigger. + * + * This API is experimental. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** ID of the project that owns the trigger. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** ID of the BuildTrigger to get. */ + triggerId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists existing BuildTrigger. + * + * This API is experimental. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** ID of the project for which to list BuildTriggers. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates an BuildTrigger by its project ID and trigger ID. + * + * This API is experimental. + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** ID of the project that owns the trigger. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** ID of the BuildTrigger to update. */ + triggerId: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface ProjectsResource { + builds: BuildsResource; + triggers: TriggersResource; + } + } +} diff --git a/types/gapi.client.cloudbuild/readme.md b/types/gapi.client.cloudbuild/readme.md new file mode 100644 index 0000000000..a7371764be --- /dev/null +++ b/types/gapi.client.cloudbuild/readme.md @@ -0,0 +1,89 @@ +# TypeScript typings for Google Cloud Container Builder API v1 +Builds container images in the cloud. +For detailed description please check [documentation](https://cloud.google.com/container-builder/docs/). + +## Installing + +Install typings for Google Cloud Container Builder API: +``` +npm install @types/gapi.client.cloudbuild@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('cloudbuild', 'v1', () => { + // now we can use gapi.client.cloudbuild + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Cloud Container Builder API resources: + +```typescript + +/* +Starts asynchronous cancellation on a long-running operation. The server +makes a best effort to cancel the operation, but success is not +guaranteed. If the server doesn't support this method, it returns +`google.rpc.Code.UNIMPLEMENTED`. Clients can use +Operations.GetOperation or +other methods to check whether the cancellation succeeded or whether the +operation completed despite cancellation. On successful cancellation, +the operation is not deleted; instead, it becomes an operation with +an Operation.error value with a google.rpc.Status.code of 1, +corresponding to `Code.CANCELLED`. +*/ +await gapi.client.operations.cancel({ name: "name", }); + +/* +Gets the latest state of a long-running operation. Clients can use this +method to poll the operation result at intervals as recommended by the API +service. +*/ +await gapi.client.operations.get({ name: "name", }); + +/* +Lists operations that match the specified filter in the request. If the +server doesn't support this method, it returns `UNIMPLEMENTED`. + +NOTE: the `name` binding allows API services to override the binding +to use different resource name schemes, such as `users/*/operations`. To +override the binding, API services can add a binding such as +`"/v1/{name=users/*}/operations"` to their service configuration. +For backwards compatibility, the default name includes the operations +collection id, however overriding users must ensure the name binding +is the parent resource, without the operations collection id. +*/ +await gapi.client.operations.list({ name: "name", }); +``` \ No newline at end of file diff --git a/types/gapi.client.cloudbuild/tsconfig.json b/types/gapi.client.cloudbuild/tsconfig.json new file mode 100644 index 0000000000..22d8d6d390 --- /dev/null +++ b/types/gapi.client.cloudbuild/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.cloudbuild-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.cloudbuild/tslint.json b/types/gapi.client.cloudbuild/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.cloudbuild/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.clouddebugger/gapi.client.clouddebugger-tests.ts b/types/gapi.client.clouddebugger/gapi.client.clouddebugger-tests.ts new file mode 100644 index 0000000000..983c975c44 --- /dev/null +++ b/types/gapi.client.clouddebugger/gapi.client.clouddebugger-tests.ts @@ -0,0 +1,34 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('clouddebugger', 'v2', () => { + /** now we can use gapi.client.clouddebugger */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** Manage cloud debugger */ + 'https://www.googleapis.com/auth/cloud_debugger', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + } +}); diff --git a/types/gapi.client.clouddebugger/index.d.ts b/types/gapi.client.clouddebugger/index.d.ts new file mode 100644 index 0000000000..0fdb5167ce --- /dev/null +++ b/types/gapi.client.clouddebugger/index.d.ts @@ -0,0 +1,817 @@ +// Type definitions for Google Stackdriver Debugger API v2 2.0 +// Project: http://cloud.google.com/debugger +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://clouddebugger.googleapis.com/$discovery/rest?version=v2 + +/// + +declare namespace gapi.client { + /** Load Stackdriver Debugger API v2 */ + function load(name: "clouddebugger", version: "v2"): PromiseLike; + function load(name: "clouddebugger", version: "v2", callback: () => any): void; + + const controller: clouddebugger.ControllerResource; + + namespace clouddebugger { + interface AliasContext { + /** The alias kind. */ + kind?: string; + /** The alias name. */ + name?: string; + } + interface Breakpoint { + /** + * Action that the agent should perform when the code at the + * breakpoint location is hit. + */ + action?: string; + /** + * Condition that triggers the breakpoint. + * The condition is a compound boolean expression composed using expressions + * in a programming language at the source location. + */ + condition?: string; + /** Time this breakpoint was created by the server in seconds resolution. */ + createTime?: string; + /** + * Values of evaluated expressions at breakpoint time. + * The evaluated expressions appear in exactly the same order they + * are listed in the `expressions` field. + * The `name` field holds the original expression text, the `value` or + * `members` field holds the result of the evaluated expression. + * If the expression cannot be evaluated, the `status` inside the `Variable` + * will indicate an error and contain the error text. + */ + evaluatedExpressions?: Variable[]; + /** + * List of read-only expressions to evaluate at the breakpoint location. + * The expressions are composed using expressions in the programming language + * at the source location. If the breakpoint action is `LOG`, the evaluated + * expressions are included in log statements. + */ + expressions?: string[]; + /** + * Time this breakpoint was finalized as seen by the server in seconds + * resolution. + */ + finalTime?: string; + /** Breakpoint identifier, unique in the scope of the debuggee. */ + id?: string; + /** + * When true, indicates that this is a final result and the + * breakpoint state will not change from here on. + */ + isFinalState?: boolean; + /** + * A set of custom breakpoint properties, populated by the agent, to be + * displayed to the user. + */ + labels?: Record; + /** Breakpoint source location. */ + location?: SourceLocation; + /** Indicates the severity of the log. Only relevant when action is `LOG`. */ + logLevel?: string; + /** + * Only relevant when action is `LOG`. Defines the message to log when + * the breakpoint hits. The message may include parameter placeholders `$0`, + * `$1`, etc. These placeholders are replaced with the evaluated value + * of the appropriate expression. Expressions not referenced in + * `log_message_format` are not logged. + * + * Example: `Message received, id = $0, count = $1` with + * `expressions` = `[ message.id, message.count ]`. + */ + logMessageFormat?: string; + /** The stack at breakpoint time. */ + stackFrames?: StackFrame[]; + /** + * Breakpoint status. + * + * The status includes an error flag and a human readable message. + * This field is usually unset. The message can be either + * informational or an error message. Regardless, clients should always + * display the text message back to the user. + * + * Error status indicates complete failure of the breakpoint. + * + * Example (non-final state): `Still loading symbols...` + * + * Examples (final state): + * + * * `Invalid line number` referring to location + * * `Field f not found in class C` referring to condition + */ + status?: StatusMessage; + /** E-mail address of the user that created this breakpoint */ + userEmail?: string; + /** + * The `variable_table` exists to aid with computation, memory and network + * traffic optimization. It enables storing a variable once and reference + * it from multiple variables, including variables stored in the + * `variable_table` itself. + * For example, the same `this` object, which may appear at many levels of + * the stack, can have all of its data stored once in this table. The + * stack frame variables then would hold only a reference to it. + * + * The variable `var_table_index` field is an index into this repeated field. + * The stored objects are nameless and get their name from the referencing + * variable. The effective variable is a merge of the referencing variable + * and the referenced variable. + */ + variableTable?: Variable[]; + } + interface CloudRepoSourceContext { + /** An alias, which may be a branch or tag. */ + aliasContext?: AliasContext; + /** The name of an alias (branch, tag, etc.). */ + aliasName?: string; + /** The ID of the repo. */ + repoId?: RepoId; + /** A revision ID. */ + revisionId?: string; + } + interface CloudWorkspaceId { + /** + * The unique name of the workspace within the repo. This is the name + * chosen by the client in the Source API's CreateWorkspace method. + */ + name?: string; + /** The ID of the repo containing the workspace. */ + repoId?: RepoId; + } + interface CloudWorkspaceSourceContext { + /** + * The ID of the snapshot. + * An empty snapshot_id refers to the most recent snapshot. + */ + snapshotId?: string; + /** The ID of the workspace. */ + workspaceId?: CloudWorkspaceId; + } + interface Debuggee { + /** + * Version ID of the agent. + * Schema: `domain/language-platform/vmajor.minor` (for example + * `google.com/java-gcp/v1.1`). + */ + agentVersion?: string; + /** + * Human readable description of the debuggee. + * Including a human-readable project name, environment name and version + * information is recommended. + */ + description?: string; + /** + * References to the locations and revisions of the source code used in the + * deployed application. + * + * NOTE: this field is experimental and can be ignored. + */ + extSourceContexts?: ExtendedSourceContext[]; + /** Unique identifier for the debuggee generated by the controller service. */ + id?: string; + /** + * If set to `true`, indicates that the agent should disable itself and + * detach from the debuggee. + */ + isDisabled?: boolean; + /** + * If set to `true`, indicates that Controller service does not detect any + * activity from the debuggee agents and the application is possibly stopped. + */ + isInactive?: boolean; + /** + * A set of custom debuggee properties, populated by the agent, to be + * displayed to the user. + */ + labels?: Record; + /** + * Project the debuggee is associated with. + * Use project number or id when registering a Google Cloud Platform project. + */ + project?: string; + /** + * References to the locations and revisions of the source code used in the + * deployed application. + */ + sourceContexts?: SourceContext[]; + /** + * Human readable message to be displayed to the user about this debuggee. + * Absence of this field indicates no status. The message can be either + * informational or an error status. + */ + status?: StatusMessage; + /** + * Uniquifier to further distiguish the application. + * It is possible that different applications might have identical values in + * the debuggee message, thus, incorrectly identified as a single application + * by the Controller service. This field adds salt to further distiguish the + * application. Agents should consider seeding this field with value that + * identifies the code, binary, configuration and environment. + */ + uniquifier?: string; + } + interface ExtendedSourceContext { + /** Any source context. */ + context?: SourceContext; + /** Labels with user defined metadata. */ + labels?: Record; + } + interface FormatMessage { + /** + * Format template for the message. The `format` uses placeholders `$0`, + * `$1`, etc. to reference parameters. `$$` can be used to denote the `$` + * character. + * + * Examples: + * + * * `Failed to load '$0' which helps debug $1 the first time it + * is loaded. Again, $0 is very important.` + * * `Please pay $$10 to use $0 instead of $1.` + */ + format?: string; + /** Optional parameters to be embedded into the message. */ + parameters?: string[]; + } + interface GerritSourceContext { + /** An alias, which may be a branch or tag. */ + aliasContext?: AliasContext; + /** The name of an alias (branch, tag, etc.). */ + aliasName?: string; + /** + * The full project name within the host. Projects may be nested, so + * "project/subproject" is a valid project name. + * The "repo name" is hostURI/project. + */ + gerritProject?: string; + /** The URI of a running Gerrit instance. */ + hostUri?: string; + /** A revision (commit) ID. */ + revisionId?: string; + } + interface GetBreakpointResponse { + /** + * Complete breakpoint state. + * The fields `id` and `location` are guaranteed to be set. + */ + breakpoint?: Breakpoint; + } + interface GitSourceContext { + /** + * Git commit hash. + * required. + */ + revisionId?: string; + /** Git repository URL. */ + url?: string; + } + interface ListActiveBreakpointsResponse { + /** + * List of all active breakpoints. + * The fields `id` and `location` are guaranteed to be set on each breakpoint. + */ + breakpoints?: Breakpoint[]; + /** + * A token that can be used in the next method call to block until + * the list of breakpoints changes. + */ + nextWaitToken?: string; + /** + * If set to `true`, indicates that there is no change to the + * list of active breakpoints and the server-selected timeout has expired. + * The `breakpoints` field would be empty and should be ignored. + */ + waitExpired?: boolean; + } + interface ListBreakpointsResponse { + /** + * List of breakpoints matching the request. + * The fields `id` and `location` are guaranteed to be set on each breakpoint. + * The fields: `stack_frames`, `evaluated_expressions` and `variable_table` + * are cleared on each breakpoint regardless of its status. + */ + breakpoints?: Breakpoint[]; + /** + * A wait token that can be used in the next call to `list` (REST) or + * `ListBreakpoints` (RPC) to block until the list of breakpoints has changes. + */ + nextWaitToken?: string; + } + interface ListDebuggeesResponse { + /** + * List of debuggees accessible to the calling user. + * The fields `debuggee.id` and `description` are guaranteed to be set. + * The `description` field is a human readable field provided by agents and + * can be displayed to users. + */ + debuggees?: Debuggee[]; + } + interface ProjectRepoId { + /** The ID of the project. */ + projectId?: string; + /** The name of the repo. Leave empty for the default repo. */ + repoName?: string; + } + interface RegisterDebuggeeRequest { + /** + * Debuggee information to register. + * The fields `project`, `uniquifier`, `description` and `agent_version` + * of the debuggee must be set. + */ + debuggee?: Debuggee; + } + interface RegisterDebuggeeResponse { + /** + * Debuggee resource. + * The field `id` is guranteed to be set (in addition to the echoed fields). + * If the field `is_disabled` is set to `true`, the agent should disable + * itself by removing all breakpoints and detaching from the application. + * It should however continue to poll `RegisterDebuggee` until reenabled. + */ + debuggee?: Debuggee; + } + interface RepoId { + /** A combination of a project ID and a repo name. */ + projectRepoId?: ProjectRepoId; + /** A server-assigned, globally unique identifier. */ + uid?: string; + } + interface SetBreakpointResponse { + /** + * Breakpoint resource. + * The field `id` is guaranteed to be set (in addition to the echoed fileds). + */ + breakpoint?: Breakpoint; + } + interface SourceContext { + /** A SourceContext referring to a revision in a cloud repo. */ + cloudRepo?: CloudRepoSourceContext; + /** A SourceContext referring to a snapshot in a cloud workspace. */ + cloudWorkspace?: CloudWorkspaceSourceContext; + /** A SourceContext referring to a Gerrit project. */ + gerrit?: GerritSourceContext; + /** A SourceContext referring to any third party Git repo (e.g. GitHub). */ + git?: GitSourceContext; + } + interface SourceLocation { + /** Line inside the file. The first line in the file has the value `1`. */ + line?: number; + /** Path to the source file within the source context of the target binary. */ + path?: string; + } + interface StackFrame { + /** + * Set of arguments passed to this function. + * Note that this might not be populated for all stack frames. + */ + arguments?: Variable[]; + /** Demangled function name at the call site. */ + function?: string; + /** + * Set of local variables at the stack frame location. + * Note that this might not be populated for all stack frames. + */ + locals?: Variable[]; + /** Source location of the call site. */ + location?: SourceLocation; + } + interface StatusMessage { + /** Status message text. */ + description?: FormatMessage; + /** Distinguishes errors from informational messages. */ + isError?: boolean; + /** Reference to which the message applies. */ + refersTo?: string; + } + interface UpdateActiveBreakpointRequest { + /** + * Updated breakpoint information. + * The field `id` must be set. + * The agent must echo all Breakpoint specification fields in the update. + */ + breakpoint?: Breakpoint; + } + interface Variable { + /** Members contained or pointed to by the variable. */ + members?: Variable[]; + /** Name of the variable, if any. */ + name?: string; + /** + * Status associated with the variable. This field will usually stay + * unset. A status of a single variable only applies to that variable or + * expression. The rest of breakpoint data still remains valid. Variables + * might be reported in error state even when breakpoint is not in final + * state. + * + * The message may refer to variable name with `refers_to` set to + * `VARIABLE_NAME`. Alternatively `refers_to` will be set to `VARIABLE_VALUE`. + * In either case variable value and members will be unset. + * + * Example of error message applied to name: `Invalid expression syntax`. + * + * Example of information message applied to value: `Not captured`. + * + * Examples of error message applied to value: + * + * * `Malformed string`, + * * `Field f not found in class C` + * * `Null pointer dereference` + */ + status?: StatusMessage; + /** + * Variable type (e.g. `MyClass`). If the variable is split with + * `var_table_index`, `type` goes next to `value`. The interpretation of + * a type is agent specific. It is recommended to include the dynamic type + * rather than a static type of an object. + */ + type?: string; + /** Simple value of the variable. */ + value?: string; + /** + * Reference to a variable in the shared variable table. More than + * one variable can reference the same variable in the table. The + * `var_table_index` field is an index into `variable_table` in Breakpoint. + */ + varTableIndex?: number; + } + interface BreakpointsResource { + /** + * Returns the list of all active breakpoints for the debuggee. + * + * The breakpoint specification (`location`, `condition`, and `expressions` + * fields) is semantically immutable, although the field values may + * change. For example, an agent may update the location line number + * to reflect the actual line where the breakpoint was set, but this + * doesn't change the breakpoint semantics. + * + * This means that an agent does not need to check if a breakpoint has changed + * when it encounters the same breakpoint on a successive call. + * Moreover, an agent should remember the breakpoints that are completed + * until the controller removes them from the active list to avoid + * setting those breakpoints again. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Identifies the debuggee. */ + debuggeeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * If set to `true` (recommended), returns `google.rpc.Code.OK` status and + * sets the `wait_expired` response field to `true` when the server-selected + * timeout has expired. + * + * If set to `false` (deprecated), returns `google.rpc.Code.ABORTED` status + * when the server-selected timeout has expired. + */ + successOnTimeout?: boolean; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * A token that, if specified, blocks the method call until the list + * of active breakpoints has changed, or a server-selected timeout has + * expired. The value should be set from the `next_wait_token` field in + * the last response. The initial value should be set to `"init"`. + */ + waitToken?: string; + }): Request; + /** + * Updates the breakpoint state or mutable fields. + * The entire Breakpoint message must be sent back to the controller service. + * + * Updates to active breakpoint fields are only allowed if the new value + * does not change the breakpoint specification. Updates to the `location`, + * `condition` and `expressions` fields should not alter the breakpoint + * semantics. These may only make changes such as canonicalizing a value + * or snapping the location to the correct line of code. + */ + update(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Identifies the debuggee being debugged. */ + debuggeeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Breakpoint identifier, unique in the scope of the debuggee. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + } + interface DebuggeesResource { + /** + * Registers the debuggee with the controller service. + * + * All agents attached to the same application must call this method with + * exactly the same request content to get back the same stable `debuggee_id`. + * Agents should call this method again whenever `google.rpc.Code.NOT_FOUND` + * is returned from any controller method. + * + * This protocol allows the controller service to disable debuggees, recover + * from data loss, or change the `debuggee_id` format. Agents must handle + * `debuggee_id` value changing upon re-registration. + */ + register(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + breakpoints: BreakpointsResource; + } + interface ControllerResource { + debuggees: DebuggeesResource; + } + interface BreakpointsResource { + /** Deletes the breakpoint from the debuggee. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** ID of the breakpoint to delete. */ + breakpointId: string; + /** JSONP */ + callback?: string; + /** + * The client version making the call. + * Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). + */ + clientVersion?: string; + /** ID of the debuggee whose breakpoint to delete. */ + debuggeeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Gets breakpoint information. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** ID of the breakpoint to get. */ + breakpointId: string; + /** JSONP */ + callback?: string; + /** + * The client version making the call. + * Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). + */ + clientVersion?: string; + /** ID of the debuggee whose breakpoint to get. */ + debuggeeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists all breakpoints for the debuggee. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Only breakpoints with the specified action will pass the filter. */ + "action.value"?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The client version making the call. + * Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). + */ + clientVersion?: string; + /** ID of the debuggee whose breakpoints to list. */ + debuggeeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * When set to `true`, the response includes the list of breakpoints set by + * any user. Otherwise, it includes only breakpoints set by the caller. + */ + includeAllUsers?: boolean; + /** + * When set to `true`, the response includes active and inactive + * breakpoints. Otherwise, it includes only active breakpoints. + */ + includeInactive?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * This field is deprecated. The following fields are always stripped out of + * the result: `stack_frames`, `evaluated_expressions` and `variable_table`. + */ + stripResults?: boolean; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * A wait token that, if specified, blocks the call until the breakpoints + * list has changed, or a server selected timeout has expired. The value + * should be set from the last response. The error code + * `google.rpc.Code.ABORTED` (RPC) is returned on wait timeout, which + * should be called again with the same `wait_token`. + */ + waitToken?: string; + }): Request; + /** Sets the breakpoint to the debuggee. */ + set(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The client version making the call. + * Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). + */ + clientVersion?: string; + /** ID of the debuggee where the breakpoint is to be set. */ + debuggeeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface DebuggeesResource { + /** Lists all the debuggees that the user has access to. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The client version making the call. + * Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). + */ + clientVersion?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * When set to `true`, the result includes all debuggees. Otherwise, the + * result includes only debuggees that are active. + */ + includeInactive?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project number of a Google Cloud project whose debuggees to list. */ + project?: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + breakpoints: BreakpointsResource; + } + interface DebuggerResource { + debuggees: DebuggeesResource; + } + } +} diff --git a/types/gapi.client.clouddebugger/readme.md b/types/gapi.client.clouddebugger/readme.md new file mode 100644 index 0000000000..1b61d87192 --- /dev/null +++ b/types/gapi.client.clouddebugger/readme.md @@ -0,0 +1,58 @@ +# TypeScript typings for Stackdriver Debugger API v2 +Examines the call stack and variables of a running application without stopping or slowing it down. + +For detailed description please check [documentation](http://cloud.google.com/debugger). + +## Installing + +Install typings for Stackdriver Debugger API: +``` +npm install @types/gapi.client.clouddebugger@v2 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('clouddebugger', 'v2', () => { + // now we can use gapi.client.clouddebugger + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // Manage cloud debugger + 'https://www.googleapis.com/auth/cloud_debugger', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Stackdriver Debugger API resources: + +```typescript +``` \ No newline at end of file diff --git a/types/gapi.client.clouddebugger/tsconfig.json b/types/gapi.client.clouddebugger/tsconfig.json new file mode 100644 index 0000000000..de9d4c94bc --- /dev/null +++ b/types/gapi.client.clouddebugger/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.clouddebugger-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.clouddebugger/tslint.json b/types/gapi.client.clouddebugger/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.clouddebugger/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.clouderrorreporting/gapi.client.clouderrorreporting-tests.ts b/types/gapi.client.clouderrorreporting/gapi.client.clouderrorreporting-tests.ts new file mode 100644 index 0000000000..7123a90021 --- /dev/null +++ b/types/gapi.client.clouderrorreporting/gapi.client.clouderrorreporting-tests.ts @@ -0,0 +1,36 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('clouderrorreporting', 'v1beta1', () => { + /** now we can use gapi.client.clouderrorreporting */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Deletes all error events of a given project. */ + await gapi.client.projects.deleteEvents({ + projectName: "projectName", + }); + } +}); diff --git a/types/gapi.client.clouderrorreporting/index.d.ts b/types/gapi.client.clouderrorreporting/index.d.ts new file mode 100644 index 0000000000..a19854416f --- /dev/null +++ b/types/gapi.client.clouderrorreporting/index.d.ts @@ -0,0 +1,614 @@ +// Type definitions for Google Stackdriver Error Reporting API v1beta1 1.0 +// Project: https://cloud.google.com/error-reporting/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://clouderrorreporting.googleapis.com/$discovery/rest?version=v1beta1 + +/// + +declare namespace gapi.client { + /** Load Stackdriver Error Reporting API v1beta1 */ + function load(name: "clouderrorreporting", version: "v1beta1"): PromiseLike; + function load(name: "clouderrorreporting", version: "v1beta1", callback: () => any): void; + + const projects: clouderrorreporting.ProjectsResource; + + namespace clouderrorreporting { + interface ErrorContext { + /** + * The HTTP request which was processed when the error was + * triggered. + */ + httpRequest?: HttpRequestContext; + /** + * The location in the source code where the decision was made to + * report the error, usually the place where it was logged. + * For a logged exception this would be the source line where the + * exception is logged, usually close to the place where it was + * caught. + */ + reportLocation?: SourceLocation; + /** + * Source code that was used to build the executable which has + * caused the given error message. + */ + sourceReferences?: SourceReference[]; + /** + * The user who caused or was affected by the crash. + * This can be a user ID, an email address, or an arbitrary token that + * uniquely identifies the user. + * When sending an error report, leave this field empty if the user was not + * logged in. In this case the + * Error Reporting system will use other data, such as remote IP address, to + * distinguish affected users. See `affected_users_count` in + * `ErrorGroupStats`. + */ + user?: string; + } + interface ErrorEvent { + /** Data about the context in which the error occurred. */ + context?: ErrorContext; + /** + * Time when the event occurred as provided in the error report. + * If the report did not contain a timestamp, the time the error was received + * by the Error Reporting system is used. + */ + eventTime?: string; + /** The stack trace that was reported or logged by the service. */ + message?: string; + /** The `ServiceContext` for which this error was reported. */ + serviceContext?: ServiceContext; + } + interface ErrorGroup { + /** + * Group IDs are unique for a given project. If the same kind of error + * occurs in different service contexts, it will receive the same group ID. + */ + groupId?: string; + /** + * The group resource name. + * Example: projects/my-project-123/groups/my-groupid + */ + name?: string; + /** Associated tracking issues. */ + trackingIssues?: TrackingIssue[]; + } + interface ErrorGroupStats { + /** + * Service contexts with a non-zero error count for the given filter + * criteria. This list can be truncated if multiple services are affected. + * Refer to `num_affected_services` for the total count. + */ + affectedServices?: ServiceContext[]; + /** + * Approximate number of affected users in the given group that + * match the filter criteria. + * Users are distinguished by data in the `ErrorContext` of the + * individual error events, such as their login name or their remote + * IP address in case of HTTP requests. + * The number of affected users can be zero even if the number of + * errors is non-zero if no data was provided from which the + * affected user could be deduced. + * Users are counted based on data in the request + * context that was provided in the error report. If more users are + * implicitly affected, such as due to a crash of the whole service, + * this is not reflected here. + */ + affectedUsersCount?: string; + /** + * Approximate total number of events in the given group that match + * the filter criteria. + */ + count?: string; + /** + * Approximate first occurrence that was ever seen for this group + * and which matches the given filter criteria, ignoring the + * time_range that was specified in the request. + */ + firstSeenTime?: string; + /** Group data that is independent of the filter criteria. */ + group?: ErrorGroup; + /** + * Approximate last occurrence that was ever seen for this group and + * which matches the given filter criteria, ignoring the time_range + * that was specified in the request. + */ + lastSeenTime?: string; + /** + * The total number of services with a non-zero error count for the given + * filter criteria. + */ + numAffectedServices?: number; + /** + * An arbitrary event that is chosen as representative for the whole group. + * The representative event is intended to be used as a quick preview for + * the whole group. Events in the group are usually sufficiently similar + * to each other such that showing an arbitrary representative provides + * insight into the characteristics of the group as a whole. + */ + representative?: ErrorEvent; + /** + * Approximate number of occurrences over time. + * Timed counts returned by ListGroups are guaranteed to be: + * + * - Inside the requested time interval + * - Non-overlapping, and + * - Ordered by ascending time. + */ + timedCounts?: TimedCount[]; + } + interface HttpRequestContext { + /** The type of HTTP request, such as `GET`, `POST`, etc. */ + method?: string; + /** The referrer information that is provided with the request. */ + referrer?: string; + /** + * The IP address from which the request originated. + * This can be IPv4, IPv6, or a token which is derived from the + * IP address, depending on the data that has been provided + * in the error report. + */ + remoteIp?: string; + /** The HTTP response status code for the request. */ + responseStatusCode?: number; + /** The URL of the request. */ + url?: string; + /** The user agent information that is provided with the request. */ + userAgent?: string; + } + interface ListEventsResponse { + /** The error events which match the given request. */ + errorEvents?: ErrorEvent[]; + /** + * If non-empty, more results are available. + * Pass this token, along with the same query parameters as the first + * request, to view the next page of results. + */ + nextPageToken?: string; + /** The timestamp specifies the start time to which the request was restricted. */ + timeRangeBegin?: string; + } + interface ListGroupStatsResponse { + /** The error group stats which match the given request. */ + errorGroupStats?: ErrorGroupStats[]; + /** + * If non-empty, more results are available. + * Pass this token, along with the same query parameters as the first + * request, to view the next page of results. + */ + nextPageToken?: string; + /** + * The timestamp specifies the start time to which the request was restricted. + * The start time is set based on the requested time range. It may be adjusted + * to a later time if a project has exceeded the storage quota and older data + * has been deleted. + */ + timeRangeBegin?: string; + } + interface ReportedErrorEvent { + /** [Optional] A description of the context in which the error occurred. */ + context?: ErrorContext; + /** + * [Optional] Time when the event occurred. + * If not provided, the time when the event was received by the + * Error Reporting system will be used. + */ + eventTime?: string; + /** + * [Required] The error message. + * If no `context.reportLocation` is provided, the message must contain a + * header (typically consisting of the exception type name and an error + * message) and an exception stack trace in one of the supported programming + * languages and formats. + * Supported languages are Java, Python, JavaScript, Ruby, C#, PHP, and Go. + * Supported stack trace formats are: + * + * * **Java**: Must be the return value of + * [`Throwable.printStackTrace()`](https://docs.oracle.com/javase/7/docs/api/java/lang/Throwable.html#printStackTrace%28%29). + * * **Python**: Must be the return value of [`traceback.format_exc()`](https://docs.python.org/2/library/traceback.html#traceback.format_exc). + * * **JavaScript**: Must be the value of [`error.stack`](https://github.com/v8/v8/wiki/Stack-Trace-API) + * as returned by V8. + * * **Ruby**: Must contain frames returned by [`Exception.backtrace`](https://ruby-doc.org/core-2.2.0/Exception.html#method-i-backtrace). + * * **C#**: Must be the return value of [`Exception.ToString()`](https://msdn.microsoft.com/en-us/library/system.exception.tostring.aspx). + * * **PHP**: Must start with `PHP (Notice|Parse error|Fatal error|Warning)` + * and contain the result of [`(string)$exception`](http://php.net/manual/en/exception.tostring.php). + * * **Go**: Must be the return value of [`runtime.Stack()`](https://golang.org/pkg/runtime/debug/#Stack). + */ + message?: string; + /** [Required] The service context in which this error has occurred. */ + serviceContext?: ServiceContext; + } + interface ServiceContext { + /** + * Type of the MonitoredResource. List of possible values: + * https://cloud.google.com/monitoring/api/resources + * + * Value is set automatically for incoming errors and must not be set when + * reporting errors. + */ + resourceType?: string; + /** + * An identifier of the service, such as the name of the + * executable, job, or Google App Engine service name. This field is expected + * to have a low number of values that are relatively stable over time, as + * opposed to `version`, which can be changed whenever new code is deployed. + * + * Contains the service name for error reports extracted from Google + * App Engine logs or `default` if the App Engine default service is used. + */ + service?: string; + /** + * Represents the source code version that the developer provided, + * which could represent a version label or a Git SHA-1 hash, for example. + * For App Engine standard environment, the version is set to the version of + * the app. + */ + version?: string; + } + interface SourceLocation { + /** + * The source code filename, which can include a truncated relative + * path, or a full path from a production machine. + */ + filePath?: string; + /** + * Human-readable name of a function or method. + * The value can include optional context like the class or package name. + * For example, `my.package.MyClass.method` in case of Java. + */ + functionName?: string; + /** 1-based. 0 indicates that the line number is unknown. */ + lineNumber?: number; + } + interface SourceReference { + /** + * Optional. A URI string identifying the repository. + * Example: "https://github.com/GoogleCloudPlatform/kubernetes.git" + */ + repository?: string; + /** + * The canonical and persistent identifier of the deployed revision. + * Example (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b" + */ + revisionId?: string; + } + interface TimedCount { + /** Approximate number of occurrences in the given time period. */ + count?: string; + /** End of the time period to which `count` refers (excluded). */ + endTime?: string; + /** Start of the time period to which `count` refers (included). */ + startTime?: string; + } + interface TrackingIssue { + /** + * A URL pointing to a related entry in an issue tracking system. + * Example: https://github.com/user/project/issues/4 + */ + url?: string; + } + interface EventsResource { + /** Lists the specified events. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** [Required] The group for which events shall be returned. */ + groupId?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** [Optional] The maximum number of results to return per response. */ + pageSize?: number; + /** [Optional] A `next_page_token` provided by a previous response. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * [Required] The resource name of the Google Cloud Platform project. Written + * as `projects/` plus the + * [Google Cloud Platform project + * ID](https://support.google.com/cloud/answer/6158840). + * Example: `projects/my-project-123`. + */ + projectName: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * [Optional] The exact value to match against + * [`ServiceContext.resource_type`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type). + */ + "serviceFilter.resourceType"?: string; + /** + * [Optional] The exact value to match against + * [`ServiceContext.service`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service). + */ + "serviceFilter.service"?: string; + /** + * [Optional] The exact value to match against + * [`ServiceContext.version`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version). + */ + "serviceFilter.version"?: string; + /** Restricts the query to the specified time range. */ + "timeRange.period"?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Report an individual error event. + * + * This endpoint accepts either an OAuth token, + * or an + * API key + * for authentication. To use an API key, append it to the URL as the value of + * a `key` parameter. For example: + *
    POST https://clouderrorreporting.googleapis.com/v1beta1/projects/example-project/events:report?key=123ABC456
    + */ + report(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * [Required] The resource name of the Google Cloud Platform project. Written + * as `projects/` plus the + * [Google Cloud Platform project ID](https://support.google.com/cloud/answer/6158840). + * Example: `projects/my-project-123`. + */ + projectName: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + } + interface GroupStatsResource { + /** Lists the specified groups. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** + * [Optional] The alignment of the timed counts to be returned. + * Default is `ALIGNMENT_EQUAL_AT_END`. + */ + alignment?: string; + /** + * [Optional] Time where the timed counts shall be aligned if rounded + * alignment is chosen. Default is 00:00 UTC. + */ + alignmentTime?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** [Optional] List all ErrorGroupStats with these IDs. */ + groupId?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * [Optional] The sort order in which the results are returned. + * Default is `COUNT_DESC`. + */ + order?: string; + /** + * [Optional] The maximum number of results to return per response. + * Default is 20. + */ + pageSize?: number; + /** + * [Optional] A `next_page_token` provided by a previous response. To view + * additional results, pass this token along with the identical query + * parameters as the first request. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * [Required] The resource name of the Google Cloud Platform project. Written + * as projects/ plus the + * Google Cloud + * Platform project ID. + * + * Example: projects/my-project-123. + */ + projectName: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * [Optional] The exact value to match against + * [`ServiceContext.resource_type`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type). + */ + "serviceFilter.resourceType"?: string; + /** + * [Optional] The exact value to match against + * [`ServiceContext.service`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service). + */ + "serviceFilter.service"?: string; + /** + * [Optional] The exact value to match against + * [`ServiceContext.version`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version). + */ + "serviceFilter.version"?: string; + /** Restricts the query to the specified time range. */ + "timeRange.period"?: string; + /** + * [Optional] The preferred duration for a single returned `TimedCount`. + * If not set, no timed counts are returned. + */ + timedCountDuration?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface GroupsResource { + /** Get the specified group. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * [Required] The group resource name. Written as + * projects/projectID/groups/group_name. + * Call + * + * groupStats.list to return a list of groups belonging to + * this project. + * + * Example: projects/my-project-123/groups/my-group + */ + groupName: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Replace the data for the specified group. + * Fails if the group does not exist. + */ + update(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The group resource name. + * Example: projects/my-project-123/groups/my-groupid + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface ProjectsResource { + /** Deletes all error events of a given project. */ + deleteEvents(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * [Required] The resource name of the Google Cloud Platform project. Written + * as `projects/` plus the + * [Google Cloud Platform project + * ID](https://support.google.com/cloud/answer/6158840). + * Example: `projects/my-project-123`. + */ + projectName: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + events: EventsResource; + groupStats: GroupStatsResource; + groups: GroupsResource; + } + } +} diff --git a/types/gapi.client.clouderrorreporting/readme.md b/types/gapi.client.clouderrorreporting/readme.md new file mode 100644 index 0000000000..aacd09c395 --- /dev/null +++ b/types/gapi.client.clouderrorreporting/readme.md @@ -0,0 +1,60 @@ +# TypeScript typings for Stackdriver Error Reporting API v1beta1 +Groups and counts similar errors from cloud services and applications, reports new errors, and provides access to error groups and their associated errors. + +For detailed description please check [documentation](https://cloud.google.com/error-reporting/). + +## Installing + +Install typings for Stackdriver Error Reporting API: +``` +npm install @types/gapi.client.clouderrorreporting@v1beta1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('clouderrorreporting', 'v1beta1', () => { + // now we can use gapi.client.clouderrorreporting + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Stackdriver Error Reporting API resources: + +```typescript + +/* +Deletes all error events of a given project. +*/ +await gapi.client.projects.deleteEvents({ projectName: "projectName", }); +``` \ No newline at end of file diff --git a/types/gapi.client.clouderrorreporting/tsconfig.json b/types/gapi.client.clouderrorreporting/tsconfig.json new file mode 100644 index 0000000000..cc1296f8ee --- /dev/null +++ b/types/gapi.client.clouderrorreporting/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.clouderrorreporting-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.clouderrorreporting/tslint.json b/types/gapi.client.clouderrorreporting/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.clouderrorreporting/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.cloudfunctions/gapi.client.cloudfunctions-tests.ts b/types/gapi.client.cloudfunctions/gapi.client.cloudfunctions-tests.ts new file mode 100644 index 0000000000..fe11f8e612 --- /dev/null +++ b/types/gapi.client.cloudfunctions/gapi.client.cloudfunctions-tests.ts @@ -0,0 +1,58 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('cloudfunctions', 'v1', () => { + /** now we can use gapi.client.cloudfunctions */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + */ + await gapi.client.operations.get({ + name: "name", + }); + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. + * + * NOTE: the `name` binding allows API services to override the binding + * to use different resource name schemes, such as `users/*/operations`. To + * override the binding, API services can add a binding such as + * `"/v1/{name=users/*}/operations"` to their service configuration. + * For backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding + * is the parent resource, without the operations collection id. + */ + await gapi.client.operations.list({ + filter: "filter", + name: "name", + pageSize: 3, + pageToken: "pageToken", + }); + } +}); diff --git a/types/gapi.client.cloudfunctions/index.d.ts b/types/gapi.client.cloudfunctions/index.d.ts new file mode 100644 index 0000000000..f3cd5cc4a2 --- /dev/null +++ b/types/gapi.client.cloudfunctions/index.d.ts @@ -0,0 +1,249 @@ +// Type definitions for Google Google Cloud Functions API v1 1.0 +// Project: https://cloud.google.com/functions +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://cloudfunctions.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Google Cloud Functions API v1 */ + function load(name: "cloudfunctions", version: "v1"): PromiseLike; + function load(name: "cloudfunctions", version: "v1", callback: () => any): void; + + const operations: cloudfunctions.OperationsResource; + + const projects: cloudfunctions.ProjectsResource; + + namespace cloudfunctions { + interface ListLocationsResponse { + /** A list of locations that matches the specified filter in the request. */ + locations?: Location[]; + /** The standard List next-page token. */ + nextPageToken?: string; + } + interface ListOperationsResponse { + /** The standard List next-page token. */ + nextPageToken?: string; + /** A list of operations that matches the specified filter in the request. */ + operations?: Operation[]; + } + interface Location { + /** + * Cross-service attributes for the location. For example + * + * {"cloud.googleapis.com/region": "us-east1"} + */ + labels?: Record; + /** The canonical id for this location. For example: `"us-east1"`. */ + locationId?: string; + /** + * Service-specific metadata. For example the available capacity at the given + * location. + */ + metadata?: Record; + /** + * Resource name for the location, which may vary between implementations. + * For example: `"projects/example-project/locations/us-east1"` + */ + name?: string; + } + interface Operation { + /** + * If the value is `false`, it means the operation is still in progress. + * If `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done?: boolean; + /** The error result of the operation in case of failure or cancellation. */ + error?: Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata?: Record; + /** + * The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name?: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` + * is the original method name. For example, if the original method name + * is `TakeSnapshot()`, the inferred response type is + * `TakeSnapshotResponse`. + */ + response?: Record; + } + interface OperationMetadataV1Beta2 { + /** The original request that started the operation. */ + request?: Record; + /** + * Target of the operation - for example + * projects/project-1/locations/region-1/functions/function-1 + */ + target?: string; + /** Type of operation. */ + type?: string; + /** + * Version id of the function created or updated by an API call. + * This field is only pupulated for Create and Update operations. + */ + versionId?: string; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface OperationsResource { + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. + * + * NOTE: the `name` binding allows API services to override the binding + * to use different resource name schemes, such as `users/*/operations`. To + * override the binding, API services can add a binding such as + * `"/v1/{name=users/*}/operations"` to their service configuration. + * For backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding + * is the parent resource, without the operations collection id. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The standard list filter. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation's parent resource. */ + name?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The standard list page size. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface LocationsResource { + /** Lists information about the supported locations for this service. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The standard list filter. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The resource that owns the locations collection, if applicable. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The standard list page size. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface ProjectsResource { + locations: LocationsResource; + } + } +} diff --git a/types/gapi.client.cloudfunctions/readme.md b/types/gapi.client.cloudfunctions/readme.md new file mode 100644 index 0000000000..2d9c14ec33 --- /dev/null +++ b/types/gapi.client.cloudfunctions/readme.md @@ -0,0 +1,75 @@ +# TypeScript typings for Google Cloud Functions API v1 +API for managing lightweight user-provided functions executed in response to events. +For detailed description please check [documentation](https://cloud.google.com/functions). + +## Installing + +Install typings for Google Cloud Functions API: +``` +npm install @types/gapi.client.cloudfunctions@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('cloudfunctions', 'v1', () => { + // now we can use gapi.client.cloudfunctions + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Cloud Functions API resources: + +```typescript + +/* +Gets the latest state of a long-running operation. Clients can use this +method to poll the operation result at intervals as recommended by the API +service. +*/ +await gapi.client.operations.get({ name: "name", }); + +/* +Lists operations that match the specified filter in the request. If the +server doesn't support this method, it returns `UNIMPLEMENTED`. + +NOTE: the `name` binding allows API services to override the binding +to use different resource name schemes, such as `users/*/operations`. To +override the binding, API services can add a binding such as +`"/v1/{name=users/*}/operations"` to their service configuration. +For backwards compatibility, the default name includes the operations +collection id, however overriding users must ensure the name binding +is the parent resource, without the operations collection id. +*/ +await gapi.client.operations.list({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.cloudfunctions/tsconfig.json b/types/gapi.client.cloudfunctions/tsconfig.json new file mode 100644 index 0000000000..720b272f2e --- /dev/null +++ b/types/gapi.client.cloudfunctions/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.cloudfunctions-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.cloudfunctions/tslint.json b/types/gapi.client.cloudfunctions/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.cloudfunctions/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.cloudiot/gapi.client.cloudiot-tests.ts b/types/gapi.client.cloudiot/gapi.client.cloudiot-tests.ts new file mode 100644 index 0000000000..f9e8f3f18b --- /dev/null +++ b/types/gapi.client.cloudiot/gapi.client.cloudiot-tests.ts @@ -0,0 +1,34 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('cloudiot', 'v1', () => { + /** now we can use gapi.client.cloudiot */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** Register and manage devices in the Google Cloud IoT service */ + 'https://www.googleapis.com/auth/cloudiot', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + } +}); diff --git a/types/gapi.client.cloudiot/index.d.ts b/types/gapi.client.cloudiot/index.d.ts new file mode 100644 index 0000000000..eeb0647503 --- /dev/null +++ b/types/gapi.client.cloudiot/index.d.ts @@ -0,0 +1,1161 @@ +// Type definitions for Google Google Cloud IoT API v1 1.0 +// Project: https://cloud.google.com/iot +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://cloudiot.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Google Cloud IoT API v1 */ + function load(name: "cloudiot", version: "v1"): PromiseLike; + function load(name: "cloudiot", version: "v1", callback: () => any): void; + + const projects: cloudiot.ProjectsResource; + + namespace cloudiot { + interface AuditConfig { + /** + * The configuration for logging of each type of permission. + * Next ID: 4 + */ + auditLogConfigs?: AuditLogConfig[]; + exemptedMembers?: string[]; + /** + * Specifies a service that will be enabled for audit logging. + * For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + * `allServices` is a special value that covers all services. + */ + service?: string; + } + interface AuditLogConfig { + /** + * Specifies the identities that do not cause logging for this type of + * permission. + * Follows the same format of Binding.members. + */ + exemptedMembers?: string[]; + /** The log type that this config enables. */ + logType?: string; + } + interface Binding { + /** + * The condition that is associated with this binding. + * NOTE: an unsatisfied condition will not allow user access via current + * binding. Different bindings, including their conditions, are examined + * independently. + * This field is GOOGLE_INTERNAL. + */ + condition?: Expr; + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: + * + * * `allUsers`: A special identifier that represents anyone who is + * on the internet; with or without a Google account. + * + * * `allAuthenticatedUsers`: A special identifier that represents anyone + * who is authenticated with a Google account or a service account. + * + * * `user:{emailid}`: An email address that represents a specific Google + * account. For example, `alice@gmail.com` or `joe@example.com`. + * + * + * * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. + * + * * `group:{emailid}`: An email address that represents a Google group. + * For example, `admins@example.com`. + * + * + * * `domain:{domain}`: A Google Apps domain name that represents all the + * users of that domain. For example, `google.com` or `example.com`. + */ + members?: string[]; + /** + * Role that is assigned to `members`. + * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + * Required + */ + role?: string; + } + interface Device { + /** + * If a device is blocked, connections or requests from this device will fail. + * Can be used to temporarily prevent the device from connecting if, for + * example, the sensor is generating bad data and needs maintenance. + */ + blocked?: boolean; + /** + * The most recent device configuration, which is eventually sent from + * Cloud IoT Core to the device. If not present on creation, the + * configuration will be initialized with an empty payload and version value + * of `1`. To update this field after creation, use the + * `DeviceManager.ModifyCloudToDeviceConfig` method. + */ + config?: DeviceConfig; + /** + * The credentials used to authenticate this device. To allow credential + * rotation without interruption, multiple device credentials can be bound to + * this device. No more than 3 credentials can be bound to a single device at + * a time. When new credentials are added to a device, they are verified + * against the registry credentials. For details, see the description of the + * `DeviceRegistry.credentials` field. + */ + credentials?: DeviceCredential[]; + /** + * The user-defined device identifier. The device ID must be unique + * within a device registry. + */ + id?: string; + /** + * [Output only] The last time a cloud-to-device config version acknowledgment + * was received from the device. This field is only for configurations + * sent through MQTT. + */ + lastConfigAckTime?: string; + /** + * [Output only] The last time a cloud-to-device config version was sent to + * the device. + */ + lastConfigSendTime?: string; + /** + * [Output only] The error message of the most recent error, such as a failure + * to publish to Cloud Pub/Sub. 'last_error_time' is the timestamp of this + * field. If no errors have occurred, this field has an empty message + * and the status code 0 == OK. Otherwise, this field is expected to have a + * status code other than OK. + */ + lastErrorStatus?: Status; + /** + * [Output only] The time the most recent error occurred, such as a failure to + * publish to Cloud Pub/Sub. This field is the timestamp of + * 'last_error_status'. + */ + lastErrorTime?: string; + /** + * [Output only] The last time a telemetry event was received. Timestamps are + * periodically collected and written to storage; they may be stale by a few + * minutes. + */ + lastEventTime?: string; + /** + * [Output only] The last time a heartbeat was received. Timestamps are + * periodically collected and written to storage; they may be stale by a few + * minutes. This field is only for devices connecting through MQTT. + */ + lastHeartbeatTime?: string; + /** + * [Output only] The last time a state event was received. Timestamps are + * periodically collected and written to storage; they may be stale by a few + * minutes. + */ + lastStateTime?: string; + /** + * The metadata key-value pairs assigned to the device. This metadata is not + * interpreted or indexed by Cloud IoT Core. It can be used to add contextual + * information for the device. + * + * Keys must conform to the regular expression [a-zA-Z0-9-_]+ and be less than + * 128 bytes in length. + * + * Values are free-form strings. Each value must be less than or equal to 32 + * KB in size. + * + * The total size of all keys and values must be less than 256 KB, and the + * maximum number of key-value pairs is 500. + */ + metadata?: Record; + /** + * The resource path name. For example, + * `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or + * `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`. + * When `name` is populated as a response from the service, it always ends + * in the device numeric ID. + */ + name?: string; + /** + * [Output only] A server-defined unique numeric ID for the device. This is a + * more compact way to identify devices, and it is globally unique. + */ + numId?: string; + /** + * [Output only] The state most recently received from the device. If no state + * has been reported, this field is not present. + */ + state?: DeviceState; + } + interface DeviceConfig { + /** The device configuration data. */ + binaryData?: string; + /** + * [Output only] The time at which this configuration version was updated in + * Cloud IoT Core. This timestamp is set by the server. + */ + cloudUpdateTime?: string; + /** + * [Output only] The time at which Cloud IoT Core received the + * acknowledgment from the device, indicating that the device has received + * this configuration version. If this field is not present, the device has + * not yet acknowledged that it received this version. Note that when + * the config was sent to the device, many config versions may have been + * available in Cloud IoT Core while the device was disconnected, and on + * connection, only the latest version is sent to the device. Some + * versions may never be sent to the device, and therefore are never + * acknowledged. This timestamp is set by Cloud IoT Core. + */ + deviceAckTime?: string; + /** + * [Output only] The version of this update. The version number is assigned by + * the server, and is always greater than 0 after device creation. The + * version must be 0 on the `CreateDevice` request if a `config` is + * specified; the response of `CreateDevice` will always have a value of 1. + */ + version?: string; + } + interface DeviceCredential { + /** + * [Optional] The time at which this credential becomes invalid. This + * credential will be ignored for new client authentication requests after + * this timestamp; however, it will not be automatically deleted. + */ + expirationTime?: string; + /** + * A public key used to verify the signature of JSON Web Tokens (JWTs). + * When adding a new device credential, either via device creation or via + * modifications, this public key credential may be required to be signed by + * one of the registry level certificates. More specifically, if the + * registry contains at least one certificate, any new device credential + * must be signed by one of the registry certificates. As a result, + * when the registry contains certificates, only X.509 certificates are + * accepted as device credentials. However, if the registry does + * not contain a certificate, self-signed certificates and public keys will + * be accepted. New device credentials must be different from every + * registry-level certificate. + */ + publicKey?: PublicKeyCredential; + } + interface DeviceRegistry { + /** + * The credentials used to verify the device credentials. No more than 10 + * credentials can be bound to a single registry at a time. The verification + * process occurs at the time of device creation or update. If this field is + * empty, no verification is performed. Otherwise, the credentials of a newly + * created device or added credentials of an updated device should be signed + * with one of these registry credentials. + * + * Note, however, that existing devices will never be affected by + * modifications to this list of credentials: after a device has been + * successfully created in a registry, it should be able to connect even if + * its registry credentials are revoked, deleted, or modified. + */ + credentials?: RegistryCredential[]; + /** + * The configuration for notification of telemetry events received from the + * device. All telemetry events that were successfully published by the + * device and acknowledged by Cloud IoT Core are guaranteed to be + * delivered to Cloud Pub/Sub. Only the first configuration is used. + */ + eventNotificationConfigs?: EventNotificationConfig[]; + /** The DeviceService (HTTP) configuration for this device registry. */ + httpConfig?: HttpConfig; + /** The identifier of this device registry. For example, `myRegistry`. */ + id?: string; + /** The MQTT configuration for this device registry. */ + mqttConfig?: MqttConfig; + /** + * The resource path name. For example, + * `projects/example-project/locations/us-central1/registries/my-registry`. + */ + name?: string; + /** + * The configuration for notification of new states received from the device. + * State updates are guaranteed to be stored in the state history, but + * notifications to Cloud Pub/Sub are not guaranteed. For example, if + * permissions are misconfigured or the specified topic doesn't exist, no + * notification will be published but the state will still be stored in Cloud + * IoT Core. + */ + stateNotificationConfig?: StateNotificationConfig; + } + interface DeviceState { + /** The device state data. */ + binaryData?: string; + /** + * [Output only] The time at which this state version was updated in Cloud + * IoT Core. + */ + updateTime?: string; + } + interface EventNotificationConfig { + /** + * A Cloud Pub/Sub topic name. For example, + * `projects/myProject/topics/deviceEvents`. + */ + pubsubTopicName?: string; + } + interface Expr { + /** + * An optional description of the expression. This is a longer text which + * describes the expression, e.g. when hovered over it in a UI. + */ + description?: string; + /** + * Textual representation of an expression in + * Common Expression Language syntax. + * + * The application context of the containing message determines which + * well-known feature set of CEL is supported. + */ + expression?: string; + /** + * An optional string indicating the location of the expression for error + * reporting, e.g. a file name and a position in the file. + */ + location?: string; + /** + * An optional title for the expression, i.e. a short string describing + * its purpose. This can be used e.g. in UIs which allow to enter the + * expression. + */ + title?: string; + } + interface HttpConfig { + /** + * If enabled, allows devices to use DeviceService via the HTTP protocol. + * Otherwise, any requests to DeviceService will fail for this registry. + */ + httpEnabledState?: string; + } + interface ListDeviceConfigVersionsResponse { + /** + * The device configuration for the last few versions. Versions are listed + * in decreasing order, starting from the most recent one. + */ + deviceConfigs?: DeviceConfig[]; + } + interface ListDeviceRegistriesResponse { + /** The registries that matched the query. */ + deviceRegistries?: DeviceRegistry[]; + /** + * If not empty, indicates that there may be more registries that match the + * request; this value should be passed in a new + * `ListDeviceRegistriesRequest`. + */ + nextPageToken?: string; + } + interface ListDeviceStatesResponse { + /** + * The last few device states. States are listed in descending order of server + * update time, starting from the most recent one. + */ + deviceStates?: DeviceState[]; + } + interface ListDevicesResponse { + /** The devices that match the request. */ + devices?: Device[]; + /** + * If not empty, indicates that there may be more devices that match the + * request; this value should be passed in a new `ListDevicesRequest`. + */ + nextPageToken?: string; + } + interface ModifyCloudToDeviceConfigRequest { + /** The configuration data for the device. */ + binaryData?: string; + /** + * The version number to update. If this value is zero, it will not check the + * version number of the server and will always update the current version; + * otherwise, this update will fail if the version number found on the server + * does not match this version number. This is used to support multiple + * simultaneous updates without losing data. + */ + versionToUpdate?: string; + } + interface MqttConfig { + /** + * If enabled, allows connections using the MQTT protocol. Otherwise, MQTT + * connections to this registry will fail. + */ + mqttEnabledState?: string; + } + interface Policy { + /** Specifies cloud audit logging configuration for this policy. */ + auditConfigs?: AuditConfig[]; + /** + * Associates a list of `members` to a `role`. + * `bindings` with no members will result in an error. + */ + bindings?: Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. + * It is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the policy. + * + * If no `etag` is provided in the call to `setIamPolicy`, then the existing + * policy is overwritten blindly. + */ + etag?: string; + iamOwned?: boolean; + /** Version of the `Policy`. The default version is 0. */ + version?: number; + } + interface PublicKeyCertificate { + /** The certificate data. */ + certificate?: string; + /** The certificate format. */ + format?: string; + /** [Output only] The certificate details. Used only for X.509 certificates. */ + x509Details?: X509CertificateDetails; + } + interface PublicKeyCredential { + /** The format of the key. */ + format?: string; + /** The key data. */ + key?: string; + } + interface RegistryCredential { + /** A public key certificate used to verify the device credentials. */ + publicKeyCertificate?: PublicKeyCertificate; + } + interface SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + policy?: Policy; + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * paths: "bindings, etag" + * This field is only used by Cloud IAM. + */ + updateMask?: string; + } + interface StateNotificationConfig { + /** + * A Cloud Pub/Sub topic name. For example, + * `projects/myProject/topics/deviceEvents`. + */ + pubsubTopicName?: string; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface TestIamPermissionsRequest { + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + permissions?: string[]; + } + interface TestIamPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions?: string[]; + } + interface X509CertificateDetails { + /** The time the certificate becomes invalid. */ + expiryTime?: string; + /** The entity that signed the certificate. */ + issuer?: string; + /** The type of public key in the certificate. */ + publicKeyType?: string; + /** The algorithm used to sign the certificate. */ + signatureAlgorithm?: string; + /** The time the certificate becomes valid. */ + startTime?: string; + /** The entity the certificate and public key belong to. */ + subject?: string; + } + interface ConfigVersionsResource { + /** + * Lists the last few versions of the device configuration in descending + * order (i.e.: newest first). + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The name of the device. For example, + * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + */ + name: string; + /** + * The number of versions to list. Versions are listed in decreasing order of + * the version number. The maximum number of versions retained is 10. If this + * value is zero, it will return all the versions available. + */ + numVersions?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface StatesResource { + /** + * Lists the last few versions of the device state in descending order (i.e.: + * newest first). + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The name of the device. For example, + * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + */ + name: string; + /** + * The number of states to list. States are listed in descending order of + * update time. The maximum number of states retained is 10. If this + * value is zero, it will return all the states available. + */ + numStates?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface DevicesResource { + /** Creates a device in a device registry. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The name of the device registry where this device should be created. + * For example, + * `projects/example-project/locations/us-central1/registries/my-registry`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Deletes a device. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The name of the device. For example, + * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Gets details about a device. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The name of the device. For example, + * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** List devices in a device registry. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * A list of device string identifiers. If empty, it will ignore this field. + * For example, `['device0', 'device12']`. This field cannot hold more than + * 10,000 entries. + */ + deviceIds?: string; + /** + * A list of device numerical ids. If empty, it will ignore this field. This + * field cannot hold more than 10,000 entries. + */ + deviceNumIds?: string; + /** + * The fields of the `Device` resource to be returned in the response. The + * fields `id`, and `num_id` are always returned by default, along with any + * other fields specified. + */ + fieldMask?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The maximum number of devices to return in the response. If this value + * is zero, the service will select a default size. A call may return fewer + * objects than requested, but if there is a non-empty `page_token`, it + * indicates that more entries are available. + */ + pageSize?: number; + /** + * The value returned by the last `ListDevicesResponse`; indicates + * that this is a continuation of a prior `ListDevices` call, and + * that the system should return the next page of data. + */ + pageToken?: string; + /** + * The device registry path. Required. For example, + * `projects/my-project/locations/us-central1/registries/my-registry`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Modifies the configuration for the device, which is eventually sent from + * the Cloud IoT Core servers. Returns the modified configuration version and + * its metadata. + */ + modifyCloudToDeviceConfig(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The name of the device. For example, + * `projects/p0/locations/us-central1/registries/registry0/devices/device0` or + * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Updates a device. */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The resource path name. For example, + * `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or + * `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`. + * When `name` is populated as a response from the service, it always ends + * in the device numeric ID. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Only updates the `device` fields indicated by this mask. + * The field mask must not be empty, and it must not contain fields that + * are immutable or only set by the server. + * Mutable top-level fields: `credentials`, `enabled_state`, and `metadata` + */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + configVersions: ConfigVersionsResource; + states: StatesResource; + } + interface RegistriesResource { + /** Creates a device registry that contains devices. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The project and cloud region where this device registry must be created. + * For example, `projects/example-project/locations/us-central1`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Deletes a device registry configuration. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The name of the device registry. For example, + * `projects/example-project/locations/us-central1/registries/my-registry`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Gets a device registry configuration. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The name of the device registry. For example, + * `projects/example-project/locations/us-central1/registries/my-registry`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Gets the access control policy for a resource. + * Returns an empty policy if the resource exists and does not have a policy + * set. + */ + getIamPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists device registries. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The maximum number of registries to return in the response. If this value + * is zero, the service will select a default size. A call may return fewer + * objects than requested, but if there is a non-empty `page_token`, it + * indicates that more entries are available. + */ + pageSize?: number; + /** + * The value returned by the last `ListDeviceRegistriesResponse`; indicates + * that this is a continuation of a prior `ListDeviceRegistries` call, and + * that the system should return the next page of data. + */ + pageToken?: string; + /** + * The project and cloud region path. For example, + * `projects/example-project/locations/us-central1`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Updates a device registry configuration. */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The resource path name. For example, + * `projects/example-project/locations/us-central1/registries/my-registry`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Only updates the `device_registry` fields indicated by this mask. + * The field mask must not be empty, and it must not contain fields that + * are immutable or only set by the server. + * Mutable top-level fields: `event_notification_config`, `mqtt_config`, and + * `state_notification_config`. + */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Sets the access control policy on the specified resource. Replaces any + * existing policy. + */ + setIamPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns permissions that a caller has on the specified resource. + * If the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + */ + testIamPermissions(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + devices: DevicesResource; + } + interface LocationsResource { + registries: RegistriesResource; + } + interface ProjectsResource { + locations: LocationsResource; + } + } +} diff --git a/types/gapi.client.cloudiot/readme.md b/types/gapi.client.cloudiot/readme.md new file mode 100644 index 0000000000..290068ffb7 --- /dev/null +++ b/types/gapi.client.cloudiot/readme.md @@ -0,0 +1,58 @@ +# TypeScript typings for Google Cloud IoT API v1 +Registers and manages IoT (Internet of Things) devices that connect to the Google Cloud Platform. + +For detailed description please check [documentation](https://cloud.google.com/iot). + +## Installing + +Install typings for Google Cloud IoT API: +``` +npm install @types/gapi.client.cloudiot@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('cloudiot', 'v1', () => { + // now we can use gapi.client.cloudiot + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // Register and manage devices in the Google Cloud IoT service + 'https://www.googleapis.com/auth/cloudiot', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Cloud IoT API resources: + +```typescript +``` \ No newline at end of file diff --git a/types/gapi.client.cloudiot/tsconfig.json b/types/gapi.client.cloudiot/tsconfig.json new file mode 100644 index 0000000000..03ed93c76d --- /dev/null +++ b/types/gapi.client.cloudiot/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.cloudiot-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.cloudiot/tslint.json b/types/gapi.client.cloudiot/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.cloudiot/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.cloudkms/gapi.client.cloudkms-tests.ts b/types/gapi.client.cloudkms/gapi.client.cloudkms-tests.ts new file mode 100644 index 0000000000..07eeeeb5d7 --- /dev/null +++ b/types/gapi.client.cloudkms/gapi.client.cloudkms-tests.ts @@ -0,0 +1,32 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('cloudkms', 'v1', () => { + /** now we can use gapi.client.cloudkms */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + } +}); diff --git a/types/gapi.client.cloudkms/index.d.ts b/types/gapi.client.cloudkms/index.d.ts new file mode 100644 index 0000000000..82f44805fd --- /dev/null +++ b/types/gapi.client.cloudkms/index.d.ts @@ -0,0 +1,1285 @@ +// Type definitions for Google Google Cloud Key Management Service (KMS) API v1 1.0 +// Project: https://cloud.google.com/kms/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://cloudkms.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Google Cloud Key Management Service (KMS) API v1 */ + function load(name: "cloudkms", version: "v1"): PromiseLike; + function load(name: "cloudkms", version: "v1", callback: () => any): void; + + const projects: cloudkms.ProjectsResource; + + namespace cloudkms { + interface AuditConfig { + /** + * The configuration for logging of each type of permission. + * Next ID: 4 + */ + auditLogConfigs?: AuditLogConfig[]; + exemptedMembers?: string[]; + /** + * Specifies a service that will be enabled for audit logging. + * For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + * `allServices` is a special value that covers all services. + */ + service?: string; + } + interface AuditLogConfig { + /** + * Specifies the identities that do not cause logging for this type of + * permission. + * Follows the same format of Binding.members. + */ + exemptedMembers?: string[]; + /** The log type that this config enables. */ + logType?: string; + } + interface Binding { + /** + * The condition that is associated with this binding. + * NOTE: an unsatisfied condition will not allow user access via current + * binding. Different bindings, including their conditions, are examined + * independently. + * This field is GOOGLE_INTERNAL. + */ + condition?: Expr; + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: + * + * * `allUsers`: A special identifier that represents anyone who is + * on the internet; with or without a Google account. + * + * * `allAuthenticatedUsers`: A special identifier that represents anyone + * who is authenticated with a Google account or a service account. + * + * * `user:{emailid}`: An email address that represents a specific Google + * account. For example, `alice@gmail.com` or `joe@example.com`. + * + * + * * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. + * + * * `group:{emailid}`: An email address that represents a Google group. + * For example, `admins@example.com`. + * + * + * * `domain:{domain}`: A Google Apps domain name that represents all the + * users of that domain. For example, `google.com` or `example.com`. + */ + members?: string[]; + /** + * Role that is assigned to `members`. + * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + * Required + */ + role?: string; + } + interface CryptoKey { + /** Output only. The time at which this CryptoKey was created. */ + createTime?: string; + /** Labels with user defined metadata. */ + labels?: Record; + /** + * Output only. The resource name for this CryptoKey in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + */ + name?: string; + /** + * At next_rotation_time, the Key Management Service will automatically: + * + * 1. Create a new version of this CryptoKey. + * 2. Mark the new version as primary. + * + * Key rotations performed manually via + * CreateCryptoKeyVersion and + * UpdateCryptoKeyPrimaryVersion + * do not affect next_rotation_time. + */ + nextRotationTime?: string; + /** + * Output only. A copy of the "primary" CryptoKeyVersion that will be used + * by Encrypt when this CryptoKey is given + * in EncryptRequest.name. + * + * The CryptoKey's primary version can be updated via + * UpdateCryptoKeyPrimaryVersion. + */ + primary?: CryptoKeyVersion; + /** + * The immutable purpose of this CryptoKey. Currently, the only acceptable + * purpose is ENCRYPT_DECRYPT. + */ + purpose?: string; + /** + * next_rotation_time will be advanced by this period when the service + * automatically rotates a key. Must be at least one day. + * + * If rotation_period is set, next_rotation_time must also be set. + */ + rotationPeriod?: string; + } + interface CryptoKeyVersion { + /** Output only. The time at which this CryptoKeyVersion was created. */ + createTime?: string; + /** + * Output only. The time this CryptoKeyVersion's key material was + * destroyed. Only present if state is + * DESTROYED. + */ + destroyEventTime?: string; + /** + * Output only. The time this CryptoKeyVersion's key material is scheduled + * for destruction. Only present if state is + * DESTROY_SCHEDULED. + */ + destroyTime?: string; + /** + * Output only. The resource name for this CryptoKeyVersion in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + */ + name?: string; + /** The current state of the CryptoKeyVersion. */ + state?: string; + } + interface DecryptRequest { + /** + * Optional data that must match the data originally supplied in + * EncryptRequest.additional_authenticated_data. + */ + additionalAuthenticatedData?: string; + /** + * Required. The encrypted data originally returned in + * EncryptResponse.ciphertext. + */ + ciphertext?: string; + } + interface DecryptResponse { + /** The decrypted data originally supplied in EncryptRequest.plaintext. */ + plaintext?: string; + } + interface EncryptRequest { + /** + * Optional data that, if specified, must also be provided during decryption + * through DecryptRequest.additional_authenticated_data. Must be no + * larger than 64KiB. + */ + additionalAuthenticatedData?: string; + /** Required. The data to encrypt. Must be no larger than 64KiB. */ + plaintext?: string; + } + interface EncryptResponse { + /** The encrypted data. */ + ciphertext?: string; + /** The resource name of the CryptoKeyVersion used in encryption. */ + name?: string; + } + interface Expr { + /** + * An optional description of the expression. This is a longer text which + * describes the expression, e.g. when hovered over it in a UI. + */ + description?: string; + /** + * Textual representation of an expression in + * Common Expression Language syntax. + * + * The application context of the containing message determines which + * well-known feature set of CEL is supported. + */ + expression?: string; + /** + * An optional string indicating the location of the expression for error + * reporting, e.g. a file name and a position in the file. + */ + location?: string; + /** + * An optional title for the expression, i.e. a short string describing + * its purpose. This can be used e.g. in UIs which allow to enter the + * expression. + */ + title?: string; + } + interface KeyRing { + /** Output only. The time at which this KeyRing was created. */ + createTime?: string; + /** + * Output only. The resource name for the KeyRing in the format + * `projects/*/locations/*/keyRings/*`. + */ + name?: string; + } + interface ListCryptoKeyVersionsResponse { + /** The list of CryptoKeyVersions. */ + cryptoKeyVersions?: CryptoKeyVersion[]; + /** + * A token to retrieve next page of results. Pass this value in + * ListCryptoKeyVersionsRequest.page_token to retrieve the next page of + * results. + */ + nextPageToken?: string; + /** + * The total number of CryptoKeyVersions that matched the + * query. + */ + totalSize?: number; + } + interface ListCryptoKeysResponse { + /** The list of CryptoKeys. */ + cryptoKeys?: CryptoKey[]; + /** + * A token to retrieve next page of results. Pass this value in + * ListCryptoKeysRequest.page_token to retrieve the next page of results. + */ + nextPageToken?: string; + /** The total number of CryptoKeys that matched the query. */ + totalSize?: number; + } + interface ListKeyRingsResponse { + /** The list of KeyRings. */ + keyRings?: KeyRing[]; + /** + * A token to retrieve next page of results. Pass this value in + * ListKeyRingsRequest.page_token to retrieve the next page of results. + */ + nextPageToken?: string; + /** The total number of KeyRings that matched the query. */ + totalSize?: number; + } + interface ListLocationsResponse { + /** A list of locations that matches the specified filter in the request. */ + locations?: Location[]; + /** The standard List next-page token. */ + nextPageToken?: string; + } + interface Location { + /** + * Cross-service attributes for the location. For example + * + * {"cloud.googleapis.com/region": "us-east1"} + */ + labels?: Record; + /** The canonical id for this location. For example: `"us-east1"`. */ + locationId?: string; + /** + * Service-specific metadata. For example the available capacity at the given + * location. + */ + metadata?: Record; + /** + * Resource name for the location, which may vary between implementations. + * For example: `"projects/example-project/locations/us-east1"` + */ + name?: string; + } + interface Policy { + /** Specifies cloud audit logging configuration for this policy. */ + auditConfigs?: AuditConfig[]; + /** + * Associates a list of `members` to a `role`. + * `bindings` with no members will result in an error. + */ + bindings?: Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. + * It is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the policy. + * + * If no `etag` is provided in the call to `setIamPolicy`, then the existing + * policy is overwritten blindly. + */ + etag?: string; + iamOwned?: boolean; + /** Version of the `Policy`. The default version is 0. */ + version?: number; + } + interface SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + policy?: Policy; + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * paths: "bindings, etag" + * This field is only used by Cloud IAM. + */ + updateMask?: string; + } + interface TestIamPermissionsRequest { + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + permissions?: string[]; + } + interface TestIamPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions?: string[]; + } + interface UpdateCryptoKeyPrimaryVersionRequest { + /** The id of the child CryptoKeyVersion to use as primary. */ + cryptoKeyVersionId?: string; + } + interface CryptoKeyVersionsResource { + /** + * Create a new CryptoKeyVersion in a CryptoKey. + * + * The server will assign the next sequential id. If unset, + * state will be set to + * ENABLED. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Required. The name of the CryptoKey associated with + * the CryptoKeyVersions. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Schedule a CryptoKeyVersion for destruction. + * + * Upon calling this method, CryptoKeyVersion.state will be set to + * DESTROY_SCHEDULED + * and destroy_time will be set to a time 24 + * hours in the future, at which point the state + * will be changed to + * DESTROYED, and the key + * material will be irrevocably destroyed. + * + * Before the destroy_time is reached, + * RestoreCryptoKeyVersion may be called to reverse the process. + */ + destroy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The resource name of the CryptoKeyVersion to destroy. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Returns metadata for a given CryptoKeyVersion. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the CryptoKeyVersion to get. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists CryptoKeyVersions. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Optional limit on the number of CryptoKeyVersions to + * include in the response. Further CryptoKeyVersions can + * subsequently be obtained by including the + * ListCryptoKeyVersionsResponse.next_page_token in a subsequent request. + * If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * Optional pagination token, returned earlier via + * ListCryptoKeyVersionsResponse.next_page_token. + */ + pageToken?: string; + /** + * Required. The resource name of the CryptoKey to list, in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Update a CryptoKeyVersion's metadata. + * + * state may be changed between + * ENABLED and + * DISABLED using this + * method. See DestroyCryptoKeyVersion and RestoreCryptoKeyVersion to + * move between other states. + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Output only. The resource name for this CryptoKeyVersion in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required list of fields to be updated in this request. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Restore a CryptoKeyVersion in the + * DESTROY_SCHEDULED, + * state. + * + * Upon restoration of the CryptoKeyVersion, state + * will be set to DISABLED, + * and destroy_time will be cleared. + */ + restore(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The resource name of the CryptoKeyVersion to restore. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface CryptoKeysResource { + /** + * Create a new CryptoKey within a KeyRing. + * + * CryptoKey.purpose is required. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Required. It must be unique within a KeyRing and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + */ + cryptoKeyId?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Required. The name of the KeyRing associated with the + * CryptoKeys. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Decrypts data that was protected by Encrypt. */ + decrypt(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. The resource name of the CryptoKey to use for decryption. + * The server will choose the appropriate version. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Encrypts data, so that it can only be recovered by a call to Decrypt. */ + encrypt(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. The resource name of the CryptoKey or CryptoKeyVersion + * to use for encryption. + * + * If a CryptoKey is specified, the server will use its + * primary version. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns metadata for a given CryptoKey, as well as its + * primary CryptoKeyVersion. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the CryptoKey to get. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Gets the access control policy for a resource. + * Returns an empty policy if the resource exists and does not have a policy + * set. + */ + getIamPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists CryptoKeys. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Optional limit on the number of CryptoKeys to include in the + * response. Further CryptoKeys can subsequently be obtained by + * including the ListCryptoKeysResponse.next_page_token in a subsequent + * request. If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * Optional pagination token, returned earlier via + * ListCryptoKeysResponse.next_page_token. + */ + pageToken?: string; + /** + * Required. The resource name of the KeyRing to list, in the format + * `projects/*/locations/*/keyRings/*`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Update a CryptoKey. */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Output only. The resource name for this CryptoKey in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required list of fields to be updated in this request. */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Sets the access control policy on the specified resource. Replaces any + * existing policy. + */ + setIamPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns permissions that a caller has on the specified resource. + * If the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building permission-aware + * UIs and command-line tools, not for authorization checking. This operation + * may "fail open" without warning. + */ + testIamPermissions(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Update the version of a CryptoKey that will be used in Encrypt */ + updatePrimaryVersion(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The resource name of the CryptoKey to update. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + cryptoKeyVersions: CryptoKeyVersionsResource; + } + interface KeyRingsResource { + /** Create a new KeyRing in a given Project and Location. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + */ + keyRingId?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Required. The resource name of the location associated with the + * KeyRings, in the format `projects/*/locations/*`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Returns metadata for a given KeyRing. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the KeyRing to get. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Gets the access control policy for a resource. + * Returns an empty policy if the resource exists and does not have a policy + * set. + */ + getIamPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists KeyRings. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Optional limit on the number of KeyRings to include in the + * response. Further KeyRings can subsequently be obtained by + * including the ListKeyRingsResponse.next_page_token in a subsequent + * request. If unspecified, the server will pick an appropriate default. + */ + pageSize?: number; + /** + * Optional pagination token, returned earlier via + * ListKeyRingsResponse.next_page_token. + */ + pageToken?: string; + /** + * Required. The resource name of the location associated with the + * KeyRings, in the format `projects/*/locations/*`. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Sets the access control policy on the specified resource. Replaces any + * existing policy. + */ + setIamPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns permissions that a caller has on the specified resource. + * If the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building permission-aware + * UIs and command-line tools, not for authorization checking. This operation + * may "fail open" without warning. + */ + testIamPermissions(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + cryptoKeys: CryptoKeysResource; + } + interface LocationsResource { + /** Get information about a location. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Resource name for the location. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists information about the supported locations for this service. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The standard list filter. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The resource that owns the locations collection, if applicable. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The standard list page size. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + keyRings: KeyRingsResource; + } + interface ProjectsResource { + locations: LocationsResource; + } + } +} diff --git a/types/gapi.client.cloudkms/readme.md b/types/gapi.client.cloudkms/readme.md new file mode 100644 index 0000000000..23c623c02d --- /dev/null +++ b/types/gapi.client.cloudkms/readme.md @@ -0,0 +1,54 @@ +# TypeScript typings for Google Cloud Key Management Service (KMS) API v1 +Manages encryption for your cloud services the same way you do on-premises. You can generate, use, rotate, and destroy AES256 encryption keys. +For detailed description please check [documentation](https://cloud.google.com/kms/). + +## Installing + +Install typings for Google Cloud Key Management Service (KMS) API: +``` +npm install @types/gapi.client.cloudkms@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('cloudkms', 'v1', () => { + // now we can use gapi.client.cloudkms + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Cloud Key Management Service (KMS) API resources: + +```typescript +``` \ No newline at end of file diff --git a/types/gapi.client.cloudkms/tsconfig.json b/types/gapi.client.cloudkms/tsconfig.json new file mode 100644 index 0000000000..ff982b97d1 --- /dev/null +++ b/types/gapi.client.cloudkms/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.cloudkms-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.cloudkms/tslint.json b/types/gapi.client.cloudkms/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.cloudkms/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.cloudmonitoring/gapi.client.cloudmonitoring-tests.ts b/types/gapi.client.cloudmonitoring/gapi.client.cloudmonitoring-tests.ts new file mode 100644 index 0000000000..c14ba534aa --- /dev/null +++ b/types/gapi.client.cloudmonitoring/gapi.client.cloudmonitoring-tests.ts @@ -0,0 +1,97 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('cloudmonitoring', 'v2beta2', () => { + /** now we can use gapi.client.cloudmonitoring */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View and write monitoring data for all of your Google and third-party Cloud and API projects */ + 'https://www.googleapis.com/auth/monitoring', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Create a new metric. */ + await gapi.client.metricDescriptors.create({ + project: "project", + }); + /** Delete an existing metric. */ + await gapi.client.metricDescriptors.delete({ + metric: "metric", + project: "project", + }); + /** + * List metric descriptors that match the query. If the query is not set, then all of the metric descriptors will be returned. Large responses will be + * paginated, use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value + * of the nextPageToken. + */ + await gapi.client.metricDescriptors.list({ + count: 1, + pageToken: "pageToken", + project: "project", + query: "query", + }); + /** + * List the data points of the time series that match the metric and labels values and that have data points in the interval. Large responses are + * paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value + * of the nextPageToken. + */ + await gapi.client.timeseries.list({ + aggregator: "aggregator", + count: 2, + labels: "labels", + metric: "metric", + oldest: "oldest", + pageToken: "pageToken", + project: "project", + timespan: "timespan", + window: "window", + youngest: "youngest", + }); + /** + * Put data points to one or more time series for one or more metrics. If a time series does not exist, a new time series will be created. It is not + * allowed to write a time series point that is older than the existing youngest point of that time series. Points that are older than the existing + * youngest point of that time series will be discarded silently. Therefore, users should make sure that points of a time series are written sequentially + * in the order of their end time. + */ + await gapi.client.timeseries.write({ + project: "project", + }); + /** + * List the descriptors of the time series that match the metric and labels values and that have data points in the interval. Large responses are + * paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value + * of the nextPageToken. + */ + await gapi.client.timeseriesDescriptors.list({ + aggregator: "aggregator", + count: 2, + labels: "labels", + metric: "metric", + oldest: "oldest", + pageToken: "pageToken", + project: "project", + timespan: "timespan", + window: "window", + youngest: "youngest", + }); + } +}); diff --git a/types/gapi.client.cloudmonitoring/index.d.ts b/types/gapi.client.cloudmonitoring/index.d.ts new file mode 100644 index 0000000000..6febf1d4e8 --- /dev/null +++ b/types/gapi.client.cloudmonitoring/index.d.ts @@ -0,0 +1,476 @@ +// Type definitions for Google Cloud Monitoring API v2beta2 2.0 +// Project: https://cloud.google.com/monitoring/v2beta2/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/cloudmonitoring/v2beta2/rest + +/// + +declare namespace gapi.client { + /** Load Cloud Monitoring API v2beta2 */ + function load(name: "cloudmonitoring", version: "v2beta2"): PromiseLike; + function load(name: "cloudmonitoring", version: "v2beta2", callback: () => any): void; + + const metricDescriptors: cloudmonitoring.MetricDescriptorsResource; + + const timeseries: cloudmonitoring.TimeseriesResource; + + const timeseriesDescriptors: cloudmonitoring.TimeseriesDescriptorsResource; + + namespace cloudmonitoring { + interface DeleteMetricDescriptorResponse { + /** Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#deleteMetricDescriptorResponse". */ + kind?: string; + } + interface ListMetricDescriptorsRequest { + /** Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#listMetricDescriptorsRequest". */ + kind?: string; + } + interface ListMetricDescriptorsResponse { + /** Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#listMetricDescriptorsResponse". */ + kind?: string; + /** The returned metric descriptors. */ + metrics?: MetricDescriptor[]; + /** + * Pagination token. If present, indicates that additional results are available for retrieval. To access the results past the pagination limit, pass this + * value to the pageToken query parameter. + */ + nextPageToken?: string; + } + interface ListTimeseriesDescriptorsRequest { + /** Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#listTimeseriesDescriptorsRequest". */ + kind?: string; + } + interface ListTimeseriesDescriptorsResponse { + /** Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#listTimeseriesDescriptorsResponse". */ + kind?: string; + /** + * Pagination token. If present, indicates that additional results are available for retrieval. To access the results past the pagination limit, set this + * value to the pageToken query parameter. + */ + nextPageToken?: string; + /** The oldest timestamp of the interval of this query, as an RFC 3339 string. */ + oldest?: string; + /** The returned time series descriptors. */ + timeseries?: TimeseriesDescriptor[]; + /** The youngest timestamp of the interval of this query, as an RFC 3339 string. */ + youngest?: string; + } + interface ListTimeseriesRequest { + /** Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#listTimeseriesRequest". */ + kind?: string; + } + interface ListTimeseriesResponse { + /** Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#listTimeseriesResponse". */ + kind?: string; + /** + * Pagination token. If present, indicates that additional results are available for retrieval. To access the results past the pagination limit, set the + * pageToken query parameter to this value. All of the points of a time series will be returned before returning any point of the subsequent time series. + */ + nextPageToken?: string; + /** The oldest timestamp of the interval of this query as an RFC 3339 string. */ + oldest?: string; + /** The returned time series. */ + timeseries?: Timeseries[]; + /** The youngest timestamp of the interval of this query as an RFC 3339 string. */ + youngest?: string; + } + interface MetricDescriptor { + /** Description of this metric. */ + description?: string; + /** Labels defined for this metric. */ + labels?: MetricDescriptorLabelDescriptor[]; + /** The name of this metric. */ + name?: string; + /** The project ID to which the metric belongs. */ + project?: string; + /** Type description for this metric. */ + typeDescriptor?: MetricDescriptorTypeDescriptor; + } + interface MetricDescriptorLabelDescriptor { + /** Label description. */ + description?: string; + /** Label key. */ + key?: string; + } + interface MetricDescriptorTypeDescriptor { + /** The method of collecting data for the metric. See Metric types. */ + metricType?: string; + /** The data type of of individual points in the metric's time series. See Metric value types. */ + valueType?: string; + } + interface Point { + /** The value of this data point. Either "true" or "false". */ + boolValue?: boolean; + /** + * The value of this data point as a distribution. A distribution value can contain a list of buckets and/or an underflowBucket and an overflowBucket. The + * values of these points can be used to create a histogram. + */ + distributionValue?: PointDistribution; + /** The value of this data point as a double-precision floating-point number. */ + doubleValue?: number; + /** + * The interval [start, end] is the time period to which the point's value applies. For gauge metrics, whose values are instantaneous measurements, this + * interval should be empty (start should equal end). For cumulative metrics (of which deltas and rates are special cases), the interval should be + * non-empty. Both start and end are RFC 3339 strings. + */ + end?: string; + /** The value of this data point as a 64-bit integer. */ + int64Value?: string; + /** + * The interval [start, end] is the time period to which the point's value applies. For gauge metrics, whose values are instantaneous measurements, this + * interval should be empty (start should equal end). For cumulative metrics (of which deltas and rates are special cases), the interval should be + * non-empty. Both start and end are RFC 3339 strings. + */ + start?: string; + /** The value of this data point in string format. */ + stringValue?: string; + } + interface PointDistribution { + /** The finite buckets. */ + buckets?: PointDistributionBucket[]; + /** The overflow bucket. */ + overflowBucket?: PointDistributionOverflowBucket; + /** The underflow bucket. */ + underflowBucket?: PointDistributionUnderflowBucket; + } + interface PointDistributionBucket { + /** The number of events whose values are in the interval defined by this bucket. */ + count?: string; + /** The lower bound of the value interval of this bucket (inclusive). */ + lowerBound?: number; + /** The upper bound of the value interval of this bucket (exclusive). */ + upperBound?: number; + } + interface PointDistributionOverflowBucket { + /** The number of events whose values are in the interval defined by this bucket. */ + count?: string; + /** The lower bound of the value interval of this bucket (inclusive). */ + lowerBound?: number; + } + interface PointDistributionUnderflowBucket { + /** The number of events whose values are in the interval defined by this bucket. */ + count?: string; + /** The upper bound of the value interval of this bucket (exclusive). */ + upperBound?: number; + } + interface Timeseries { + /** The data points of this time series. The points are listed in order of their end timestamp, from younger to older. */ + points?: Point[]; + /** The descriptor of this time series. */ + timeseriesDesc?: TimeseriesDescriptor; + } + interface TimeseriesDescriptor { + /** The label's name. */ + labels?: Record; + /** The name of the metric. */ + metric?: string; + /** The Developers Console project number to which this time series belongs. */ + project?: string; + } + interface TimeseriesDescriptorLabel { + /** The label's name. */ + key?: string; + /** The label's value. */ + value?: string; + } + interface TimeseriesPoint { + /** The data point in this time series snapshot. */ + point?: Point; + /** The descriptor of this time series. */ + timeseriesDesc?: TimeseriesDescriptor; + } + interface WriteTimeseriesRequest { + /** The label's name. */ + commonLabels?: Record; + /** + * Provide time series specific labels and the data points for each time series. The labels in timeseries and the common_labels should form a complete + * list of labels that required by the metric. + */ + timeseries?: TimeseriesPoint[]; + } + interface WriteTimeseriesResponse { + /** Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#writeTimeseriesResponse". */ + kind?: string; + } + interface MetricDescriptorsResource { + /** Create a new metric. */ + create(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project id. The value can be the numeric project ID or string-based project name. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Delete an existing metric. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Name of the metric. */ + metric: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID to which the metric belongs. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * List metric descriptors that match the query. If the query is not set, then all of the metric descriptors will be returned. Large responses will be + * paginated, use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value + * of the nextPageToken. + */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Maximum number of metric descriptors per page. Used for pagination. If not specified, count = 100. */ + count?: number; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The pagination token, which is used to page through large result sets. Set this value to the value of the nextPageToken to retrieve the next page of + * results. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project id. The value can be the numeric project ID or string-based project name. */ + project: string; + /** + * The query used to search against existing metrics. Separate keywords with a space; the service joins all keywords with AND, meaning that all keywords + * must match for a metric to be returned. If this field is omitted, all metrics are returned. If an empty string is passed with this field, no metrics + * are returned. + */ + query?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TimeseriesResource { + /** + * List the data points of the time series that match the metric and labels values and that have data points in the interval. Large responses are + * paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value + * of the nextPageToken. + */ + list(request: { + /** + * The aggregation function that will reduce the data points in each window to a single point. This parameter is only valid for non-cumulative metrics + * with a value type of INT64 or DOUBLE. + */ + aggregator?: string; + /** Data format for the response. */ + alt?: string; + /** Maximum number of data points per page, which is used for pagination of results. */ + count?: number; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * A collection of labels for the matching time series, which are represented as: + * - key==value: key equals the value + * - key=~value: key regex matches the value + * - key!=value: key does not equal the value + * - key!~value: key regex does not match the value For example, to list all of the time series descriptors for the region us-central1, you could + * specify: + * label=cloud.googleapis.com%2Flocation=~us-central1.* + */ + labels?: string; + /** Metric names are protocol-free URLs as listed in the Supported Metrics page. For example, compute.googleapis.com/instance/disk/read_ops_count. */ + metric: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Start of the time interval (exclusive), which is expressed as an RFC 3339 timestamp. If neither oldest nor timespan is specified, the default time + * interval will be (youngest - 4 hours, youngest] + */ + oldest?: string; + /** + * The pagination token, which is used to page through large result sets. Set this value to the value of the nextPageToken to retrieve the next page of + * results. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID to which this time series belongs. The value can be the numeric project ID or string-based project name. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Length of the time interval to query, which is an alternative way to declare the interval: (youngest - timespan, youngest]. The timespan and oldest + * parameters should not be used together. Units: + * - s: second + * - m: minute + * - h: hour + * - d: day + * - w: week Examples: 2s, 3m, 4w. Only one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead. + * + * If neither oldest nor timespan is specified, the default time interval will be (youngest - 4 hours, youngest]. + */ + timespan?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** + * The sampling window. At most one data point will be returned for each window in the requested time interval. This parameter is only valid for + * non-cumulative metric types. Units: + * - m: minute + * - h: hour + * - d: day + * - w: week Examples: 3m, 4w. Only one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead. + */ + window?: string; + /** End of the time interval (inclusive), which is expressed as an RFC 3339 timestamp. */ + youngest: string; + }): Request; + /** + * Put data points to one or more time series for one or more metrics. If a time series does not exist, a new time series will be created. It is not + * allowed to write a time series point that is older than the existing youngest point of that time series. Points that are older than the existing + * youngest point of that time series will be discarded silently. Therefore, users should make sure that points of a time series are written sequentially + * in the order of their end time. + */ + write(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID. The value can be the numeric project ID or string-based project name. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TimeseriesDescriptorsResource { + /** + * List the descriptors of the time series that match the metric and labels values and that have data points in the interval. Large responses are + * paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value + * of the nextPageToken. + */ + list(request: { + /** + * The aggregation function that will reduce the data points in each window to a single point. This parameter is only valid for non-cumulative metrics + * with a value type of INT64 or DOUBLE. + */ + aggregator?: string; + /** Data format for the response. */ + alt?: string; + /** Maximum number of time series descriptors per page. Used for pagination. If not specified, count = 100. */ + count?: number; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * A collection of labels for the matching time series, which are represented as: + * - key==value: key equals the value + * - key=~value: key regex matches the value + * - key!=value: key does not equal the value + * - key!~value: key regex does not match the value For example, to list all of the time series descriptors for the region us-central1, you could + * specify: + * label=cloud.googleapis.com%2Flocation=~us-central1.* + */ + labels?: string; + /** Metric names are protocol-free URLs as listed in the Supported Metrics page. For example, compute.googleapis.com/instance/disk/read_ops_count. */ + metric: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Start of the time interval (exclusive), which is expressed as an RFC 3339 timestamp. If neither oldest nor timespan is specified, the default time + * interval will be (youngest - 4 hours, youngest] + */ + oldest?: string; + /** + * The pagination token, which is used to page through large result sets. Set this value to the value of the nextPageToken to retrieve the next page of + * results. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID to which this time series belongs. The value can be the numeric project ID or string-based project name. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Length of the time interval to query, which is an alternative way to declare the interval: (youngest - timespan, youngest]. The timespan and oldest + * parameters should not be used together. Units: + * - s: second + * - m: minute + * - h: hour + * - d: day + * - w: week Examples: 2s, 3m, 4w. Only one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead. + * + * If neither oldest nor timespan is specified, the default time interval will be (youngest - 4 hours, youngest]. + */ + timespan?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** + * The sampling window. At most one data point will be returned for each window in the requested time interval. This parameter is only valid for + * non-cumulative metric types. Units: + * - m: minute + * - h: hour + * - d: day + * - w: week Examples: 3m, 4w. Only one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead. + */ + window?: string; + /** End of the time interval (inclusive), which is expressed as an RFC 3339 timestamp. */ + youngest: string; + }): Request; + } + } +} diff --git a/types/gapi.client.cloudmonitoring/readme.md b/types/gapi.client.cloudmonitoring/readme.md new file mode 100644 index 0000000000..44ce6fbfc0 --- /dev/null +++ b/types/gapi.client.cloudmonitoring/readme.md @@ -0,0 +1,87 @@ +# TypeScript typings for Cloud Monitoring API v2beta2 +Accesses Google Cloud Monitoring data. +For detailed description please check [documentation](https://cloud.google.com/monitoring/v2beta2/). + +## Installing + +Install typings for Cloud Monitoring API: +``` +npm install @types/gapi.client.cloudmonitoring@v2beta2 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('cloudmonitoring', 'v2beta2', () => { + // now we can use gapi.client.cloudmonitoring + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View and write monitoring data for all of your Google and third-party Cloud and API projects + 'https://www.googleapis.com/auth/monitoring', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Cloud Monitoring API resources: + +```typescript + +/* +Create a new metric. +*/ +await gapi.client.metricDescriptors.create({ project: "project", }); + +/* +Delete an existing metric. +*/ +await gapi.client.metricDescriptors.delete({ metric: "metric", project: "project", }); + +/* +List metric descriptors that match the query. If the query is not set, then all of the metric descriptors will be returned. Large responses will be paginated, use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken. +*/ +await gapi.client.metricDescriptors.list({ project: "project", }); + +/* +List the data points of the time series that match the metric and labels values and that have data points in the interval. Large responses are paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken. +*/ +await gapi.client.timeseries.list({ metric: "metric", project: "project", youngest: "youngest", }); + +/* +Put data points to one or more time series for one or more metrics. If a time series does not exist, a new time series will be created. It is not allowed to write a time series point that is older than the existing youngest point of that time series. Points that are older than the existing youngest point of that time series will be discarded silently. Therefore, users should make sure that points of a time series are written sequentially in the order of their end time. +*/ +await gapi.client.timeseries.write({ project: "project", }); + +/* +List the descriptors of the time series that match the metric and labels values and that have data points in the interval. Large responses are paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken. +*/ +await gapi.client.timeseriesDescriptors.list({ metric: "metric", project: "project", youngest: "youngest", }); +``` \ No newline at end of file diff --git a/types/gapi.client.cloudmonitoring/tsconfig.json b/types/gapi.client.cloudmonitoring/tsconfig.json new file mode 100644 index 0000000000..e007418ca9 --- /dev/null +++ b/types/gapi.client.cloudmonitoring/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.cloudmonitoring-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.cloudmonitoring/tslint.json b/types/gapi.client.cloudmonitoring/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.cloudmonitoring/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.cloudresourcemanager/gapi.client.cloudresourcemanager-tests.ts b/types/gapi.client.cloudresourcemanager/gapi.client.cloudresourcemanager-tests.ts new file mode 100644 index 0000000000..4bb0eafbfc --- /dev/null +++ b/types/gapi.client.cloudresourcemanager/gapi.client.cloudresourcemanager-tests.ts @@ -0,0 +1,404 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('cloudresourcemanager', 'v1', () => { + /** now we can use gapi.client.cloudresourcemanager */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Clears a `Policy` from a resource. */ + await gapi.client.folders.clearOrgPolicy({ + resource: "resource", + }); + /** + * Gets the effective `Policy` on a resource. This is the result of merging + * `Policies` in the resource hierarchy. The returned `Policy` will not have + * an `etag`set because it is a computed `Policy` across multiple resources. + */ + await gapi.client.folders.getEffectiveOrgPolicy({ + resource: "resource", + }); + /** + * Gets a `Policy` on a resource. + * + * If no `Policy` is set on the resource, a `Policy` is returned with default + * values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The + * `etag` value can be used with `SetOrgPolicy()` to create or update a + * `Policy` during read-modify-write. + */ + await gapi.client.folders.getOrgPolicy({ + resource: "resource", + }); + /** Lists `Constraints` that could be applied on the specified resource. */ + await gapi.client.folders.listAvailableOrgPolicyConstraints({ + resource: "resource", + }); + /** Lists all the `Policies` set for a particular resource. */ + await gapi.client.folders.listOrgPolicies({ + resource: "resource", + }); + /** + * Updates the specified `Policy` on the resource. Creates a new `Policy` for + * that `Constraint` on the resource if one does not exist. + * + * Not supplying an `etag` on the request `Policy` results in an unconditional + * write of the `Policy`. + */ + await gapi.client.folders.setOrgPolicy({ + resource: "resource", + }); + /** + * Create a Lien which applies to the resource denoted by the `parent` field. + * + * Callers of this method will require permission on the `parent` resource. + * For example, applying to `projects/1234` requires permission + * `resourcemanager.projects.updateLiens`. + * + * NOTE: Some resources may limit the number of Liens which may be applied. + */ + await gapi.client.liens.create({ + }); + /** + * Delete a Lien by `name`. + * + * Callers of this method will require permission on the `parent` resource. + * For example, a Lien with a `parent` of `projects/1234` requires permission + * `resourcemanager.projects.updateLiens`. + */ + await gapi.client.liens.delete({ + name: "name", + }); + /** + * List all Liens applied to the `parent` resource. + * + * Callers of this method will require permission on the `parent` resource. + * For example, a Lien with a `parent` of `projects/1234` requires permission + * `resourcemanager.projects.get`. + */ + await gapi.client.liens.list({ + pageSize: 1, + pageToken: "pageToken", + parent: "parent", + }); + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + */ + await gapi.client.operations.get({ + name: "name", + }); + /** Clears a `Policy` from a resource. */ + await gapi.client.organizations.clearOrgPolicy({ + resource: "resource", + }); + /** Fetches an Organization resource identified by the specified resource name. */ + await gapi.client.organizations.get({ + name: "name", + }); + /** + * Gets the effective `Policy` on a resource. This is the result of merging + * `Policies` in the resource hierarchy. The returned `Policy` will not have + * an `etag`set because it is a computed `Policy` across multiple resources. + */ + await gapi.client.organizations.getEffectiveOrgPolicy({ + resource: "resource", + }); + /** + * Gets the access control policy for an Organization resource. May be empty + * if no such policy or resource exists. The `resource` field should be the + * organization's resource name, e.g. "organizations/123". + * + * Authorization requires the Google IAM permission + * `resourcemanager.organizations.getIamPolicy` on the specified organization + */ + await gapi.client.organizations.getIamPolicy({ + resource: "resource", + }); + /** + * Gets a `Policy` on a resource. + * + * If no `Policy` is set on the resource, a `Policy` is returned with default + * values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The + * `etag` value can be used with `SetOrgPolicy()` to create or update a + * `Policy` during read-modify-write. + */ + await gapi.client.organizations.getOrgPolicy({ + resource: "resource", + }); + /** Lists `Constraints` that could be applied on the specified resource. */ + await gapi.client.organizations.listAvailableOrgPolicyConstraints({ + resource: "resource", + }); + /** Lists all the `Policies` set for a particular resource. */ + await gapi.client.organizations.listOrgPolicies({ + resource: "resource", + }); + /** + * Searches Organization resources that are visible to the user and satisfy + * the specified filter. This method returns Organizations in an unspecified + * order. New Organizations do not necessarily appear at the end of the + * results. + * + * Search will only return organizations on which the user has the permission + * `resourcemanager.organizations.get` + */ + await gapi.client.organizations.search({ + }); + /** + * Sets the access control policy on an Organization resource. Replaces any + * existing policy. The `resource` field should be the organization's resource + * name, e.g. "organizations/123". + * + * Authorization requires the Google IAM permission + * `resourcemanager.organizations.setIamPolicy` on the specified organization + */ + await gapi.client.organizations.setIamPolicy({ + resource: "resource", + }); + /** + * Updates the specified `Policy` on the resource. Creates a new `Policy` for + * that `Constraint` on the resource if one does not exist. + * + * Not supplying an `etag` on the request `Policy` results in an unconditional + * write of the `Policy`. + */ + await gapi.client.organizations.setOrgPolicy({ + resource: "resource", + }); + /** + * Returns permissions that a caller has on the specified Organization. + * The `resource` field should be the organization's resource name, + * e.g. "organizations/123". + * + * There are no permissions required for making this API call. + */ + await gapi.client.organizations.testIamPermissions({ + resource: "resource", + }); + /** Clears a `Policy` from a resource. */ + await gapi.client.projects.clearOrgPolicy({ + resource: "resource", + }); + /** + * Request that a new Project be created. The result is an Operation which + * can be used to track the creation process. It is automatically deleted + * after a few hours, so there is no need to call DeleteOperation. + * + * Our SLO permits Project creation to take up to 30 seconds at the 90th + * percentile. As of 2016-08-29, we are observing 6 seconds 50th percentile + * latency. 95th percentile latency is around 11 seconds. We recommend + * polling at the 5th second with an exponential backoff. + * + * Authorization requires the Google IAM permission + * `resourcemanager.projects.create` on the specified parent for the new + * project. + */ + await gapi.client.projects.create({ + }); + /** + * Marks the Project identified by the specified + * `project_id` (for example, `my-project-123`) for deletion. + * This method will only affect the Project if the following criteria are met: + * + * + The Project does not have a billing account associated with it. + * + The Project has a lifecycle state of + * ACTIVE. + * + * This method changes the Project's lifecycle state from + * ACTIVE + * to DELETE_REQUESTED. + * The deletion starts at an unspecified time, + * at which point the Project is no longer accessible. + * + * Until the deletion completes, you can check the lifecycle state + * checked by retrieving the Project with GetProject, + * and the Project remains visible to ListProjects. + * However, you cannot update the project. + * + * After the deletion completes, the Project is not retrievable by + * the GetProject and + * ListProjects methods. + * + * The caller must have modify permissions for this Project. + */ + await gapi.client.projects.delete({ + projectId: "projectId", + }); + /** + * Retrieves the Project identified by the specified + * `project_id` (for example, `my-project-123`). + * + * The caller must have read permissions for this Project. + */ + await gapi.client.projects.get({ + projectId: "projectId", + }); + /** + * Gets a list of ancestors in the resource hierarchy for the Project + * identified by the specified `project_id` (for example, `my-project-123`). + * + * The caller must have read permissions for this Project. + */ + await gapi.client.projects.getAncestry({ + projectId: "projectId", + }); + /** + * Gets the effective `Policy` on a resource. This is the result of merging + * `Policies` in the resource hierarchy. The returned `Policy` will not have + * an `etag`set because it is a computed `Policy` across multiple resources. + */ + await gapi.client.projects.getEffectiveOrgPolicy({ + resource: "resource", + }); + /** + * Returns the IAM access control policy for the specified Project. + * Permission is denied if the policy or the resource does not exist. + * + * Authorization requires the Google IAM permission + * `resourcemanager.projects.getIamPolicy` on the project + */ + await gapi.client.projects.getIamPolicy({ + resource: "resource", + }); + /** + * Gets a `Policy` on a resource. + * + * If no `Policy` is set on the resource, a `Policy` is returned with default + * values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The + * `etag` value can be used with `SetOrgPolicy()` to create or update a + * `Policy` during read-modify-write. + */ + await gapi.client.projects.getOrgPolicy({ + resource: "resource", + }); + /** + * Lists Projects that are visible to the user and satisfy the + * specified filter. This method returns Projects in an unspecified order. + * New Projects do not necessarily appear at the end of the list. + */ + await gapi.client.projects.list({ + filter: "filter", + pageSize: 2, + pageToken: "pageToken", + }); + /** Lists `Constraints` that could be applied on the specified resource. */ + await gapi.client.projects.listAvailableOrgPolicyConstraints({ + resource: "resource", + }); + /** Lists all the `Policies` set for a particular resource. */ + await gapi.client.projects.listOrgPolicies({ + resource: "resource", + }); + /** + * Sets the IAM access control policy for the specified Project. Replaces + * any existing policy. + * + * The following constraints apply when using `setIamPolicy()`: + * + * + Project does not support `allUsers` and `allAuthenticatedUsers` as + * `members` in a `Binding` of a `Policy`. + * + * + The owner role can be granted only to `user` and `serviceAccount`. + * + * + Service accounts can be made owners of a project directly + * without any restrictions. However, to be added as an owner, a user must be + * invited via Cloud Platform console and must accept the invitation. + * + * + A user cannot be granted the owner role using `setIamPolicy()`. The user + * must be granted the owner role using the Cloud Platform Console and must + * explicitly accept the invitation. + * + * + Invitations to grant the owner role cannot be sent using + * `setIamPolicy()`; + * they must be sent only using the Cloud Platform Console. + * + * + Membership changes that leave the project without any owners that have + * accepted the Terms of Service (ToS) will be rejected. + * + * + If the project is not part of an organization, there must be at least + * one owner who has accepted the Terms of Service (ToS) agreement in the + * policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner + * from the policy will fail. This restriction also applies to legacy + * projects that no longer have owners who have accepted the ToS. Edits to + * IAM policies will be rejected until the lack of a ToS-accepting owner is + * rectified. + * + * + Calling this method requires enabling the App Engine Admin API. + * + * Note: Removing service accounts from policies or changing their roles + * can render services completely inoperable. It is important to understand + * how the service account is being used before removing or updating its + * roles. + * + * Authorization requires the Google IAM permission + * `resourcemanager.projects.setIamPolicy` on the project + */ + await gapi.client.projects.setIamPolicy({ + resource: "resource", + }); + /** + * Updates the specified `Policy` on the resource. Creates a new `Policy` for + * that `Constraint` on the resource if one does not exist. + * + * Not supplying an `etag` on the request `Policy` results in an unconditional + * write of the `Policy`. + */ + await gapi.client.projects.setOrgPolicy({ + resource: "resource", + }); + /** + * Returns permissions that a caller has on the specified Project. + * + * There are no permissions required for making this API call. + */ + await gapi.client.projects.testIamPermissions({ + resource: "resource", + }); + /** + * Restores the Project identified by the specified + * `project_id` (for example, `my-project-123`). + * You can only use this method for a Project that has a lifecycle state of + * DELETE_REQUESTED. + * After deletion starts, the Project cannot be restored. + * + * The caller must have modify permissions for this Project. + */ + await gapi.client.projects.undelete({ + projectId: "projectId", + }); + /** + * Updates the attributes of the Project identified by the specified + * `project_id` (for example, `my-project-123`). + * + * The caller must have modify permissions for this Project. + */ + await gapi.client.projects.update({ + projectId: "projectId", + }); + } +}); diff --git a/types/gapi.client.cloudresourcemanager/index.d.ts b/types/gapi.client.cloudresourcemanager/index.d.ts new file mode 100644 index 0000000000..a2c8500ac6 --- /dev/null +++ b/types/gapi.client.cloudresourcemanager/index.d.ts @@ -0,0 +1,2234 @@ +// Type definitions for Google Google Cloud Resource Manager API v1 1.0 +// Project: https://cloud.google.com/resource-manager +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://cloudresourcemanager.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Google Cloud Resource Manager API v1 */ + function load(name: "cloudresourcemanager", version: "v1"): PromiseLike; + function load(name: "cloudresourcemanager", version: "v1", callback: () => any): void; + + const folders: cloudresourcemanager.FoldersResource; + + const liens: cloudresourcemanager.LiensResource; + + const operations: cloudresourcemanager.OperationsResource; + + const organizations: cloudresourcemanager.OrganizationsResource; + + const projects: cloudresourcemanager.ProjectsResource; + + namespace cloudresourcemanager { + interface Ancestor { + /** Resource id of the ancestor. */ + resourceId?: ResourceId; + } + interface AuditConfig { + /** + * The configuration for logging of each type of permission. + * Next ID: 4 + */ + auditLogConfigs?: AuditLogConfig[]; + /** + * Specifies a service that will be enabled for audit logging. + * For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + * `allServices` is a special value that covers all services. + */ + service?: string; + } + interface AuditLogConfig { + /** + * Specifies the identities that do not cause logging for this type of + * permission. + * Follows the same format of Binding.members. + */ + exemptedMembers?: string[]; + /** The log type that this config enables. */ + logType?: string; + } + interface Binding { + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: + * + * * `allUsers`: A special identifier that represents anyone who is + * on the internet; with or without a Google account. + * + * * `allAuthenticatedUsers`: A special identifier that represents anyone + * who is authenticated with a Google account or a service account. + * + * * `user:{emailid}`: An email address that represents a specific Google + * account. For example, `alice@gmail.com` or `joe@example.com`. + * + * + * * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. + * + * * `group:{emailid}`: An email address that represents a Google group. + * For example, `admins@example.com`. + * + * + * * `domain:{domain}`: A Google Apps domain name that represents all the + * users of that domain. For example, `google.com` or `example.com`. + */ + members?: string[]; + /** + * Role that is assigned to `members`. + * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + * Required + */ + role?: string; + } + interface BooleanPolicy { + /** + * If `true`, then the `Policy` is enforced. If `false`, then any + * configuration is acceptable. + * + * Suppose you have a `Constraint` `constraints/compute.disableSerialPortAccess` + * with `constraint_default` set to `ALLOW`. A `Policy` for that + * `Constraint` exhibits the following behavior: + * - If the `Policy` at this resource has enforced set to `false`, serial + * port connection attempts will be allowed. + * - If the `Policy` at this resource has enforced set to `true`, serial + * port connection attempts will be refused. + * - If the `Policy` at this resource is `RestoreDefault`, serial port + * connection attempts will be allowed. + * - If no `Policy` is set at this resource or anywhere higher in the + * resource hierarchy, serial port connection attempts will be allowed. + * - If no `Policy` is set at this resource, but one exists higher in the + * resource hierarchy, the behavior is as if the`Policy` were set at + * this resource. + * + * The following examples demonstrate the different possible layerings: + * + * Example 1 (nearest `Constraint` wins): + * `organizations/foo` has a `Policy` with: + * {enforced: false} + * `projects/bar` has no `Policy` set. + * The constraint at `projects/bar` and `organizations/foo` will not be + * enforced. + * + * Example 2 (enforcement gets replaced): + * `organizations/foo` has a `Policy` with: + * {enforced: false} + * `projects/bar` has a `Policy` with: + * {enforced: true} + * The constraint at `organizations/foo` is not enforced. + * The constraint at `projects/bar` is enforced. + * + * Example 3 (RestoreDefault): + * `organizations/foo` has a `Policy` with: + * {enforced: true} + * `projects/bar` has a `Policy` with: + * {RestoreDefault: {}} + * The constraint at `organizations/foo` is enforced. + * The constraint at `projects/bar` is not enforced, because + * `constraint_default` for the `Constraint` is `ALLOW`. + */ + enforced?: boolean; + } + interface ClearOrgPolicyRequest { + /** Name of the `Constraint` of the `Policy` to clear. */ + constraint?: string; + /** + * The current version, for concurrency control. Not sending an `etag` + * will cause the `Policy` to be cleared blindly. + */ + etag?: string; + } + interface Constraint { + /** Defines this constraint as being a BooleanConstraint. */ + booleanConstraint?: any; + /** The evaluation behavior of this constraint in the absense of 'Policy'. */ + constraintDefault?: string; + /** + * Detailed description of what this `Constraint` controls as well as how and + * where it is enforced. + * + * Mutable. + */ + description?: string; + /** + * The human readable name. + * + * Mutable. + */ + displayName?: string; + /** Defines this constraint as being a ListConstraint. */ + listConstraint?: ListConstraint; + /** + * Immutable value, required to globally be unique. For example, + * `constraints/serviceuser.services` + */ + name?: string; + /** Version of the `Constraint`. Default version is 0; */ + version?: number; + } + interface FolderOperation { + /** + * The resource name of the folder or organization we are either creating + * the folder under or moving the folder to. + */ + destinationParent?: string; + /** The display name of the folder. */ + displayName?: string; + /** The type of this operation. */ + operationType?: string; + /** + * The resource name of the folder's parent. + * Only applicable when the operation_type is MOVE. + */ + sourceParent?: string; + } + interface FolderOperationError { + /** The type of operation error experienced. */ + errorMessageId?: string; + } + interface GetAncestryResponse { + /** + * Ancestors are ordered from bottom to top of the resource hierarchy. The + * first ancestor is the project itself, followed by the project's parent, + * etc. + */ + ancestor?: Ancestor[]; + } + interface GetEffectiveOrgPolicyRequest { + /** The name of the `Constraint` to compute the effective `Policy`. */ + constraint?: string; + } + interface GetOrgPolicyRequest { + /** Name of the `Constraint` to get the `Policy`. */ + constraint?: string; + } + interface Lien { + /** The creation time of this Lien. */ + createTime?: string; + /** + * A system-generated unique identifier for this Lien. + * + * Example: `liens/1234abcd` + */ + name?: string; + /** + * A stable, user-visible/meaningful string identifying the origin of the + * Lien, intended to be inspected programmatically. Maximum length of 200 + * characters. + * + * Example: 'compute.googleapis.com' + */ + origin?: string; + /** + * A reference to the resource this Lien is attached to. The server will + * validate the parent against those for which Liens are supported. + * + * Example: `projects/1234` + */ + parent?: string; + /** + * Concise user-visible strings indicating why an action cannot be performed + * on a resource. Maximum lenth of 200 characters. + * + * Example: 'Holds production API key' + */ + reason?: string; + /** + * The types of operations which should be blocked as a result of this Lien. + * Each value should correspond to an IAM permission. The server will + * validate the permissions against those for which Liens are supported. + * + * An empty list is meaningless and will be rejected. + * + * Example: ['resourcemanager.projects.delete'] + */ + restrictions?: string[]; + } + interface ListAvailableOrgPolicyConstraintsRequest { + /** + * Size of the pages to be returned. This is currently unsupported and will + * be ignored. The server may at any point start using this field to limit + * page size. + */ + pageSize?: number; + /** + * Page token used to retrieve the next page. This is currently unsupported + * and will be ignored. The server may at any point start using this field. + */ + pageToken?: string; + } + interface ListAvailableOrgPolicyConstraintsResponse { + /** The collection of constraints that are settable on the request resource. */ + constraints?: Constraint[]; + /** Page token used to retrieve the next page. This is currently not used. */ + nextPageToken?: string; + } + interface ListConstraint { + /** + * Optional. The Google Cloud Console will try to default to a configuration + * that matches the value specified in this `Constraint`. + */ + suggestedValue?: string; + } + interface ListLiensResponse { + /** A list of Liens. */ + liens?: Lien[]; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + */ + nextPageToken?: string; + } + interface ListOrgPoliciesRequest { + /** + * Size of the pages to be returned. This is currently unsupported and will + * be ignored. The server may at any point start using this field to limit + * page size. + */ + pageSize?: number; + /** + * Page token used to retrieve the next page. This is currently unsupported + * and will be ignored. The server may at any point start using this field. + */ + pageToken?: string; + } + interface ListOrgPoliciesResponse { + /** + * Page token used to retrieve the next page. This is currently not used, but + * the server may at any point start supplying a valid token. + */ + nextPageToken?: string; + /** + * The `Policies` that are set on the resource. It will be empty if no + * `Policies` are set. + */ + policies?: OrgPolicy[]; + } + interface ListPolicy { + /** The policy all_values state. */ + allValues?: string; + /** + * List of values allowed at this resource. Can only be set if no values + * are set for `denied_values` and `all_values` is set to + * `ALL_VALUES_UNSPECIFIED`. + */ + allowedValues?: string[]; + /** + * List of values denied at this resource. Can only be set if no values are + * set for `allowed_values` and `all_values` is set to + * `ALL_VALUES_UNSPECIFIED`. + */ + deniedValues?: string[]; + /** + * Determines the inheritance behavior for this `Policy`. + * + * By default, a `ListPolicy` set at a resource supercedes any `Policy` set + * anywhere up the resource hierarchy. However, if `inherit_from_parent` is + * set to `true`, then the values from the effective `Policy` of the parent + * resource are inherited, meaning the values set in this `Policy` are + * added to the values inherited up the hierarchy. + * + * Setting `Policy` hierarchies that inherit both allowed values and denied + * values isn't recommended in most circumstances to keep the configuration + * simple and understandable. However, it is possible to set a `Policy` with + * `allowed_values` set that inherits a `Policy` with `denied_values` set. + * In this case, the values that are allowed must be in `allowed_values` and + * not present in `denied_values`. + * + * For example, suppose you have a `Constraint` + * `constraints/serviceuser.services`, which has a `constraint_type` of + * `list_constraint`, and with `constraint_default` set to `ALLOW`. + * Suppose that at the Organization level, a `Policy` is applied that + * restricts the allowed API activations to {`E1`, `E2`}. Then, if a + * `Policy` is applied to a project below the Organization that has + * `inherit_from_parent` set to `false` and field all_values set to DENY, + * then an attempt to activate any API will be denied. + * + * The following examples demonstrate different possible layerings: + * + * Example 1 (no inherited values): + * `organizations/foo` has a `Policy` with values: + * {allowed_values: “E1” allowed_values:”E2”} + * ``projects/bar`` has `inherit_from_parent` `false` and values: + * {allowed_values: "E3" allowed_values: "E4"} + * The accepted values at `organizations/foo` are `E1`, `E2`. + * The accepted values at `projects/bar` are `E3`, and `E4`. + * + * Example 2 (inherited values): + * `organizations/foo` has a `Policy` with values: + * {allowed_values: “E1” allowed_values:”E2”} + * `projects/bar` has a `Policy` with values: + * {value: “E3” value: ”E4” inherit_from_parent: true} + * The accepted values at `organizations/foo` are `E1`, `E2`. + * The accepted values at `projects/bar` are `E1`, `E2`, `E3`, and `E4`. + * + * Example 3 (inheriting both allowed and denied values): + * `organizations/foo` has a `Policy` with values: + * {allowed_values: "E1" allowed_values: "E2"} + * `projects/bar` has a `Policy` with: + * {denied_values: "E1"} + * The accepted values at `organizations/foo` are `E1`, `E2`. + * The value accepted at `projects/bar` is `E2`. + * + * Example 4 (RestoreDefault): + * `organizations/foo` has a `Policy` with values: + * {allowed_values: “E1” allowed_values:”E2”} + * `projects/bar` has a `Policy` with values: + * {RestoreDefault: {}} + * The accepted values at `organizations/foo` are `E1`, `E2`. + * The accepted values at `projects/bar` are either all or none depending on + * the value of `constraint_default` (if `ALLOW`, all; if + * `DENY`, none). + * + * Example 5 (no policy inherits parent policy): + * `organizations/foo` has no `Policy` set. + * `projects/bar` has no `Policy` set. + * The accepted values at both levels are either all or none depending on + * the value of `constraint_default` (if `ALLOW`, all; if + * `DENY`, none). + * + * Example 6 (ListConstraint allowing all): + * `organizations/foo` has a `Policy` with values: + * {allowed_values: “E1” allowed_values: ”E2”} + * `projects/bar` has a `Policy` with: + * {all: ALLOW} + * The accepted values at `organizations/foo` are `E1`, E2`. + * Any value is accepted at `projects/bar`. + * + * Example 7 (ListConstraint allowing none): + * `organizations/foo` has a `Policy` with values: + * {allowed_values: “E1” allowed_values: ”E2”} + * `projects/bar` has a `Policy` with: + * {all: DENY} + * The accepted values at `organizations/foo` are `E1`, E2`. + * No value is accepted at `projects/bar`. + */ + inheritFromParent?: boolean; + /** + * Optional. The Google Cloud Console will try to default to a configuration + * that matches the value specified in this `Policy`. If `suggested_value` + * is not set, it will inherit the value specified higher in the hierarchy, + * unless `inherit_from_parent` is `false`. + */ + suggestedValue?: string; + } + interface ListProjectsResponse { + /** + * Pagination token. + * + * If the result set is too large to fit in a single response, this token + * is returned. It encodes the position of the current result cursor. + * Feeding this value into a new list request with the `page_token` parameter + * gives the next page of the results. + * + * When `next_page_token` is not filled in, there is no next page and + * the list returned is the last page in the result set. + * + * Pagination tokens have a limited lifetime. + */ + nextPageToken?: string; + /** + * The list of Projects that matched the list filter. This list can + * be paginated. + */ + projects?: Project[]; + } + interface Operation { + /** + * If the value is `false`, it means the operation is still in progress. + * If `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done?: boolean; + /** The error result of the operation in case of failure or cancellation. */ + error?: Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata?: Record; + /** + * The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name?: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` + * is the original method name. For example, if the original method name + * is `TakeSnapshot()`, the inferred response type is + * `TakeSnapshotResponse`. + */ + response?: Record; + } + interface OrgPolicy { + /** For boolean `Constraints`, whether to enforce the `Constraint` or not. */ + booleanPolicy?: BooleanPolicy; + /** + * The name of the `Constraint` the `Policy` is configuring, for example, + * `constraints/serviceuser.services`. + * + * Immutable after creation. + */ + constraint?: string; + /** + * An opaque tag indicating the current version of the `Policy`, used for + * concurrency control. + * + * When the `Policy` is returned from either a `GetPolicy` or a + * `ListOrgPolicy` request, this `etag` indicates the version of the current + * `Policy` to use when executing a read-modify-write loop. + * + * When the `Policy` is returned from a `GetEffectivePolicy` request, the + * `etag` will be unset. + * + * When the `Policy` is used in a `SetOrgPolicy` method, use the `etag` value + * that was returned from a `GetOrgPolicy` request as part of a + * read-modify-write loop for concurrency control. Not setting the `etag`in a + * `SetOrgPolicy` request will result in an unconditional write of the + * `Policy`. + */ + etag?: string; + /** List of values either allowed or disallowed. */ + listPolicy?: ListPolicy; + /** + * Restores the default behavior of the constraint; independent of + * `Constraint` type. + */ + restoreDefault?: any; + /** + * The time stamp the `Policy` was previously updated. This is set by the + * server, not specified by the caller, and represents the last time a call to + * `SetOrgPolicy` was made for that `Policy`. Any value set by the client will + * be ignored. + */ + updateTime?: string; + /** Version of the `Policy`. Default version is 0; */ + version?: number; + } + interface Organization { + /** + * Timestamp when the Organization was created. Assigned by the server. + * @OutputOnly + */ + creationTime?: string; + /** + * A friendly string to be used to refer to the Organization in the UI. + * Assigned by the server, set to the primary domain of the G Suite + * customer that owns the organization. + * @OutputOnly + */ + displayName?: string; + /** + * The organization's current lifecycle state. Assigned by the server. + * @OutputOnly + */ + lifecycleState?: string; + /** + * Output Only. The resource name of the organization. This is the + * organization's relative path in the API. Its format is + * "organizations/[organization_id]". For example, "organizations/1234". + */ + name?: string; + /** + * The owner of this Organization. The owner should be specified on + * creation. Once set, it cannot be changed. + * This field is required. + */ + owner?: OrganizationOwner; + } + interface OrganizationOwner { + /** The Google for Work customer id used in the Directory API. */ + directoryCustomerId?: string; + } + interface Policy { + /** Specifies cloud audit logging configuration for this policy. */ + auditConfigs?: AuditConfig[]; + /** + * Associates a list of `members` to a `role`. + * `bindings` with no members will result in an error. + */ + bindings?: Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. + * It is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the policy. + * + * If no `etag` is provided in the call to `setIamPolicy`, then the existing + * policy is overwritten blindly. + */ + etag?: string; + /** Version of the `Policy`. The default version is 0. */ + version?: number; + } + interface Project { + /** + * Creation time. + * + * Read-only. + */ + createTime?: string; + /** + * The labels associated with this Project. + * + * Label keys must be between 1 and 63 characters long and must conform + * to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. + * + * Label values must be between 0 and 63 characters long and must conform + * to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. + * + * No more than 256 labels can be associated with a given resource. + * + * Clients should store labels in a representation such as JSON that does not + * depend on specific characters being disallowed. + * + * Example: "environment" : "dev" + * Read-write. + */ + labels?: Record; + /** + * The Project lifecycle state. + * + * Read-only. + */ + lifecycleState?: string; + /** + * The user-assigned display name of the Project. + * It must be 4 to 30 characters. + * Allowed characters are: lowercase and uppercase letters, numbers, + * hyphen, single-quote, double-quote, space, and exclamation point. + * + * Example: My Project + * Read-write. + */ + name?: string; + /** + * An optional reference to a parent Resource. + * + * The only supported parent type is "organization". Once set, the parent + * cannot be modified. The `parent` can be set on creation or using the + * `UpdateProject` method; the end user must have the + * `resourcemanager.projects.create` permission on the parent. + * + * Read-write. + */ + parent?: ResourceId; + /** + * The unique, user-assigned ID of the Project. + * It must be 6 to 30 lowercase letters, digits, or hyphens. + * It must start with a letter. + * Trailing hyphens are prohibited. + * + * Example: tokyo-rain-123 + * Read-only after creation. + */ + projectId?: string; + /** + * The number uniquely identifying the project. + * + * Example: 415104041262 + * Read-only. + */ + projectNumber?: string; + } + interface ProjectCreationStatus { + /** Creation time of the project creation workflow. */ + createTime?: string; + /** + * True if the project can be retrieved using GetProject. No other operations + * on the project are guaranteed to work until the project creation is + * complete. + */ + gettable?: boolean; + /** True if the project creation process is complete. */ + ready?: boolean; + } + interface ResourceId { + /** + * Required field for the type-specific id. This should correspond to the id + * used in the type-specific API's. + */ + id?: string; + /** + * Required field representing the resource type this id is for. + * At present, the valid types are: "organization" + */ + type?: string; + } + interface SearchOrganizationsRequest { + /** + * An optional query string used to filter the Organizations to return in + * the response. Filter rules are case-insensitive. + * + * + * Organizations may be filtered by `owner.directoryCustomerId` or by + * `domain`, where the domain is a Google for Work domain, for example: + * + * |Filter|Description| + * |------|-----------| + * |owner.directorycustomerid:123456789|Organizations with + * `owner.directory_customer_id` equal to `123456789`.| + * |domain:google.com|Organizations corresponding to the domain `google.com`.| + * + * This field is optional. + */ + filter?: string; + /** + * The maximum number of Organizations to return in the response. + * This field is optional. + */ + pageSize?: number; + /** + * A pagination token returned from a previous call to `SearchOrganizations` + * that indicates from where listing should continue. + * This field is optional. + */ + pageToken?: string; + } + interface SearchOrganizationsResponse { + /** + * A pagination token to be used to retrieve the next page of results. If the + * result is too large to fit within the page size specified in the request, + * this field will be set with a token that can be used to fetch the next page + * of results. If this field is empty, it indicates that this response + * contains the last page of results. + */ + nextPageToken?: string; + /** + * The list of Organizations that matched the search query, possibly + * paginated. + */ + organizations?: Organization[]; + } + interface SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + policy?: Policy; + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * paths: "bindings, etag" + * This field is only used by Cloud IAM. + */ + updateMask?: string; + } + interface SetOrgPolicyRequest { + /** `Policy` to set on the resource. */ + policy?: OrgPolicy; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface TestIamPermissionsRequest { + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + permissions?: string[]; + } + interface TestIamPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions?: string[]; + } + interface FoldersResource { + /** Clears a `Policy` from a resource. */ + clearOrgPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Name of the resource for the `Policy` to clear. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Gets the effective `Policy` on a resource. This is the result of merging + * `Policies` in the resource hierarchy. The returned `Policy` will not have + * an `etag`set because it is a computed `Policy` across multiple resources. + */ + getEffectiveOrgPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** The name of the resource to start computing the effective `Policy`. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Gets a `Policy` on a resource. + * + * If no `Policy` is set on the resource, a `Policy` is returned with default + * values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The + * `etag` value can be used with `SetOrgPolicy()` to create or update a + * `Policy` during read-modify-write. + */ + getOrgPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Name of the resource the `Policy` is set on. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists `Constraints` that could be applied on the specified resource. */ + listAvailableOrgPolicyConstraints(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Name of the resource to list `Constraints` for. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists all the `Policies` set for a particular resource. */ + listOrgPolicies(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Name of the resource to list Policies for. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates the specified `Policy` on the resource. Creates a new `Policy` for + * that `Constraint` on the resource if one does not exist. + * + * Not supplying an `etag` on the request `Policy` results in an unconditional + * write of the `Policy`. + */ + setOrgPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Resource name of the resource to attach the `Policy`. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface LiensResource { + /** + * Create a Lien which applies to the resource denoted by the `parent` field. + * + * Callers of this method will require permission on the `parent` resource. + * For example, applying to `projects/1234` requires permission + * `resourcemanager.projects.updateLiens`. + * + * NOTE: Some resources may limit the number of Liens which may be applied. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Delete a Lien by `name`. + * + * Callers of this method will require permission on the `parent` resource. + * For example, a Lien with a `parent` of `projects/1234` requires permission + * `resourcemanager.projects.updateLiens`. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name/identifier of the Lien to delete. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * List all Liens applied to the `parent` resource. + * + * Callers of this method will require permission on the `parent` resource. + * For example, a Lien with a `parent` of `projects/1234` requires permission + * `resourcemanager.projects.get`. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The maximum number of items to return. This is a suggestion for the server. */ + pageSize?: number; + /** The `next_page_token` value returned from a previous List request, if any. */ + pageToken?: string; + /** + * The name of the resource to list all attached Liens. + * For example, `projects/1234`. + */ + parent?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface OperationsResource { + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface OrganizationsResource { + /** Clears a `Policy` from a resource. */ + clearOrgPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Name of the resource for the `Policy` to clear. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Fetches an Organization resource identified by the specified resource name. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The resource name of the Organization to fetch, e.g. "organizations/1234". */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Gets the effective `Policy` on a resource. This is the result of merging + * `Policies` in the resource hierarchy. The returned `Policy` will not have + * an `etag`set because it is a computed `Policy` across multiple resources. + */ + getEffectiveOrgPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** The name of the resource to start computing the effective `Policy`. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Gets the access control policy for an Organization resource. May be empty + * if no such policy or resource exists. The `resource` field should be the + * organization's resource name, e.g. "organizations/123". + * + * Authorization requires the Google IAM permission + * `resourcemanager.organizations.getIamPolicy` on the specified organization + */ + getIamPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Gets a `Policy` on a resource. + * + * If no `Policy` is set on the resource, a `Policy` is returned with default + * values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The + * `etag` value can be used with `SetOrgPolicy()` to create or update a + * `Policy` during read-modify-write. + */ + getOrgPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Name of the resource the `Policy` is set on. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists `Constraints` that could be applied on the specified resource. */ + listAvailableOrgPolicyConstraints(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Name of the resource to list `Constraints` for. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists all the `Policies` set for a particular resource. */ + listOrgPolicies(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Name of the resource to list Policies for. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Searches Organization resources that are visible to the user and satisfy + * the specified filter. This method returns Organizations in an unspecified + * order. New Organizations do not necessarily appear at the end of the + * results. + * + * Search will only return organizations on which the user has the permission + * `resourcemanager.organizations.get` + */ + search(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Sets the access control policy on an Organization resource. Replaces any + * existing policy. The `resource` field should be the organization's resource + * name, e.g. "organizations/123". + * + * Authorization requires the Google IAM permission + * `resourcemanager.organizations.setIamPolicy` on the specified organization + */ + setIamPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates the specified `Policy` on the resource. Creates a new `Policy` for + * that `Constraint` on the resource if one does not exist. + * + * Not supplying an `etag` on the request `Policy` results in an unconditional + * write of the `Policy`. + */ + setOrgPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Resource name of the resource to attach the `Policy`. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns permissions that a caller has on the specified Organization. + * The `resource` field should be the organization's resource name, + * e.g. "organizations/123". + * + * There are no permissions required for making this API call. + */ + testIamPermissions(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface ProjectsResource { + /** Clears a `Policy` from a resource. */ + clearOrgPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Name of the resource for the `Policy` to clear. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Request that a new Project be created. The result is an Operation which + * can be used to track the creation process. It is automatically deleted + * after a few hours, so there is no need to call DeleteOperation. + * + * Our SLO permits Project creation to take up to 30 seconds at the 90th + * percentile. As of 2016-08-29, we are observing 6 seconds 50th percentile + * latency. 95th percentile latency is around 11 seconds. We recommend + * polling at the 5th second with an exponential backoff. + * + * Authorization requires the Google IAM permission + * `resourcemanager.projects.create` on the specified parent for the new + * project. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Marks the Project identified by the specified + * `project_id` (for example, `my-project-123`) for deletion. + * This method will only affect the Project if the following criteria are met: + * + * + The Project does not have a billing account associated with it. + * + The Project has a lifecycle state of + * ACTIVE. + * + * This method changes the Project's lifecycle state from + * ACTIVE + * to DELETE_REQUESTED. + * The deletion starts at an unspecified time, + * at which point the Project is no longer accessible. + * + * Until the deletion completes, you can check the lifecycle state + * checked by retrieving the Project with GetProject, + * and the Project remains visible to ListProjects. + * However, you cannot update the project. + * + * After the deletion completes, the Project is not retrievable by + * the GetProject and + * ListProjects methods. + * + * The caller must have modify permissions for this Project. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Project ID (for example, `foo-bar-123`). + * + * Required. + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Retrieves the Project identified by the specified + * `project_id` (for example, `my-project-123`). + * + * The caller must have read permissions for this Project. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Project ID (for example, `my-project-123`). + * + * Required. + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Gets a list of ancestors in the resource hierarchy for the Project + * identified by the specified `project_id` (for example, `my-project-123`). + * + * The caller must have read permissions for this Project. + */ + getAncestry(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Project ID (for example, `my-project-123`). + * + * Required. + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Gets the effective `Policy` on a resource. This is the result of merging + * `Policies` in the resource hierarchy. The returned `Policy` will not have + * an `etag`set because it is a computed `Policy` across multiple resources. + */ + getEffectiveOrgPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** The name of the resource to start computing the effective `Policy`. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns the IAM access control policy for the specified Project. + * Permission is denied if the policy or the resource does not exist. + * + * Authorization requires the Google IAM permission + * `resourcemanager.projects.getIamPolicy` on the project + */ + getIamPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Gets a `Policy` on a resource. + * + * If no `Policy` is set on the resource, a `Policy` is returned with default + * values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The + * `etag` value can be used with `SetOrgPolicy()` to create or update a + * `Policy` during read-modify-write. + */ + getOrgPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Name of the resource the `Policy` is set on. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists Projects that are visible to the user and satisfy the + * specified filter. This method returns Projects in an unspecified order. + * New Projects do not necessarily appear at the end of the list. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * An expression for filtering the results of the request. Filter rules are + * case insensitive. The fields eligible for filtering are: + * + * + `name` + * + `id` + * + labels.key where *key* is the name of a label + * + * Some examples of using labels as filters: + * + * |Filter|Description| + * |------|-----------| + * |name:how*|The project's name starts with "how".| + * |name:Howl|The project's name is `Howl` or `howl`.| + * |name:HOWL|Equivalent to above.| + * |NAME:howl|Equivalent to above.| + * |labels.color:*|The project has the label `color`.| + * |labels.color:red|The project's label `color` has the value `red`.| + * |labels.color:red labels.size:big|The project's label `color` has the value `red` and its label `size` has the value `big`. + * + * If you specify a filter that has both `parent.type` and `parent.id`, then + * the `resourcemanager.projects.list` permission is checked on the parent. + * If the user has this permission, all projects under the parent will be + * returned after remaining filters have been applied. If the user lacks this + * permission, then all projects for which the user has the + * `resourcemanager.projects.get` permission will be returned after remaining + * filters have been applied. If no filter is specified, the call will return + * projects for which the user has `resourcemanager.projects.get` permissions. + * + * Optional. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The maximum number of Projects to return in the response. + * The server can return fewer Projects than requested. + * If unspecified, server picks an appropriate default. + * + * Optional. + */ + pageSize?: number; + /** + * A pagination token returned from a previous call to ListProjects + * that indicates from where listing should continue. + * + * Optional. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists `Constraints` that could be applied on the specified resource. */ + listAvailableOrgPolicyConstraints(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Name of the resource to list `Constraints` for. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists all the `Policies` set for a particular resource. */ + listOrgPolicies(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Name of the resource to list Policies for. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Sets the IAM access control policy for the specified Project. Replaces + * any existing policy. + * + * The following constraints apply when using `setIamPolicy()`: + * + * + Project does not support `allUsers` and `allAuthenticatedUsers` as + * `members` in a `Binding` of a `Policy`. + * + * + The owner role can be granted only to `user` and `serviceAccount`. + * + * + Service accounts can be made owners of a project directly + * without any restrictions. However, to be added as an owner, a user must be + * invited via Cloud Platform console and must accept the invitation. + * + * + A user cannot be granted the owner role using `setIamPolicy()`. The user + * must be granted the owner role using the Cloud Platform Console and must + * explicitly accept the invitation. + * + * + Invitations to grant the owner role cannot be sent using + * `setIamPolicy()`; + * they must be sent only using the Cloud Platform Console. + * + * + Membership changes that leave the project without any owners that have + * accepted the Terms of Service (ToS) will be rejected. + * + * + If the project is not part of an organization, there must be at least + * one owner who has accepted the Terms of Service (ToS) agreement in the + * policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner + * from the policy will fail. This restriction also applies to legacy + * projects that no longer have owners who have accepted the ToS. Edits to + * IAM policies will be rejected until the lack of a ToS-accepting owner is + * rectified. + * + * + Calling this method requires enabling the App Engine Admin API. + * + * Note: Removing service accounts from policies or changing their roles + * can render services completely inoperable. It is important to understand + * how the service account is being used before removing or updating its + * roles. + * + * Authorization requires the Google IAM permission + * `resourcemanager.projects.setIamPolicy` on the project + */ + setIamPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates the specified `Policy` on the resource. Creates a new `Policy` for + * that `Constraint` on the resource if one does not exist. + * + * Not supplying an `etag` on the request `Policy` results in an unconditional + * write of the `Policy`. + */ + setOrgPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Resource name of the resource to attach the `Policy`. */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns permissions that a caller has on the specified Project. + * + * There are no permissions required for making this API call. + */ + testIamPermissions(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Restores the Project identified by the specified + * `project_id` (for example, `my-project-123`). + * You can only use this method for a Project that has a lifecycle state of + * DELETE_REQUESTED. + * After deletion starts, the Project cannot be restored. + * + * The caller must have modify permissions for this Project. + */ + undelete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The project ID (for example, `foo-bar-123`). + * + * Required. + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Updates the attributes of the Project identified by the specified + * `project_id` (for example, `my-project-123`). + * + * The caller must have modify permissions for this Project. + */ + update(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The project ID (for example, `my-project-123`). + * + * Required. + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.cloudresourcemanager/readme.md b/types/gapi.client.cloudresourcemanager/readme.md new file mode 100644 index 0000000000..c034eb5ae9 --- /dev/null +++ b/types/gapi.client.cloudresourcemanager/readme.md @@ -0,0 +1,409 @@ +# TypeScript typings for Google Cloud Resource Manager API v1 +The Google Cloud Resource Manager API provides methods for creating, reading, and updating project metadata. +For detailed description please check [documentation](https://cloud.google.com/resource-manager). + +## Installing + +Install typings for Google Cloud Resource Manager API: +``` +npm install @types/gapi.client.cloudresourcemanager@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('cloudresourcemanager', 'v1', () => { + // now we can use gapi.client.cloudresourcemanager + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform.read-only', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Cloud Resource Manager API resources: + +```typescript + +/* +Clears a `Policy` from a resource. +*/ +await gapi.client.folders.clearOrgPolicy({ resource: "resource", }); + +/* +Gets the effective `Policy` on a resource. This is the result of merging +`Policies` in the resource hierarchy. The returned `Policy` will not have +an `etag`set because it is a computed `Policy` across multiple resources. +*/ +await gapi.client.folders.getEffectiveOrgPolicy({ resource: "resource", }); + +/* +Gets a `Policy` on a resource. + +If no `Policy` is set on the resource, a `Policy` is returned with default +values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The +`etag` value can be used with `SetOrgPolicy()` to create or update a +`Policy` during read-modify-write. +*/ +await gapi.client.folders.getOrgPolicy({ resource: "resource", }); + +/* +Lists `Constraints` that could be applied on the specified resource. +*/ +await gapi.client.folders.listAvailableOrgPolicyConstraints({ resource: "resource", }); + +/* +Lists all the `Policies` set for a particular resource. +*/ +await gapi.client.folders.listOrgPolicies({ resource: "resource", }); + +/* +Updates the specified `Policy` on the resource. Creates a new `Policy` for +that `Constraint` on the resource if one does not exist. + +Not supplying an `etag` on the request `Policy` results in an unconditional +write of the `Policy`. +*/ +await gapi.client.folders.setOrgPolicy({ resource: "resource", }); + +/* +Create a Lien which applies to the resource denoted by the `parent` field. + +Callers of this method will require permission on the `parent` resource. +For example, applying to `projects/1234` requires permission +`resourcemanager.projects.updateLiens`. + +NOTE: Some resources may limit the number of Liens which may be applied. +*/ +await gapi.client.liens.create({ }); + +/* +Delete a Lien by `name`. + +Callers of this method will require permission on the `parent` resource. +For example, a Lien with a `parent` of `projects/1234` requires permission +`resourcemanager.projects.updateLiens`. +*/ +await gapi.client.liens.delete({ name: "name", }); + +/* +List all Liens applied to the `parent` resource. + +Callers of this method will require permission on the `parent` resource. +For example, a Lien with a `parent` of `projects/1234` requires permission +`resourcemanager.projects.get`. +*/ +await gapi.client.liens.list({ }); + +/* +Gets the latest state of a long-running operation. Clients can use this +method to poll the operation result at intervals as recommended by the API +service. +*/ +await gapi.client.operations.get({ name: "name", }); + +/* +Clears a `Policy` from a resource. +*/ +await gapi.client.organizations.clearOrgPolicy({ resource: "resource", }); + +/* +Fetches an Organization resource identified by the specified resource name. +*/ +await gapi.client.organizations.get({ name: "name", }); + +/* +Gets the effective `Policy` on a resource. This is the result of merging +`Policies` in the resource hierarchy. The returned `Policy` will not have +an `etag`set because it is a computed `Policy` across multiple resources. +*/ +await gapi.client.organizations.getEffectiveOrgPolicy({ resource: "resource", }); + +/* +Gets the access control policy for an Organization resource. May be empty +if no such policy or resource exists. The `resource` field should be the +organization's resource name, e.g. "organizations/123". + +Authorization requires the Google IAM permission +`resourcemanager.organizations.getIamPolicy` on the specified organization +*/ +await gapi.client.organizations.getIamPolicy({ resource: "resource", }); + +/* +Gets a `Policy` on a resource. + +If no `Policy` is set on the resource, a `Policy` is returned with default +values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The +`etag` value can be used with `SetOrgPolicy()` to create or update a +`Policy` during read-modify-write. +*/ +await gapi.client.organizations.getOrgPolicy({ resource: "resource", }); + +/* +Lists `Constraints` that could be applied on the specified resource. +*/ +await gapi.client.organizations.listAvailableOrgPolicyConstraints({ resource: "resource", }); + +/* +Lists all the `Policies` set for a particular resource. +*/ +await gapi.client.organizations.listOrgPolicies({ resource: "resource", }); + +/* +Searches Organization resources that are visible to the user and satisfy +the specified filter. This method returns Organizations in an unspecified +order. New Organizations do not necessarily appear at the end of the +results. + +Search will only return organizations on which the user has the permission +`resourcemanager.organizations.get` +*/ +await gapi.client.organizations.search({ }); + +/* +Sets the access control policy on an Organization resource. Replaces any +existing policy. The `resource` field should be the organization's resource +name, e.g. "organizations/123". + +Authorization requires the Google IAM permission +`resourcemanager.organizations.setIamPolicy` on the specified organization +*/ +await gapi.client.organizations.setIamPolicy({ resource: "resource", }); + +/* +Updates the specified `Policy` on the resource. Creates a new `Policy` for +that `Constraint` on the resource if one does not exist. + +Not supplying an `etag` on the request `Policy` results in an unconditional +write of the `Policy`. +*/ +await gapi.client.organizations.setOrgPolicy({ resource: "resource", }); + +/* +Returns permissions that a caller has on the specified Organization. +The `resource` field should be the organization's resource name, +e.g. "organizations/123". + +There are no permissions required for making this API call. +*/ +await gapi.client.organizations.testIamPermissions({ resource: "resource", }); + +/* +Clears a `Policy` from a resource. +*/ +await gapi.client.projects.clearOrgPolicy({ resource: "resource", }); + +/* +Request that a new Project be created. The result is an Operation which +can be used to track the creation process. It is automatically deleted +after a few hours, so there is no need to call DeleteOperation. + +Our SLO permits Project creation to take up to 30 seconds at the 90th +percentile. As of 2016-08-29, we are observing 6 seconds 50th percentile +latency. 95th percentile latency is around 11 seconds. We recommend +polling at the 5th second with an exponential backoff. + +Authorization requires the Google IAM permission +`resourcemanager.projects.create` on the specified parent for the new +project. +*/ +await gapi.client.projects.create({ }); + +/* +Marks the Project identified by the specified +`project_id` (for example, `my-project-123`) for deletion. +This method will only affect the Project if the following criteria are met: + ++ The Project does not have a billing account associated with it. ++ The Project has a lifecycle state of +ACTIVE. + +This method changes the Project's lifecycle state from +ACTIVE +to DELETE_REQUESTED. +The deletion starts at an unspecified time, +at which point the Project is no longer accessible. + +Until the deletion completes, you can check the lifecycle state +checked by retrieving the Project with GetProject, +and the Project remains visible to ListProjects. +However, you cannot update the project. + +After the deletion completes, the Project is not retrievable by +the GetProject and +ListProjects methods. + +The caller must have modify permissions for this Project. +*/ +await gapi.client.projects.delete({ projectId: "projectId", }); + +/* +Retrieves the Project identified by the specified +`project_id` (for example, `my-project-123`). + +The caller must have read permissions for this Project. +*/ +await gapi.client.projects.get({ projectId: "projectId", }); + +/* +Gets a list of ancestors in the resource hierarchy for the Project +identified by the specified `project_id` (for example, `my-project-123`). + +The caller must have read permissions for this Project. +*/ +await gapi.client.projects.getAncestry({ projectId: "projectId", }); + +/* +Gets the effective `Policy` on a resource. This is the result of merging +`Policies` in the resource hierarchy. The returned `Policy` will not have +an `etag`set because it is a computed `Policy` across multiple resources. +*/ +await gapi.client.projects.getEffectiveOrgPolicy({ resource: "resource", }); + +/* +Returns the IAM access control policy for the specified Project. +Permission is denied if the policy or the resource does not exist. + +Authorization requires the Google IAM permission +`resourcemanager.projects.getIamPolicy` on the project +*/ +await gapi.client.projects.getIamPolicy({ resource: "resource", }); + +/* +Gets a `Policy` on a resource. + +If no `Policy` is set on the resource, a `Policy` is returned with default +values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The +`etag` value can be used with `SetOrgPolicy()` to create or update a +`Policy` during read-modify-write. +*/ +await gapi.client.projects.getOrgPolicy({ resource: "resource", }); + +/* +Lists Projects that are visible to the user and satisfy the +specified filter. This method returns Projects in an unspecified order. +New Projects do not necessarily appear at the end of the list. +*/ +await gapi.client.projects.list({ }); + +/* +Lists `Constraints` that could be applied on the specified resource. +*/ +await gapi.client.projects.listAvailableOrgPolicyConstraints({ resource: "resource", }); + +/* +Lists all the `Policies` set for a particular resource. +*/ +await gapi.client.projects.listOrgPolicies({ resource: "resource", }); + +/* +Sets the IAM access control policy for the specified Project. Replaces +any existing policy. + +The following constraints apply when using `setIamPolicy()`: + ++ Project does not support `allUsers` and `allAuthenticatedUsers` as +`members` in a `Binding` of a `Policy`. + ++ The owner role can be granted only to `user` and `serviceAccount`. + ++ Service accounts can be made owners of a project directly +without any restrictions. However, to be added as an owner, a user must be +invited via Cloud Platform console and must accept the invitation. + ++ A user cannot be granted the owner role using `setIamPolicy()`. The user +must be granted the owner role using the Cloud Platform Console and must +explicitly accept the invitation. + ++ Invitations to grant the owner role cannot be sent using +`setIamPolicy()`; +they must be sent only using the Cloud Platform Console. + ++ Membership changes that leave the project without any owners that have +accepted the Terms of Service (ToS) will be rejected. + ++ If the project is not part of an organization, there must be at least +one owner who has accepted the Terms of Service (ToS) agreement in the +policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner +from the policy will fail. This restriction also applies to legacy +projects that no longer have owners who have accepted the ToS. Edits to +IAM policies will be rejected until the lack of a ToS-accepting owner is +rectified. + ++ Calling this method requires enabling the App Engine Admin API. + +Note: Removing service accounts from policies or changing their roles +can render services completely inoperable. It is important to understand +how the service account is being used before removing or updating its +roles. + +Authorization requires the Google IAM permission +`resourcemanager.projects.setIamPolicy` on the project +*/ +await gapi.client.projects.setIamPolicy({ resource: "resource", }); + +/* +Updates the specified `Policy` on the resource. Creates a new `Policy` for +that `Constraint` on the resource if one does not exist. + +Not supplying an `etag` on the request `Policy` results in an unconditional +write of the `Policy`. +*/ +await gapi.client.projects.setOrgPolicy({ resource: "resource", }); + +/* +Returns permissions that a caller has on the specified Project. + +There are no permissions required for making this API call. +*/ +await gapi.client.projects.testIamPermissions({ resource: "resource", }); + +/* +Restores the Project identified by the specified +`project_id` (for example, `my-project-123`). +You can only use this method for a Project that has a lifecycle state of +DELETE_REQUESTED. +After deletion starts, the Project cannot be restored. + +The caller must have modify permissions for this Project. +*/ +await gapi.client.projects.undelete({ projectId: "projectId", }); + +/* +Updates the attributes of the Project identified by the specified +`project_id` (for example, `my-project-123`). + +The caller must have modify permissions for this Project. +*/ +await gapi.client.projects.update({ projectId: "projectId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.cloudresourcemanager/tsconfig.json b/types/gapi.client.cloudresourcemanager/tsconfig.json new file mode 100644 index 0000000000..c82cbc16f6 --- /dev/null +++ b/types/gapi.client.cloudresourcemanager/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.cloudresourcemanager-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.cloudresourcemanager/tslint.json b/types/gapi.client.cloudresourcemanager/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.cloudresourcemanager/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.cloudtasks/gapi.client.cloudtasks-tests.ts b/types/gapi.client.cloudtasks/gapi.client.cloudtasks-tests.ts new file mode 100644 index 0000000000..dc2da0ba4c --- /dev/null +++ b/types/gapi.client.cloudtasks/gapi.client.cloudtasks-tests.ts @@ -0,0 +1,32 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('cloudtasks', 'v2beta2', () => { + /** now we can use gapi.client.cloudtasks */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + } +}); diff --git a/types/gapi.client.cloudtasks/index.d.ts b/types/gapi.client.cloudtasks/index.d.ts new file mode 100644 index 0000000000..3e1d3f3c08 --- /dev/null +++ b/types/gapi.client.cloudtasks/index.d.ts @@ -0,0 +1,2100 @@ +// Type definitions for Google Cloud Tasks API v2beta2 2.0 +// Project: https://cloud.google.com/cloud-tasks/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://cloudtasks.googleapis.com/$discovery/rest?version=v2beta2 + +/// + +declare namespace gapi.client { + /** Load Cloud Tasks API v2beta2 */ + function load(name: "cloudtasks", version: "v2beta2"): PromiseLike; + function load(name: "cloudtasks", version: "v2beta2", callback: () => any): void; + + const projects: cloudtasks.ProjectsResource; + + namespace cloudtasks { + interface AcknowledgeTaskRequest { + /** + * Required. + * + * The task's current schedule time, available in the Task.schedule_time + * returned in PullTasksResponse.tasks or + * CloudTasks.RenewLease. This restriction is to check that + * the caller is acknowledging the correct task. + */ + scheduleTime?: string; + } + interface AppEngineHttpRequest { + /** + * Task-level setting for App Engine routing. + * + * If set, AppEngineHttpTarget.app_engine_routing_override is used for + * all tasks in the queue, no matter what the setting is for the + * task-level app_engine_routing. + */ + appEngineRouting?: AppEngineRouting; + /** + * HTTP request headers. + * + * This map contains the header field names and values. + * Headers can be set when the + * [task is created](google.cloud.tasks.v2beta2.CloudTasks.CreateTask). + * Repeated headers are not supported but a header value can contain commas. + * + * Cloud Tasks sets some headers to default values: + * + * * `User-Agent`: By default, this header is + * `"AppEngine-Google; (+http://code.google.com/appengine)"`. + * This header can be modified, but Cloud Tasks will append + * `"AppEngine-Google; (+http://code.google.com/appengine)"` to the + * modified `User-Agent`. + * + * If the task has an AppEngineHttpRequest.payload, Cloud Tasks sets the + * following headers: + * + * * `Content-Type`: By default, the `Content-Type` header is set to + * `"application/octet-stream"`. The default can be overridden by explictly + * setting `Content-Type` to a particular media type when the + * [task is created](google.cloud.tasks.v2beta2.CloudTasks.CreateTask). + * For example, `Content-Type` can be set to `"application/json"`. + * * `Content-Length`: This is computed by Cloud Tasks. This value is + * output only. It cannot be changed. + * + * The headers below cannot be set or overridden: + * + * * `Host` + * * `X-Google-*` + * * `X-AppEngine-*` + * + * In addition, some App Engine headers, which contain + * task-specific information, are also be sent to the task handler; see + * [request headers](/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). + */ + headers?: Record; + /** + * The HTTP method to use for the request. The default is POST. + * + * The app's request handler for the task's target URL must be able to handle + * HTTP requests with this http_method, otherwise the task attempt will fail + * with error code 405 (Method Not Allowed). See + * the Request-Line is not allowed for the resource identified by the + * Request-URI". See + * [Writing a push task request handler](/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) + * and the documentation for the request handlers in the language your app is + * written in e.g. + * [python RequestHandler](/appengine/docs/python/tools/webapp/requesthandlerclass). + */ + httpMethod?: string; + /** + * Payload. + * + * The payload will be sent as the HTTP message body. A message + * body, and thus a payload, is allowed only if the HTTP method is + * POST or PUT. It is an error to set a data payload on a task with + * an incompatible HttpMethod. + */ + payload?: string; + /** + * The relative URL. + * + * The relative URL must begin with "/" and must be a valid HTTP relative URL. + * It can contain a path and query string arguments. + * If the relative URL is empty, then the root path "/" will be used. + * No spaces are allowed, and the maximum length allowed is 2083 characters. + */ + relativeUrl?: string; + } + interface AppEngineHttpTarget { + /** + * Overrides for the + * task-level app_engine_routing. + * + * If set, AppEngineHttpTarget.app_engine_routing_override is used for + * all tasks in the queue, no matter what the setting is for the + * task-level app_engine_routing. + */ + appEngineRoutingOverride?: AppEngineRouting; + } + interface AppEngineQueueConfig { + /** Deprecated. Use AppEngineTarget.app_engine_routing_override. */ + appEngineRoutingOverride?: AppEngineRouting; + } + interface AppEngineRouting { + /** + * Output only. + * + * The host that the task is sent to. For more information, see + * [How Requests are Routed](/appengine/docs/standard/python/how-requests-are-routed). + * + * The host is constructed as: + * + * + * * `host = [application_domain_name]`
    + * `| [service] + '.' + [application_domain_name]`
    + * `| [version] + '.' + [application_domain_name]`
    + * `| [version_dot_service]+ '.' + [application_domain_name]`
    + * `| [instance] + '.' + [application_domain_name]`
    + * `| [instance_dot_service] + '.' + [application_domain_name]`
    + * `| [instance_dot_version] + '.' + [application_domain_name]`
    + * `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` + * + * * `application_domain_name` = The domain name of the app, for + * example .appspot.com, which is associated with the + * queue's project ID. Some tasks which were created using the App Engine + * SDK use a custom domain name. + * + * * `service =` AppEngineRouting.service + * + * * `version =` AppEngineRouting.version + * + * * `version_dot_service =` + * AppEngineRouting.version `+ '.' +` AppEngineRouting.service + * + * * `instance =` AppEngineRouting.instance + * + * * `instance_dot_service =` + * AppEngineRouting.instance `+ '.' +` AppEngineRouting.service + * + * * `instance_dot_version =` + * AppEngineRouting.instance `+ '.' +` AppEngineRouting.version + * + * * `instance_dot_version_dot_service =` + * AppEngineRouting.instance `+ '.' +` + * AppEngineRouting.version `+ '.' +` AppEngineRouting.service + * + * If AppEngineRouting.service is empty, then the task will be sent + * to the service which is the default service when the task is attempted. + * + * If AppEngineRouting.version is empty, then the task will be sent + * to the version which is the default version when the task is attempted. + * + * If AppEngineRouting.instance is empty, then the task will be sent + * to an instance which is available when the task is attempted. + * + * When AppEngineRouting.service is "default", + * AppEngineRouting.version is "default", and + * AppEngineRouting.instance is empty, AppEngineRouting.host is + * shortened to just the `application_domain_name`. + * + * If AppEngineRouting.service, AppEngineRouting.version, or + * AppEngineRouting.instance is invalid, then the task will be sent + * to the default version of the default service when the task is attempted. + */ + host?: string; + /** + * App instance. + * + * By default, the task is sent to an instance which is available when + * the task is attempted. + * + * Requests can only be sent to a specific instance if + * [manual scaling is used in App Engine Standard](/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). + * App Engine Flex does not support instances. For more information, see + * [App Engine Standard request routing](/appengine/docs/standard/python/how-requests-are-routed) + * and [App Engine Flex request routing](/appengine/docs/flexible/python/how-requests-are-routed). + */ + instance?: string; + /** + * App service. + * + * By default, the task is sent to the service which is the default + * service when the task is attempted ("default"). + * + * For some queues or tasks which were created using the App Engine Task Queue + * API, AppEngineRouting.host is not parsable into + * AppEngineRouting.service, AppEngineRouting.version, and + * AppEngineRouting.instance. For example, some tasks which were created + * using the App Engine SDK use a custom domain name; custom domains are not + * parsed by Cloud Tasks. If AppEngineRouting.host is not parsable, then + * AppEngineRouting.service, AppEngineRouting.version, and + * AppEngineRouting.instance are the empty string. + */ + service?: string; + /** + * App version. + * + * By default, the task is sent to the version which is the default + * version when the task is attempted ("default"). + * + * For some queues or tasks which were created using the App Engine Task Queue + * API, AppEngineRouting.host is not parsable into + * AppEngineRouting.service, AppEngineRouting.version, and + * AppEngineRouting.instance. For example, some tasks which were created + * using the App Engine SDK use a custom domain name; custom domains are not + * parsed by Cloud Tasks. If AppEngineRouting.host is not parsable, then + * AppEngineRouting.service, AppEngineRouting.version, and + * AppEngineRouting.instance are the empty string. + */ + version?: string; + } + interface AppEngineTaskTarget { + /** Deprecated. Use AppEngineHttpRequest.app_engine_routing. */ + appEngineRouting?: AppEngineRouting; + /** Deprecated. Use AppEngineHttpRequest.headers. */ + headers?: Record; + /** Deprecated. Use AppEngineHttpRequest.http_method. */ + httpMethod?: string; + /** Deprecated. Use AppEngineHttpRequest.payload. */ + payload?: string; + /** Deprecated. Use AppEngineHttpRequest.relative_url. */ + relativeUrl?: string; + } + interface AttemptStatus { + /** + * Output only. + * + * The time that this attempt was dispatched. + * + * `dispatch_time` will be truncated to the nearest microsecond. + */ + dispatchTime?: string; + /** + * Output only. + * + * The response from the target for this attempt. + * + * If the task has not been attempted or the task is currently running + * then the response status is google.rpc.Code.UNKNOWN. + */ + responseStatus?: Status; + /** + * Output only. + * + * The time that this attempt response was received. + * + * `response_time` will be truncated to the nearest microsecond. + */ + responseTime?: string; + /** + * Output only. + * + * The time that this attempt was scheduled. + * + * `schedule_time` will be truncated to the nearest microsecond. + */ + scheduleTime?: string; + } + interface Binding { + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: + * + * * `allUsers`: A special identifier that represents anyone who is + * on the internet; with or without a Google account. + * + * * `allAuthenticatedUsers`: A special identifier that represents anyone + * who is authenticated with a Google account or a service account. + * + * * `user:{emailid}`: An email address that represents a specific Google + * account. For example, `alice@gmail.com` or `joe@example.com`. + * + * + * * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. + * + * * `group:{emailid}`: An email address that represents a Google group. + * For example, `admins@example.com`. + * + * + * * `domain:{domain}`: A Google Apps domain name that represents all the + * users of that domain. For example, `google.com` or `example.com`. + */ + members?: string[]; + /** + * Role that is assigned to `members`. + * For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + * Required + */ + role?: string; + } + interface CancelLeaseRequest { + /** + * The response_view specifies which subset of the Task will be + * returned. + * + * By default response_view is Task.View.BASIC; not all + * information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for Task.View.FULL requires `cloudtasks.tasks.fullView` + * [Google IAM](/iam/) permission on the + * Task.name resource. + */ + responseView?: string; + /** + * Required. + * + * The task's current schedule time, available in the Task.schedule_time + * returned in PullTasksResponse.tasks or + * CloudTasks.RenewLease. This restriction is to check that + * the caller is canceling the correct task. + */ + scheduleTime?: string; + } + interface CreateTaskRequest { + /** + * The response_view specifies which subset of the Task will be + * returned. + * + * By default response_view is Task.View.BASIC; not all + * information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for Task.View.FULL requires `cloudtasks.tasks.fullView` + * [Google IAM](/iam/) permission on the + * Task.name resource. + */ + responseView?: string; + /** + * Required. + * + * The task to add. + * + * Task names have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + * The user can optionally specify a name for the task in + * Task.name. If a name is not specified then the system will + * generate a random unique task id, which will be returned in the + * response's Task.name. + * + * If Task.schedule_time is not set or is in the past then Cloud + * Tasks will set it to the current time. + * + * Task De-duplication: + * + * Explicitly specifying a task ID enables task de-duplication. If + * a task's ID is identical to that of an existing task or a task + * that was deleted or completed recently then the call will fail + * with google.rpc.Code.ALREADY_EXISTS. If the task's queue was + * created using Cloud Tasks, then another task with the same name + * can't be created for ~1hour after the original task was deleted + * or completed. If the task's queue was created using queue.yaml or + * queue.xml, then another task with the same name can't be created + * for ~9days after the original task was deleted or completed. + * + * Because there is an extra lookup cost to identify duplicate task + * names, these CloudTasks.CreateTask calls have significantly + * increased latency. Using hashed strings for the task id or for + * the prefix of the task id is recommended. Choosing task ids that + * are sequential or have sequential prefixes, for example using a + * timestamp, causes an increase in latency and error rates in all + * task commands. The infrastructure relies on an approximately + * uniform distribution of task ids to store and serve tasks + * efficiently. + */ + task?: Task; + } + interface ListLocationsResponse { + /** A list of locations that matches the specified filter in the request. */ + locations?: Location[]; + /** The standard List next-page token. */ + nextPageToken?: string; + } + interface ListQueuesResponse { + /** + * A token to retrieve next page of results. + * + * To return the next page of results, call + * CloudTasks.ListQueues with this value as the + * ListQueuesRequest.page_token. + * + * If the next_page_token is empty, there are no more results. + * + * The page token is valid for only 2 hours. + */ + nextPageToken?: string; + /** The list of queues. */ + queues?: Queue[]; + } + interface ListTasksResponse { + /** + * A token to retrieve next page of results. + * + * To return the next page of results, call + * CloudTasks.ListTasks with this value as the + * ListTasksRequest.page_token. + * + * If the next_page_token is empty, there are no more results. + */ + nextPageToken?: string; + /** The list of tasks. */ + tasks?: Task[]; + } + interface Location { + /** + * Cross-service attributes for the location. For example + * + * {"cloud.googleapis.com/region": "us-east1"} + */ + labels?: Record; + /** The canonical id for this location. For example: `"us-east1"`. */ + locationId?: string; + /** + * Service-specific metadata. For example the available capacity at the given + * location. + */ + metadata?: Record; + /** + * Resource name for the location, which may vary between implementations. + * For example: `"projects/example-project/locations/us-east1"` + */ + name?: string; + } + interface Policy { + /** + * Associates a list of `members` to a `role`. + * `bindings` with no members will result in an error. + */ + bindings?: Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. + * It is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the policy. + * + * If no `etag` is provided in the call to `setIamPolicy`, then the existing + * policy is overwritten blindly. + */ + etag?: string; + /** Version of the `Policy`. The default version is 0. */ + version?: number; + } + interface PullMessage { + /** A data payload consumed by the task worker to execute the task. */ + payload?: string; + /** + * A meta-data tag for this task. + * + * This value is used by CloudTasks.PullTasks calls when + * PullTasksRequest.filter is `tag=`. + * + * The tag must be less than 500 bytes. + */ + tag?: string; + } + interface PullTaskTarget { + /** Deprecated. Use PullMessage.payload. */ + payload?: string; + /** Deprecated. Use PullMessage.tag. */ + tag?: string; + } + interface PullTasksRequest { + /** + * `filter` can be used to specify a subset of tasks to lease. + * + * When `filter` is set to `tag=` then the + * PullTasksResponse will contain only tasks whose + * PullMessage.tag is equal to ``. `` must be less than + * 500 bytes. + * + * When `filter` is set to `tag_function=oldest_tag()`, only tasks which have + * the same tag as the task with the oldest schedule_time will be returned. + * + * Grammar Syntax: + * + * * `filter = "tag=" tag | "tag_function=" function` + * + * * `tag = string | bytes` + * + * * `function = "oldest_tag()"` + * + * The `oldest_tag()` function returns tasks which have the same tag as the + * oldest task (ordered by schedule time). + */ + filter?: string; + /** + * The duration of the lease. + * + * Each task returned in the PullTasksResponse will have its + * Task.schedule_time set to the current time plus the + * `lease_duration`. A task that has been returned in a + * PullTasksResponse is leased -- that task will not be + * returned in a different PullTasksResponse before the + * Task.schedule_time. + * + * After the lease holder has successfully finished the work + * associated with the task, the lease holder must call + * CloudTasks.AcknowledgeTask. If the task is not acknowledged + * via CloudTasks.AcknowledgeTask before the + * Task.schedule_time then it will be returned in a later + * PullTasksResponse so that another lease holder can process + * it. + * + * The maximum lease duration is 1 week. + * `lease_duration` will be truncated to the nearest second. + */ + leaseDuration?: string; + /** + * The maximum number of tasks to lease. The maximum that can be + * requested is 1000. + */ + maxTasks?: number; + /** + * The response_view specifies which subset of the Task will be + * returned. + * + * By default response_view is Task.View.BASIC; not all + * information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for Task.View.FULL requires `cloudtasks.tasks.fullView` + * [Google IAM](/iam/) permission on the + * Task.name resource. + */ + responseView?: string; + } + interface PullTasksResponse { + /** The leased tasks. */ + tasks?: Task[]; + } + interface Queue { + /** + * App Engine HTTP target. + * + * An App Engine queue is a queue that has an AppEngineHttpTarget. + */ + appEngineHttpTarget?: AppEngineHttpTarget; + /** Deprecated. Use Queue.app_engine_http_target. */ + appEngineQueueConfig?: AppEngineQueueConfig; + /** + * The queue name. + * + * The queue name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * * `PROJECT_ID` can contain uppercase and lowercase letters, + * numbers, hyphens, colons, and periods; that is, it must match + * the regular expression: `[a-zA-Z\\d-:\\.]+`. + * * `QUEUE_ID` can contain uppercase and lowercase letters, + * numbers, and hyphens; that is, it must match the regular + * expression: `[a-zA-Z\\d-]+`. The maximum length is 100 + * characters. + * + * Caller-specified and required in CreateQueueRequest, after which + * it becomes output only. + */ + name?: string; + /** Deprecated. Use Queue.pull_target. */ + pullQueueConfig?: any; + /** + * Pull target. + * + * A pull queue is a queue that has a PullTarget. + */ + pullTarget?: any; + /** + * Output only. + * + * The last time this queue was purged. All tasks that were + * created before this time were purged. + * + * A queue can be purged using CloudTasks.PurgeQueue, the + * [App Engine Task Queue SDK, or the Cloud + * Console](/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). + * + * Purge time will be truncated to the nearest microsecond. Purge + * time will be zero if the queue has never been purged. + */ + purgeTime?: string; + /** + * Output only. + * + * The state of the queue. + * + * `queue_state` can only be changed by called + * CloudTasks.PauseQueue, CloudTasks.ResumeQueue, or uploading + * [queue.yaml](/appengine/docs/python/config/queueref). + * CloudTasks.UpdateQueue cannot be used to change `queue_state`. + */ + queueState?: string; + /** + * Rate limits for task dispatches. + * + * Queue.rate_limits and Queue.retry_config are related because they + * both control task attempts however they control how tasks are attempted in + * different ways: + * + * * Queue.rate_limits controls the total rate of dispatches from a queue + * (i.e. all traffic dispatched from the queue, regardless of whether the + * dispatch is from a first attempt or a retry). + * * Queue.retry_config controls what happens to particular a task after + * its first attempt fails. That is, Queue.retry_config controls task + * retries (the second attempt, third attempt, etc). + */ + rateLimits?: RateLimits; + /** + * Settings that determine the retry behavior. + * + * * For tasks created using Cloud Tasks: the queue-level retry settings + * apply to all tasks in the queue that were created using Cloud Tasks. + * Retry settings cannot be set on individual tasks. + * * For tasks created using the App Engine SDK: the queue-level retry + * settings apply to all tasks in the queue which do not have retry settings + * explicitly set on the task and were created by the App Engine SDK. See + * [App Engine documentation](/appengine/docs/standard/python/taskqueue/push/retrying-tasks). + */ + retryConfig?: RetryConfig; + } + interface RateLimits { + /** + * Output only. + * + * The max burst size limits how fast the queue is processed when + * many tasks are in the queue and the rate is high. This field + * allows the queue to have a high rate so processing starts shortly + * after a task is enqueued, but still limits resource usage when + * many tasks are enqueued in a short period of time. + * + * * For App Engine queues, if + * RateLimits.max_tasks_dispatched_per_second is 1, this + * field is 10; otherwise this field is + * RateLimits.max_tasks_dispatched_per_second / 5. + * * For pull queues, this field is output only and always 10,000. + * + * Note: For App Engine queues that were created through + * `queue.yaml/xml`, `max_burst_size` might not have the same + * settings as specified above; CloudTasks.UpdateQueue can be + * used to set `max_burst_size` only to the values specified above. + * + * This field has the same meaning as + * [bucket_size in queue.yaml](/appengine/docs/standard/python/config/queueref#bucket_size). + */ + maxBurstSize?: number; + /** + * The maximum number of concurrent tasks that Cloud Tasks allows + * to be dispatched for this queue. After this threshold has been + * reached, Cloud Tasks stops dispatching tasks until the number of + * concurrent requests decreases. + * + * The maximum allowed value is 5,000. + * + * * For App Engine queues, this field is 10 by default. + * * For pull queues, this field is output only and always -1, which + * indicates no limit. + * + * This field has the same meaning as + * [max_concurrent_requests in queue.yaml](/appengine/docs/standard/python/config/queueref#max_concurrent_requests). + */ + maxConcurrentTasks?: number; + /** + * The maximum rate at which tasks are dispatched from this + * queue. + * + * The maximum allowed value is 500. + * + * * For App Engine queues, this field is 1 by default. + * * For pull queues, this field is output only and always 10,000. + * + * This field has the same meaning as + * [rate in queue.yaml](/appengine/docs/standard/python/config/queueref#rate). + */ + maxTasksDispatchedPerSecond?: number; + } + interface RenewLeaseRequest { + /** + * Required. + * + * The desired new lease duration, starting from now. + * + * + * The maximum lease duration is 1 week. + * `new_lease_duration` will be truncated to the nearest second. + */ + newLeaseDuration?: string; + /** + * The response_view specifies which subset of the Task will be + * returned. + * + * By default response_view is Task.View.BASIC; not all + * information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for Task.View.FULL requires `cloudtasks.tasks.fullView` + * [Google IAM](/iam/) permission on the + * Task.name resource. + */ + responseView?: string; + /** + * Required. + * + * The task's current schedule time, available in the Task.schedule_time + * returned in PullTasksResponse.tasks or + * CloudTasks.RenewLease. This restriction is to check that + * the caller is renewing the correct task. + */ + scheduleTime?: string; + } + interface RetryConfig { + /** + * The maximum number of attempts for a task. + * + * Cloud Tasks will attempt the task `max_attempts` times (that + * is, if the first attempt fails, then there will be + * `max_attempts - 1` retries). Must be > 0. + */ + maxAttempts?: number; + /** + * The maximum amount of time to wait before retrying a task after + * it fails. The default is 1 hour. + * + * * For [App Engine queues](google.cloud.tasks.v2beta2.AppEngineHttpTarget), + * this field is 1 hour by default. + * * For [pull queues](google.cloud.tasks.v2beta2.PullTarget), this field + * is output only and always 0. + * + * `max_backoff` will be truncated to the nearest second. + * + * This field has the same meaning as + * [max_backoff_seconds in queue.yaml](/appengine/docs/standard/python/config/queueref#retry_parameters). + */ + maxBackoff?: string; + /** + * The time between retries increases exponentially `max_doublings` times. + * `max_doublings` is maximum number of times that the interval between failed + * task retries will be doubled before the interval increases linearly. + * After max_doublings intervals, the retry interval will be + * 2^(max_doublings - 1) * RetryConfig.min_backoff. + * + * * For [App Engine queues](google.cloud.tasks.v2beta2.AppEngineHttpTarget), + * this field is 16 by default. + * * For [pull queues](google.cloud.tasks.v2beta2.PullTarget), this field + * is output only and always 0. + * + * This field has the same meaning as + * [max_doublings in queue.yaml](/appengine/docs/standard/python/config/queueref#retry_parameters). + */ + maxDoublings?: number; + /** + * If positive, `max_retry_duration` specifies the time limit for retrying a + * failed task, measured from when the task was first attempted. Once + * `max_retry_duration` time has passed *and* the task has been attempted + * RetryConfig.max_attempts times, no further attempts will be made and + * the task will be deleted. + * + * If zero, then the task age is unlimited. + * + * * For [App Engine queues](google.cloud.tasks.v2beta2.AppEngineHttpTarget), + * this field is 0 seconds by default. + * * For [pull queues](google.cloud.tasks.v2beta2.PullTarget), this + * field is output only and always 0. + * + * `max_retry_duration` will be truncated to the nearest second. + * + * This field has the same meaning as + * [task_age_limit in queue.yaml](/appengine/docs/standard/python/config/queueref#retry_parameters). + */ + maxRetryDuration?: string; + /** + * The minimum amount of time to wait before retrying a task after + * it fails. + * + * * For [App Engine queues](google.cloud.tasks.v2beta2.AppEngineHttpTarget), + * this field is 0.1 seconds by default. + * * For [pull queues](google.cloud.tasks.v2beta2.PullTarget), this + * field is output only and always 0. + * + * `min_backoff` will be truncated to the nearest second. + * + * This field has the same meaning as + * [min_backoff_seconds in queue.yaml](/appengine/docs/standard/python/config/queueref#retry_parameters). + */ + minBackoff?: string; + /** If true, then the number of attempts is unlimited. */ + unlimitedAttempts?: boolean; + } + interface RunTaskRequest { + /** + * The response_view specifies which subset of the Task will be + * returned. + * + * By default response_view is Task.View.BASIC; not all + * information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for Task.View.FULL requires `cloudtasks.tasks.fullView` + * [Google IAM](/iam/) permission on the + * Task.name resource. + */ + responseView?: string; + } + interface SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size of + * the policy is limited to a few 10s of KB. An empty policy is a + * valid policy but certain Cloud Platform services (such as Projects) + * might reject them. + */ + policy?: Policy; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface Task { + /** + * App Engine HTTP request that is sent to the task's target. Can be set + * only if Queue.app_engine_http_target is set. + * + * An App Engine task is a task that has AppEngineHttpRequest set. + */ + appEngineHttpRequest?: AppEngineHttpRequest; + /** Deprecated. Use Task.app_engine_http_request. */ + appEngineTaskTarget?: AppEngineTaskTarget; + /** + * Output only. + * + * The time that the task was created. + * + * `create_time` will be truncated to the nearest second. + */ + createTime?: string; + /** + * The task name. + * + * The task name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * + * * `PROJECT_ID` can contain uppercase and lowercase letters, + * numbers, hyphens, colons, and periods; that is, it must match + * the regular expression: `[a-zA-Z\\d-:\\.]+`. + * * `QUEUE_ID` can contain uppercase and lowercase letters, + * numbers, and hyphens; that is, it must match the regular + * expression: `[a-zA-Z\\d-]+`. The maximum length is 100 + * characters. + * * `TASK_ID` contain uppercase and lowercase letters, numbers, + * underscores, and hyphens; that is, it must match the regular + * expression: `[a-zA-Z\\d_-]+`. The maximum length is 500 + * characters. + * + * Optionally caller-specified in CreateTaskRequest. + */ + name?: string; + /** + * Pull message contains data that should be used by the caller of + * CloudTasks.PullTasks to process the task. Can be set only if + * Queue.pull_target is set. + * + * A pull task is a task that has PullMessage set. + */ + pullMessage?: PullMessage; + /** Deprecated. Use Task.pull_message. */ + pullTaskTarget?: PullTaskTarget; + /** + * The time when the task is scheduled to be attempted. + * + * For pull queues, this is the time when the task is available to + * be leased; if a task is currently leased, this is the time when + * the current lease expires, that is, the time that the task was + * leased plus the PullTasksRequest.lease_duration. + * + * For App Engine queues, this is when the task will be attempted or retried. + * + * `schedule_time` will be truncated to the nearest microsecond. + */ + scheduleTime?: string; + /** + * Output only. + * + * Task status. + */ + taskStatus?: TaskStatus; + /** + * Output only. + * + * The view specifies which subset of the Task has been + * returned. + */ + view?: string; + } + interface TaskStatus { + /** + * Output only. + * + * The number of attempts dispatched. This count includes tasks which have + * been dispatched but haven't received a response. + */ + attemptDispatchCount?: string; + /** + * Output only. + * + * The number of attempts which have received a response. + * + * This field is not calculated for + * [pull tasks](google.cloud.tasks.v2beta2.PullTaskTarget). + */ + attemptResponseCount?: string; + /** + * Output only. + * + * The status of the task's first attempt. + * + * Only AttemptStatus.dispatch_time will be set. + * The other AttemptStatus information is not retained by Cloud Tasks. + * + * This field is not calculated for + * [pull tasks](google.cloud.tasks.v2beta2.PullTaskTarget). + */ + firstAttemptStatus?: AttemptStatus; + /** + * Output only. + * + * The status of the task's last attempt. + * + * This field is not calculated for + * [pull tasks](google.cloud.tasks.v2beta2.PullTaskTarget). + */ + lastAttemptStatus?: AttemptStatus; + } + interface TestIamPermissionsRequest { + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + permissions?: string[]; + } + interface TestIamPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions?: string[]; + } + interface TasksResource { + /** + * Acknowledges a pull task. + * + * The lease holder, that is, the entity that received this task in + * a PullTasksResponse, must call this method to indicate that + * the work associated with the task has finished. + * + * The lease holder must acknowledge a task within the + * PullTasksRequest.lease_duration or the lease will expire and + * the task will become ready to be returned in a different + * PullTasksResponse. After the task is acknowledged, it will + * not be returned by a later CloudTasks.PullTasks, + * CloudTasks.GetTask, or CloudTasks.ListTasks. + */ + acknowledge(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. + * + * The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Cancel a pull task's lease. + * + * The lease holder can use this method to cancel a task's lease + * by setting Task.schedule_time to now. This will make the task + * available to be leased to the next caller of CloudTasks.PullTasks. + */ + cancelLease(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. + * + * The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Creates a task and adds it to a queue. + * + * To add multiple tasks at the same time, use + * [HTTP batching](/storage/docs/json_api/v1/how-tos/batch) + * or the batching documentation for your client library, for example + * https://developers.google.com/api-client-library/python/guide/batch. + * + * Tasks cannot be updated after creation; there is no UpdateTask command. + * + * * For [App Engine queues](google.cloud.tasks.v2beta2.AppEngineHttpTarget), + * the maximum task size is 100KB. + * * For [pull queues](google.cloud.tasks.v2beta2.PullTarget), this + * the maximum task size is 1MB. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * The queue must already exist. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes a task. + * + * A task can be deleted if it is scheduled or dispatched. A task + * cannot be deleted if it has completed successfully or permanently + * failed. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. + * + * The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Gets a task. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. + * + * The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * The response_view specifies which subset of the Task will be + * returned. + * + * By default response_view is Task.View.BASIC; not all + * information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for Task.View.FULL requires `cloudtasks.tasks.fullView` + * [Google IAM](/iam/) permission on the + * Task.name resource. + */ + responseView?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists the tasks in a queue. + * + * By default response_view is Task.View.BASIC; not all + * information is retrieved by default due to performance + * considerations; ListTasksRequest.response_view controls the + * subset of information which is returned. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sort order used for the query. The fields supported for sorting + * are Task.schedule_time and PullMessage.tag. All results will be + * returned in ascending order. The default ordering is by + * Task.schedule_time. + */ + orderBy?: string; + /** + * Requested page size. Fewer tasks than requested might be returned. + * + * The maximum page size is 1000. If unspecified, the page size will + * be the maximum. Fewer tasks than requested might be returned, + * even if more tasks exist; use + * ListTasksResponse.next_page_token to determine if more tasks + * exist. + */ + pageSize?: number; + /** + * A token identifying the page of results to return. + * + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * ListTasksResponse.next_page_token returned from the previous + * call to CloudTasks.ListTasks method. + * + * The page token is valid for only 2 hours. + */ + pageToken?: string; + /** + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * The response_view specifies which subset of the Task will be + * returned. + * + * By default response_view is Task.View.BASIC; not all + * information is retrieved by default because some data, such as + * payloads, might be desirable to return only when needed because + * of its large size or because of the sensitivity of data that it + * contains. + * + * Authorization for Task.View.FULL requires `cloudtasks.tasks.fullView` + * [Google IAM](/iam/) permission on the + * Task.name resource. + */ + responseView?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Pulls tasks from a pull queue and acquires a lease on them for a + * specified PullTasksRequest.lease_duration. + * + * This method is invoked by the lease holder to obtain the + * lease. The lease holder must acknowledge the task via + * CloudTasks.AcknowledgeTask after they have performed the work + * associated with the task. + * + * The payload is intended to store data that the lease holder needs + * to perform the work associated with the task. To return the + * payloads in the PullTasksResponse, set + * PullTasksRequest.response_view to Task.View.FULL. + * + * A maximum of 10 qps of CloudTasks.PullTasks requests are allowed per + * queue. google.rpc.Code.RESOURCE_EXHAUSTED is returned when this limit + * is exceeded. google.rpc.Code.RESOURCE_EXHAUSTED is also returned when + * RateLimits.max_tasks_dispatched_per_second is exceeded. + */ + pull(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Renew the current lease of a pull task. + * + * The lease holder can use this method to extend the lease by a new + * duration, starting from now. The new task lease will be + * returned in Task.schedule_time. + */ + renewLease(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. + * + * The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Forces a task to run now. + * + * This command is meant to be used for manual debugging. For + * example, CloudTasks.RunTask can be used to retry a failed + * task after a fix has been made or to manually force a task to be + * dispatched now. + * + * When this method is called, Cloud Tasks will dispatch the task to its + * target, even if the queue is Queue.QueueState.PAUSED. + * + * The dispatched task is returned. That is, the task that is returned + * contains the Task.task_status after the task is dispatched but + * before the task is received by its target. + * + * If Cloud Tasks receives a successful response from the task's + * handler, then the task will be deleted; otherwise the task's + * Task.schedule_time will be reset to the time that + * CloudTasks.RunTask was called plus the retry delay specified + * in the queue and task's RetryConfig. + * + * CloudTasks.RunTask returns google.rpc.Code.NOT_FOUND when + * it is called on a task that has already succeeded or permanently + * failed. google.rpc.Code.FAILED_PRECONDITION is returned when + * CloudTasks.RunTask is called on task that is dispatched or + * already running. + */ + run(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. + * + * The task name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface QueuesResource { + /** + * Creates a queue. + * + * WARNING: This method is only available to whitelisted + * users. Using this method carries some risk. Read + * [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) + * carefully and then sign up for + * [whitelist access to this method](https://goo.gl/Fe5mUy). + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Required. + * + * The location name in which the queue will be created. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * + * The list of allowed locations can be obtained by calling Cloud + * Tasks' implementation of + * google.cloud.location.Locations.ListLocations. + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Deletes a queue. + * + * This command will delete the queue even if it has tasks in it. + * + * Note: If you delete a queue, a queue with the same name can't be created + * for 7 days. + * + * WARNING: This method is only available to whitelisted + * users. Using this method carries some risk. Read + * [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) + * carefully and then sign up for + * [whitelist access to this method](https://goo.gl/Fe5mUy). + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Gets a queue. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. + * + * The resource name of the queue. For example: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Gets the access control policy for a Queue. + * Returns an empty policy if the resource exists and does not have a policy + * set. + * + * Authorization requires the following [Google IAM](/iam) permission on the + * specified resource parent: + * + * * `cloudtasks.queues.getIamPolicy` + */ + getIamPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists queues. + * + * Queues are returned in lexicographical order. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * `filter` can be used to specify a subset of queues. Any Queue + * field can be used as a filter and several operators as supported. + * For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as + * described in + * [Stackdriver's Advanced Logs Filters](/logging/docs/view/advanced_filters). + * + * Sample filter "app_engine_http_target: *". + * + * Note that using filters might cause fewer queues than the + * requested_page size to be returned. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Requested page size. + * + * The maximum page size is 9800. If unspecified, the page size will + * be the maximum. Fewer queues than requested might be returned, + * even if more queues exist; use + * ListQueuesResponse.next_page_token to determine if more + * queues exist. + */ + pageSize?: number; + /** + * A token identifying the page of results to return. + * + * To request the first page results, page_token must be empty. To + * request the next page of results, page_token must be the value of + * ListQueuesResponse.next_page_token returned from the previous + * call to CloudTasks.ListQueues method. It is an error to + * switch the value of ListQueuesRequest.filter while iterating + * through pages. + */ + pageToken?: string; + /** + * Required. + * + * The location name. + * For example: `projects/PROJECT_ID/locations/LOCATION_ID` + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Updates a queue. + * + * This method creates the queue if it does not exist and updates + * the queue if it does exist. + * + * WARNING: This method is only available to whitelisted + * users. Using this method carries some risk. Read + * [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) + * carefully and then sign up for + * [whitelist access to this method](https://goo.gl/Fe5mUy). + */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The queue name. + * + * The queue name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * + * * `PROJECT_ID` can contain uppercase and lowercase letters, + * numbers, hyphens, colons, and periods; that is, it must match + * the regular expression: `[a-zA-Z\\d-:\\.]+`. + * * `QUEUE_ID` can contain uppercase and lowercase letters, + * numbers, and hyphens; that is, it must match the regular + * expression: `[a-zA-Z\\d-]+`. The maximum length is 100 + * characters. + * + * Caller-specified and required in CreateQueueRequest, after which + * it becomes output only. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * A mask used to specify which fields of the queue are being updated. + * + * If empty, then all fields will be updated. + */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Pauses the queue. + * + * If a queue is paused then the system will stop executing the + * tasks in the queue until it is resumed via + * CloudTasks.ResumeQueue. Tasks can still be added when the + * queue is paused. The state of the queue is stored in + * Queue.queue_state; if paused it will be set to + * Queue.QueueState.PAUSED. + * + * WARNING: This method is only available to whitelisted + * users. Using this method carries some risk. Read + * [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) + * carefully and then sign up for + * [whitelist access to this method](https://goo.gl/Fe5mUy). + */ + pause(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Purges a queue by deleting all of its tasks. + * + * All tasks created before this method is called are permanently deleted. + * + * Purge operations can take up to one minute to take effect. Tasks + * might be dispatched before the purge takes effect. A purge is irreversible. + */ + purge(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Resume a queue. + * + * This method resumes a queue after it has been + * Queue.QueueState.PAUSED or Queue.QueueState.DISABLED. The state of + * a queue is stored in Queue.queue_state; after calling this method it + * will be set to Queue.QueueState.RUNNING. + * + * WARNING: This method is only available to whitelisted + * users. Using this method carries some risk. Read + * [Overview of Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) + * carefully and then sign up for + * [whitelist access to this method](https://goo.gl/Fe5mUy). + * + * WARNING: Resuming many high-QPS queues at the same time can + * lead to target overloading. If you are resuming high-QPS + * queues, follow the 500/50/5 pattern described in + * [Managing Cloud Tasks Scaling Risks](/cloud-tasks/pdfs/managing-cloud-tasks-scaling-risks-2017-06-05.pdf). + */ + resume(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. + * + * The queue name. For example: + * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Sets the access control policy for a Queue. Replaces any existing + * policy. + * + * Authorization requires the following [Google IAM](/iam) permission on the + * specified resource parent: + * + * * `cloudtasks.queues.setIamPolicy` + */ + setIamPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy is being specified. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Returns permissions that a caller has on a Queue. + * If the resource does not exist, this will return an empty set of + * permissions, not a google.rpc.Code.NOT_FOUND error. + * + * Note: This operation is designed to be used for building permission-aware + * UIs and command-line tools, not for authorization checking. This operation + * may "fail open" without warning. + */ + testIamPermissions(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + resource: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + tasks: TasksResource; + } + interface LocationsResource { + /** Get information about a location. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Resource name for the location. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists information about the supported locations for this service. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The standard list filter. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The resource that owns the locations collection, if applicable. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The standard list page size. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + queues: QueuesResource; + } + interface ProjectsResource { + locations: LocationsResource; + } + } +} diff --git a/types/gapi.client.cloudtasks/readme.md b/types/gapi.client.cloudtasks/readme.md new file mode 100644 index 0000000000..59a3b660e3 --- /dev/null +++ b/types/gapi.client.cloudtasks/readme.md @@ -0,0 +1,54 @@ +# TypeScript typings for Cloud Tasks API v2beta2 +Manages the execution of large numbers of distributed requests. Cloud Tasks is in Alpha. +For detailed description please check [documentation](https://cloud.google.com/cloud-tasks/). + +## Installing + +Install typings for Cloud Tasks API: +``` +npm install @types/gapi.client.cloudtasks@v2beta2 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('cloudtasks', 'v2beta2', () => { + // now we can use gapi.client.cloudtasks + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Cloud Tasks API resources: + +```typescript +``` \ No newline at end of file diff --git a/types/gapi.client.cloudtasks/tsconfig.json b/types/gapi.client.cloudtasks/tsconfig.json new file mode 100644 index 0000000000..d4240ab7d4 --- /dev/null +++ b/types/gapi.client.cloudtasks/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.cloudtasks-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.cloudtasks/tslint.json b/types/gapi.client.cloudtasks/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.cloudtasks/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.cloudtrace/gapi.client.cloudtrace-tests.ts b/types/gapi.client.cloudtrace/gapi.client.cloudtrace-tests.ts new file mode 100644 index 0000000000..96bc98ea32 --- /dev/null +++ b/types/gapi.client.cloudtrace/gapi.client.cloudtrace-tests.ts @@ -0,0 +1,34 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('cloudtrace', 'v2', () => { + /** now we can use gapi.client.cloudtrace */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** Write Trace data for a project or application */ + 'https://www.googleapis.com/auth/trace.append', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + } +}); diff --git a/types/gapi.client.cloudtrace/index.d.ts b/types/gapi.client.cloudtrace/index.d.ts new file mode 100644 index 0000000000..ba868581d1 --- /dev/null +++ b/types/gapi.client.cloudtrace/index.d.ts @@ -0,0 +1,378 @@ +// Type definitions for Google Stackdriver Trace API v2 2.0 +// Project: https://cloud.google.com/trace +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://cloudtrace.googleapis.com/$discovery/rest?version=v2 + +/// + +declare namespace gapi.client { + /** Load Stackdriver Trace API v2 */ + function load(name: "cloudtrace", version: "v2"): PromiseLike; + function load(name: "cloudtrace", version: "v2", callback: () => any): void; + + const projects: cloudtrace.ProjectsResource; + + namespace cloudtrace { + interface Annotation { + /** + * A set of attributes on the annotation. There is a limit of 4 attributes + * per Annotation. + */ + attributes?: Attributes; + /** + * A user-supplied message describing the event. The maximum length for + * the description is 256 bytes. + */ + description?: TruncatableString; + } + interface AttributeValue { + /** A Boolean value represented by `true` or `false`. */ + boolValue?: boolean; + /** A 64-bit signed integer. */ + intValue?: string; + /** A string up to 256 bytes long. */ + stringValue?: TruncatableString; + } + interface Attributes { + /** + * The set of attributes. Each attribute's key can be up to 128 bytes + * long. The value can be a string up to 256 bytes, an integer, or the + * Boolean values `true` and `false`. For example: + * + * "/instance_id": "my-instance" + * "/http/user_agent": "" + * "/http/request_bytes": 300 + * "abc.com/myattribute": true + */ + attributeMap?: Record; + /** + * The number of attributes that were discarded. Attributes can be discarded + * because their keys are too long or because there are too many attributes. + * If this value is 0 then all attributes are valid. + */ + droppedAttributesCount?: number; + } + interface BatchWriteSpansRequest { + /** A collection of spans. */ + spans?: Span[]; + } + interface Link { + /** + * A set of attributes on the link. There is a limit of 32 attributes per + * link. + */ + attributes?: Attributes; + /** `SPAN_ID` identifies a span within a trace. */ + spanId?: string; + /** `TRACE_ID` identifies a trace within a project. */ + traceId?: string; + /** The relationship of the current span relative to the linked span. */ + type?: string; + } + interface Links { + /** + * The number of dropped links after the maximum size was enforced. If + * this value is 0, then no links were dropped. + */ + droppedLinksCount?: number; + /** A collection of links. */ + link?: Link[]; + } + interface Module { + /** + * A unique identifier for the module, usually a hash of its + * contents (up to 128 bytes). + */ + buildId?: TruncatableString; + /** + * For example: main binary, kernel modules, and dynamic libraries + * such as libc.so, sharedlib.so (up to 256 bytes). + */ + module?: TruncatableString; + } + interface NetworkEvent { + /** The number of compressed bytes sent or received. */ + compressedMessageSize?: string; + /** An identifier for the message, which must be unique in this span. */ + messageId?: string; + /** + * For sent messages, this is the time at which the first bit was sent. + * For received messages, this is the time at which the last bit was + * received. + */ + time?: string; + /** + * Type of NetworkEvent. Indicates whether the RPC message was sent or + * received. + */ + type?: string; + /** The number of uncompressed bytes sent or received. */ + uncompressedMessageSize?: string; + } + interface Span { + /** + * A set of attributes on the span. There is a limit of 32 attributes per + * span. + */ + attributes?: Attributes; + /** + * An optional number of child spans that were generated while this span + * was active. If set, allows implementation to detect missing child spans. + */ + childSpanCount?: number; + /** + * A description of the span's operation (up to 128 bytes). + * Stackdriver Trace displays the description in the + * {% dynamic print site_values.console_name %}. + * For example, the display name can be a qualified method name or a file name + * and a line number where the operation is called. A best practice is to use + * the same display name within an application and at the same call point. + * This makes it easier to correlate spans in different traces. + */ + displayName?: TruncatableString; + /** + * The end time of the span. On the client side, this is the time kept by + * the local machine where the span execution ends. On the server side, this + * is the time when the server application handler stops running. + */ + endTime?: string; + /** A maximum of 128 links are allowed per Span. */ + links?: Links; + /** + * The resource name of the span in the following format: + * + * projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/SPAN_ID is a unique identifier for a trace within a project. + * [SPAN_ID] is a unique identifier for a span within a trace, + * assigned when the span is created. + */ + name?: string; + /** + * The [SPAN_ID] of this span's parent span. If this is a root span, + * then this field must be empty. + */ + parentSpanId?: string; + /** + * A highly recommended but not required flag that identifies when a trace + * crosses a process boundary. True when the parent_span belongs to the + * same process as the current span. + */ + sameProcessAsParentSpan?: boolean; + /** The [SPAN_ID] portion of the span's resource name. */ + spanId?: string; + /** Stack trace captured at the start of the span. */ + stackTrace?: StackTrace; + /** + * The start time of the span. On the client side, this is the time kept by + * the local machine where the span execution starts. On the server side, this + * is the time when the server's application handler starts running. + */ + startTime?: string; + /** An optional final status for this span. */ + status?: Status; + /** + * The included time events. There can be up to 32 annotations and 128 network + * events per span. + */ + timeEvents?: TimeEvents; + } + interface StackFrame { + /** + * The column number where the function call appears, if available. + * This is important in JavaScript because of its anonymous functions. + */ + columnNumber?: string; + /** + * The name of the source file where the function call appears (up to 256 + * bytes). + */ + fileName?: TruncatableString; + /** + * The fully-qualified name that uniquely identifies the function or + * method that is active in this frame (up to 1024 bytes). + */ + functionName?: TruncatableString; + /** The line number in `file_name` where the function call appears. */ + lineNumber?: string; + /** The binary module from where the code was loaded. */ + loadModule?: Module; + /** + * An un-mangled function name, if `function_name` is + * [mangled](http://www.avabodh.com/cxxin/namemangling.html). The name can + * be fully-qualified (up to 1024 bytes). + */ + originalFunctionName?: TruncatableString; + /** The version of the deployed source code (up to 128 bytes). */ + sourceVersion?: TruncatableString; + } + interface StackFrames { + /** + * The number of stack frames that were dropped because there + * were too many stack frames. + * If this value is 0, then no stack frames were dropped. + */ + droppedFramesCount?: number; + /** Stack frames in this call stack. */ + frame?: StackFrame[]; + } + interface StackTrace { + /** Stack frames in this stack trace. A maximum of 128 frames are allowed. */ + stackFrames?: StackFrames; + /** + * The hash ID is used to conserve network bandwidth for duplicate + * stack traces within a single trace. + * + * Often multiple spans will have identical stack traces. + * The first occurrence of a stack trace should contain both the + * `stackFrame` content and a value in `stackTraceHashId`. + * + * Subsequent spans within the same request can refer + * to that stack trace by only setting `stackTraceHashId`. + */ + stackTraceHashId?: string; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface TimeEvent { + /** Text annotation with a set of attributes. */ + annotation?: Annotation; + /** An event describing an RPC message sent/received on the network. */ + networkEvent?: NetworkEvent; + /** The timestamp indicating the time the event occurred. */ + time?: string; + } + interface TimeEvents { + /** + * The number of dropped annotations in all the included time events. + * If the value is 0, then no annotations were dropped. + */ + droppedAnnotationsCount?: number; + /** + * The number of dropped network events in all the included time events. + * If the value is 0, then no network events were dropped. + */ + droppedNetworkEventsCount?: number; + /** A collection of `TimeEvent`s. */ + timeEvent?: TimeEvent[]; + } + interface TruncatableString { + /** + * The number of bytes removed from the original string. If this + * value is 0, then the string was not shortened. + */ + truncatedByteCount?: number; + /** + * The shortened string. For example, if the original string was 500 + * bytes long and the limit of the string was 128 bytes, then this + * value contains the first 128 bytes of the 500-byte string. Note that + * truncation always happens on the character boundary, to ensure that + * truncated string is still valid UTF8. In case of multi-byte characters, + * size of truncated string can be less than truncation limit. + */ + value?: string; + } + interface SpansResource { + /** Creates a new Span. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The resource name of the span in the following format: + * + * projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/SPAN_ID is a unique identifier for a trace within a project. + * [SPAN_ID] is a unique identifier for a span within a trace, + * assigned when the span is created. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface TracesResource { + /** + * Sends new spans to Stackdriver Trace or updates existing traces. If the + * name of a trace that you send matches that of an existing trace, new spans + * are added to the existing trace. Attempt to update existing spans results + * undefined behavior. If the name does not match, a new trace is created + * with given set of spans. + */ + batchWrite(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Required. Name of the project where the spans belong. The format is + * `projects/PROJECT_ID`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + spans: SpansResource; + } + interface ProjectsResource { + traces: TracesResource; + } + } +} diff --git a/types/gapi.client.cloudtrace/readme.md b/types/gapi.client.cloudtrace/readme.md new file mode 100644 index 0000000000..c7c8408a0b --- /dev/null +++ b/types/gapi.client.cloudtrace/readme.md @@ -0,0 +1,58 @@ +# TypeScript typings for Stackdriver Trace API v2 +Send and retrieve trace data from Stackdriver Trace. Data is generated and available by default for all App Engine applications. Data from other applications can be written to Stackdriver Trace for display, reporting, and analysis. + +For detailed description please check [documentation](https://cloud.google.com/trace). + +## Installing + +Install typings for Stackdriver Trace API: +``` +npm install @types/gapi.client.cloudtrace@v2 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('cloudtrace', 'v2', () => { + // now we can use gapi.client.cloudtrace + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // Write Trace data for a project or application + 'https://www.googleapis.com/auth/trace.append', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Stackdriver Trace API resources: + +```typescript +``` \ No newline at end of file diff --git a/types/gapi.client.cloudtrace/tsconfig.json b/types/gapi.client.cloudtrace/tsconfig.json new file mode 100644 index 0000000000..977a1fd91f --- /dev/null +++ b/types/gapi.client.cloudtrace/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.cloudtrace-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.cloudtrace/tslint.json b/types/gapi.client.cloudtrace/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.cloudtrace/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.clouduseraccounts/gapi.client.clouduseraccounts-tests.ts b/types/gapi.client.clouduseraccounts/gapi.client.clouduseraccounts-tests.ts new file mode 100644 index 0000000000..29c552c543 --- /dev/null +++ b/types/gapi.client.clouduseraccounts/gapi.client.clouduseraccounts-tests.ts @@ -0,0 +1,169 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('clouduseraccounts', 'vm_alpha', () => { + /** now we can use gapi.client.clouduseraccounts */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform.read-only', + /** Manage your Google Cloud User Accounts */ + 'https://www.googleapis.com/auth/cloud.useraccounts', + /** View your Google Cloud User Accounts */ + 'https://www.googleapis.com/auth/cloud.useraccounts.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Deletes the specified operation resource. */ + await gapi.client.globalAccountsOperations.delete({ + operation: "operation", + project: "project", + }); + /** Retrieves the specified operation resource. */ + await gapi.client.globalAccountsOperations.get({ + operation: "operation", + project: "project", + }); + /** Retrieves the list of operation resources contained within the specified project. */ + await gapi.client.globalAccountsOperations.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Adds users to the specified group. */ + await gapi.client.groups.addMember({ + groupName: "groupName", + project: "project", + }); + /** Deletes the specified Group resource. */ + await gapi.client.groups.delete({ + groupName: "groupName", + project: "project", + }); + /** Returns the specified Group resource. */ + await gapi.client.groups.get({ + groupName: "groupName", + project: "project", + }); + /** Gets the access control policy for a resource. May be empty if no such policy or resource exists. */ + await gapi.client.groups.getIamPolicy({ + project: "project", + resource: "resource", + }); + /** Creates a Group resource in the specified project using the data included in the request. */ + await gapi.client.groups.insert({ + project: "project", + }); + /** Retrieves the list of groups contained within the specified project. */ + await gapi.client.groups.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Removes users from the specified group. */ + await gapi.client.groups.removeMember({ + groupName: "groupName", + project: "project", + }); + /** Sets the access control policy on the specified resource. Replaces any existing policy. */ + await gapi.client.groups.setIamPolicy({ + project: "project", + resource: "resource", + }); + /** Returns permissions that a caller has on the specified resource. */ + await gapi.client.groups.testIamPermissions({ + project: "project", + resource: "resource", + }); + /** Returns a list of authorized public keys for a specific user account. */ + await gapi.client.linux.getAuthorizedKeysView({ + instance: "instance", + login: true, + project: "project", + user: "user", + zone: "zone", + }); + /** Retrieves a list of user accounts for an instance within a specific project. */ + await gapi.client.linux.getLinuxAccountViews({ + filter: "filter", + instance: "instance", + maxResults: 3, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** Adds a public key to the specified User resource with the data included in the request. */ + await gapi.client.users.addPublicKey({ + project: "project", + user: "user", + }); + /** Deletes the specified User resource. */ + await gapi.client.users.delete({ + project: "project", + user: "user", + }); + /** Returns the specified User resource. */ + await gapi.client.users.get({ + project: "project", + user: "user", + }); + /** Gets the access control policy for a resource. May be empty if no such policy or resource exists. */ + await gapi.client.users.getIamPolicy({ + project: "project", + resource: "resource", + }); + /** Creates a User resource in the specified project using the data included in the request. */ + await gapi.client.users.insert({ + project: "project", + }); + /** Retrieves a list of users contained within the specified project. */ + await gapi.client.users.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Removes the specified public key from the user. */ + await gapi.client.users.removePublicKey({ + fingerprint: "fingerprint", + project: "project", + user: "user", + }); + /** Sets the access control policy on the specified resource. Replaces any existing policy. */ + await gapi.client.users.setIamPolicy({ + project: "project", + resource: "resource", + }); + /** Returns permissions that a caller has on the specified resource. */ + await gapi.client.users.testIamPermissions({ + project: "project", + resource: "resource", + }); + } +}); diff --git a/types/gapi.client.clouduseraccounts/index.d.ts b/types/gapi.client.clouduseraccounts/index.d.ts new file mode 100644 index 0000000000..75e8f0d852 --- /dev/null +++ b/types/gapi.client.clouduseraccounts/index.d.ts @@ -0,0 +1,1084 @@ +// Type definitions for Google Cloud User Accounts API vm_alpha 0.0 +// Project: https://cloud.google.com/compute/docs/access/user-accounts/api/latest/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/clouduseraccounts/vm_alpha/rest + +/// + +declare namespace gapi.client { + /** Load Cloud User Accounts API vm_alpha */ + function load(name: "clouduseraccounts", version: "vm_alpha"): PromiseLike; + function load(name: "clouduseraccounts", version: "vm_alpha", callback: () => any): void; + + const globalAccountsOperations: clouduseraccounts.GlobalAccountsOperationsResource; + + const groups: clouduseraccounts.GroupsResource; + + const linux: clouduseraccounts.LinuxResource; + + const users: clouduseraccounts.UsersResource; + + namespace clouduseraccounts { + interface AuditConfig { + /** + * Specifies the identities that are exempted from "data access" audit logging for the `service` specified above. Follows the same format of + * Binding.members. + */ + exemptedMembers?: string[]; + /** + * Specifies a service that will be enabled for "data access" audit logging. For example, `resourcemanager`, `storage`, `compute`. `allServices` is a + * special value that covers all services. + */ + service?: string; + } + interface AuthorizedKeysView { + /** [Output Only] The list of authorized public keys in SSH format. */ + keys?: string[]; + /** [Output Only] Whether the user has the ability to elevate on the instance that requested the authorized keys. */ + sudoer?: boolean; + } + interface Binding { + /** + * Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values: + * + * * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. + * + * * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. + * + * * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`. + * + * * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. + * + * * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. + * + * * `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`. + */ + members?: string[]; + /** Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. */ + role?: string; + } + interface Condition { + /** Trusted attributes supplied by the IAM system. */ + iam?: string; + /** An operator to apply the subject with. */ + op?: string; + /** Trusted attributes discharged by the service. */ + svc?: string; + /** Trusted attributes supplied by any service that owns resources and uses the IAM system for access control. */ + sys?: string; + /** The object of the condition. Exactly one of these must be set. */ + value?: string; + /** The objects of the condition. This is mutually exclusive with 'value'. */ + values?: string[]; + } + interface Group { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional textual description of the resource; provided by the client when the resource is created. */ + description?: string; + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always clouduseraccounts#group for groups. */ + kind?: string; + /** [Output Only] A list of URLs to User resources who belong to the group. Users may only be members of groups in the same project. */ + members?: string[]; + /** Name of the resource; provided by the client when the resource is created. */ + name?: string; + /** [Output Only] Server defined URL for the resource. */ + selfLink?: string; + } + interface GroupList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** [Output Only] A list of Group resources. */ + items?: Group[]; + /** [Output Only] Type of resource. Always clouduseraccounts#groupList for lists of groups. */ + kind?: string; + /** [Output Only] A token used to continue a truncated list request. */ + nextPageToken?: string; + /** [Output Only] Server defined URL for this resource. */ + selfLink?: string; + } + interface GroupsAddMemberRequest { + /** Fully-qualified URLs of the User resources to add. */ + users?: string[]; + } + interface GroupsRemoveMemberRequest { + /** Fully-qualified URLs of the User resources to remove. */ + users?: string[]; + } + interface LinuxAccountViews { + /** [Output Only] A list of all groups within a project. */ + groupViews?: LinuxGroupView[]; + /** [Output Only] Type of the resource. Always clouduseraccounts#linuxAccountViews for Linux resources. */ + kind?: string; + /** [Output Only] A list of all users within a project. */ + userViews?: LinuxUserView[]; + } + interface LinuxGetAuthorizedKeysViewResponse { + /** [Output Only] A list of authorized public keys for a user. */ + resource?: AuthorizedKeysView; + } + interface LinuxGetLinuxAccountViewsResponse { + /** [Output Only] A list of authorized user accounts and groups. */ + resource?: LinuxAccountViews; + } + interface LinuxGroupView { + /** [Output Only] The Group ID. */ + gid?: number; + /** [Output Only] Group name. */ + groupName?: string; + /** [Output Only] List of user accounts that belong to the group. */ + members?: string[]; + } + interface LinuxUserView { + /** [Output Only] The GECOS (user information) entry for this account. */ + gecos?: string; + /** [Output Only] User's default group ID. */ + gid?: number; + /** [Output Only] The path to the home directory for this account. */ + homeDirectory?: string; + /** [Output Only] The path to the login shell for this account. */ + shell?: string; + /** [Output Only] User ID. */ + uid?: number; + /** [Output Only] The username of the account. */ + username?: string; + } + interface LogConfig { + /** Counter options. */ + counter?: LogConfigCounterOptions; + } + interface LogConfigCounterOptions { + /** The field value to attribute. */ + field?: string; + /** The metric to update. */ + metric?: string; + } + interface Operation { + /** [Output Only] Reserved for future use. */ + clientOperationId?: string; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** [Output Only] A textual description of the operation, which is set when the operation is created. */ + description?: string; + /** [Output Only] The time that this operation was completed. This value is in RFC3339 text format. */ + endTime?: string; + /** [Output Only] If errors are generated during processing of the operation, this field will be populated. */ + error?: { + /** [Output Only] The array of errors encountered while processing this operation. */ + errors?: Array<{ + /** [Output Only] The error type identifier for this error. */ + code?: string; + /** [Output Only] Indicates the field in the request that caused the error. This property is optional. */ + location?: string; + /** [Output Only] An optional, human-readable error message. */ + message?: string; + }>; + }; + /** [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. */ + httpErrorMessage?: string; + /** + * [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a 404 means the resource was not + * found. + */ + httpErrorStatusCode?: number; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] The time that this operation was requested. This value is in RFC3339 text format. */ + insertTime?: string; + /** [Output Only] Type of the resource. Always compute#operation for Operation resources. */ + kind?: string; + /** [Output Only] Name of the resource. */ + name?: string; + /** [Output Only] The type of operation, such as insert, update, or delete, and so on. */ + operationType?: string; + /** + * [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of + * operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation + * progresses. + */ + progress?: number; + /** [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. */ + region?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. */ + startTime?: string; + /** [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. */ + status?: string; + /** [Output Only] An optional textual description of the current status of the operation. */ + statusMessage?: string; + /** [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. */ + targetId?: string; + /** [Output Only] The URL of the resource that the operation modifies. */ + targetLink?: string; + /** [Output Only] User who requested the operation, for example: user@example.com. */ + user?: string; + /** [Output Only] If warning messages are generated during processing of the operation, this field will be populated. */ + warnings?: Array<{ + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }>; + /** [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations. */ + zone?: string; + } + interface OperationList { + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] A list of Operation resources. */ + items?: Operation[]; + /** [Output Only] Type of resource. Always compute#operations for Operations resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + } + interface Policy { + /** + * Specifies audit logging configs for "data access". "data access": generally refers to data reads/writes and admin reads. "admin activity": generally + * refers to admin writes. + * + * Note: `AuditConfig` doesn't apply to "admin activity", which always enables audit logging. + */ + auditConfigs?: AuditConfig[]; + /** + * Associates a list of `members` to a `role`. Multiple `bindings` must not be specified for the same `role`. `bindings` with no members will result in an + * error. + */ + bindings?: Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly + * suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is + * returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will + * be applied to the same version of the policy. + * + * If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly. + */ + etag?: string; + iamOwned?: boolean; + /** + * If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any + * DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any + * ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no + * rule applies, permission is denied. + */ + rules?: Rule[]; + /** Version of the `Policy`. The default version is 0. */ + version?: number; + } + interface PublicKey { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional textual description of the resource; provided by the client when the resource is created. */ + description?: string; + /** Optional expiration timestamp. If provided, the timestamp must be in RFC3339 text format. If not provided, the public key never expires. */ + expirationTimestamp?: string; + /** [Output Only] The fingerprint of the key is defined by RFC4716 to be the MD5 digest of the public key. */ + fingerprint?: string; + /** Public key text in SSH format, defined by RFC4253 section 6.6. */ + key?: string; + } + interface Rule { + /** Required */ + action?: string; + /** Additional restrictions that must be met */ + conditions?: Condition[]; + /** Human-readable description of the rule. */ + description?: string; + /** The rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in this set of entries. */ + ins?: string[]; + /** The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action. */ + logConfigs?: LogConfig[]; + /** The rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is not in this set of entries. */ + notIns?: string[]; + /** + * A permission is a string of form '..' (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, and a verb part of '*' (e.g., + * 'storage.buckets.*') matches all verbs. + */ + permissions?: string[]; + } + interface TestPermissionsRequest { + /** The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. */ + permissions?: string[]; + } + interface TestPermissionsResponse { + /** A subset of `TestPermissionsRequest.permissions` that the caller is allowed. */ + permissions?: string[]; + } + interface User { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional textual description of the resource; provided by the client when the resource is created. */ + description?: string; + /** [Output Only] A list of URLs to Group resources who contain the user. Users are only members of groups in the same project. */ + groups?: string[]; + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always clouduseraccounts#user for users. */ + kind?: string; + /** Name of the resource; provided by the client when the resource is created. */ + name?: string; + /** + * Email address of account's owner. This account will be validated to make sure it exists. The email can belong to any domain, but it must be tied to a + * Google account. + */ + owner?: string; + /** [Output Only] Public keys that this user may use to login. */ + publicKeys?: PublicKey[]; + /** [Output Only] Server defined URL for the resource. */ + selfLink?: string; + } + interface UserList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** [Output Only] A list of User resources. */ + items?: User[]; + /** [Output Only] Type of resource. Always clouduseraccounts#userList for lists of users. */ + kind?: string; + /** [Output Only] A token used to continue a truncated list request. */ + nextPageToken?: string; + /** [Output Only] Server defined URL for this resource. */ + selfLink?: string; + } + interface GlobalAccountsOperationsResource { + /** Deletes the specified operation resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Name of the Operations resource to delete. */ + operation: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the specified operation resource. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Name of the Operations resource to return. */ + operation: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of operation resources contained within the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name + * comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance. + * + * Compute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances + * that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to + * organize and filter results based on label values. + * + * The Beta API also supports filtering on multiple expressions by providing each separate expression within parentheses. For example, + * (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match + * all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface GroupsResource { + /** Adds users to the specified group. */ + addMember(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the group for this request. */ + groupName: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified Group resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the Group resource to delete. */ + groupName: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified Group resource. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the Group resource to return. */ + groupName: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets the access control policy for a resource. May be empty if no such policy or resource exists. */ + getIamPolicy(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a Group resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of groups contained within the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name + * comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance. + * + * Compute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances + * that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to + * organize and filter results based on label values. + * + * The Beta API also supports filtering on multiple expressions by providing each separate expression within parentheses. For example, + * (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match + * all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Removes users from the specified group. */ + removeMember(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the group for this request. */ + groupName: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Sets the access control policy on the specified resource. Replaces any existing policy. */ + setIamPolicy(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns permissions that a caller has on the specified resource. */ + testIamPermissions(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface LinuxResource { + /** Returns a list of authorized public keys for a specific user account. */ + getAuthorizedKeysView(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The fully-qualified URL of the virtual machine requesting the view. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Whether the view was requested as part of a user-initiated login. */ + login?: boolean; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The user account for which you want to get a list of authorized public keys. */ + user: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone for this request. */ + zone: string; + }): Request; + /** Retrieves a list of user accounts for an instance within a specific project. */ + getLinuxAccountViews(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name + * comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance. + * + * Compute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances + * that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to + * organize and filter results based on label values. + * + * The Beta API also supports filtering on multiple expressions by providing each separate expression within parentheses. For example, + * (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match + * all expressions to pass the filters. + */ + filter?: string; + /** The fully-qualified URL of the virtual machine requesting the views. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone for this request. */ + zone: string; + }): Request; + } + interface UsersResource { + /** Adds a public key to the specified User resource with the data included in the request. */ + addPublicKey(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the user for this request. */ + user: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified User resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the user resource to delete. */ + user: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified User resource. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the user resource to return. */ + user: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets the access control policy for a resource. May be empty if no such policy or resource exists. */ + getIamPolicy(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a User resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of users contained within the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name + * comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance. + * + * Compute Engine Beta API Only: If you use filtering in the Beta API, you can also filter on nested fields. For example, you could filter on instances + * that have set the scheduling.automaticRestart field to true. In particular, use filtering on nested fields to take advantage of instance labels to + * organize and filter results based on label values. + * + * The Beta API also supports filtering on multiple expressions by providing each separate expression within parentheses. For example, + * (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match + * all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Removes the specified public key from the user. */ + removePublicKey(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * The fingerprint of the public key to delete. Public keys are identified by their fingerprint, which is defined by RFC4716 to be the MD5 digest of the + * public key. + */ + fingerprint: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the user for this request. */ + user: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Sets the access control policy on the specified resource. Replaces any existing policy. */ + setIamPolicy(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns permissions that a caller has on the specified resource. */ + testIamPermissions(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.clouduseraccounts/readme.md b/types/gapi.client.clouduseraccounts/readme.md new file mode 100644 index 0000000000..fb442397ca --- /dev/null +++ b/types/gapi.client.clouduseraccounts/readme.md @@ -0,0 +1,178 @@ +# TypeScript typings for Cloud User Accounts API vm_alpha +Creates and manages users and groups for accessing Google Compute Engine virtual machines. +For detailed description please check [documentation](https://cloud.google.com/compute/docs/access/user-accounts/api/latest/). + +## Installing + +Install typings for Cloud User Accounts API: +``` +npm install @types/gapi.client.clouduseraccounts@vm_alpha --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('clouduseraccounts', 'vm_alpha', () => { + // now we can use gapi.client.clouduseraccounts + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform.read-only', + + // Manage your Google Cloud User Accounts + 'https://www.googleapis.com/auth/cloud.useraccounts', + + // View your Google Cloud User Accounts + 'https://www.googleapis.com/auth/cloud.useraccounts.readonly', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Cloud User Accounts API resources: + +```typescript + +/* +Deletes the specified operation resource. +*/ +await gapi.client.globalAccountsOperations.delete({ operation: "operation", project: "project", }); + +/* +Retrieves the specified operation resource. +*/ +await gapi.client.globalAccountsOperations.get({ operation: "operation", project: "project", }); + +/* +Retrieves the list of operation resources contained within the specified project. +*/ +await gapi.client.globalAccountsOperations.list({ project: "project", }); + +/* +Adds users to the specified group. +*/ +await gapi.client.groups.addMember({ groupName: "groupName", project: "project", }); + +/* +Deletes the specified Group resource. +*/ +await gapi.client.groups.delete({ groupName: "groupName", project: "project", }); + +/* +Returns the specified Group resource. +*/ +await gapi.client.groups.get({ groupName: "groupName", project: "project", }); + +/* +Gets the access control policy for a resource. May be empty if no such policy or resource exists. +*/ +await gapi.client.groups.getIamPolicy({ project: "project", resource: "resource", }); + +/* +Creates a Group resource in the specified project using the data included in the request. +*/ +await gapi.client.groups.insert({ project: "project", }); + +/* +Retrieves the list of groups contained within the specified project. +*/ +await gapi.client.groups.list({ project: "project", }); + +/* +Removes users from the specified group. +*/ +await gapi.client.groups.removeMember({ groupName: "groupName", project: "project", }); + +/* +Sets the access control policy on the specified resource. Replaces any existing policy. +*/ +await gapi.client.groups.setIamPolicy({ project: "project", resource: "resource", }); + +/* +Returns permissions that a caller has on the specified resource. +*/ +await gapi.client.groups.testIamPermissions({ project: "project", resource: "resource", }); + +/* +Returns a list of authorized public keys for a specific user account. +*/ +await gapi.client.linux.getAuthorizedKeysView({ instance: "instance", project: "project", user: "user", zone: "zone", }); + +/* +Retrieves a list of user accounts for an instance within a specific project. +*/ +await gapi.client.linux.getLinuxAccountViews({ instance: "instance", project: "project", zone: "zone", }); + +/* +Adds a public key to the specified User resource with the data included in the request. +*/ +await gapi.client.users.addPublicKey({ project: "project", user: "user", }); + +/* +Deletes the specified User resource. +*/ +await gapi.client.users.delete({ project: "project", user: "user", }); + +/* +Returns the specified User resource. +*/ +await gapi.client.users.get({ project: "project", user: "user", }); + +/* +Gets the access control policy for a resource. May be empty if no such policy or resource exists. +*/ +await gapi.client.users.getIamPolicy({ project: "project", resource: "resource", }); + +/* +Creates a User resource in the specified project using the data included in the request. +*/ +await gapi.client.users.insert({ project: "project", }); + +/* +Retrieves a list of users contained within the specified project. +*/ +await gapi.client.users.list({ project: "project", }); + +/* +Removes the specified public key from the user. +*/ +await gapi.client.users.removePublicKey({ fingerprint: "fingerprint", project: "project", user: "user", }); + +/* +Sets the access control policy on the specified resource. Replaces any existing policy. +*/ +await gapi.client.users.setIamPolicy({ project: "project", resource: "resource", }); + +/* +Returns permissions that a caller has on the specified resource. +*/ +await gapi.client.users.testIamPermissions({ project: "project", resource: "resource", }); +``` \ No newline at end of file diff --git a/types/gapi.client.clouduseraccounts/tsconfig.json b/types/gapi.client.clouduseraccounts/tsconfig.json new file mode 100644 index 0000000000..a6e3b9ffec --- /dev/null +++ b/types/gapi.client.clouduseraccounts/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.clouduseraccounts-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.clouduseraccounts/tslint.json b/types/gapi.client.clouduseraccounts/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.clouduseraccounts/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.compute/gapi.client.compute-tests.ts b/types/gapi.client.compute/gapi.client.compute-tests.ts new file mode 100644 index 0000000000..7ebfeccdcd --- /dev/null +++ b/types/gapi.client.compute/gapi.client.compute-tests.ts @@ -0,0 +1,2184 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('compute', 'v1', () => { + /** now we can use gapi.client.compute */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View and manage your Google Compute Engine resources */ + 'https://www.googleapis.com/auth/compute', + /** View your Google Compute Engine resources */ + 'https://www.googleapis.com/auth/compute.readonly', + /** Manage your data and permissions in Google Cloud Storage */ + 'https://www.googleapis.com/auth/devstorage.full_control', + /** View your data in Google Cloud Storage */ + 'https://www.googleapis.com/auth/devstorage.read_only', + /** Manage your data in Google Cloud Storage */ + 'https://www.googleapis.com/auth/devstorage.read_write', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Retrieves an aggregated list of accelerator types. */ + await gapi.client.acceleratorTypes.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Returns the specified accelerator type. Get a list of available accelerator types by making a list() request. */ + await gapi.client.acceleratorTypes.get({ + acceleratorType: "acceleratorType", + project: "project", + zone: "zone", + }); + /** Retrieves a list of accelerator types available to the specified project. */ + await gapi.client.acceleratorTypes.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** Retrieves an aggregated list of addresses. */ + await gapi.client.addresses.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified address resource. */ + await gapi.client.addresses.delete({ + address: "address", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Returns the specified address resource. */ + await gapi.client.addresses.get({ + address: "address", + project: "project", + region: "region", + }); + /** Creates an address resource in the specified project using the data included in the request. */ + await gapi.client.addresses.insert({ + project: "project", + region: "region", + requestId: "requestId", + }); + /** Retrieves a list of addresses contained within the specified region. */ + await gapi.client.addresses.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** Retrieves an aggregated list of autoscalers. */ + await gapi.client.autoscalers.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified autoscaler. */ + await gapi.client.autoscalers.delete({ + autoscaler: "autoscaler", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Returns the specified autoscaler resource. Get a list of available autoscalers by making a list() request. */ + await gapi.client.autoscalers.get({ + autoscaler: "autoscaler", + project: "project", + zone: "zone", + }); + /** Creates an autoscaler in the specified project using the data included in the request. */ + await gapi.client.autoscalers.insert({ + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Retrieves a list of autoscalers contained within the specified zone. */ + await gapi.client.autoscalers.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** + * Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge + * patch format and processing rules. + */ + await gapi.client.autoscalers.patch({ + autoscaler: "autoscaler", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Updates an autoscaler in the specified project using the data included in the request. */ + await gapi.client.autoscalers.update({ + autoscaler: "autoscaler", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Deletes the specified BackendBucket resource. */ + await gapi.client.backendBuckets.delete({ + backendBucket: "backendBucket", + project: "project", + requestId: "requestId", + }); + /** Returns the specified BackendBucket resource. Get a list of available backend buckets by making a list() request. */ + await gapi.client.backendBuckets.get({ + backendBucket: "backendBucket", + project: "project", + }); + /** Creates a BackendBucket resource in the specified project using the data included in the request. */ + await gapi.client.backendBuckets.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of BackendBucket resources available to the specified project. */ + await gapi.client.backendBuckets.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** + * Updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch + * format and processing rules. + */ + await gapi.client.backendBuckets.patch({ + backendBucket: "backendBucket", + project: "project", + requestId: "requestId", + }); + /** Updates the specified BackendBucket resource with the data included in the request. */ + await gapi.client.backendBuckets.update({ + backendBucket: "backendBucket", + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of all BackendService resources, regional and global, available to the specified project. */ + await gapi.client.backendServices.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified BackendService resource. */ + await gapi.client.backendServices.delete({ + backendService: "backendService", + project: "project", + requestId: "requestId", + }); + /** Returns the specified BackendService resource. Get a list of available backend services by making a list() request. */ + await gapi.client.backendServices.get({ + backendService: "backendService", + project: "project", + }); + /** Gets the most recent health check results for this BackendService. */ + await gapi.client.backendServices.getHealth({ + backendService: "backendService", + project: "project", + }); + /** + * Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to + * keep in mind when creating a backend service. Read Restrictions and Guidelines for more information. + */ + await gapi.client.backendServices.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of BackendService resources available to the specified project. */ + await gapi.client.backendServices.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** + * Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when + * updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch + * format and processing rules. + */ + await gapi.client.backendServices.patch({ + backendService: "backendService", + project: "project", + requestId: "requestId", + }); + /** + * Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when + * updating a backend service. Read Restrictions and Guidelines for more information. + */ + await gapi.client.backendServices.update({ + backendService: "backendService", + project: "project", + requestId: "requestId", + }); + /** Retrieves an aggregated list of disk types. */ + await gapi.client.diskTypes.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Returns the specified disk type. Get a list of available disk types by making a list() request. */ + await gapi.client.diskTypes.get({ + diskType: "diskType", + project: "project", + zone: "zone", + }); + /** Retrieves a list of disk types available to the specified project. */ + await gapi.client.diskTypes.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** Retrieves an aggregated list of persistent disks. */ + await gapi.client.disks.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Creates a snapshot of a specified persistent disk. */ + await gapi.client.disks.createSnapshot({ + disk: "disk", + guestFlush: true, + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** + * Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any + * snapshots previously made from the disk. You must separately delete snapshots. + */ + await gapi.client.disks.delete({ + disk: "disk", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Returns a specified persistent disk. Get a list of available persistent disks by making a list() request. */ + await gapi.client.disks.get({ + disk: "disk", + project: "project", + zone: "zone", + }); + /** + * Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, or create + * an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb + * property. + */ + await gapi.client.disks.insert({ + project: "project", + requestId: "requestId", + sourceImage: "sourceImage", + zone: "zone", + }); + /** Retrieves a list of persistent disks contained within the specified zone. */ + await gapi.client.disks.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** Resizes the specified persistent disk. */ + await gapi.client.disks.resize({ + disk: "disk", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. */ + await gapi.client.disks.setLabels({ + project: "project", + requestId: "requestId", + resource: "resource", + zone: "zone", + }); + /** Deletes the specified firewall. */ + await gapi.client.firewalls.delete({ + firewall: "firewall", + project: "project", + requestId: "requestId", + }); + /** Returns the specified firewall. */ + await gapi.client.firewalls.get({ + firewall: "firewall", + project: "project", + }); + /** Creates a firewall rule in the specified project using the data included in the request. */ + await gapi.client.firewalls.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of firewall rules available to the specified project. */ + await gapi.client.firewalls.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** + * Updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format + * and processing rules. + */ + await gapi.client.firewalls.patch({ + firewall: "firewall", + project: "project", + requestId: "requestId", + }); + /** + * Updates the specified firewall rule with the data included in the request. Using PUT method, can only update following fields of firewall rule: + * allowed, description, sourceRanges, sourceTags, targetTags. + */ + await gapi.client.firewalls.update({ + firewall: "firewall", + project: "project", + requestId: "requestId", + }); + /** Retrieves an aggregated list of forwarding rules. */ + await gapi.client.forwardingRules.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified ForwardingRule resource. */ + await gapi.client.forwardingRules.delete({ + forwardingRule: "forwardingRule", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Returns the specified ForwardingRule resource. */ + await gapi.client.forwardingRules.get({ + forwardingRule: "forwardingRule", + project: "project", + region: "region", + }); + /** Creates a ForwardingRule resource in the specified project and region using the data included in the request. */ + await gapi.client.forwardingRules.insert({ + project: "project", + region: "region", + requestId: "requestId", + }); + /** Retrieves a list of ForwardingRule resources available to the specified project and region. */ + await gapi.client.forwardingRules.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** Changes target URL for forwarding rule. The new target should be of the same type as the old target. */ + await gapi.client.forwardingRules.setTarget({ + forwardingRule: "forwardingRule", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Deletes the specified address resource. */ + await gapi.client.globalAddresses.delete({ + address: "address", + project: "project", + requestId: "requestId", + }); + /** Returns the specified address resource. Get a list of available addresses by making a list() request. */ + await gapi.client.globalAddresses.get({ + address: "address", + project: "project", + }); + /** Creates an address resource in the specified project using the data included in the request. */ + await gapi.client.globalAddresses.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves a list of global addresses. */ + await gapi.client.globalAddresses.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified GlobalForwardingRule resource. */ + await gapi.client.globalForwardingRules.delete({ + forwardingRule: "forwardingRule", + project: "project", + requestId: "requestId", + }); + /** Returns the specified GlobalForwardingRule resource. Get a list of available forwarding rules by making a list() request. */ + await gapi.client.globalForwardingRules.get({ + forwardingRule: "forwardingRule", + project: "project", + }); + /** Creates a GlobalForwardingRule resource in the specified project using the data included in the request. */ + await gapi.client.globalForwardingRules.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves a list of GlobalForwardingRule resources available to the specified project. */ + await gapi.client.globalForwardingRules.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target. */ + await gapi.client.globalForwardingRules.setTarget({ + forwardingRule: "forwardingRule", + project: "project", + requestId: "requestId", + }); + /** Retrieves an aggregated list of all operations. */ + await gapi.client.globalOperations.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified Operations resource. */ + await gapi.client.globalOperations.delete({ + operation: "operation", + project: "project", + }); + /** Retrieves the specified Operations resource. Get a list of operations by making a list() request. */ + await gapi.client.globalOperations.get({ + operation: "operation", + project: "project", + }); + /** Retrieves a list of Operation resources contained within the specified project. */ + await gapi.client.globalOperations.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified HealthCheck resource. */ + await gapi.client.healthChecks.delete({ + healthCheck: "healthCheck", + project: "project", + requestId: "requestId", + }); + /** Returns the specified HealthCheck resource. Get a list of available health checks by making a list() request. */ + await gapi.client.healthChecks.get({ + healthCheck: "healthCheck", + project: "project", + }); + /** Creates a HealthCheck resource in the specified project using the data included in the request. */ + await gapi.client.healthChecks.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of HealthCheck resources available to the specified project. */ + await gapi.client.healthChecks.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** + * Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON + * merge patch format and processing rules. + */ + await gapi.client.healthChecks.patch({ + healthCheck: "healthCheck", + project: "project", + requestId: "requestId", + }); + /** Updates a HealthCheck resource in the specified project using the data included in the request. */ + await gapi.client.healthChecks.update({ + healthCheck: "healthCheck", + project: "project", + requestId: "requestId", + }); + /** Deletes the specified HttpHealthCheck resource. */ + await gapi.client.httpHealthChecks.delete({ + httpHealthCheck: "httpHealthCheck", + project: "project", + requestId: "requestId", + }); + /** Returns the specified HttpHealthCheck resource. Get a list of available HTTP health checks by making a list() request. */ + await gapi.client.httpHealthChecks.get({ + httpHealthCheck: "httpHealthCheck", + project: "project", + }); + /** Creates a HttpHealthCheck resource in the specified project using the data included in the request. */ + await gapi.client.httpHealthChecks.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of HttpHealthCheck resources available to the specified project. */ + await gapi.client.httpHealthChecks.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** + * Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the + * JSON merge patch format and processing rules. + */ + await gapi.client.httpHealthChecks.patch({ + httpHealthCheck: "httpHealthCheck", + project: "project", + requestId: "requestId", + }); + /** Updates a HttpHealthCheck resource in the specified project using the data included in the request. */ + await gapi.client.httpHealthChecks.update({ + httpHealthCheck: "httpHealthCheck", + project: "project", + requestId: "requestId", + }); + /** Deletes the specified HttpsHealthCheck resource. */ + await gapi.client.httpsHealthChecks.delete({ + httpsHealthCheck: "httpsHealthCheck", + project: "project", + requestId: "requestId", + }); + /** Returns the specified HttpsHealthCheck resource. Get a list of available HTTPS health checks by making a list() request. */ + await gapi.client.httpsHealthChecks.get({ + httpsHealthCheck: "httpsHealthCheck", + project: "project", + }); + /** Creates a HttpsHealthCheck resource in the specified project using the data included in the request. */ + await gapi.client.httpsHealthChecks.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of HttpsHealthCheck resources available to the specified project. */ + await gapi.client.httpsHealthChecks.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** + * Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the + * JSON merge patch format and processing rules. + */ + await gapi.client.httpsHealthChecks.patch({ + httpsHealthCheck: "httpsHealthCheck", + project: "project", + requestId: "requestId", + }); + /** Updates a HttpsHealthCheck resource in the specified project using the data included in the request. */ + await gapi.client.httpsHealthChecks.update({ + httpsHealthCheck: "httpsHealthCheck", + project: "project", + requestId: "requestId", + }); + /** Deletes the specified image. */ + await gapi.client.images.delete({ + image: "image", + project: "project", + requestId: "requestId", + }); + /** + * Sets the deprecation status of an image. + * + * If an empty request body is given, clears the deprecation status instead. + */ + await gapi.client.images.deprecate({ + image: "image", + project: "project", + requestId: "requestId", + }); + /** Returns the specified image. Get a list of available images by making a list() request. */ + await gapi.client.images.get({ + image: "image", + project: "project", + }); + /** Returns the latest image that is part of an image family and is not deprecated. */ + await gapi.client.images.getFromFamily({ + family: "family", + project: "project", + }); + /** Creates an image in the specified project using the data included in the request. */ + await gapi.client.images.insert({ + forceCreate: true, + project: "project", + requestId: "requestId", + }); + /** + * Retrieves the list of private images available to the specified project. Private images are images you create that belong to your project. This method + * does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of + * publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. + */ + await gapi.client.images.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation. */ + await gapi.client.images.setLabels({ + project: "project", + resource: "resource", + }); + /** + * Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it + * does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed + * instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have + * not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + */ + await gapi.client.instanceGroupManagers.abandonInstances({ + instanceGroupManager: "instanceGroupManager", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Retrieves the list of managed instance groups and groups them by zone. */ + await gapi.client.instanceGroupManagers.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** + * Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. + * Read Deleting an instance group for more information. + */ + await gapi.client.instanceGroupManagers.delete({ + instanceGroupManager: "instanceGroupManager", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** + * Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which + * they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is + * marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action + * with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + */ + await gapi.client.instanceGroupManagers.deleteInstances({ + instanceGroupManager: "instanceGroupManager", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Returns all of the details about the specified managed instance group. Get a list of available managed instance groups by making a list() request. */ + await gapi.client.instanceGroupManagers.get({ + instanceGroupManager: "instanceGroupManager", + project: "project", + zone: "zone", + }); + /** + * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create + * instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the + * group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. + * + * A managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit. + */ + await gapi.client.instanceGroupManagers.insert({ + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Retrieves a list of managed instance groups that are contained within the specified project and zone. */ + await gapi.client.instanceGroupManagers.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** + * Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed + * instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous + * action failed, the list displays the errors for that failed action. + */ + await gapi.client.instanceGroupManagers.listManagedInstances({ + filter: "filter", + instanceGroupManager: "instanceGroupManager", + maxResults: 3, + order_by: "order_by", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** + * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current + * instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been + * recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + */ + await gapi.client.instanceGroupManagers.recreateInstances({ + instanceGroupManager: "instanceGroupManager", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** + * Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the + * size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or + * deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + */ + await gapi.client.instanceGroupManagers.resize({ + instanceGroupManager: "instanceGroupManager", + project: "project", + requestId: "requestId", + size: 4, + zone: "zone", + }); + /** + * Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change + * unless you recreate them. + */ + await gapi.client.instanceGroupManagers.setInstanceTemplate({ + instanceGroupManager: "instanceGroupManager", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** + * Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the + * instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their + * target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group. + */ + await gapi.client.instanceGroupManagers.setTargetPools({ + instanceGroupManager: "instanceGroupManager", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** + * Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read + * Adding instances for more information. + */ + await gapi.client.instanceGroups.addInstances({ + instanceGroup: "instanceGroup", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Retrieves the list of instance groups and sorts them by zone. */ + await gapi.client.instanceGroups.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** + * Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read + * Deleting an instance group for more information. + */ + await gapi.client.instanceGroups.delete({ + instanceGroup: "instanceGroup", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Returns the specified instance group. Get a list of available instance groups by making a list() request. */ + await gapi.client.instanceGroups.get({ + instanceGroup: "instanceGroup", + project: "project", + zone: "zone", + }); + /** Creates an instance group in the specified project using the parameters that are included in the request. */ + await gapi.client.instanceGroups.insert({ + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Retrieves the list of instance groups that are located in the specified project and zone. */ + await gapi.client.instanceGroups.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** Lists the instances in the specified instance group. */ + await gapi.client.instanceGroups.listInstances({ + filter: "filter", + instanceGroup: "instanceGroup", + maxResults: 3, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** + * Removes one or more instances from the specified instance group, but does not delete those instances. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration + * before the VM instance is removed or deleted. + */ + await gapi.client.instanceGroups.removeInstances({ + instanceGroup: "instanceGroup", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Sets the named ports for the specified instance group. */ + await gapi.client.instanceGroups.setNamedPorts({ + instanceGroup: "instanceGroup", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** + * Deletes the specified instance template. If you delete an instance template that is being referenced from another instance group, the instance group + * will not be able to create or recreate virtual machine instances. Deleting an instance template is permanent and cannot be undone. + */ + await gapi.client.instanceTemplates.delete({ + instanceTemplate: "instanceTemplate", + project: "project", + requestId: "requestId", + }); + /** Returns the specified instance template. Get a list of available instance templates by making a list() request. */ + await gapi.client.instanceTemplates.get({ + instanceTemplate: "instanceTemplate", + project: "project", + }); + /** + * Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an + * existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template. + */ + await gapi.client.instanceTemplates.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves a list of instance templates that are contained within the specified project and zone. */ + await gapi.client.instanceTemplates.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Adds an access config to an instance's network interface. */ + await gapi.client.instances.addAccessConfig({ + instance: "instance", + networkInterface: "networkInterface", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Retrieves aggregated list of instances. */ + await gapi.client.instances.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** + * Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a + * disk at the same time. For more information, read Adding a persistent disk to your instance. + */ + await gapi.client.instances.attachDisk({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance. */ + await gapi.client.instances.delete({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Deletes an access config from an instance's network interface. */ + await gapi.client.instances.deleteAccessConfig({ + accessConfig: "accessConfig", + instance: "instance", + networkInterface: "networkInterface", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Detaches a disk from an instance. */ + await gapi.client.instances.detachDisk({ + deviceName: "deviceName", + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Returns the specified Instance resource. Get a list of available instances by making a list() request. */ + await gapi.client.instances.get({ + instance: "instance", + project: "project", + zone: "zone", + }); + /** Returns the specified instance's serial port output. */ + await gapi.client.instances.getSerialPortOutput({ + instance: "instance", + port: 2, + project: "project", + start: "start", + zone: "zone", + }); + /** Creates an instance resource in the specified project using the data included in the request. */ + await gapi.client.instances.insert({ + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Retrieves the list of instances contained within the specified zone. */ + await gapi.client.instances.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** Performs a reset on the instance. For more information, see Resetting an instance. */ + await gapi.client.instances.reset({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Sets the auto-delete flag for a disk attached to an instance. */ + await gapi.client.instances.setDiskAutoDelete({ + autoDelete: true, + deviceName: "deviceName", + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. */ + await gapi.client.instances.setLabels({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. */ + await gapi.client.instances.setMachineResources({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Changes the machine type for a stopped instance to the machine type specified in the request. */ + await gapi.client.instances.setMachineType({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Sets metadata for the specified instance to the data included in the request. */ + await gapi.client.instances.setMetadata({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** + * Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read + * Specifying a Minimum CPU Platform. + */ + await gapi.client.instances.setMinCpuPlatform({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Sets an instance's scheduling options. */ + await gapi.client.instances.setScheduling({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance. */ + await gapi.client.instances.setServiceAccount({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Sets tags for the specified instance to the data included in the request. */ + await gapi.client.instances.setTags({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. */ + await gapi.client.instances.start({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. */ + await gapi.client.instances.startWithEncryptionKey({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** + * Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, + * virtual machine usage charges while they are stopped, but any resources that the virtual machine is using, such as persistent disks and static IP + * addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance. + */ + await gapi.client.instances.stop({ + instance: "instance", + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Returns the specified License resource. */ + await gapi.client.licenses.get({ + license: "license", + project: "project", + }); + /** Retrieves an aggregated list of machine types. */ + await gapi.client.machineTypes.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Returns the specified machine type. Get a list of available machine types by making a list() request. */ + await gapi.client.machineTypes.get({ + machineType: "machineType", + project: "project", + zone: "zone", + }); + /** Retrieves a list of machine types available to the specified project. */ + await gapi.client.machineTypes.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** Adds a peering to the specified network. */ + await gapi.client.networks.addPeering({ + network: "network", + project: "project", + requestId: "requestId", + }); + /** Deletes the specified network. */ + await gapi.client.networks.delete({ + network: "network", + project: "project", + requestId: "requestId", + }); + /** Returns the specified network. Get a list of available networks by making a list() request. */ + await gapi.client.networks.get({ + network: "network", + project: "project", + }); + /** Creates a network in the specified project using the data included in the request. */ + await gapi.client.networks.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of networks available to the specified project. */ + await gapi.client.networks.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Patches the specified network with the data included in the request. */ + await gapi.client.networks.patch({ + network: "network", + project: "project", + requestId: "requestId", + }); + /** Removes a peering from the specified network. */ + await gapi.client.networks.removePeering({ + network: "network", + project: "project", + requestId: "requestId", + }); + /** Switches the network mode from auto subnet mode to custom subnet mode. */ + await gapi.client.networks.switchToCustomMode({ + network: "network", + project: "project", + requestId: "requestId", + }); + /** Disable this project as a shared VPC host project. */ + await gapi.client.projects.disableXpnHost({ + project: "project", + requestId: "requestId", + }); + /** Disable a serivce resource (a.k.a service project) associated with this host project. */ + await gapi.client.projects.disableXpnResource({ + project: "project", + requestId: "requestId", + }); + /** Enable this project as a shared VPC host project. */ + await gapi.client.projects.enableXpnHost({ + project: "project", + requestId: "requestId", + }); + /** + * Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service + * project. + */ + await gapi.client.projects.enableXpnResource({ + project: "project", + requestId: "requestId", + }); + /** Returns the specified Project resource. */ + await gapi.client.projects.get({ + project: "project", + }); + /** Get the shared VPC host project that this project links to. May be empty if no link exists. */ + await gapi.client.projects.getXpnHost({ + project: "project", + }); + /** Get service resources (a.k.a service project) associated with this host project. */ + await gapi.client.projects.getXpnResources({ + filter: "filter", + maxResults: 2, + order_by: "order_by", + pageToken: "pageToken", + project: "project", + }); + /** List all shared VPC host projects visible to the user in an organization. */ + await gapi.client.projects.listXpnHosts({ + filter: "filter", + maxResults: 2, + order_by: "order_by", + pageToken: "pageToken", + project: "project", + }); + /** Moves a persistent disk from one zone to another. */ + await gapi.client.projects.moveDisk({ + project: "project", + requestId: "requestId", + }); + /** Moves an instance and its attached persistent disks from one zone to another. */ + await gapi.client.projects.moveInstance({ + project: "project", + requestId: "requestId", + }); + /** Sets metadata common to all instances within the specified project using the data included in the request. */ + await gapi.client.projects.setCommonInstanceMetadata({ + project: "project", + requestId: "requestId", + }); + /** + * Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the + * usage export feature will be disabled. + */ + await gapi.client.projects.setUsageExportBucket({ + project: "project", + requestId: "requestId", + }); + /** Deletes the specified autoscaler. */ + await gapi.client.regionAutoscalers.delete({ + autoscaler: "autoscaler", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Returns the specified autoscaler. */ + await gapi.client.regionAutoscalers.get({ + autoscaler: "autoscaler", + project: "project", + region: "region", + }); + /** Creates an autoscaler in the specified project using the data included in the request. */ + await gapi.client.regionAutoscalers.insert({ + project: "project", + region: "region", + requestId: "requestId", + }); + /** Retrieves a list of autoscalers contained within the specified region. */ + await gapi.client.regionAutoscalers.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** + * Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge + * patch format and processing rules. + */ + await gapi.client.regionAutoscalers.patch({ + autoscaler: "autoscaler", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Updates an autoscaler in the specified project using the data included in the request. */ + await gapi.client.regionAutoscalers.update({ + autoscaler: "autoscaler", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Deletes the specified regional BackendService resource. */ + await gapi.client.regionBackendServices.delete({ + backendService: "backendService", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Returns the specified regional BackendService resource. */ + await gapi.client.regionBackendServices.get({ + backendService: "backendService", + project: "project", + region: "region", + }); + /** Gets the most recent health check results for this regional BackendService. */ + await gapi.client.regionBackendServices.getHealth({ + backendService: "backendService", + project: "project", + region: "region", + }); + /** + * Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and + * guidelines to keep in mind when creating a regional backend service. Read Restrictions and Guidelines for more information. + */ + await gapi.client.regionBackendServices.insert({ + project: "project", + region: "region", + requestId: "requestId", + }); + /** Retrieves the list of regional BackendService resources available to the specified project in the given region. */ + await gapi.client.regionBackendServices.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** + * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in + * mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON + * merge patch format and processing rules. + */ + await gapi.client.regionBackendServices.patch({ + backendService: "backendService", + project: "project", + region: "region", + requestId: "requestId", + }); + /** + * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in + * mind when updating a backend service. Read Restrictions and Guidelines for more information. + */ + await gapi.client.regionBackendServices.update({ + backendService: "backendService", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Retrieves an aggregated list of commitments. */ + await gapi.client.regionCommitments.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Returns the specified commitment resource. Get a list of available commitments by making a list() request. */ + await gapi.client.regionCommitments.get({ + commitment: "commitment", + project: "project", + region: "region", + }); + /** Creates a commitment in the specified project using the data included in the request. */ + await gapi.client.regionCommitments.insert({ + project: "project", + region: "region", + requestId: "requestId", + }); + /** Retrieves a list of commitments contained within the specified region. */ + await gapi.client.regionCommitments.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** + * Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it + * does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed + * instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have + * not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + */ + await gapi.client.regionInstanceGroupManagers.abandonInstances({ + instanceGroupManager: "instanceGroupManager", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Deletes the specified managed instance group and all of the instances in that group. */ + await gapi.client.regionInstanceGroupManagers.delete({ + instanceGroupManager: "instanceGroupManager", + project: "project", + region: "region", + requestId: "requestId", + }); + /** + * Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which + * they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is + * marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action + * with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + */ + await gapi.client.regionInstanceGroupManagers.deleteInstances({ + instanceGroupManager: "instanceGroupManager", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Returns all of the details about the specified managed instance group. */ + await gapi.client.regionInstanceGroupManagers.get({ + instanceGroupManager: "instanceGroupManager", + project: "project", + region: "region", + }); + /** + * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create + * instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the + * group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. + * + * A regional managed instance group can contain up to 2000 instances. + */ + await gapi.client.regionInstanceGroupManagers.insert({ + project: "project", + region: "region", + requestId: "requestId", + }); + /** Retrieves the list of managed instance groups that are contained within the specified region. */ + await gapi.client.regionInstanceGroupManagers.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** + * Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group + * has scheduled for its instances. + */ + await gapi.client.regionInstanceGroupManagers.listManagedInstances({ + filter: "filter", + instanceGroupManager: "instanceGroupManager", + maxResults: 3, + order_by: "order_by", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** + * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current + * instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been + * recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + */ + await gapi.client.regionInstanceGroupManagers.recreateInstances({ + instanceGroupManager: "instanceGroupManager", + project: "project", + region: "region", + requestId: "requestId", + }); + /** + * Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the + * current instance template. If you decrease the size, the group schedules delete actions on one or more instances. The resize operation is marked DONE + * when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the + * creating or deleting actions with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + */ + await gapi.client.regionInstanceGroupManagers.resize({ + instanceGroupManager: "instanceGroupManager", + project: "project", + region: "region", + requestId: "requestId", + size: 5, + }); + /** Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. */ + await gapi.client.regionInstanceGroupManagers.setInstanceTemplate({ + instanceGroupManager: "instanceGroupManager", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. */ + await gapi.client.regionInstanceGroupManagers.setTargetPools({ + instanceGroupManager: "instanceGroupManager", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Returns the specified instance group resource. */ + await gapi.client.regionInstanceGroups.get({ + instanceGroup: "instanceGroup", + project: "project", + region: "region", + }); + /** Retrieves the list of instance group resources contained within the specified region. */ + await gapi.client.regionInstanceGroups.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** + * Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can + * list all instances or only the instances that are running. + */ + await gapi.client.regionInstanceGroups.listInstances({ + filter: "filter", + instanceGroup: "instanceGroup", + maxResults: 3, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** Sets the named ports for the specified regional instance group. */ + await gapi.client.regionInstanceGroups.setNamedPorts({ + instanceGroup: "instanceGroup", + project: "project", + region: "region", + requestId: "requestId", + }); + /** Deletes the specified region-specific Operations resource. */ + await gapi.client.regionOperations.delete({ + operation: "operation", + project: "project", + region: "region", + }); + /** Retrieves the specified region-specific Operations resource. */ + await gapi.client.regionOperations.get({ + operation: "operation", + project: "project", + region: "region", + }); + /** Retrieves a list of Operation resources contained within the specified region. */ + await gapi.client.regionOperations.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** Returns the specified Region resource. Get a list of available regions by making a list() request. */ + await gapi.client.regions.get({ + project: "project", + region: "region", + }); + /** Retrieves the list of region resources available to the specified project. */ + await gapi.client.regions.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Retrieves an aggregated list of routers. */ + await gapi.client.routers.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified Router resource. */ + await gapi.client.routers.delete({ + project: "project", + region: "region", + requestId: "requestId", + router: "router", + }); + /** Returns the specified Router resource. Get a list of available routers by making a list() request. */ + await gapi.client.routers.get({ + project: "project", + region: "region", + router: "router", + }); + /** Retrieves runtime information of the specified router. */ + await gapi.client.routers.getRouterStatus({ + project: "project", + region: "region", + router: "router", + }); + /** Creates a Router resource in the specified project and region using the data included in the request. */ + await gapi.client.routers.insert({ + project: "project", + region: "region", + requestId: "requestId", + }); + /** Retrieves a list of Router resources available to the specified project. */ + await gapi.client.routers.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** + * Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and + * processing rules. + */ + await gapi.client.routers.patch({ + project: "project", + region: "region", + requestId: "requestId", + router: "router", + }); + /** Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router. */ + await gapi.client.routers.preview({ + project: "project", + region: "region", + router: "router", + }); + /** Updates the specified Router resource with the data included in the request. */ + await gapi.client.routers.update({ + project: "project", + region: "region", + requestId: "requestId", + router: "router", + }); + /** Deletes the specified Route resource. */ + await gapi.client.routes.delete({ + project: "project", + requestId: "requestId", + route: "route", + }); + /** Returns the specified Route resource. Get a list of available routes by making a list() request. */ + await gapi.client.routes.get({ + project: "project", + route: "route", + }); + /** Creates a Route resource in the specified project using the data included in the request. */ + await gapi.client.routes.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of Route resources available to the specified project. */ + await gapi.client.routes.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** + * Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If + * any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. + * + * For more information, see Deleting snaphots. + */ + await gapi.client.snapshots.delete({ + project: "project", + requestId: "requestId", + snapshot: "snapshot", + }); + /** Returns the specified Snapshot resource. Get a list of available snapshots by making a list() request. */ + await gapi.client.snapshots.get({ + project: "project", + snapshot: "snapshot", + }); + /** Retrieves the list of Snapshot resources contained within the specified project. */ + await gapi.client.snapshots.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation. */ + await gapi.client.snapshots.setLabels({ + project: "project", + resource: "resource", + }); + /** Deletes the specified SslCertificate resource. */ + await gapi.client.sslCertificates.delete({ + project: "project", + requestId: "requestId", + sslCertificate: "sslCertificate", + }); + /** Returns the specified SslCertificate resource. Get a list of available SSL certificates by making a list() request. */ + await gapi.client.sslCertificates.get({ + project: "project", + sslCertificate: "sslCertificate", + }); + /** Creates a SslCertificate resource in the specified project using the data included in the request. */ + await gapi.client.sslCertificates.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of SslCertificate resources available to the specified project. */ + await gapi.client.sslCertificates.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Retrieves an aggregated list of subnetworks. */ + await gapi.client.subnetworks.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified subnetwork. */ + await gapi.client.subnetworks.delete({ + project: "project", + region: "region", + requestId: "requestId", + subnetwork: "subnetwork", + }); + /** Expands the IP CIDR range of the subnetwork to a specified value. */ + await gapi.client.subnetworks.expandIpCidrRange({ + project: "project", + region: "region", + requestId: "requestId", + subnetwork: "subnetwork", + }); + /** Returns the specified subnetwork. Get a list of available subnetworks list() request. */ + await gapi.client.subnetworks.get({ + project: "project", + region: "region", + subnetwork: "subnetwork", + }); + /** Creates a subnetwork in the specified project using the data included in the request. */ + await gapi.client.subnetworks.insert({ + project: "project", + region: "region", + requestId: "requestId", + }); + /** Retrieves a list of subnetworks available to the specified project. */ + await gapi.client.subnetworks.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access. */ + await gapi.client.subnetworks.setPrivateIpGoogleAccess({ + project: "project", + region: "region", + requestId: "requestId", + subnetwork: "subnetwork", + }); + /** Deletes the specified TargetHttpProxy resource. */ + await gapi.client.targetHttpProxies.delete({ + project: "project", + requestId: "requestId", + targetHttpProxy: "targetHttpProxy", + }); + /** Returns the specified TargetHttpProxy resource. Get a list of available target HTTP proxies by making a list() request. */ + await gapi.client.targetHttpProxies.get({ + project: "project", + targetHttpProxy: "targetHttpProxy", + }); + /** Creates a TargetHttpProxy resource in the specified project using the data included in the request. */ + await gapi.client.targetHttpProxies.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of TargetHttpProxy resources available to the specified project. */ + await gapi.client.targetHttpProxies.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Changes the URL map for TargetHttpProxy. */ + await gapi.client.targetHttpProxies.setUrlMap({ + project: "project", + requestId: "requestId", + targetHttpProxy: "targetHttpProxy", + }); + /** Deletes the specified TargetHttpsProxy resource. */ + await gapi.client.targetHttpsProxies.delete({ + project: "project", + requestId: "requestId", + targetHttpsProxy: "targetHttpsProxy", + }); + /** Returns the specified TargetHttpsProxy resource. Get a list of available target HTTPS proxies by making a list() request. */ + await gapi.client.targetHttpsProxies.get({ + project: "project", + targetHttpsProxy: "targetHttpsProxy", + }); + /** Creates a TargetHttpsProxy resource in the specified project using the data included in the request. */ + await gapi.client.targetHttpsProxies.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of TargetHttpsProxy resources available to the specified project. */ + await gapi.client.targetHttpsProxies.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Replaces SslCertificates for TargetHttpsProxy. */ + await gapi.client.targetHttpsProxies.setSslCertificates({ + project: "project", + requestId: "requestId", + targetHttpsProxy: "targetHttpsProxy", + }); + /** Changes the URL map for TargetHttpsProxy. */ + await gapi.client.targetHttpsProxies.setUrlMap({ + project: "project", + requestId: "requestId", + targetHttpsProxy: "targetHttpsProxy", + }); + /** Retrieves an aggregated list of target instances. */ + await gapi.client.targetInstances.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified TargetInstance resource. */ + await gapi.client.targetInstances.delete({ + project: "project", + requestId: "requestId", + targetInstance: "targetInstance", + zone: "zone", + }); + /** Returns the specified TargetInstance resource. Get a list of available target instances by making a list() request. */ + await gapi.client.targetInstances.get({ + project: "project", + targetInstance: "targetInstance", + zone: "zone", + }); + /** Creates a TargetInstance resource in the specified project and zone using the data included in the request. */ + await gapi.client.targetInstances.insert({ + project: "project", + requestId: "requestId", + zone: "zone", + }); + /** Retrieves a list of TargetInstance resources available to the specified project and zone. */ + await gapi.client.targetInstances.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** Adds health check URLs to a target pool. */ + await gapi.client.targetPools.addHealthCheck({ + project: "project", + region: "region", + requestId: "requestId", + targetPool: "targetPool", + }); + /** Adds an instance to a target pool. */ + await gapi.client.targetPools.addInstance({ + project: "project", + region: "region", + requestId: "requestId", + targetPool: "targetPool", + }); + /** Retrieves an aggregated list of target pools. */ + await gapi.client.targetPools.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified target pool. */ + await gapi.client.targetPools.delete({ + project: "project", + region: "region", + requestId: "requestId", + targetPool: "targetPool", + }); + /** Returns the specified target pool. Get a list of available target pools by making a list() request. */ + await gapi.client.targetPools.get({ + project: "project", + region: "region", + targetPool: "targetPool", + }); + /** Gets the most recent health check results for each IP for the instance that is referenced by the given target pool. */ + await gapi.client.targetPools.getHealth({ + project: "project", + region: "region", + targetPool: "targetPool", + }); + /** Creates a target pool in the specified project and region using the data included in the request. */ + await gapi.client.targetPools.insert({ + project: "project", + region: "region", + requestId: "requestId", + }); + /** Retrieves a list of target pools available to the specified project and region. */ + await gapi.client.targetPools.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** Removes health check URL from a target pool. */ + await gapi.client.targetPools.removeHealthCheck({ + project: "project", + region: "region", + requestId: "requestId", + targetPool: "targetPool", + }); + /** Removes instance URL from a target pool. */ + await gapi.client.targetPools.removeInstance({ + project: "project", + region: "region", + requestId: "requestId", + targetPool: "targetPool", + }); + /** Changes a backup target pool's configurations. */ + await gapi.client.targetPools.setBackup({ + failoverRatio: 1, + project: "project", + region: "region", + requestId: "requestId", + targetPool: "targetPool", + }); + /** Deletes the specified TargetSslProxy resource. */ + await gapi.client.targetSslProxies.delete({ + project: "project", + requestId: "requestId", + targetSslProxy: "targetSslProxy", + }); + /** Returns the specified TargetSslProxy resource. Get a list of available target SSL proxies by making a list() request. */ + await gapi.client.targetSslProxies.get({ + project: "project", + targetSslProxy: "targetSslProxy", + }); + /** Creates a TargetSslProxy resource in the specified project using the data included in the request. */ + await gapi.client.targetSslProxies.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of TargetSslProxy resources available to the specified project. */ + await gapi.client.targetSslProxies.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Changes the BackendService for TargetSslProxy. */ + await gapi.client.targetSslProxies.setBackendService({ + project: "project", + requestId: "requestId", + targetSslProxy: "targetSslProxy", + }); + /** Changes the ProxyHeaderType for TargetSslProxy. */ + await gapi.client.targetSslProxies.setProxyHeader({ + project: "project", + requestId: "requestId", + targetSslProxy: "targetSslProxy", + }); + /** Changes SslCertificates for TargetSslProxy. */ + await gapi.client.targetSslProxies.setSslCertificates({ + project: "project", + requestId: "requestId", + targetSslProxy: "targetSslProxy", + }); + /** Deletes the specified TargetTcpProxy resource. */ + await gapi.client.targetTcpProxies.delete({ + project: "project", + requestId: "requestId", + targetTcpProxy: "targetTcpProxy", + }); + /** Returns the specified TargetTcpProxy resource. Get a list of available target TCP proxies by making a list() request. */ + await gapi.client.targetTcpProxies.get({ + project: "project", + targetTcpProxy: "targetTcpProxy", + }); + /** Creates a TargetTcpProxy resource in the specified project using the data included in the request. */ + await gapi.client.targetTcpProxies.insert({ + project: "project", + requestId: "requestId", + }); + /** Retrieves the list of TargetTcpProxy resources available to the specified project. */ + await gapi.client.targetTcpProxies.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Changes the BackendService for TargetTcpProxy. */ + await gapi.client.targetTcpProxies.setBackendService({ + project: "project", + requestId: "requestId", + targetTcpProxy: "targetTcpProxy", + }); + /** Changes the ProxyHeaderType for TargetTcpProxy. */ + await gapi.client.targetTcpProxies.setProxyHeader({ + project: "project", + requestId: "requestId", + targetTcpProxy: "targetTcpProxy", + }); + /** Retrieves an aggregated list of target VPN gateways. */ + await gapi.client.targetVpnGateways.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified target VPN gateway. */ + await gapi.client.targetVpnGateways.delete({ + project: "project", + region: "region", + requestId: "requestId", + targetVpnGateway: "targetVpnGateway", + }); + /** Returns the specified target VPN gateway. Get a list of available target VPN gateways by making a list() request. */ + await gapi.client.targetVpnGateways.get({ + project: "project", + region: "region", + targetVpnGateway: "targetVpnGateway", + }); + /** Creates a target VPN gateway in the specified project and region using the data included in the request. */ + await gapi.client.targetVpnGateways.insert({ + project: "project", + region: "region", + requestId: "requestId", + }); + /** Retrieves a list of target VPN gateways available to the specified project and region. */ + await gapi.client.targetVpnGateways.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** Deletes the specified UrlMap resource. */ + await gapi.client.urlMaps.delete({ + project: "project", + requestId: "requestId", + urlMap: "urlMap", + }); + /** Returns the specified UrlMap resource. Get a list of available URL maps by making a list() request. */ + await gapi.client.urlMaps.get({ + project: "project", + urlMap: "urlMap", + }); + /** Creates a UrlMap resource in the specified project using the data included in the request. */ + await gapi.client.urlMaps.insert({ + project: "project", + requestId: "requestId", + }); + /** Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. */ + await gapi.client.urlMaps.invalidateCache({ + project: "project", + requestId: "requestId", + urlMap: "urlMap", + }); + /** Retrieves the list of UrlMap resources available to the specified project. */ + await gapi.client.urlMaps.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** + * Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format + * and processing rules. + */ + await gapi.client.urlMaps.patch({ + project: "project", + requestId: "requestId", + urlMap: "urlMap", + }); + /** Updates the specified UrlMap resource with the data included in the request. */ + await gapi.client.urlMaps.update({ + project: "project", + requestId: "requestId", + urlMap: "urlMap", + }); + /** Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. */ + await gapi.client.urlMaps.validate({ + project: "project", + urlMap: "urlMap", + }); + /** Retrieves an aggregated list of VPN tunnels. */ + await gapi.client.vpnTunnels.aggregatedList({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Deletes the specified VpnTunnel resource. */ + await gapi.client.vpnTunnels.delete({ + project: "project", + region: "region", + requestId: "requestId", + vpnTunnel: "vpnTunnel", + }); + /** Returns the specified VpnTunnel resource. Get a list of available VPN tunnels by making a list() request. */ + await gapi.client.vpnTunnels.get({ + project: "project", + region: "region", + vpnTunnel: "vpnTunnel", + }); + /** Creates a VpnTunnel resource in the specified project and region using the data included in the request. */ + await gapi.client.vpnTunnels.insert({ + project: "project", + region: "region", + requestId: "requestId", + }); + /** Retrieves a list of VpnTunnel resources contained in the specified project and region. */ + await gapi.client.vpnTunnels.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + region: "region", + }); + /** Deletes the specified zone-specific Operations resource. */ + await gapi.client.zoneOperations.delete({ + operation: "operation", + project: "project", + zone: "zone", + }); + /** Retrieves the specified zone-specific Operations resource. */ + await gapi.client.zoneOperations.get({ + operation: "operation", + project: "project", + zone: "zone", + }); + /** Retrieves a list of Operation resources contained within the specified zone. */ + await gapi.client.zoneOperations.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + zone: "zone", + }); + /** Returns the specified Zone resource. Get a list of available zones by making a list() request. */ + await gapi.client.zones.get({ + project: "project", + zone: "zone", + }); + /** Retrieves the list of Zone resources available to the specified project. */ + await gapi.client.zones.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + } +}); diff --git a/types/gapi.client.compute/index.d.ts b/types/gapi.client.compute/index.d.ts new file mode 100644 index 0000000000..fe53df316f --- /dev/null +++ b/types/gapi.client.compute/index.d.ts @@ -0,0 +1,17367 @@ +// Type definitions for Google Compute Engine API v1 1.0 +// Project: https://developers.google.com/compute/docs/reference/latest/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/compute/v1/rest + +/// + +declare namespace gapi.client { + /** Load Compute Engine API v1 */ + function load(name: "compute", version: "v1"): PromiseLike; + function load(name: "compute", version: "v1", callback: () => any): void; + + const acceleratorTypes: compute.AcceleratorTypesResource; + + const addresses: compute.AddressesResource; + + const autoscalers: compute.AutoscalersResource; + + const backendBuckets: compute.BackendBucketsResource; + + const backendServices: compute.BackendServicesResource; + + const diskTypes: compute.DiskTypesResource; + + const disks: compute.DisksResource; + + const firewalls: compute.FirewallsResource; + + const forwardingRules: compute.ForwardingRulesResource; + + const globalAddresses: compute.GlobalAddressesResource; + + const globalForwardingRules: compute.GlobalForwardingRulesResource; + + const globalOperations: compute.GlobalOperationsResource; + + const healthChecks: compute.HealthChecksResource; + + const httpHealthChecks: compute.HttpHealthChecksResource; + + const httpsHealthChecks: compute.HttpsHealthChecksResource; + + const images: compute.ImagesResource; + + const instanceGroupManagers: compute.InstanceGroupManagersResource; + + const instanceGroups: compute.InstanceGroupsResource; + + const instanceTemplates: compute.InstanceTemplatesResource; + + const instances: compute.InstancesResource; + + const licenses: compute.LicensesResource; + + const machineTypes: compute.MachineTypesResource; + + const networks: compute.NetworksResource; + + const projects: compute.ProjectsResource; + + const regionAutoscalers: compute.RegionAutoscalersResource; + + const regionBackendServices: compute.RegionBackendServicesResource; + + const regionCommitments: compute.RegionCommitmentsResource; + + const regionInstanceGroupManagers: compute.RegionInstanceGroupManagersResource; + + const regionInstanceGroups: compute.RegionInstanceGroupsResource; + + const regionOperations: compute.RegionOperationsResource; + + const regions: compute.RegionsResource; + + const routers: compute.RoutersResource; + + const routes: compute.RoutesResource; + + const snapshots: compute.SnapshotsResource; + + const sslCertificates: compute.SslCertificatesResource; + + const subnetworks: compute.SubnetworksResource; + + const targetHttpProxies: compute.TargetHttpProxiesResource; + + const targetHttpsProxies: compute.TargetHttpsProxiesResource; + + const targetInstances: compute.TargetInstancesResource; + + const targetPools: compute.TargetPoolsResource; + + const targetSslProxies: compute.TargetSslProxiesResource; + + const targetTcpProxies: compute.TargetTcpProxiesResource; + + const targetVpnGateways: compute.TargetVpnGatewaysResource; + + const urlMaps: compute.UrlMapsResource; + + const vpnTunnels: compute.VpnTunnelsResource; + + const zoneOperations: compute.ZoneOperationsResource; + + const zones: compute.ZonesResource; + + namespace compute { + interface AcceleratorConfig { + /** The number of the guest accelerator cards exposed to this instance. */ + acceleratorCount?: number; + /** Full or partial URL of the accelerator type resource to expose to this instance. */ + acceleratorType?: string; + } + interface AcceleratorType { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** [Output Only] The deprecation status associated with this accelerator type. */ + deprecated?: DeprecationStatus; + /** [Output Only] An optional textual description of the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] The type of the resource. Always compute#acceleratorType for accelerator types. */ + kind?: string; + /** [Output Only] Maximum accelerator cards allowed per instance. */ + maximumCardsPerInstance?: number; + /** [Output Only] Name of the resource. */ + name?: string; + /** [Output Only] Server-defined fully-qualified URL for this resource. */ + selfLink?: string; + /** [Output Only] The name of the zone where the accelerator type resides, such as us-central1-a. */ + zone?: string; + } + interface AcceleratorTypeAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of AcceleratorTypesScopedList resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#acceleratorTypeAggregatedList for aggregated lists of accelerator types. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface AcceleratorTypeList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of AcceleratorType resources. */ + items?: AcceleratorType[]; + /** [Output Only] Type of resource. Always compute#acceleratorTypeList for lists of accelerator types. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface AcceleratorTypesScopedList { + /** [Output Only] List of accelerator types contained in this scope. */ + acceleratorTypes?: AcceleratorType[]; + /** [Output Only] An informational warning that appears when the accelerator types list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface AccessConfig { + /** [Output Only] Type of the resource. Always compute#accessConfig for access configs. */ + kind?: string; + /** + * The name of this access configuration. The default and recommended name is External NAT but you can use any arbitrary string you would like. For + * example, My external IP or Network Access. + */ + name?: string; + /** + * An external IP address associated with this instance. Specify an unused static external IP address available to the project or leave this field + * undefined to use an IP from a shared ephemeral IP address pool. If you specify a static external IP address, it must live in the same region as the + * zone of the instance. + */ + natIP?: string; + /** The type of configuration. The default and only option is ONE_TO_ONE_NAT. */ + type?: string; + } + interface Address { + /** The static IP address represented by this resource. */ + address?: string; + /** The type of address to reserve. If unspecified, defaults to EXTERNAL. */ + addressType?: string; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** The IP Version that will be used by this address. Valid options are IPV4 or IPV6. This can only be specified for a global address. */ + ipVersion?: string; + /** [Output Only] Type of the resource. Always compute#address for addresses. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** [Output Only] URL of the region where the regional address resides. This field is not applicable to global addresses. */ + region?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** + * [Output Only] The status of the address, which can be one of RESERVING, RESERVED, or IN_USE. An address that is RESERVING is currently in the process + * of being reserved. A RESERVED address is currently reserved and available to use. An IN_USE address is currently being used by another resource and is + * not available. + */ + status?: string; + /** + * For external addresses, this field should not be used. + * + * The URL of the subnetwork in which to reserve the address. If an IP address is specified, it must be within the subnetwork's IP range. + */ + subnetwork?: string; + /** [Output Only] The URLs of the resources that are using this address. */ + users?: string[]; + } + interface AddressAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of AddressesScopedList resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#addressAggregatedList for aggregated lists of addresses. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface AddressList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Address resources. */ + items?: Address[]; + /** [Output Only] Type of resource. Always compute#addressList for lists of addresses. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface AddressesScopedList { + /** [Output Only] List of addresses contained in this scope. */ + addresses?: Address[]; + /** [Output Only] Informational warning which replaces the list of addresses when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface AliasIpRange { + /** + * The IP CIDR range represented by this alias IP range. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses + * reserved by system or used by other network interfaces. This range may be a single IP address (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR format + * string (e.g. 10.1.2.0/24). + */ + ipCidrRange?: string; + /** + * Optional subnetwork secondary range name specifying the secondary range from which to allocate the IP CIDR range for this alias IP range. If left + * unspecified, the primary range of the subnetwork will be used. + */ + subnetworkRangeName?: string; + } + interface AttachedDisk { + /** Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance). */ + autoDelete?: boolean; + /** Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem. */ + boot?: boolean; + /** + * Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the + * instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance. + * + * If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disks-x, where x is a number assigned by + * Google Compute Engine. This field is only applicable for persistent disks. + */ + deviceName?: string; + /** + * Encrypts or decrypts a disk using a customer-supplied encryption key. + * + * If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that + * is already encrypted, this field decrypts the disk using the customer-supplied encryption key. + * + * If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For + * example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance. + * + * If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to + * use the disk later. + * + * Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group. + */ + diskEncryptionKey?: CustomerEncryptionKey; + /** + * [Output Only] A zero-based index to this disk, where 0 is reserved for the boot disk. If you have many disks attached to an instance, each disk would + * have a unique index number. + */ + index?: number; + /** + * [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot + * disks or local SSDs attached to the new instance. + * + * This property is mutually exclusive with the source property; you can only define one or the other, but not both. + */ + initializeParams?: AttachedDiskInitializeParams; + /** + * Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. Persistent disks must always use SCSI + * and the request will fail if you attempt to attach a persistent disk in any other format than SCSI. Local SSDs can use either NVME or SCSI. For + * performance characteristics of SCSI over NVMe, see Local SSD performance. + */ + interface?: string; + /** [Output Only] Type of the resource. Always compute#attachedDisk for attached disks. */ + kind?: string; + /** [Output Only] Any valid publicly visible licenses. */ + licenses?: string[]; + /** The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. */ + mode?: string; + /** + * Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or + * disks.source is required. + * + * If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. + * + * Note that for InstanceTemplate, specify the disk name, not the URL for the disk. + */ + source?: string; + /** Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT. */ + type?: string; + } + interface AttachedDiskInitializeParams { + /** Specifies the disk name. If not specified, the default is to use the name of the instance. */ + diskName?: string; + /** Specifies the size of the disk in base-2 GB. */ + diskSizeGb?: string; + /** + * Specifies the disk type to use to create the instance. If not specified, the default is pd-standard, specified using the full URL. For example: + * + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard + * + * Other values include pd-ssd and local-ssd. If you define this field, you can provide either the full or partial URL. For example, the following are + * valid values: + * - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType + * - projects/project/zones/zone/diskTypes/diskType + * - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL. + */ + diskType?: string; + /** + * The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or disks.source is required. + * + * To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the + * latest Debian 8 image: + * + * projects/debian-cloud/global/images/family/debian-8 + * + * Alternatively, use a specific version of a public operating system image: + * + * projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD + * + * To create a disk with a private image that you created, specify the image name in the following format: + * + * global/images/my-private-image + * + * You can also specify a private image by its image family, which returns the latest version of the image in that family. Replace the image name with + * family/family-name: + * + * global/images/family/my-private-family + * + * If the source image is deleted later, this field will not be set. + */ + sourceImage?: string; + /** + * The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. + * + * Instance templates do not store customer-supplied encryption keys, so you cannot create disks for instances in a managed instance group if the source + * images are encrypted with your own keys. + */ + sourceImageEncryptionKey?: CustomerEncryptionKey; + } + interface Autoscaler { + /** + * The configuration parameters for the autoscaling algorithm. You can define one or more of the policies for an autoscaler: cpuUtilization, + * customMetricUtilizations, and loadBalancingUtilization. + * + * If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%. + */ + autoscalingPolicy?: AutoscalingPolicy; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#autoscaler for autoscalers. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope). */ + region?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output Only] The status of the autoscaler configuration. */ + status?: string; + /** + * [Output Only] Human-readable details about the current state of the autoscaler. Read the documentation for Commonly returned status messages for + * examples of status messages you might encounter. + */ + statusDetails?: AutoscalerStatusDetails[]; + /** URL of the managed instance group that this autoscaler will scale. */ + target?: string; + /** [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope). */ + zone?: string; + } + interface AutoscalerAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of AutoscalersScopedList resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#autoscalerAggregatedList for aggregated lists of autoscalers. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface AutoscalerList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Autoscaler resources. */ + items?: Autoscaler[]; + /** [Output Only] Type of resource. Always compute#autoscalerList for lists of autoscalers. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface AutoscalerStatusDetails { + /** The status message. */ + message?: string; + /** The type of error returned. */ + type?: string; + } + interface AutoscalersScopedList { + /** [Output Only] List of autoscalers contained in this scope. */ + autoscalers?: Autoscaler[]; + /** [Output Only] Informational warning which replaces the list of autoscalers when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface AutoscalingPolicy { + /** + * The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. This prevents the autoscaler from + * collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is + * 60 seconds. + * + * Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To + * do this, create an instance and time the startup process. + */ + coolDownPeriodSec?: number; + /** Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group. */ + cpuUtilization?: AutoscalingPolicyCpuUtilization; + /** Configuration parameters of autoscaling based on a custom metric. */ + customMetricUtilizations?: AutoscalingPolicyCustomMetricUtilization[]; + /** Configuration parameters of autoscaling based on load balancer. */ + loadBalancingUtilization?: AutoscalingPolicyLoadBalancingUtilization; + /** + * The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of + * replicas should not be lower than minimal number of replicas. + */ + maxNumReplicas?: number; + /** + * The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. If not provided, autoscaler will choose a default + * value depending on maximum number of instances allowed. + */ + minNumReplicas?: number; + } + interface AutoscalingPolicyCpuUtilization { + /** + * The target CPU utilization that the autoscaler should maintain. Must be a float value in the range (0, 1]. If not specified, the default is 0.6. + * + * If the CPU level is below the target utilization, the autoscaler scales down the number of instances until it reaches the minimum number of instances + * you specified or until the average CPU of your instances reaches the target utilization. + * + * If the average CPU is above the target utilization, the autoscaler scales up until it reaches the maximum number of instances you specified or until + * the average utilization reaches the target utilization. + */ + utilizationTarget?: number; + } + interface AutoscalingPolicyCustomMetricUtilization { + /** + * The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values and should be a utilization metric, which means that + * the number of virtual machines handling requests should increase or decrease proportionally to the metric. + * + * The metric must have a value type of INT64 or DOUBLE. + */ + metric?: string; + /** + * The target value of the metric that autoscaler should maintain. This must be a positive value. + * + * For example, a good metric to use as a utilization_target is compute.googleapis.com/instance/network/received_bytes_count. The autoscaler will work to + * keep this value constant for each of the instances. + */ + utilizationTarget?: number; + /** + * Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. If not + * specified, the default is GAUGE. + */ + utilizationTargetType?: string; + } + interface AutoscalingPolicyLoadBalancingUtilization { + /** + * Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. + * If not defined, the default is 0.8. + */ + utilizationTarget?: number; + } + interface Backend { + /** + * Specifies the balancing mode for this backend. For global HTTP(S) or TCP/SSL load balancing, the default is UTILIZATION. Valid values are UTILIZATION, + * RATE (for HTTP(S)) and CONNECTION (for TCP/SSL). + * + * For Internal Load Balancing, the default and only supported mode is CONNECTION. + */ + balancingMode?: string; + /** + * A multiplier applied to the group's maximum servicing capacity (based on UTILIZATION, RATE or CONNECTION). Default value is 1, which means the group + * will serve up to 100% of its configured capacity (depending on balancingMode). A setting of 0 means the group is completely drained, offering 0% of its + * available Capacity. Valid range is [0.0,1.0]. + * + * This cannot be used for internal load balancing. + */ + capacityScaler?: number; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** + * The fully-qualified URL of a Instance Group resource. This instance group defines the list of instances that serve traffic. Member virtual machine + * instances from each instance group must live in the same zone as the instance group itself. No two backends in a backend service are allowed to use + * same Instance Group resource. + * + * Note that you must specify an Instance Group resource using the fully-qualified URL, rather than a partial URL. + * + * When the BackendService has load balancing scheme INTERNAL, the instance group must be within the same region as the BackendService. + */ + group?: string; + /** + * The max number of simultaneous connections for the group. Can be used with either CONNECTION or UTILIZATION balancing modes. For CONNECTION mode, + * either maxConnections or maxConnectionsPerInstance must be set. + * + * This cannot be used for internal load balancing. + */ + maxConnections?: number; + /** + * The max number of simultaneous connections that a single backend instance can handle. This is used to calculate the capacity of the group. Can be used + * in either CONNECTION or UTILIZATION balancing modes. For CONNECTION mode, either maxConnections or maxConnectionsPerInstance must be set. + * + * This cannot be used for internal load balancing. + */ + maxConnectionsPerInstance?: number; + /** + * The max requests per second (RPS) of the group. Can be used with either RATE or UTILIZATION balancing modes, but required if RATE mode. For RATE mode, + * either maxRate or maxRatePerInstance must be set. + * + * This cannot be used for internal load balancing. + */ + maxRate?: number; + /** + * The max requests per second (RPS) that a single backend instance can handle. This is used to calculate the capacity of the group. Can be used in either + * balancing mode. For RATE mode, either maxRate or maxRatePerInstance must be set. + * + * This cannot be used for internal load balancing. + */ + maxRatePerInstance?: number; + /** + * Used when balancingMode is UTILIZATION. This ratio defines the CPU utilization target for the group. The default is 0.8. Valid range is [0.0, 1.0]. + * + * This cannot be used for internal load balancing. + */ + maxUtilization?: number; + } + interface BackendBucket { + /** Cloud Storage bucket name. */ + bucketName?: string; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional textual description of the resource; provided by the client when the resource is created. */ + description?: string; + /** If true, enable Cloud CDN for this BackendBucket. */ + enableCdn?: boolean; + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** Type of the resource. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + } + interface BackendBucketList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of BackendBucket resources. */ + items?: BackendBucket[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface BackendService { + /** + * Lifetime of cookies in seconds if session_affinity is GENERATED_COOKIE. If set to 0, the cookie is non-persistent and lasts only until the end of the + * browser session (or equivalent). The maximum allowed value for TTL is one day. + * + * When the load balancing scheme is INTERNAL, this field is not used. + */ + affinityCookieTtlSec?: number; + /** The list of backends that serve this BackendService. */ + backends?: Backend[]; + /** Cloud CDN configuration for this BackendService. */ + cdnPolicy?: BackendServiceCdnPolicy; + connectionDraining?: ConnectionDraining; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** + * If true, enable Cloud CDN for this BackendService. + * + * When the load balancing scheme is INTERNAL, this field is not used. + */ + enableCDN?: boolean; + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when + * inserting a BackendService. An up-to-date fingerprint must be provided in order to update the BackendService. + */ + fingerprint?: string; + /** + * The list of URLs to the HttpHealthCheck or HttpsHealthCheck resource for health checking this BackendService. Currently at most one health check can be + * specified, and a health check is required for Compute Engine backend services. A health check must not be specified for App Engine backend and Cloud + * Function backend. + * + * For internal load balancing, a URL to a HealthCheck resource must be specified instead. + */ + healthChecks?: string[]; + iap?: BackendServiceIAP; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of resource. Always compute#backendService for backend services. */ + kind?: string; + /** + * Indicates whether the backend service will be used with internal or external load balancing. A backend service created for one type of load balancing + * cannot be used with the other. Possible values are INTERNAL and EXTERNAL. + */ + loadBalancingScheme?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** + * Deprecated in favor of portName. The TCP port to connect on the backend. The default value is 80. + * + * This cannot be used for internal load balancing. + */ + port?: number; + /** + * Name of backend port. The same name should appear in the instance groups referenced by this service. Required when the load balancing scheme is + * EXTERNAL. + * + * When the load balancing scheme is INTERNAL, this field is not used. + */ + portName?: string; + /** + * The protocol this BackendService uses to communicate with backends. + * + * Possible values are HTTP, HTTPS, TCP, and SSL. The default is HTTP. + * + * For internal load balancing, the possible values are TCP and UDP, and the default is TCP. + */ + protocol?: string; + /** [Output Only] URL of the region where the regional backend service resides. This field is not applicable to global backend services. */ + region?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** + * Type of session affinity to use. The default is NONE. + * + * When the load balancing scheme is EXTERNAL, can be NONE, CLIENT_IP, or GENERATED_COOKIE. + * + * When the load balancing scheme is INTERNAL, can be NONE, CLIENT_IP, CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO. + * + * When the protocol is UDP, this field is not used. + */ + sessionAffinity?: string; + /** How many seconds to wait for the backend before considering it a failed request. Default is 30 seconds. */ + timeoutSec?: number; + } + interface BackendServiceAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of BackendServicesScopedList resources. */ + items?: Record; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface BackendServiceCdnPolicy { + /** The CacheKeyPolicy for this CdnPolicy. */ + cacheKeyPolicy?: CacheKeyPolicy; + } + interface BackendServiceGroupHealth { + healthStatus?: HealthStatus[]; + /** [Output Only] Type of resource. Always compute#backendServiceGroupHealth for the health of backend services. */ + kind?: string; + } + interface BackendServiceIAP { + enabled?: boolean; + oauth2ClientId?: string; + oauth2ClientSecret?: string; + /** [Output Only] SHA256 hash value for the field oauth2_client_secret above. */ + oauth2ClientSecretSha256?: string; + } + interface BackendServiceList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of BackendService resources. */ + items?: BackendService[]; + /** [Output Only] Type of resource. Always compute#backendServiceList for lists of backend services. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface BackendServicesScopedList { + /** List of BackendServices contained in this scope. */ + backendServices?: BackendService[]; + /** Informational warning which replaces the list of backend services when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface CacheInvalidationRule { + /** If set, this invalidation rule will only apply to requests with a Host header matching host. */ + host?: string; + path?: string; + } + interface CacheKeyPolicy { + /** If true, requests to different hosts will be cached separately. */ + includeHost?: boolean; + /** If true, http and https requests will be cached separately. */ + includeProtocol?: boolean; + /** + * If true, include query string parameters in the cache key according to query_string_whitelist and query_string_blacklist. If neither is set, the entire + * query string will be included. If false, the query string will be excluded from the cache key entirely. + */ + includeQueryString?: boolean; + /** + * Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify query_string_whitelist or + * query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters. + */ + queryStringBlacklist?: string[]; + /** + * Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify query_string_whitelist or + * query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters. + */ + queryStringWhitelist?: string[]; + } + interface Commitment { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] Commitment end time in RFC3339 text format. */ + endTimestamp?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#commitment for commitments. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** + * The plan for this commitment, which determines duration and discount rate. The currently supported plans are TWELVE_MONTH (1 year), and + * THIRTY_SIX_MONTH (3 years). + */ + plan?: string; + /** [Output Only] URL of the region where this commitment may be used. */ + region?: string; + /** List of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together. */ + resources?: ResourceCommitment[]; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output Only] Commitment start time in RFC3339 text format. */ + startTimestamp?: string; + /** + * [Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end date defined). One of the following values: + * NOT_YET_ACTIVE, ACTIVE, EXPIRED. + */ + status?: string; + /** [Output Only] An optional, human-readable explanation of the status. */ + statusMessage?: string; + } + interface CommitmentAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of CommitmentsScopedList resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#commitmentAggregatedList for aggregated lists of commitments. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface CommitmentList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Commitment resources. */ + items?: Commitment[]; + /** [Output Only] Type of resource. Always compute#commitmentList for lists of commitments. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface CommitmentsScopedList { + /** [Output Only] List of commitments contained in this scope. */ + commitments?: Commitment[]; + /** [Output Only] Informational warning which replaces the list of commitments when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface ConnectionDraining { + /** Time for which instance will be drained (not accept new connections, but still work to finish started). */ + drainingTimeoutSec?: number; + } + interface CustomerEncryptionKey { + /** Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. */ + rawKey?: string; + /** [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. */ + sha256?: string; + } + interface CustomerEncryptionKeyProtectedDisk { + /** Decrypts data associated with the disk with a customer-supplied encryption key. */ + diskEncryptionKey?: CustomerEncryptionKey; + /** Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks. */ + source?: string; + } + interface DeprecationStatus { + /** + * An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DELETED. This is only informational and the status + * will not change unless the client explicitly changes it. + */ + deleted?: string; + /** + * An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DEPRECATED. This is only informational and the + * status will not change unless the client explicitly changes it. + */ + deprecated?: string; + /** + * An optional RFC3339 timestamp on or after which the state of this resource is intended to change to OBSOLETE. This is only informational and the status + * will not change unless the client explicitly changes it. + */ + obsolete?: string; + /** + * The URL of the suggested replacement for a deprecated resource. The suggested replacement resource must be the same kind of resource as the deprecated + * resource. + */ + replacement?: string; + /** + * The deprecation state of this resource. This can be DEPRECATED, OBSOLETE, or DELETED. Operations which create a new resource using a DEPRECATED + * resource will return successfully, but with a warning indicating the deprecated resource and recommending its replacement. Operations which use + * OBSOLETE or DELETED resources will be rejected and result in an error. + */ + state?: string; + } + interface Disk { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** + * Encrypts the disk using a customer-supplied encryption key. + * + * After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later (e.g. to create a disk snapshot or an + * image, or to attach the disk to a virtual machine). + * + * Customer-supplied encryption keys do not protect access to metadata of the disk. + * + * If you do not provide an encryption key when creating the disk, then the disk will be encrypted using an automatically generated key and you do not + * need to provide a key to use the disk later. + */ + diskEncryptionKey?: CustomerEncryptionKey; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#disk for disks. */ + kind?: string; + /** + * A fingerprint for the labels being applied to this disk, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is + * initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint + * hash in order to update or change labels. + * + * To see the latest fingerprint, make a get() request to retrieve a disk. + */ + labelFingerprint?: string; + /** Labels to apply to this disk. These can be later modified by the setLabels method. */ + labels?: Record; + /** [Output Only] Last attach timestamp in RFC3339 text format. */ + lastAttachTimestamp?: string; + /** [Output Only] Last detach timestamp in RFC3339 text format. */ + lastDetachTimestamp?: string; + /** Any applicable publicly visible licenses. */ + licenses?: string[]; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** Internal use only. */ + options?: string; + /** [Output Only] Server-defined fully-qualified URL for this resource. */ + selfLink?: string; + /** + * Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the sourceImage or sourceSnapshot + * parameter, or specify it alone to create an empty persistent disk. + * + * If you specify this field along with sourceImage or sourceSnapshot, the value of sizeGb must not be less than the size of the sourceImage or the size + * of the snapshot. Acceptable values are 1 to 65536, inclusive. + */ + sizeGb?: string; + /** + * The source image used to create this disk. If the source image is deleted, this field will not be set. + * + * To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the + * latest Debian 8 image: + * + * projects/debian-cloud/global/images/family/debian-8 + * + * Alternatively, use a specific version of a public operating system image: + * + * projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD + * + * To create a disk with a private image that you created, specify the image name in the following format: + * + * global/images/my-private-image + * + * You can also specify a private image by its image family, which returns the latest version of the image in that family. Replace the image name with + * family/family-name: + * + * global/images/family/my-private-family + */ + sourceImage?: string; + /** The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. */ + sourceImageEncryptionKey?: CustomerEncryptionKey; + /** + * [Output Only] The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. + * For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would + * identify the exact version of the image that was used. + */ + sourceImageId?: string; + /** + * The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid + * values: + * - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot + * - projects/project/global/snapshots/snapshot + * - global/snapshots/snapshot + */ + sourceSnapshot?: string; + /** The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. */ + sourceSnapshotEncryptionKey?: CustomerEncryptionKey; + /** + * [Output Only] The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent + * disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID + * would identify the exact version of the snapshot that was used. + */ + sourceSnapshotId?: string; + /** [Output Only] The status of disk creation. */ + status?: string; + /** URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk. */ + type?: string; + /** [Output Only] Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance */ + users?: string[]; + /** [Output Only] URL of the zone where the disk resides. */ + zone?: string; + } + interface DiskAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of DisksScopedList resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#diskAggregatedList for aggregated lists of persistent disks. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface DiskList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Disk resources. */ + items?: Disk[]; + /** [Output Only] Type of resource. Always compute#diskList for lists of disks. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface DiskMoveRequest { + /** + * The URL of the destination zone to move the disk. This can be a full or partial URL. For example, the following are all valid URLs to a zone: + * - https://www.googleapis.com/compute/v1/projects/project/zones/zone + * - projects/project/zones/zone + * - zones/zone + */ + destinationZone?: string; + /** + * The URL of the target disk to move. This can be a full or partial URL. For example, the following are all valid URLs to a disk: + * - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk + * - projects/project/zones/zone/disks/disk + * - zones/zone/disks/disk + */ + targetDisk?: string; + } + interface DiskType { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** [Output Only] Server-defined default disk size in GB. */ + defaultDiskSizeGb?: string; + /** [Output Only] The deprecation status associated with this disk type. */ + deprecated?: DeprecationStatus; + /** [Output Only] An optional description of this resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#diskType for disk types. */ + kind?: string; + /** [Output Only] Name of the resource. */ + name?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output Only] An optional textual description of the valid disk size, such as "10GB-10TB". */ + validDiskSize?: string; + /** [Output Only] URL of the zone where the disk type resides. */ + zone?: string; + } + interface DiskTypeAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of DiskTypesScopedList resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#diskTypeAggregatedList. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface DiskTypeList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of DiskType resources. */ + items?: DiskType[]; + /** [Output Only] Type of resource. Always compute#diskTypeList for disk types. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface DiskTypesScopedList { + /** [Output Only] List of disk types contained in this scope. */ + diskTypes?: DiskType[]; + /** [Output Only] Informational warning which replaces the list of disk types when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface DisksResizeRequest { + /** The new size of the persistent disk, which is specified in GB. */ + sizeGb?: string; + } + interface DisksScopedList { + /** [Output Only] List of disks contained in this scope. */ + disks?: Disk[]; + /** [Output Only] Informational warning which replaces the list of disks when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface Firewall { + /** The list of ALLOW rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. */ + allowed?: Array<{ + /** + * The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following + * well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number. + */ + IPProtocol?: string; + /** + * An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a + * range. If not specified, this rule applies to connections through any port. + * + * Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. + */ + ports?: string[]; + }>; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** The list of DENY rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. */ + denied?: Array<{ + /** + * The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following + * well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number. + */ + IPProtocol?: string; + /** + * An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a + * range. If not specified, this rule applies to connections through any port. + * + * Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. + */ + ports?: string[]; + }>; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** + * If destination ranges are specified, the firewall will apply only to traffic that has destination IP address in these ranges. These ranges must be + * expressed in CIDR format. Only IPv4 is supported. + */ + destinationRanges?: string[]; + /** + * Direction of traffic to which this firewall applies; default is INGRESS. Note: For INGRESS traffic, it is NOT supported to specify destinationRanges; + * For EGRESS traffic, it is NOT supported to specify sourceRanges OR sourceTags. + */ + direction?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#firewall for firewall rules. */ + kind?: string; + /** + * Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** + * URL of the network resource for this firewall rule. If not specified when creating a firewall rule, the default network is used: + * global/networks/default + * If you choose to specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: + * - https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network + * - projects/myproject/global/networks/my-network + * - global/networks/default + */ + network?: string; + /** + * Priority for this rule. This is an integer between 0 and 65535, both inclusive. When not specified, the value assumed is 1000. Relative priorities + * determine precedence of conflicting rules. Lower value of priority implies higher precedence (eg, a rule with priority 0 has higher precedence than a + * rule with priority 1). DENY rules take precedence over ALLOW rules having equal priority. + */ + priority?: number; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** + * If source ranges are specified, the firewall will apply only to traffic that has source IP address in these ranges. These ranges must be expressed in + * CIDR format. One or both of sourceRanges and sourceTags may be set. If both properties are set, the firewall will apply to traffic that has source IP + * address within sourceRanges OR the source IP that belongs to a tag listed in the sourceTags property. The connection does not need to match both + * properties for the firewall to apply. Only IPv4 is supported. + */ + sourceRanges?: string[]; + /** + * If source tags are specified, the firewall rule applies only to traffic with source IPs that match the primary network interfaces of VM instances that + * have the tag and are in the same VPC network. Source tags cannot be used to control traffic to an instance's external IP address, it only applies to + * traffic between instances in the same virtual network. Because tags are associated with instances, not IP addresses. One or both of sourceRanges and + * sourceTags may be set. If both properties are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP + * that belongs to a tag listed in the sourceTags property. The connection does not need to match both properties for the firewall to apply. + */ + sourceTags?: string[]; + /** + * A list of instance tags indicating sets of instances located in the network that may make network connections as specified in allowed[]. If no + * targetTags are specified, the firewall rule applies to all instances on the specified network. + */ + targetTags?: string[]; + } + interface FirewallList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Firewall resources. */ + items?: Firewall[]; + /** [Output Only] Type of resource. Always compute#firewallList for lists of firewalls. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface ForwardingRule { + /** + * The IP address that this forwarding rule is serving on behalf of. + * + * For global forwarding rules, the address must be a global IP. For regional forwarding rules, the address must live in the same region as the forwarding + * rule. By default, this field is empty and an ephemeral IPv4 address from the same scope (global or regional) will be assigned. A regional forwarding + * rule supports IPv4 only. A global forwarding rule supports either IPv4 or IPv6. + * + * When the load balancing scheme is INTERNAL, this can only be an RFC 1918 IP address belonging to the network/subnetwork configured for the forwarding + * rule. A reserved address cannot be used. If the field is empty, the IP address will be automatically allocated from the internal IP range of the + * subnetwork or network configured for this forwarding rule. + */ + IPAddress?: string; + /** + * The IP protocol to which this rule applies. Valid options are TCP, UDP, ESP, AH, SCTP or ICMP. + * + * When the load balancing scheme is INTERNAL, only TCP and UDP are valid. + */ + IPProtocol?: string; + /** + * This field is not used for external load balancing. + * + * For internal load balancing, this field identifies the BackendService resource to receive the matched traffic. + */ + backendService?: string; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** The IP Version that will be used by this forwarding rule. Valid options are IPV4 or IPV6. This can only be specified for a global forwarding rule. */ + ipVersion?: string; + /** [Output Only] Type of the resource. Always compute#forwardingRule for Forwarding Rule resources. */ + kind?: string; + /** + * This signifies what the ForwardingRule will be used for and can only take the following values: INTERNAL, EXTERNAL The value of INTERNAL means that + * this will be used for Internal Network Load Balancing (TCP, UDP). The value of EXTERNAL means that this will be used for External Load Balancing + * (HTTP(S) LB, External TCP/UDP LB, SSL Proxy) + */ + loadBalancingScheme?: string; + /** + * Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** + * This field is not used for external load balancing. + * + * For internal load balancing, this field identifies the network that the load balanced IP should belong to for this Forwarding Rule. If this field is + * not specified, the default network will be used. + */ + network?: string; + /** + * This field is used along with the target field for TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway, TargetPool, + * TargetInstance. + * + * Applicable only when IPProtocol is TCP, UDP, or SCTP, only packets addressed to ports in the specified range will be forwarded to target. Forwarding + * rules with the same [IPAddress, IPProtocol] pair must have disjoint port ranges. + * + * Some types of forwarding target have constraints on the acceptable ports: + * - TargetHttpProxy: 80, 8080 + * - TargetHttpsProxy: 443 + * - TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1883, 5222 + * - TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1883, 5222 + * - TargetVpnGateway: 500, 4500 + * - + */ + portRange?: string; + /** + * This field is used along with the backend_service field for internal load balancing. + * + * When the load balancing scheme is INTERNAL, a single port or a comma separated list of ports can be configured. Only packets addressed to these ports + * will be forwarded to the backends configured with this forwarding rule. + * + * You may specify a maximum of up to 5 ports. + */ + ports?: string[]; + /** [Output Only] URL of the region where the regional forwarding rule resides. This field is not applicable to global forwarding rules. */ + region?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** + * This field is not used for external load balancing. + * + * For internal load balancing, this field identifies the subnetwork that the load balanced IP should belong to for this Forwarding Rule. + * + * If the network specified is in auto subnet mode, this field is optional. However, if the network is in custom subnet mode, a subnetwork must be + * specified. + */ + subnetwork?: string; + /** + * The URL of the target resource to receive the matched traffic. For regional forwarding rules, this target must live in the same region as the + * forwarding rule. For global forwarding rules, this target must be a global load balancing resource. The forwarded traffic must be of a type appropriate + * to the target object. + * + * This field is not used for internal load balancing. + */ + target?: string; + } + interface ForwardingRuleAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of ForwardingRulesScopedList resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#forwardingRuleAggregatedList for lists of forwarding rules. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface ForwardingRuleList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of ForwardingRule resources. */ + items?: ForwardingRule[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface ForwardingRulesScopedList { + /** List of forwarding rules contained in this scope. */ + forwardingRules?: ForwardingRule[]; + /** Informational warning which replaces the list of forwarding rules when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface GlobalSetLabelsRequest { + /** + * The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and + * changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels. Make a + * get() request to the resource to get the latest fingerprint. + */ + labelFingerprint?: string; + /** + * A list of labels to apply for this resource. Each label key & value must comply with RFC1035. Specifically, the name must be 1-63 characters long and + * match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. For example, "webserver-frontend": "images". A label value + * can also be empty (e.g. "my-label": ""). + */ + labels?: Record; + } + interface GuestOsFeature { + /** + * The type of supported feature. Currently only VIRTIO_SCSI_MULTIQUEUE is supported. For newer Windows images, the server might also populate this + * property with the value WINDOWS to indicate that this is a Windows image. + */ + type?: string; + } + interface HTTPHealthCheck { + /** + * The value of the host header in the HTTP health check request. If left empty (default value), the IP on behalf of which this health check is performed + * will be used. + */ + host?: string; + /** The TCP port number for the health check request. The default value is 80. Valid values are 1 through 65535. */ + port?: number; + /** Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence. */ + portName?: string; + /** Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. */ + proxyHeader?: string; + /** The request path of the HTTP health check request. The default value is /. */ + requestPath?: string; + } + interface HTTPSHealthCheck { + /** + * The value of the host header in the HTTPS health check request. If left empty (default value), the IP on behalf of which this health check is performed + * will be used. + */ + host?: string; + /** The TCP port number for the health check request. The default value is 443. Valid values are 1 through 65535. */ + port?: number; + /** Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence. */ + portName?: string; + /** Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. */ + proxyHeader?: string; + /** The request path of the HTTPS health check request. The default value is /. */ + requestPath?: string; + } + interface HealthCheck { + /** How often (in seconds) to send a health check. The default value is 5 seconds. */ + checkIntervalSec?: number; + /** [Output Only] Creation timestamp in 3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2. */ + healthyThreshold?: number; + httpHealthCheck?: HTTPHealthCheck; + httpsHealthCheck?: HTTPSHealthCheck; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** Type of the resource. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + sslHealthCheck?: SSLHealthCheck; + tcpHealthCheck?: TCPHealthCheck; + /** + * How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than + * checkIntervalSec. + */ + timeoutSec?: number; + /** + * Specifies the type of the healthCheck, either TCP, SSL, HTTP or HTTPS. If not specified, the default is TCP. Exactly one of the protocol-specific + * health check field must be specified, which must match type field. + */ + type?: string; + /** A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2. */ + unhealthyThreshold?: number; + } + interface HealthCheckList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of HealthCheck resources. */ + items?: HealthCheck[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface HealthCheckReference { + healthCheck?: string; + } + interface HealthStatus { + /** Health state of the instance. */ + healthState?: string; + /** URL of the instance resource. */ + instance?: string; + /** The IP address represented by this resource. */ + ipAddress?: string; + /** The port on the instance. */ + port?: number; + } + interface HostRule { + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** + * The list of host patterns to match. They must be valid hostnames, except * will match any string of ([a-z0-9-.]*). In that case, * must be the first + * character and must be followed in the pattern by either - or .. + */ + hosts?: string[]; + /** The name of the PathMatcher to use to match the path portion of the URL if the hostRule matches the URL's host portion. */ + pathMatcher?: string; + } + interface HttpHealthCheck { + /** How often (in seconds) to send a health check. The default value is 5 seconds. */ + checkIntervalSec?: number; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2. */ + healthyThreshold?: number; + /** + * The value of the host header in the HTTP health check request. If left empty (default value), the public IP on behalf of which this health check is + * performed will be used. + */ + host?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#httpHealthCheck for HTTP health checks. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** The TCP port number for the HTTP health check request. The default value is 80. */ + port?: number; + /** The request path of the HTTP health check request. The default value is /. */ + requestPath?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** + * How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than + * checkIntervalSec. + */ + timeoutSec?: number; + /** A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2. */ + unhealthyThreshold?: number; + } + interface HttpHealthCheckList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of HttpHealthCheck resources. */ + items?: HttpHealthCheck[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface HttpsHealthCheck { + /** How often (in seconds) to send a health check. The default value is 5 seconds. */ + checkIntervalSec?: number; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2. */ + healthyThreshold?: number; + /** + * The value of the host header in the HTTPS health check request. If left empty (default value), the public IP on behalf of which this health check is + * performed will be used. + */ + host?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** Type of the resource. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** The TCP port number for the HTTPS health check request. The default value is 443. */ + port?: number; + /** The request path of the HTTPS health check request. The default value is "/". */ + requestPath?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** + * How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have a greater value than + * checkIntervalSec. + */ + timeoutSec?: number; + /** A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2. */ + unhealthyThreshold?: number; + } + interface HttpsHealthCheckList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of HttpsHealthCheck resources. */ + items?: HttpsHealthCheck[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface Image { + /** Size of the image tar.gz archive stored in Google Cloud Storage (in bytes). */ + archiveSizeBytes?: string; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** The deprecation status associated with this image. */ + deprecated?: DeprecationStatus; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** Size of the image when restored onto a persistent disk (in GB). */ + diskSizeGb?: string; + /** + * The name of the image family to which this image belongs. You can create disks by specifying an image family instead of a specific image name. The + * image family always returns its latest image that is not deprecated. The name of the image family must comply with RFC1035. + */ + family?: string; + /** + * A list of features to enable on the guest OS. Applicable for bootable images only. Currently, only one feature can be enabled, VIRTIO_SCSI_MULTIQUEUE, + * which allows each virtual CPU to have its own queue. For Windows images, you can only enable VIRTIO_SCSI_MULTIQUEUE on images with driver version + * 1.2.0.1621 or higher. Linux images with kernel versions 3.17 and higher will support VIRTIO_SCSI_MULTIQUEUE. + * + * For newer Windows images, the server might also populate this property with the value WINDOWS to indicate that this is a Windows image. + */ + guestOsFeatures?: GuestOsFeature[]; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** + * Encrypts the image using a customer-supplied encryption key. + * + * After you encrypt an image with a customer-supplied key, you must provide the same key if you use the image later (e.g. to create a disk from the + * image). + * + * Customer-supplied encryption keys do not protect access to metadata of the disk. + * + * If you do not provide an encryption key when creating the image, then the disk will be encrypted using an automatically generated key and you do not + * need to provide a key to use the image later. + */ + imageEncryptionKey?: CustomerEncryptionKey; + /** [Output Only] Type of the resource. Always compute#image for images. */ + kind?: string; + /** + * A fingerprint for the labels being applied to this image, which is essentially a hash of the labels used for optimistic locking. The fingerprint is + * initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint + * hash in order to update or change labels. + * + * To see the latest fingerprint, make a get() request to retrieve an image. + */ + labelFingerprint?: string; + /** Labels to apply to this image. These can be later modified by the setLabels method. */ + labels?: Record; + /** Any applicable license URI. */ + licenses?: string[]; + /** + * Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** The parameters of the raw disk image. */ + rawDisk?: { + /** + * The format used to encode and transmit the block device, which should be TAR. This is just a container and transmission format and not a runtime + * format. Provided by the client when the disk image is created. + */ + containerType?: string; + /** An optional SHA1 checksum of the disk image before unpackaging; provided by the client when the disk image is created. */ + sha1Checksum?: string; + /** The full Google Cloud Storage URL where the disk image is stored. You must provide either this property or the sourceDisk property but not both. */ + source?: string; + }; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** + * URL of the source disk used to create this image. This can be a full or valid partial URL. You must provide either this property or the rawDisk.source + * property but not both to create an image. For example, the following are valid values: + * - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk + * - projects/project/zones/zone/disks/disk + * - zones/zone/disks/disk + */ + sourceDisk?: string; + /** The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key. */ + sourceDiskEncryptionKey?: CustomerEncryptionKey; + /** + * The ID value of the disk used to create this image. This value may be used to determine whether the image was taken from the current or a previous + * instance of a given disk name. + */ + sourceDiskId?: string; + /** + * URL of the source image used to create this image. This can be a full or valid partial URL. You must provide exactly one of: + * - this property, or + * - the rawDisk.source property, or + * - the sourceDisk property in order to create an image. + */ + sourceImage?: string; + /** The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. */ + sourceImageEncryptionKey?: CustomerEncryptionKey; + /** + * [Output Only] The ID value of the image used to create this image. This value may be used to determine whether the image was taken from the current or + * a previous instance of a given image name. + */ + sourceImageId?: string; + /** The type of the image used to create this disk. The default and only value is RAW */ + sourceType?: string; + /** + * [Output Only] The status of the image. An image can be used to create other resources, such as instances, only after the image has been successfully + * created and the status is set to READY. Possible values are FAILED, PENDING, or READY. + */ + status?: string; + } + interface ImageList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Image resources. */ + items?: Image[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface Instance { + /** + * Allows this instance to send and receive packets with non-matching destination or source IPs. This is required if you plan to use this instance to + * forward routes. For more information, see Enabling IP Forwarding. + */ + canIpForward?: boolean; + /** [Output Only] The CPU platform used by this instance. */ + cpuPlatform?: string; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** Array of disks associated with this instance. Persistent disks must be created before you can assign them. */ + disks?: AttachedDisk[]; + /** List of the type and count of accelerator cards attached to the instance. */ + guestAccelerators?: AcceleratorConfig[]; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#instance for instances. */ + kind?: string; + /** + * A fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially + * generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in + * order to update or change metadata. + * + * To see the latest fingerprint, make get() request to the instance. + */ + labelFingerprint?: string; + /** Labels to apply to this instance. These can be later modified by the setLabels method. */ + labels?: Record; + /** + * Full or partial URL of the machine type resource to use for this instance, in the format: zones/zone/machineTypes/machine-type. This is provided by the + * client when the instance is created. For example, the following is a valid partial url to a predefined machine type: + * + * zones/us-central1-f/machineTypes/n1-standard-1 + * + * To create a custom machine type, provide a URL to a machine type in the following format, where CPUS is 1 or an even number up to 32 (2, 4, 6, ... 24, + * etc), and MEMORY is the total memory for this instance. Memory must be a multiple of 256 MB and must be supplied in MB (e.g. 5 GB of memory is 5120 + * MB): + * + * zones/zone/machineTypes/custom-CPUS-MEMORY + * + * For example: zones/us-central1-f/machineTypes/custom-4-5120 + * + * For a full list of restrictions, read the Specifications for custom machine types. + */ + machineType?: string; + /** The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys. */ + metadata?: Metadata; + /** + * Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel + * Haswell" or minCpuPlatform: "Intel Sandy Bridge". + */ + minCpuPlatform?: string; + /** + * The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with + * RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first + * character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot + * be a dash. + */ + name?: string; + /** + * An array of network configurations for this instance. These specify how interfaces are configured to interact with other network services, such as + * connecting to the internet. Multiple interfaces are supported per instance. + */ + networkInterfaces?: NetworkInterface[]; + /** Sets the scheduling options for this instance. */ + scheduling?: Scheduling; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** + * A list of service accounts, with their specified scopes, authorized for this instance. Only one service account per VM instance is supported. + * + * Service accounts generate access tokens that can be accessed through the metadata server and used to authenticate applications on the instance. See + * Service Accounts for more information. + */ + serviceAccounts?: ServiceAccount[]; + /** [Output Only] Whether a VM has been restricted for start because Compute Engine has detected suspicious activity. */ + startRestricted?: boolean; + /** + * [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED, SUSPENDING, SUSPENDED, and + * TERMINATED. + */ + status?: string; + /** [Output Only] An optional, human-readable explanation of the status. */ + statusMessage?: string; + /** + * A list of tags to apply to this instance. Tags are used to identify valid sources or targets for network firewalls and are specified by the client + * during instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035. + */ + tags?: Tags; + /** [Output Only] URL of the zone where the instance resides. */ + zone?: string; + } + interface InstanceAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of InstancesScopedList resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#instanceAggregatedList for aggregated lists of Instance resources. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface InstanceGroup { + /** [Output Only] The creation timestamp for this instance group in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** + * [Output Only] The fingerprint of the named ports. The system uses this fingerprint to detect conflicts when multiple users change the named ports + * concurrently. + */ + fingerprint?: string; + /** [Output Only] A unique identifier for this instance group, generated by the server. */ + id?: string; + /** [Output Only] The resource type, which is always compute#instanceGroup for instance groups. */ + kind?: string; + /** The name of the instance group. The name must be 1-63 characters long, and comply with RFC1035. */ + name?: string; + /** + * Assigns a name to a port number. For example: {name: "http", port: 80} + * + * This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: + * [{name: "http", port: 80},{name: "http", port: 8080}] + * + * Named ports apply to all instances in this instance group. + */ + namedPorts?: NamedPort[]; + /** The URL of the network to which all instances in the instance group belong. */ + network?: string; + /** The URL of the region where the instance group is located (for regional resources). */ + region?: string; + /** [Output Only] The URL for this instance group. The server generates this URL. */ + selfLink?: string; + /** [Output Only] The total number of instances in the instance group. */ + size?: number; + /** The URL of the subnetwork to which all instances in the instance group belong. */ + subnetwork?: string; + /** [Output Only] The URL of the zone where the instance group is located (for zonal resources). */ + zone?: string; + } + interface InstanceGroupAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of InstanceGroupsScopedList resources. */ + items?: Record; + /** [Output Only] The resource type, which is always compute#instanceGroupAggregatedList for aggregated lists of instance groups. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface InstanceGroupList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of InstanceGroup resources. */ + items?: InstanceGroup[]; + /** [Output Only] The resource type, which is always compute#instanceGroupList for instance group lists. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface InstanceGroupManager { + /** + * The base instance name to use for instances in this group. The value must be 1-58 characters long. Instances are named by appending a hyphen and a + * random four-character string to the base instance name. The base instance name must comply with RFC1035. + */ + baseInstanceName?: string; + /** [Output Only] The creation timestamp for this managed instance group in RFC3339 text format. */ + creationTimestamp?: string; + /** [Output Only] The list of instance actions and the number of instances in this managed instance group that are scheduled for each of those actions. */ + currentActions?: InstanceGroupManagerActionsSummary; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] The fingerprint of the resource data. You can use this optional field for optimistic locking when you update the resource. */ + fingerprint?: string; + /** [Output Only] A unique identifier for this resource type. The server generates this identifier. */ + id?: string; + /** [Output Only] The URL of the Instance Group resource. */ + instanceGroup?: string; + /** + * The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the + * managed instance group. + */ + instanceTemplate?: string; + /** [Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups. */ + kind?: string; + /** The name of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035. */ + name?: string; + /** Named ports configured for the Instance Groups complementary to this Instance Group Manager. */ + namedPorts?: NamedPort[]; + /** [Output Only] The URL of the region where the managed instance group resides (for regional resources). */ + region?: string; + /** [Output Only] The URL for this managed instance group. The server defines this URL. */ + selfLink?: string; + /** + * The URLs for all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the + * instances in the managed instance group. + */ + targetPools?: string[]; + /** + * The target number of running instances for this managed instance group. Deleting or abandoning instances reduces this number. Resizing the group + * changes this number. + */ + targetSize?: number; + /** [Output Only] The URL of the zone where the managed instance group is located (for zonal resources). */ + zone?: string; + } + interface InstanceGroupManagerActionsSummary { + /** + * [Output Only] The total number of instances in the managed instance group that are scheduled to be abandoned. Abandoning an instance removes it from + * the managed instance group without deleting it. + */ + abandoning?: number; + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be created or are currently being created. If the group fails + * to create any of these instances, it tries again until it creates the instance successfully. + * + * If you have disabled creation retries, this field will not be populated; instead, the creatingWithoutRetries field will be populated. + */ + creating?: number; + /** + * [Output Only] The number of instances that the managed instance group will attempt to create. The group attempts to create each instance only once. If + * the group fails to create any of these instances, it decreases the group's targetSize value accordingly. + */ + creatingWithoutRetries?: number; + /** [Output Only] The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted. */ + deleting?: number; + /** [Output Only] The number of instances in the managed instance group that are running and have no scheduled actions. */ + none?: number; + /** + * [Output Only] The number of instances in the managed instance group that are scheduled to be recreated or are currently being being recreated. + * Recreating an instance deletes the existing root persistent disk and creates a new disk from the image that is defined in the instance template. + */ + recreating?: number; + /** + * [Output Only] The number of instances in the managed instance group that are being reconfigured with properties that do not require a restart or a + * recreate action. For example, setting or removing target pools for the instance. + */ + refreshing?: number; + /** [Output Only] The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted. */ + restarting?: number; + } + interface InstanceGroupManagerAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of InstanceGroupManagersScopedList resources. */ + items?: Record; + /** [Output Only] The resource type, which is always compute#instanceGroupManagerAggregatedList for an aggregated list of managed instance groups. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface InstanceGroupManagerList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of InstanceGroupManager resources. */ + items?: InstanceGroupManager[]; + /** [Output Only] The resource type, which is always compute#instanceGroupManagerList for a list of managed instance groups. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface InstanceGroupManagersAbandonInstancesRequest { + /** The URLs of one or more instances to abandon. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. */ + instances?: string[]; + } + interface InstanceGroupManagersDeleteInstancesRequest { + /** The URLs of one or more instances to delete. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. */ + instances?: string[]; + } + interface InstanceGroupManagersListManagedInstancesResponse { + /** [Output Only] The list of instances in the managed instance group. */ + managedInstances?: ManagedInstance[]; + } + interface InstanceGroupManagersRecreateInstancesRequest { + /** The URLs of one or more instances to recreate. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. */ + instances?: string[]; + } + interface InstanceGroupManagersScopedList { + /** [Output Only] The list of managed instance groups that are contained in the specified project and zone. */ + instanceGroupManagers?: InstanceGroupManager[]; + /** [Output Only] The warning that replaces the list of managed instance groups when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface InstanceGroupManagersSetInstanceTemplateRequest { + /** + * The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the + * managed instance group. + */ + instanceTemplate?: string; + } + interface InstanceGroupManagersSetTargetPoolsRequest { + /** + * The fingerprint of the target pools information. Use this optional property to prevent conflicts when multiple users change the target pools settings + * concurrently. Obtain the fingerprint with the instanceGroupManagers.get method. Then, include the fingerprint in your request to ensure that you do not + * overwrite changes that were applied from another concurrent request. + */ + fingerprint?: string; + /** + * The list of target pool URLs that instances in this managed instance group belong to. The managed instance group applies these target pools to all of + * the instances in the group. Existing instances and new instances in the group all receive these target pool settings. + */ + targetPools?: string[]; + } + interface InstanceGroupsAddInstancesRequest { + /** The list of instances to add to the instance group. */ + instances?: InstanceReference[]; + } + interface InstanceGroupsListInstances { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of InstanceWithNamedPorts resources. */ + items?: InstanceWithNamedPorts[]; + /** [Output Only] The resource type, which is always compute#instanceGroupsListInstances for the list of instances in the specified instance group. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface InstanceGroupsListInstancesRequest { + /** + * A filter for the state of the instances in the instance group. Valid options are ALL or RUNNING. If you do not specify this parameter the list includes + * all instances regardless of their state. + */ + instanceState?: string; + } + interface InstanceGroupsRemoveInstancesRequest { + /** The list of instances to remove from the instance group. */ + instances?: InstanceReference[]; + } + interface InstanceGroupsScopedList { + /** [Output Only] The list of instance groups that are contained in this scope. */ + instanceGroups?: InstanceGroup[]; + /** [Output Only] An informational warning that replaces the list of instance groups when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface InstanceGroupsSetNamedPortsRequest { + /** + * The fingerprint of the named ports information for this instance group. Use this optional property to prevent conflicts when multiple users change the + * named ports settings concurrently. Obtain the fingerprint with the instanceGroups.get method. Then, include the fingerprint in your request to ensure + * that you do not overwrite changes that were applied from another concurrent request. + */ + fingerprint?: string; + /** The list of named ports to set for this instance group. */ + namedPorts?: NamedPort[]; + } + interface InstanceList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Instance resources. */ + items?: Instance[]; + /** [Output Only] Type of resource. Always compute#instanceList for lists of Instance resources. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface InstanceMoveRequest { + /** + * The URL of the destination zone to move the instance. This can be a full or partial URL. For example, the following are all valid URLs to a zone: + * - https://www.googleapis.com/compute/v1/projects/project/zones/zone + * - projects/project/zones/zone + * - zones/zone + */ + destinationZone?: string; + /** + * The URL of the target instance to move. This can be a full or partial URL. For example, the following are all valid URLs to an instance: + * - https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + * - projects/project/zones/zone/instances/instance + * - zones/zone/instances/instance + */ + targetInstance?: string; + } + interface InstanceProperties { + /** + * Enables instances created based on this template to send packets with source IP addresses other than their own and receive packets with destination IP + * addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, specify true. + * If unsure, leave this set to false. See the Enable IP forwarding documentation for more information. + */ + canIpForward?: boolean; + /** An optional text description for the instances that are created from this instance template. */ + description?: string; + /** An array of disks that are associated with the instances that are created from this template. */ + disks?: AttachedDisk[]; + /** A list of guest accelerator cards' type and count to use for instances created from the instance template. */ + guestAccelerators?: AcceleratorConfig[]; + /** Labels to apply to instances that are created from this template. */ + labels?: Record; + /** The machine type to use for instances that are created from this template. */ + machineType?: string; + /** + * The metadata key/value pairs to assign to instances that are created from this template. These pairs can consist of custom metadata or predefined keys. + * See Project and instance metadata for more information. + */ + metadata?: Metadata; + /** + * Minimum cpu/platform to be used by this instance. The instance may be scheduled on the specified or newer cpu/platform. Applicable values are the + * friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". For more information, read Specifying + * a Minimum CPU Platform. + */ + minCpuPlatform?: string; + /** An array of network access configurations for this interface. */ + networkInterfaces?: NetworkInterface[]; + /** Specifies the scheduling options for the instances that are created from this template. */ + scheduling?: Scheduling; + /** + * A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from this + * template. Use metadata queries to obtain the access tokens for these instances. + */ + serviceAccounts?: ServiceAccount[]; + /** + * A list of tags to apply to the instances that are created from this template. The tags identify valid sources or targets for network firewalls. The + * setTags method can modify this list of tags. Each tag within the list must comply with RFC1035. + */ + tags?: Tags; + } + interface InstanceReference { + /** The URL for a specific instance. */ + instance?: string; + } + interface InstanceTemplate { + /** [Output Only] The creation timestamp for this instance template in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] A unique identifier for this instance template. The server defines this identifier. */ + id?: string; + /** [Output Only] The resource type, which is always compute#instanceTemplate for instance templates. */ + kind?: string; + /** + * Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** The instance properties for this instance template. */ + properties?: InstanceProperties; + /** [Output Only] The URL for this instance template. The server defines this URL. */ + selfLink?: string; + } + interface InstanceTemplateList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of InstanceTemplate resources. */ + items?: InstanceTemplate[]; + /** [Output Only] The resource type, which is always compute#instanceTemplatesListResponse for instance template lists. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface InstanceWithNamedPorts { + /** [Output Only] The URL of the instance. */ + instance?: string; + /** [Output Only] The named ports that belong to this instance group. */ + namedPorts?: NamedPort[]; + /** [Output Only] The status of the instance. */ + status?: string; + } + interface InstancesScopedList { + /** [Output Only] List of instances contained in this scope. */ + instances?: Instance[]; + /** [Output Only] Informational warning which replaces the list of instances when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface InstancesSetLabelsRequest { + /** + * Fingerprint of the previous set of labels for this resource, used to prevent conflicts. Provide the latest fingerprint value when making a request to + * add or change labels. + */ + labelFingerprint?: string; + labels?: Record; + } + interface InstancesSetMachineResourcesRequest { + /** List of the type and count of accelerator cards attached to the instance. */ + guestAccelerators?: AcceleratorConfig[]; + } + interface InstancesSetMachineTypeRequest { + /** + * Full or partial URL of the machine type resource. See Machine Types for a full list of machine types. For example: + * zones/us-central1-f/machineTypes/n1-standard-1 + */ + machineType?: string; + } + interface InstancesSetMinCpuPlatformRequest { + /** Minimum cpu/platform this instance should be started at. */ + minCpuPlatform?: string; + } + interface InstancesSetServiceAccountRequest { + /** Email address of the service account. */ + email?: string; + /** The list of scopes to be made available for this service account. */ + scopes?: string[]; + } + interface InstancesStartWithEncryptionKeyRequest { + /** + * Array of disks associated with this instance that are protected with a customer-supplied encryption key. + * + * In order to start the instance, the disk url and its corresponding key must be provided. + * + * If the disk is not protected with a customer-supplied encryption key it should not be specified. + */ + disks?: CustomerEncryptionKeyProtectedDisk[]; + } + interface License { + /** [Output Only] Deprecated. This field no longer reflects whether a license charges a usage fee. */ + chargesUseFee?: boolean; + /** [Output Only] Type of resource. Always compute#license for licenses. */ + kind?: string; + /** [Output Only] Name of the resource. The name is 1-63 characters long and complies with RFC1035. */ + name?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + } + interface MachineType { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** [Output Only] The deprecation status associated with this machine type. */ + deprecated?: DeprecationStatus; + /** [Output Only] An optional textual description of the resource. */ + description?: string; + /** [Output Only] The number of virtual CPUs that are available to the instance. */ + guestCpus?: number; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Deprecated] This property is deprecated and will never be populated with any relevant values. */ + imageSpaceGb?: number; + /** [Output Only] Whether this machine type has a shared CPU. See Shared-core machine types for more information. */ + isSharedCpu?: boolean; + /** [Output Only] The type of the resource. Always compute#machineType for machine types. */ + kind?: string; + /** [Output Only] Maximum persistent disks allowed. */ + maximumPersistentDisks?: number; + /** [Output Only] Maximum total persistent disks size (GB) allowed. */ + maximumPersistentDisksSizeGb?: string; + /** [Output Only] The amount of physical memory available to the instance, defined in MB. */ + memoryMb?: number; + /** [Output Only] Name of the resource. */ + name?: string; + /** [Output Only] List of extended scratch disks assigned to the instance. */ + scratchDisks?: Array<{ + /** Size of the scratch disk, defined in GB. */ + diskGb?: number; + }>; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output Only] The name of the zone where the machine type resides, such as us-central1-a. */ + zone?: string; + } + interface MachineTypeAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of MachineTypesScopedList resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#machineTypeAggregatedList for aggregated lists of machine types. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface MachineTypeList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of MachineType resources. */ + items?: MachineType[]; + /** [Output Only] Type of resource. Always compute#machineTypeList for lists of machine types. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface MachineTypesScopedList { + /** [Output Only] List of machine types contained in this scope. */ + machineTypes?: MachineType[]; + /** [Output Only] An informational warning that appears when the machine types list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface ManagedInstance { + /** + * [Output Only] The current action that the managed instance group has scheduled for the instance. Possible values: + * - NONE The instance is running, and the managed instance group does not have any scheduled actions for this instance. + * - CREATING The managed instance group is creating this instance. If the group fails to create this instance, it will try again until it is successful. + * - CREATING_WITHOUT_RETRIES The managed instance group is attempting to create this instance only once. If the group fails to create this instance, it + * does not try again and the group's targetSize value is decreased instead. + * - RECREATING The managed instance group is recreating this instance. + * - DELETING The managed instance group is permanently deleting this instance. + * - ABANDONING The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools + * that are associated with this group. + * - RESTARTING The managed instance group is restarting the instance. + * - REFRESHING The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the + * target pool list for an instance without stopping that instance. + */ + currentAction?: string; + /** [Output only] The unique identifier for this resource. This field is empty when instance does not exist. */ + id?: string; + /** [Output Only] The URL of the instance. The URL can exist even if the instance has not yet been created. */ + instance?: string; + /** [Output Only] The status of the instance. This field is empty when the instance does not exist. */ + instanceStatus?: string; + /** [Output Only] Information about the last attempt to create or delete the instance. */ + lastAttempt?: ManagedInstanceLastAttempt; + } + interface ManagedInstanceLastAttempt { + /** [Output Only] Encountered errors during the last attempt to create or delete the instance. */ + errors?: { + /** [Output Only] The array of errors encountered while processing this operation. */ + errors?: Array<{ + /** [Output Only] The error type identifier for this error. */ + code?: string; + /** [Output Only] Indicates the field in the request that caused the error. This property is optional. */ + location?: string; + /** [Output Only] An optional, human-readable error message. */ + message?: string; + }>; + }; + } + interface Metadata { + /** + * Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is + * initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint + * hash in order to update or change metadata. + */ + fingerprint?: string; + /** Array of key/value pairs. The total size of all keys and values must be less than 512 KB. */ + items?: Array<{ + /** + * Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part + * of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project. + */ + key?: string; + /** + * Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only + * restriction placed on values is that their size must be less than or equal to 262144 bytes (256 KiB). + */ + value?: string; + }>; + /** [Output Only] Type of the resource. Always compute#metadata for metadata. */ + kind?: string; + } + interface NamedPort { + /** The name for this named port. The name must be 1-63 characters long, and comply with RFC1035. */ + name?: string; + /** The port number, which can be a value between 1 and 65535. */ + port?: number; + } + interface Network { + /** + * The range of internal addresses that are legal on this network. This range is a CIDR specification, for example: 192.168.0.0/16. Provided by the client + * when the network is created. + */ + IPv4Range?: string; + /** + * When set to true, the network is created in "auto subnet mode". When set to false, the network is in "custom subnet mode". + * + * In "auto subnet mode", a newly created network is assigned the default CIDR of 10.128.0.0/9 and it automatically creates one subnetwork per region. + */ + autoCreateSubnetworks?: boolean; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** + * A gateway address for default routing to other networks. This value is read only and is selected by the Google Compute Engine, typically as the first + * usable address in the IPv4Range. + */ + gatewayIPv4?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#network for networks. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** [Output Only] List of network peerings for the resource. */ + peerings?: NetworkPeering[]; + /** The network-level routing configuration for this network. Used by Cloud Router to determine what type of network-wide routing behavior to enforce. */ + routingConfig?: NetworkRoutingConfig; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output Only] Server-defined fully-qualified URLs for all subnetworks in this network. */ + subnetworks?: string[]; + } + interface NetworkInterface { + /** + * An array of configurations for this interface. Currently, only one access config, ONE_TO_ONE_NAT, is supported. If there are no accessConfigs + * specified, then this instance will have no external internet access. + */ + accessConfigs?: AccessConfig[]; + /** An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks. */ + aliasIpRanges?: AliasIpRange[]; + /** [Output Only] Type of the resource. Always compute#networkInterface for network interfaces. */ + kind?: string; + /** [Output Only] The name of the network interface, generated by the server. For network devices, these are eth0, eth1, etc. */ + name?: string; + /** + * URL of the network resource for this instance. When creating an instance, if neither the network nor the subnetwork is specified, the default network + * global/networks/default is used; if the network is not specified but the subnetwork is specified, the network is inferred. + * + * This field is optional when creating a firewall rule. If not specified when creating a firewall rule, the default network global/networks/default is + * used. + * + * If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: + * - https://www.googleapis.com/compute/v1/projects/project/global/networks/network + * - projects/project/global/networks/network + * - global/networks/default + */ + network?: string; + /** + * An IPv4 internal network address to assign to the instance for this network interface. If not specified by the user, an unused internal IP is assigned + * by the system. + */ + networkIP?: string; + /** + * The URL of the Subnetwork resource for this instance. If the network resource is in legacy mode, do not provide this property. If the network is in + * auto subnet mode, providing the subnetwork is optional. If the network is in custom subnet mode, then this field should be specified. If you specify + * this property, you can specify the subnetwork as a full or partial URL. For example, the following are all valid URLs: + * - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork + * - regions/region/subnetworks/subnetwork + */ + subnetwork?: string; + } + interface NetworkList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Network resources. */ + items?: Network[]; + /** [Output Only] Type of resource. Always compute#networkList for lists of networks. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface NetworkPeering { + /** + * Whether full mesh connectivity is created and managed automatically. When it is set to true, Google Compute Engine will automatically create and manage + * the routes between two networks when the state is ACTIVE. Otherwise, user needs to create routes manually to route packets to peer network. + */ + autoCreateRoutes?: boolean; + /** + * Name of this peering. Provided by the client when the peering is created. The name must comply with RFC1035. Specifically, the name must be 1-63 + * characters long and match regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all the + * following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** + * The URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not + * contain project, it is assumed that the peer network is in the same project as the current network. + */ + network?: string; + /** [Output Only] State for the peering. */ + state?: string; + /** [Output Only] Details about the current state of the peering. */ + stateDetails?: string; + } + interface NetworkRoutingConfig { + /** + * The network-wide routing mode to use. If set to REGIONAL, this network's cloud routers will only advertise routes with subnetworks of this network in + * the same region as the router. If set to GLOBAL, this network's cloud routers will advertise routes with all subnetworks of this network, across + * regions. + */ + routingMode?: string; + } + interface NetworksAddPeeringRequest { + /** Whether Google Compute Engine manages the routes automatically. */ + autoCreateRoutes?: boolean; + /** Name of the peering, which should conform to RFC1035. */ + name?: string; + /** + * URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not + * contain project, it is assumed that the peer network is in the same project as the current network. + */ + peerNetwork?: string; + } + interface NetworksRemovePeeringRequest { + /** Name of the peering, which should conform to RFC1035. */ + name?: string; + } + interface Operation { + /** [Output Only] Reserved for future use. */ + clientOperationId?: string; + /** [Deprecated] This field is deprecated. */ + creationTimestamp?: string; + /** [Output Only] A textual description of the operation, which is set when the operation is created. */ + description?: string; + /** [Output Only] The time that this operation was completed. This value is in RFC3339 text format. */ + endTime?: string; + /** [Output Only] If errors are generated during processing of the operation, this field will be populated. */ + error?: { + /** [Output Only] The array of errors encountered while processing this operation. */ + errors?: Array<{ + /** [Output Only] The error type identifier for this error. */ + code?: string; + /** [Output Only] Indicates the field in the request that caused the error. This property is optional. */ + location?: string; + /** [Output Only] An optional, human-readable error message. */ + message?: string; + }>; + }; + /** [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. */ + httpErrorMessage?: string; + /** + * [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a 404 means the resource was not + * found. + */ + httpErrorStatusCode?: number; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] The time that this operation was requested. This value is in RFC3339 text format. */ + insertTime?: string; + /** [Output Only] Type of the resource. Always compute#operation for Operation resources. */ + kind?: string; + /** [Output Only] Name of the resource. */ + name?: string; + /** [Output Only] The type of operation, such as insert, update, or delete, and so on. */ + operationType?: string; + /** + * [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of + * operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation + * progresses. + */ + progress?: number; + /** [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. */ + region?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. */ + startTime?: string; + /** [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. */ + status?: string; + /** [Output Only] An optional textual description of the current status of the operation. */ + statusMessage?: string; + /** [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. */ + targetId?: string; + /** + * [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk + * that the snapshot was created from. + */ + targetLink?: string; + /** [Output Only] User who requested the operation, for example: user@example.com. */ + user?: string; + /** [Output Only] If warning messages are generated during processing of the operation, this field will be populated. */ + warnings?: Array<{ + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }>; + /** [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations. */ + zone?: string; + } + interface OperationAggregatedList { + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] A map of scoped operation lists. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#operationAggregatedList for aggregated lists of operations. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface OperationList { + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] A list of Operation resources. */ + items?: Operation[]; + /** [Output Only] Type of resource. Always compute#operations for Operations resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface OperationsScopedList { + /** [Output Only] List of operations contained in this scope. */ + operations?: Operation[]; + /** [Output Only] Informational warning which replaces the list of operations when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface PathMatcher { + /** + * The full or partial URL to the BackendService resource. This will be used if none of the pathRules defined by this PathMatcher is matched by the URL's + * path portion. For example, the following are all valid URLs to a BackendService resource: + * - https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService + * - compute/v1/projects/project/global/backendServices/backendService + * - global/backendServices/backendService + */ + defaultService?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** The name to which this PathMatcher is referred by the HostRule. */ + name?: string; + /** The list of path rules. */ + pathRules?: PathRule[]; + } + interface PathRule { + /** + * The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path + * matcher does not include any text after the first ? or #, and those chars are not allowed here. + */ + paths?: string[]; + /** The URL of the BackendService resource if this rule is matched. */ + service?: string; + } + interface Project { + /** Metadata key/value pairs available to all instances contained in this project. See Custom metadata for more information. */ + commonInstanceMetadata?: Metadata; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** [Output Only] Default service account used by VMs running in this project. */ + defaultServiceAccount?: string; + /** An optional textual description of the resource. */ + description?: string; + /** Restricted features enabled for use on this project. */ + enabledFeatures?: string[]; + /** + * [Output Only] The unique identifier for the resource. This identifier is defined by the server. This is not the project ID, and is just a unique ID + * used by Compute Engine to identify resources. + */ + id?: string; + /** [Output Only] Type of the resource. Always compute#project for projects. */ + kind?: string; + /** The project ID. For example: my-example-project. Use the project ID to make requests to Compute Engine. */ + name?: string; + /** [Output Only] Quotas assigned to this project. */ + quotas?: Quota[]; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** The naming prefix for daily usage reports and the Google Cloud Storage bucket where they are stored. */ + usageExportLocation?: UsageExportLocation; + /** [Output Only] The role this project has in a shared VPC configuration. Currently only HOST projects are differentiated. */ + xpnProjectStatus?: string; + } + interface ProjectsDisableXpnResourceRequest { + /** Service resource (a.k.a service project) ID. */ + xpnResource?: XpnResourceId; + } + interface ProjectsEnableXpnResourceRequest { + /** Service resource (a.k.a service project) ID. */ + xpnResource?: XpnResourceId; + } + interface ProjectsGetXpnResources { + /** [Output Only] Type of resource. Always compute#projectsGetXpnResources for lists of service resources (a.k.a service projects) */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** Service resources (a.k.a service projects) attached to this project as their shared VPC host. */ + resources?: XpnResourceId[]; + } + interface ProjectsListXpnHostsRequest { + /** + * Optional organization ID managed by Cloud Resource Manager, for which to list shared VPC host projects. If not specified, the organization will be + * inferred from the project. + */ + organization?: string; + } + interface Quota { + /** [Output Only] Quota limit for this metric. */ + limit?: number; + /** [Output Only] Name of the quota metric. */ + metric?: string; + /** [Output Only] Current usage of this metric. */ + usage?: number; + } + interface Region { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** [Output Only] The deprecation status associated with this region. */ + deprecated?: DeprecationStatus; + /** [Output Only] Textual description of the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#region for regions. */ + kind?: string; + /** [Output Only] Name of the resource. */ + name?: string; + /** [Output Only] Quotas assigned to this region. */ + quotas?: Quota[]; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output Only] Status of the region, either UP or DOWN. */ + status?: string; + /** [Output Only] A list of zones available in this region, in the form of resource URLs. */ + zones?: string[]; + } + interface RegionAutoscalerList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Autoscaler resources. */ + items?: Autoscaler[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface RegionInstanceGroupList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of InstanceGroup resources. */ + items?: InstanceGroup[]; + /** The resource type. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface RegionInstanceGroupManagerList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of InstanceGroupManager resources. */ + items?: InstanceGroupManager[]; + /** + * [Output Only] The resource type, which is always compute#instanceGroupManagerList for a list of managed instance groups that exist in th regional + * scope. + */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface RegionInstanceGroupManagersAbandonInstancesRequest { + /** The URLs of one or more instances to abandon. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. */ + instances?: string[]; + } + interface RegionInstanceGroupManagersDeleteInstancesRequest { + /** The URLs of one or more instances to delete. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. */ + instances?: string[]; + } + interface RegionInstanceGroupManagersListInstancesResponse { + /** List of managed instances. */ + managedInstances?: ManagedInstance[]; + } + interface RegionInstanceGroupManagersRecreateRequest { + /** The URLs of one or more instances to recreate. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. */ + instances?: string[]; + } + interface RegionInstanceGroupManagersSetTargetPoolsRequest { + /** + * Fingerprint of the target pools information, which is a hash of the contents. This field is used for optimistic locking when you update the target pool + * entries. This field is optional. + */ + fingerprint?: string; + /** + * The URL of all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the + * instances in the managed instance group. + */ + targetPools?: string[]; + } + interface RegionInstanceGroupManagersSetTemplateRequest { + /** URL of the InstanceTemplate resource from which all new instances will be created. */ + instanceTemplate?: string; + } + interface RegionInstanceGroupsListInstances { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of InstanceWithNamedPorts resources. */ + items?: InstanceWithNamedPorts[]; + /** The resource type. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface RegionInstanceGroupsListInstancesRequest { + /** Instances in which state should be returned. Valid options are: 'ALL', 'RUNNING'. By default, it lists all instances. */ + instanceState?: string; + /** + * Name of port user is interested in. It is optional. If it is set, only information about this ports will be returned. If it is not set, all the named + * ports will be returned. Always lists all instances. + */ + portName?: string; + } + interface RegionInstanceGroupsSetNamedPortsRequest { + /** + * The fingerprint of the named ports information for this instance group. Use this optional property to prevent conflicts when multiple users change the + * named ports settings concurrently. Obtain the fingerprint with the instanceGroups.get method. Then, include the fingerprint in your request to ensure + * that you do not overwrite changes that were applied from another concurrent request. + */ + fingerprint?: string; + /** The list of named ports to set for this instance group. */ + namedPorts?: NamedPort[]; + } + interface RegionList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Region resources. */ + items?: Region[]; + /** [Output Only] Type of resource. Always compute#regionList for lists of regions. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface ResourceCommitment { + /** + * The amount of the resource purchased (in a type-dependent unit, such as bytes). For vCPUs, this can just be an integer. For memory, this must be + * provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of memory per every vCPU. + */ + amount?: string; + /** Type of resource for which this commitment applies. Possible values are VCPU and MEMORY */ + type?: string; + } + interface ResourceGroupReference { + /** A URI referencing one of the instance groups listed in the backend service. */ + group?: string; + } + interface Route { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** The destination range of outgoing packets that this route applies to. Only IPv4 is supported. */ + destRange?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of this resource. Always compute#routes for Route resources. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** Fully-qualified URL of the network that this route applies to. */ + network?: string; + /** + * The URL to a gateway that should handle matching packets. You can only specify the internet gateway using a full or partial valid URL: + * projects//global/gateways/default-internet-gateway + */ + nextHopGateway?: string; + /** + * The URL to an instance that should handle matching packets. You can specify this as a full or partial URL. For example: + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/ + */ + nextHopInstance?: string; + /** The network IP address of an instance that should handle matching packets. Only IPv4 is supported. */ + nextHopIp?: string; + /** The URL of the local network if it should handle matching packets. */ + nextHopNetwork?: string; + /** [Output Only] The network peering name that should handle matching packets, which should conform to RFC1035. */ + nextHopPeering?: string; + /** The URL to a VpnTunnel that should handle matching packets. */ + nextHopVpnTunnel?: string; + /** + * The priority of this route. Priority is used to break ties in cases where there is more than one matching route of equal prefix length. In the case of + * two routes with equal prefix length, the one with the lowest-numbered priority value wins. Default value is 1000. Valid range is 0 through 65535. + */ + priority?: number; + /** [Output Only] Server-defined fully-qualified URL for this resource. */ + selfLink?: string; + /** A list of instance tags to which this route applies. */ + tags?: string[]; + /** [Output Only] If potential misconfigurations are detected for this route, this field will be populated with warning messages. */ + warnings?: Array<{ + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }>; + } + interface RouteList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Route resources. */ + items?: Route[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface Router { + /** BGP information specific to this router. */ + bgp?: RouterBgp; + /** + * BGP information that needs to be configured into the routing stack to establish the BGP peering. It must specify peer ASN and either interface name, + * IP, or peer IP. Please refer to RFC4273. + */ + bgpPeers?: RouterBgpPeer[]; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** + * Router interfaces. Each interface requires either one linked resource (e.g. linkedVpnTunnel), or IP address and IP address range (e.g. ipRange), or + * both. + */ + interfaces?: RouterInterface[]; + /** [Output Only] Type of resource. Always compute#router for routers. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** URI of the network to which this router belongs. */ + network?: string; + /** [Output Only] URI of the region where the router resides. */ + region?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + } + interface RouterAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Router resources. */ + items?: Record; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface RouterBgp { + /** + * Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource. + * All VPN tunnels that link to this router will have the same local ASN. + */ + asn?: number; + } + interface RouterBgpPeer { + /** + * The priority of routes advertised to this BGP peer. In the case where there is more than one matching route of maximum length, the routes with lowest + * priority value win. + */ + advertisedRoutePriority?: number; + /** Name of the interface the BGP peer is associated with. */ + interfaceName?: string; + /** IP address of the interface inside Google Cloud Platform. Only IPv4 is supported. */ + ipAddress?: string; + /** Name of this BGP peer. The name must be 1-63 characters long and comply with RFC1035. */ + name?: string; + /** Peer BGP Autonomous System Number (ASN). For VPN use case, this value can be different for every tunnel. */ + peerAsn?: number; + /** IP address of the BGP interface outside Google cloud. Only IPv4 is supported. */ + peerIpAddress?: string; + } + interface RouterInterface { + /** + * IP address and range of the interface. The IP range must be in the RFC3927 link-local IP space. The value must be a CIDR-formatted string, for example: + * 169.254.0.1/30. NOTE: Do not truncate the address as it represents the IP address of the interface. + */ + ipRange?: string; + /** + * URI of the linked VPN tunnel. It must be in the same region as the router. Each interface can have at most one linked resource and it could either be a + * VPN Tunnel or an interconnect attachment. + */ + linkedVpnTunnel?: string; + /** Name of this interface entry. The name must be 1-63 characters long and comply with RFC1035. */ + name?: string; + } + interface RouterList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Router resources. */ + items?: Router[]; + /** [Output Only] Type of resource. Always compute#router for routers. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface RouterStatus { + /** Best routes for this router's network. */ + bestRoutes?: Route[]; + /** Best routes learned by this router. */ + bestRoutesForRouter?: Route[]; + bgpPeerStatus?: RouterStatusBgpPeerStatus[]; + /** URI of the network to which this router belongs. */ + network?: string; + } + interface RouterStatusBgpPeerStatus { + /** Routes that were advertised to the remote BGP peer */ + advertisedRoutes?: Route[]; + /** IP address of the local BGP interface. */ + ipAddress?: string; + /** URL of the VPN tunnel that this BGP peer controls. */ + linkedVpnTunnel?: string; + /** Name of this BGP peer. Unique within the Routers resource. */ + name?: string; + /** Number of routes learned from the remote BGP Peer. */ + numLearnedRoutes?: number; + /** IP address of the remote BGP interface. */ + peerIpAddress?: string; + /** BGP state as specified in RFC1771. */ + state?: string; + /** Status of the BGP peer: {UP, DOWN} */ + status?: string; + /** Time this session has been up. Format: 14 years, 51 weeks, 6 days, 23 hours, 59 minutes, 59 seconds */ + uptime?: string; + /** Time this session has been up, in seconds. Format: 145 */ + uptimeSeconds?: string; + } + interface RouterStatusResponse { + /** Type of resource. */ + kind?: string; + result?: RouterStatus; + } + interface RoutersPreviewResponse { + /** Preview of given router. */ + resource?: Router; + } + interface RoutersScopedList { + /** List of routers contained in this scope. */ + routers?: Router[]; + /** Informational warning which replaces the list of routers when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface SSLHealthCheck { + /** The TCP port number for the health check request. The default value is 443. Valid values are 1 through 65535. */ + port?: number; + /** Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence. */ + portName?: string; + /** Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. */ + proxyHeader?: string; + /** + * The application data to send once the SSL connection has been established (default value is empty). If both request and response are empty, the + * connection establishment alone will indicate health. The request data can only be ASCII. + */ + request?: string; + /** + * The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data + * can only be ASCII. + */ + response?: string; + } + interface Scheduling { + /** + * Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the + * automatic restart option for standard instances. Preemptible instances cannot be automatically restarted. + * + * By default, this is set to true so an instance is automatically restarted if it is terminated by Compute Engine. + */ + automaticRestart?: boolean; + /** + * Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and + * only possible behavior is TERMINATE. For more information, see Setting Instance Scheduling Options. + */ + onHostMaintenance?: string; + /** + * Defines whether the instance is preemptible. This can only be set during instance creation, it cannot be set or changed after the instance has been + * created. + */ + preemptible?: boolean; + } + interface SerialPortOutput { + /** [Output Only] The contents of the console output. */ + contents?: string; + /** [Output Only] Type of the resource. Always compute#serialPortOutput for serial port output. */ + kind?: string; + /** [Output Only] The position of the next byte of content from the serial console output. Use this value in the next request as the start parameter. */ + next?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** + * The starting byte position of the output that was returned. This should match the start parameter sent with the request. If the serial console output + * exceeds the size of the buffer, older output will be overwritten by newer content and the start values will be mismatched. + */ + start?: string; + } + interface ServiceAccount { + /** Email address of the service account. */ + email?: string; + /** The list of scopes to be made available for this service account. */ + scopes?: string[]; + } + interface Snapshot { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] Size of the snapshot, specified in GB. */ + diskSizeGb?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#snapshot for Snapshot resources. */ + kind?: string; + /** + * A fingerprint for the labels being applied to this snapshot, which is essentially a hash of the labels set used for optimistic locking. The fingerprint + * is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint + * hash in order to update or change labels. + * + * To see the latest fingerprint, make a get() request to retrieve a snapshot. + */ + labelFingerprint?: string; + /** Labels to apply to this snapshot. These can be later modified by the setLabels method. Label values may be empty. */ + labels?: Record; + /** + * [Output Only] A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a + * Windows image). + */ + licenses?: string[]; + /** + * Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** + * Encrypts the snapshot using a customer-supplied encryption key. + * + * After you encrypt a snapshot using a customer-supplied key, you must provide the same key if you use the image later For example, you must provide the + * encryption key when you create a disk from the encrypted snapshot in a future request. + * + * Customer-supplied encryption keys do not protect access to metadata of the disk. + * + * If you do not provide an encryption key when creating the snapshot, then the snapshot will be encrypted using an automatically generated key and you do + * not need to provide a key to use the snapshot later. + */ + snapshotEncryptionKey?: CustomerEncryptionKey; + /** [Output Only] The source disk used to create this snapshot. */ + sourceDisk?: string; + /** The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key. */ + sourceDiskEncryptionKey?: CustomerEncryptionKey; + /** + * [Output Only] The ID value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the + * current or a previous instance of a given disk name. + */ + sourceDiskId?: string; + /** [Output Only] The status of the snapshot. This can be CREATING, DELETING, FAILED, READY, or UPLOADING. */ + status?: string; + /** + * [Output Only] A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot + * creation/deletion. + */ + storageBytes?: string; + /** + * [Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status + * can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date. + */ + storageBytesStatus?: string; + } + interface SnapshotList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Snapshot resources. */ + items?: Snapshot[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface SslCertificate { + /** + * A local certificate file. The certificate must be in PEM format. The certificate chain must be no greater than 5 certs long. The chain must include at + * least one intermediate cert. + */ + certificate?: string; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#sslCertificate for SSL certificates. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** A write-only private key in PEM format. Only insert requests will include this field. */ + privateKey?: string; + /** [Output only] Server-defined URL for the resource. */ + selfLink?: string; + } + interface SslCertificateList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of SslCertificate resources. */ + items?: SslCertificate[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface Subnetwork { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time. */ + description?: string; + /** + * [Output Only] The gateway address for default routes to reach destination addresses outside this subnetwork. This field can be set only at resource + * creation time. + */ + gatewayAddress?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** + * The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or + * 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. This field can be set only at resource creation + * time. + */ + ipCidrRange?: string; + /** [Output Only] Type of the resource. Always compute#subnetwork for Subnetwork resources. */ + kind?: string; + /** + * The name of the resource, provided by the client when initially creating the resource. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** + * The URL of the network to which this subnetwork belongs, provided by the client when initially creating the subnetwork. Only networks that are in the + * distributed mode can have subnetworks. This field can be set only at resource creation time. + */ + network?: string; + /** + * Whether the VMs in this subnet can access Google services without assigned external IP addresses. This field can be both set at resource creation time + * and updated using setPrivateIpGoogleAccess. + */ + privateIpGoogleAccess?: boolean; + /** URL of the region where the Subnetwork resides. This field can be set only at resource creation time. */ + region?: string; + /** + * An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary + * ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. + */ + secondaryIpRanges?: SubnetworkSecondaryRange[]; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + } + interface SubnetworkAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of SubnetworksScopedList resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#subnetworkAggregatedList for aggregated lists of subnetworks. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface SubnetworkList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Subnetwork resources. */ + items?: Subnetwork[]; + /** [Output Only] Type of resource. Always compute#subnetworkList for lists of subnetworks. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface SubnetworkSecondaryRange { + /** + * The range of IP addresses belonging to this subnetwork secondary range. Provide this property when you create the subnetwork. Ranges must be unique and + * non-overlapping with all primary and secondary IP ranges within a network. Only IPv4 is supported. + */ + ipCidrRange?: string; + /** + * The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, + * and comply with RFC1035. The name must be unique within the subnetwork. + */ + rangeName?: string; + } + interface SubnetworksExpandIpCidrRangeRequest { + /** + * The IP (in CIDR format or netmask) of internal addresses that are legal on this Subnetwork. This range should be disjoint from other subnetworks within + * this network. This range can only be larger than (i.e. a superset of) the range previously defined before the update. + */ + ipCidrRange?: string; + } + interface SubnetworksScopedList { + /** List of subnetworks contained in this scope. */ + subnetworks?: Subnetwork[]; + /** An informational warning that appears when the list of addresses is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface SubnetworksSetPrivateIpGoogleAccessRequest { + privateIpGoogleAccess?: boolean; + } + interface TCPHealthCheck { + /** The TCP port number for the health check request. The default value is 80. Valid values are 1 through 65535. */ + port?: number; + /** Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence. */ + portName?: string; + /** Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. */ + proxyHeader?: string; + /** + * The application data to send once the TCP connection has been established (default value is empty). If both request and response are empty, the + * connection establishment alone will indicate health. The request data can only be ASCII. + */ + request?: string; + /** + * The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data + * can only be ASCII. + */ + response?: string; + } + interface Tags { + /** + * Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is + * initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint + * hash in order to update or change metadata. + * + * To see the latest fingerprint, make get() request to the instance. + */ + fingerprint?: string; + /** An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035. */ + items?: string[]; + } + interface TargetHttpProxy { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of resource. Always compute#targetHttpProxy for target HTTP proxies. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** URL to the UrlMap resource that defines the mapping from URL to the BackendService. */ + urlMap?: string; + } + interface TargetHttpProxyList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of TargetHttpProxy resources. */ + items?: TargetHttpProxy[]; + /** Type of resource. Always compute#targetHttpProxyList for lists of target HTTP proxies. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TargetHttpsProxiesSetSslCertificatesRequest { + /** New set of SslCertificate resources to associate with this TargetHttpsProxy resource. Currently exactly one SslCertificate resource must be specified. */ + sslCertificates?: string[]; + } + interface TargetHttpsProxy { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of resource. Always compute#targetHttpsProxy for target HTTPS proxies. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** + * URLs to SslCertificate resources that are used to authenticate connections between users and the load balancer. Currently, exactly one SSL certificate + * must be specified. + */ + sslCertificates?: string[]; + /** + * A fully-qualified or valid partial URL to the UrlMap resource that defines the mapping from URL to the BackendService. For example, the following are + * all valid URLs for specifying a URL map: + * - https://www.googleapis.compute/v1/projects/project/global/urlMaps/url-map + * - projects/project/global/urlMaps/url-map + * - global/urlMaps/url-map + */ + urlMap?: string; + } + interface TargetHttpsProxyList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of TargetHttpsProxy resources. */ + items?: TargetHttpsProxy[]; + /** Type of resource. Always compute#targetHttpsProxyList for lists of target HTTPS proxies. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TargetInstance { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** + * A URL to the virtual machine instance that handles traffic for this target instance. When creating a target instance, you can provide the + * fully-qualified URL or a valid partial URL to the desired virtual machine. For example, the following are all valid URLs: + * - https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + * - projects/project/zones/zone/instances/instance + * - zones/zone/instances/instance + */ + instance?: string; + /** [Output Only] The type of the resource. Always compute#targetInstance for target instances. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** NAT option controlling how IPs are NAT'ed to the instance. Currently only NO_NAT (default value) is supported. */ + natPolicy?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output Only] URL of the zone where the target instance resides. */ + zone?: string; + } + interface TargetInstanceAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of TargetInstance resources. */ + items?: Record; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TargetInstanceList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of TargetInstance resources. */ + items?: TargetInstance[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TargetInstancesScopedList { + /** List of target instances contained in this scope. */ + targetInstances?: TargetInstance[]; + /** Informational warning which replaces the list of addresses when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TargetPool { + /** + * This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool, and its failoverRatio field is properly + * set to a value between [0, 1]. + * + * backupPool and failoverRatio together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary + * pool is at or below failoverRatio, traffic arriving at the load-balanced IP will be directed to the backup pool. + * + * In case where failoverRatio and backupPool are not set, or all the instances in the backup pool are unhealthy, the traffic will be directed back to the + * primary pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is + * healthy. + */ + backupPool?: string; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** + * This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool (i.e., not as a backup pool to some + * other target pool). The value of the field must be in [0, 1]. + * + * If set, backupPool must also be set. They together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in + * the primary pool is at or below this number, traffic arriving at the load-balanced IP will be directed to the backup pool. + * + * In case where failoverRatio is not set or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in + * the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy. + */ + failoverRatio?: number; + /** + * The URL of the HttpHealthCheck resource. A member instance in this pool is considered healthy if and only if the health checks pass. An empty list + * means all member instances will be considered healthy at all times. Only HttpHealthChecks are supported. Only one health check may be specified. + */ + healthChecks?: string[]; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** A list of resource URLs to the virtual machine instances serving this pool. They must live in zones contained in the same region as this pool. */ + instances?: string[]; + /** [Output Only] Type of the resource. Always compute#targetPool for target pools. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** [Output Only] URL of the region where the target pool resides. */ + region?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** + * Sesssion affinity option, must be one of the following values: + * NONE: Connections from the same client IP may go to any instance in the pool. + * CLIENT_IP: Connections from the same client IP will go to the same instance in the pool while that instance remains healthy. + * CLIENT_IP_PROTO: Connections from the same client IP with the same IP protocol will go to the same instance in the pool while that instance remains + * healthy. + */ + sessionAffinity?: string; + } + interface TargetPoolAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of TargetPool resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#targetPoolAggregatedList for aggregated lists of target pools. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TargetPoolInstanceHealth { + healthStatus?: HealthStatus[]; + /** [Output Only] Type of resource. Always compute#targetPoolInstanceHealth when checking the health of an instance. */ + kind?: string; + } + interface TargetPoolList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of TargetPool resources. */ + items?: TargetPool[]; + /** [Output Only] Type of resource. Always compute#targetPoolList for lists of target pools. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TargetPoolsAddHealthCheckRequest { + /** The HttpHealthCheck to add to the target pool. */ + healthChecks?: HealthCheckReference[]; + } + interface TargetPoolsAddInstanceRequest { + /** + * A full or partial URL to an instance to add to this target pool. This can be a full or partial URL. For example, the following are valid URLs: + * - https://www.googleapis.com/compute/v1/projects/project-id/zones/zone/instances/instance-name + * - projects/project-id/zones/zone/instances/instance-name + * - zones/zone/instances/instance-name + */ + instances?: InstanceReference[]; + } + interface TargetPoolsRemoveHealthCheckRequest { + /** + * Health check URL to be removed. This can be a full or valid partial URL. For example, the following are valid URLs: + * - https://www.googleapis.com/compute/beta/projects/project/global/httpHealthChecks/health-check + * - projects/project/global/httpHealthChecks/health-check + * - global/httpHealthChecks/health-check + */ + healthChecks?: HealthCheckReference[]; + } + interface TargetPoolsRemoveInstanceRequest { + /** URLs of the instances to be removed from target pool. */ + instances?: InstanceReference[]; + } + interface TargetPoolsScopedList { + /** List of target pools contained in this scope. */ + targetPools?: TargetPool[]; + /** Informational warning which replaces the list of addresses when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TargetReference { + target?: string; + } + interface TargetSslProxiesSetBackendServiceRequest { + /** The URL of the new BackendService resource for the targetSslProxy. */ + service?: string; + } + interface TargetSslProxiesSetProxyHeaderRequest { + /** The new type of proxy header to append before sending data to the backend. NONE or PROXY_V1 are allowed. */ + proxyHeader?: string; + } + interface TargetSslProxiesSetSslCertificatesRequest { + /** New set of URLs to SslCertificate resources to associate with this TargetSslProxy. Currently exactly one ssl certificate must be specified. */ + sslCertificates?: string[]; + } + interface TargetSslProxy { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#targetSslProxy for target SSL proxies. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. */ + proxyHeader?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** URL to the BackendService resource. */ + service?: string; + /** URLs to SslCertificate resources that are used to authenticate connections to Backends. Currently exactly one SSL certificate must be specified. */ + sslCertificates?: string[]; + } + interface TargetSslProxyList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of TargetSslProxy resources. */ + items?: TargetSslProxy[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TargetTcpProxiesSetBackendServiceRequest { + /** The URL of the new BackendService resource for the targetTcpProxy. */ + service?: string; + } + interface TargetTcpProxiesSetProxyHeaderRequest { + /** The new type of proxy header to append before sending data to the backend. NONE or PROXY_V1 are allowed. */ + proxyHeader?: string; + } + interface TargetTcpProxy { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#targetTcpProxy for target TCP proxies. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. */ + proxyHeader?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** URL to the BackendService resource. */ + service?: string; + } + interface TargetTcpProxyList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of TargetTcpProxy resources. */ + items?: TargetTcpProxy[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TargetVpnGateway { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** + * [Output Only] A list of URLs to the ForwardingRule resources. ForwardingRules are created using compute.forwardingRules.insert and associated to a VPN + * gateway. + */ + forwardingRules?: string[]; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** URL of the network to which this VPN gateway is attached. Provided by the client when the VPN gateway is created. */ + network?: string; + /** [Output Only] URL of the region where the target VPN gateway resides. */ + region?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output Only] The status of the VPN gateway. */ + status?: string; + /** [Output Only] A list of URLs to VpnTunnel resources. VpnTunnels are created using compute.vpntunnels.insert method and associated to a VPN gateway. */ + tunnels?: string[]; + } + interface TargetVpnGatewayAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of TargetVpnGateway resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TargetVpnGatewayList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of TargetVpnGateway resources. */ + items?: TargetVpnGateway[]; + /** [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TargetVpnGatewaysScopedList { + /** [Output Only] List of target vpn gateways contained in this scope. */ + targetVpnGateways?: TargetVpnGateway[]; + /** [Output Only] Informational warning which replaces the list of addresses when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface TestFailure { + actualService?: string; + expectedService?: string; + host?: string; + path?: string; + } + interface UrlMap { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** The URL of the BackendService resource if none of the hostRules match. */ + defaultService?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** + * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when + * inserting a UrlMap. An up-to-date fingerprint must be provided in order to update the UrlMap. + */ + fingerprint?: string; + /** The list of HostRules to use against the URL. */ + hostRules?: HostRule[]; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#urlMaps for url maps. */ + kind?: string; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** The list of named PathMatchers to use against the URL. */ + pathMatchers?: PathMatcher[]; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** The list of expected URL mappings. Request to update this UrlMap will succeed only if all of the test cases pass. */ + tests?: UrlMapTest[]; + } + interface UrlMapList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of UrlMap resources. */ + items?: UrlMap[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface UrlMapReference { + urlMap?: string; + } + interface UrlMapTest { + /** Description of this test case. */ + description?: string; + /** Host portion of the URL. */ + host?: string; + /** Path portion of the URL. */ + path?: string; + /** Expected BackendService resource the given URL should be mapped to. */ + service?: string; + } + interface UrlMapValidationResult { + loadErrors?: string[]; + /** Whether the given UrlMap can be successfully loaded. If false, 'loadErrors' indicates the reasons. */ + loadSucceeded?: boolean; + testFailures?: TestFailure[]; + /** If successfully loaded, this field indicates whether the test passed. If false, 'testFailures's indicate the reason of failure. */ + testPassed?: boolean; + } + interface UrlMapsValidateRequest { + /** Content of the UrlMap to be validated. */ + resource?: UrlMap; + } + interface UrlMapsValidateResponse { + result?: UrlMapValidationResult; + } + interface UsageExportLocation { + /** + * The name of an existing bucket in Cloud Storage where the usage report object is stored. The Google Service Account is granted write access to this + * bucket. This can either be the bucket name by itself, such as example-bucket, or the bucket name with gs:// or https://storage.googleapis.com/ in front + * of it, such as gs://example-bucket. + */ + bucketName?: string; + /** + * An optional prefix for the name of the usage report object stored in bucketName. If not supplied, defaults to usage. The report is stored as a CSV file + * named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the usage according to Pacific Time. If you supply a prefix, it should conform + * to Cloud Storage object naming conventions. + */ + reportNamePrefix?: string; + } + interface VpnTunnel { + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** An optional description of this resource. Provide this property when you create the resource. */ + description?: string; + /** [Output Only] Detailed status message for the VPN tunnel. */ + detailedStatus?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** IKE protocol version to use when establishing the VPN tunnel with peer VPN gateway. Acceptable IKE versions are 1 or 2. Default version is 2. */ + ikeVersion?: number; + /** [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. */ + kind?: string; + /** + * Local traffic selector to use when establishing the VPN tunnel with peer VPN gateway. The value should be a CIDR formatted string, for example: + * 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is supported. + */ + localTrafficSelector?: string[]; + /** + * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** IP address of the peer VPN gateway. Only IPv4 is supported. */ + peerIp?: string; + /** [Output Only] URL of the region where the VPN tunnel resides. */ + region?: string; + /** + * Remote traffic selectors to use when establishing the VPN tunnel with peer VPN gateway. The value should be a CIDR formatted string, for example: + * 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is supported. + */ + remoteTrafficSelector?: string[]; + /** URL of router resource to be used for dynamic routing. */ + router?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** Shared secret used to set the secure session between the Cloud VPN gateway and the peer VPN gateway. */ + sharedSecret?: string; + /** Hash of the shared secret. */ + sharedSecretHash?: string; + /** [Output Only] The status of the VPN tunnel. */ + status?: string; + /** URL of the VPN gateway with which this VPN tunnel is associated. Provided by the client when the VPN tunnel is created. */ + targetVpnGateway?: string; + } + interface VpnTunnelAggregatedList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of VpnTunnelsScopedList resources. */ + items?: Record; + /** [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface VpnTunnelList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of VpnTunnel resources. */ + items?: VpnTunnel[]; + /** [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface VpnTunnelsScopedList { + /** List of vpn tunnels contained in this scope. */ + vpnTunnels?: VpnTunnel[]; + /** Informational warning which replaces the list of addresses when the list is empty. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface XpnHostList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** [Output Only] A list of shared VPC host project URLs. */ + items?: Project[]; + /** [Output Only] Type of resource. Always compute#xpnHostList for lists of shared VPC hosts. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface XpnResourceId { + /** The ID of the service resource. In the case of projects, this field matches the project ID (e.g., my-project), not the project number (e.g., 12345678). */ + id?: string; + /** The type of the service resource. */ + type?: string; + } + interface Zone { + /** [Output Only] Available cpu/platform selections for the zone. */ + availableCpuPlatforms?: string[]; + /** [Output Only] Creation timestamp in RFC3339 text format. */ + creationTimestamp?: string; + /** [Output Only] The deprecation status associated with this zone. */ + deprecated?: DeprecationStatus; + /** [Output Only] Textual description of the resource. */ + description?: string; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] Type of the resource. Always compute#zone for zones. */ + kind?: string; + /** [Output Only] Name of the resource. */ + name?: string; + /** [Output Only] Full URL reference to the region which hosts the zone. */ + region?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output Only] Status of the zone, either UP or DOWN. */ + status?: string; + } + interface ZoneList { + /** [Output Only] Unique identifier for the resource; defined by the server. */ + id?: string; + /** A list of Zone resources. */ + items?: Zone[]; + /** Type of resource. */ + kind?: string; + /** + * [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the + * nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to + * continue paging through the results. + */ + nextPageToken?: string; + /** [Output Only] Server-defined URL for this resource. */ + selfLink?: string; + /** [Output Only] Informational warning message. */ + warning?: { + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }; + } + interface ZoneSetLabelsRequest { + /** + * The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and + * changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels. + * Make a get() request to the resource to get the latest fingerprint. + */ + labelFingerprint?: string; + /** The labels to set for this resource. */ + labels?: Record; + } + interface AcceleratorTypesResource { + /** Retrieves an aggregated list of accelerator types. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified accelerator type. Get a list of available accelerator types by making a list() request. */ + get(request: { + /** Name of the accelerator type to return. */ + acceleratorType: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Retrieves a list of accelerator types available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + } + interface AddressesResource { + /** Retrieves an aggregated list of addresses. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified address resource. */ + delete(request: { + /** Name of the address resource to delete. */ + address: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified address resource. */ + get(request: { + /** Name of the address resource to return. */ + address: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request
    ; + /** Creates an address resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of addresses contained within the specified region. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AutoscalersResource { + /** Retrieves an aggregated list of autoscalers. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified autoscaler. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the autoscaler to delete. */ + autoscaler: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone for this request. */ + zone: string; + }): Request; + /** Returns the specified autoscaler resource. Get a list of available autoscalers by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the autoscaler to return. */ + autoscaler: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone for this request. */ + zone: string; + }): Request; + /** Creates an autoscaler in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone for this request. */ + zone: string; + }): Request; + /** Retrieves a list of autoscalers contained within the specified zone. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone for this request. */ + zone: string; + }): Request; + /** + * Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge + * patch format and processing rules. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the autoscaler to patch. */ + autoscaler?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone for this request. */ + zone: string; + }): Request; + /** Updates an autoscaler in the specified project using the data included in the request. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the autoscaler to update. */ + autoscaler?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone for this request. */ + zone: string; + }): Request; + } + interface BackendBucketsResource { + /** Deletes the specified BackendBucket resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendBucket resource to delete. */ + backendBucket: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified BackendBucket resource. Get a list of available backend buckets by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendBucket resource to return. */ + backendBucket: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a BackendBucket resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of BackendBucket resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch + * format and processing rules. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendBucket resource to patch. */ + backendBucket: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the specified BackendBucket resource with the data included in the request. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendBucket resource to update. */ + backendBucket: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface BackendServicesResource { + /** Retrieves the list of all BackendService resources, regional and global, available to the specified project. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Name of the project scoping this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified BackendService resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendService resource to delete. */ + backendService: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified BackendService resource. Get a list of available backend services by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendService resource to return. */ + backendService: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets the most recent health check results for this BackendService. */ + getHealth(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendService resource to which the queried instance belongs. */ + backendService: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to + * keep in mind when creating a backend service. Read Restrictions and Guidelines for more information. + */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of BackendService resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when + * updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch + * format and processing rules. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendService resource to patch. */ + backendService: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when + * updating a backend service. Read Restrictions and Guidelines for more information. + */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendService resource to update. */ + backendService: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DiskTypesResource { + /** Retrieves an aggregated list of disk types. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified disk type. Get a list of available disk types by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the disk type to return. */ + diskType: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Retrieves a list of disk types available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + } + interface DisksResource { + /** Retrieves an aggregated list of persistent disks. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a snapshot of a specified persistent disk. */ + createSnapshot(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the persistent disk to snapshot. */ + disk: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + guestFlush?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** + * Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any + * snapshots previously made from the disk. You must separately delete snapshots. + */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the persistent disk to delete. */ + disk: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Returns a specified persistent disk. Get a list of available persistent disks by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the persistent disk to return. */ + disk: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** + * Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, or create + * an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb + * property. + */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Optional. Source image to restore onto a disk. */ + sourceImage?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Retrieves a list of persistent disks contained within the specified zone. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Resizes the specified persistent disk. */ + resize(request: { + /** Data format for the response. */ + alt?: string; + /** The name of the persistent disk. */ + disk: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. */ + setLabels(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + } + interface FirewallsResource { + /** Deletes the specified firewall. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the firewall rule to delete. */ + firewall: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified firewall. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the firewall rule to return. */ + firewall: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a firewall rule in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of firewall rules available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format + * and processing rules. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the firewall rule to patch. */ + firewall: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the specified firewall rule with the data included in the request. Using PUT method, can only update following fields of firewall rule: + * allowed, description, sourceRanges, sourceTags, targetTags. + */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the firewall rule to update. */ + firewall: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ForwardingRulesResource { + /** Retrieves an aggregated list of forwarding rules. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified ForwardingRule resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the ForwardingRule resource to delete. */ + forwardingRule: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified ForwardingRule resource. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the ForwardingRule resource to return. */ + forwardingRule: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a ForwardingRule resource in the specified project and region using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of ForwardingRule resources available to the specified project and region. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Changes target URL for forwarding rule. The new target should be of the same type as the old target. */ + setTarget(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the ForwardingRule resource in which target is to be set. */ + forwardingRule: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface GlobalAddressesResource { + /** Deletes the specified address resource. */ + delete(request: { + /** Name of the address resource to delete. */ + address: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified address resource. Get a list of available addresses by making a list() request. */ + get(request: { + /** Name of the address resource to return. */ + address: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request
    ; + /** Creates an address resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of global addresses. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface GlobalForwardingRulesResource { + /** Deletes the specified GlobalForwardingRule resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the ForwardingRule resource to delete. */ + forwardingRule: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified GlobalForwardingRule resource. Get a list of available forwarding rules by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the ForwardingRule resource to return. */ + forwardingRule: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a GlobalForwardingRule resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of GlobalForwardingRule resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target. */ + setTarget(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the ForwardingRule resource in which target is to be set. */ + forwardingRule: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface GlobalOperationsResource { + /** Retrieves an aggregated list of all operations. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified Operations resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Name of the Operations resource to delete. */ + operation: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the specified Operations resource. Get a list of operations by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Name of the Operations resource to return. */ + operation: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of Operation resources contained within the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface HealthChecksResource { + /** Deletes the specified HealthCheck resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the HealthCheck resource to delete. */ + healthCheck: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified HealthCheck resource. Get a list of available health checks by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the HealthCheck resource to return. */ + healthCheck: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a HealthCheck resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of HealthCheck resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON + * merge patch format and processing rules. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the HealthCheck resource to patch. */ + healthCheck: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a HealthCheck resource in the specified project using the data included in the request. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the HealthCheck resource to update. */ + healthCheck: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface HttpHealthChecksResource { + /** Deletes the specified HttpHealthCheck resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the HttpHealthCheck resource to delete. */ + httpHealthCheck: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified HttpHealthCheck resource. Get a list of available HTTP health checks by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the HttpHealthCheck resource to return. */ + httpHealthCheck: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a HttpHealthCheck resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of HttpHealthCheck resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the + * JSON merge patch format and processing rules. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the HttpHealthCheck resource to patch. */ + httpHealthCheck: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a HttpHealthCheck resource in the specified project using the data included in the request. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the HttpHealthCheck resource to update. */ + httpHealthCheck: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface HttpsHealthChecksResource { + /** Deletes the specified HttpsHealthCheck resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the HttpsHealthCheck resource to delete. */ + httpsHealthCheck: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified HttpsHealthCheck resource. Get a list of available HTTPS health checks by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the HttpsHealthCheck resource to return. */ + httpsHealthCheck: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a HttpsHealthCheck resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of HttpsHealthCheck resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the + * JSON merge patch format and processing rules. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the HttpsHealthCheck resource to patch. */ + httpsHealthCheck: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a HttpsHealthCheck resource in the specified project using the data included in the request. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the HttpsHealthCheck resource to update. */ + httpsHealthCheck: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ImagesResource { + /** Deletes the specified image. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the image resource to delete. */ + image: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Sets the deprecation status of an image. + * + * If an empty request body is given, clears the deprecation status instead. + */ + deprecate(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Image name. */ + image: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified image. Get a list of available images by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the image resource to return. */ + image: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the latest image that is part of an image family and is not deprecated. */ + getFromFamily(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the image family to search for. */ + family: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates an image in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Force image creation if true. */ + forceCreate?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Retrieves the list of private images available to the specified project. Private images are images you create that belong to your project. This method + * does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of + * publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. + */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation. */ + setLabels(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface InstanceGroupManagersResource { + /** + * Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it + * does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed + * instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have + * not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + */ + abandonInstances(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the managed instance group is located. */ + zone: string; + }): Request; + /** Retrieves the list of managed instance groups and groups them by zone. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. + * Read Deleting an instance group for more information. + */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the managed instance group to delete. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the managed instance group is located. */ + zone: string; + }): Request; + /** + * Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which + * they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is + * marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action + * with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + */ + deleteInstances(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the managed instance group is located. */ + zone: string; + }): Request; + /** Returns all of the details about the specified managed instance group. Get a list of available managed instance groups by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the managed instance group is located. */ + zone: string; + }): Request; + /** + * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create + * instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the + * group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. + * + * A managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit. + */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where you want to create the managed instance group. */ + zone: string; + }): Request; + /** Retrieves a list of managed instance groups that are contained within the specified project and zone. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the managed instance group is located. */ + zone: string; + }): Request; + /** + * Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed + * instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous + * action failed, the list displays the errors for that failed action. + */ + listManagedInstances(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + filter?: string; + /** The name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + order_by?: string; + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the managed instance group is located. */ + zone: string; + }): Request; + /** + * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current + * instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been + * recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + */ + recreateInstances(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the managed instance group is located. */ + zone: string; + }): Request; + /** + * Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the + * size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or + * deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + */ + resize(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** + * The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to + * maintain the number of instances specified by this parameter. + */ + size: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the managed instance group is located. */ + zone: string; + }): Request; + /** + * Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change + * unless you recreate them. + */ + setInstanceTemplate(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the managed instance group is located. */ + zone: string; + }): Request; + /** + * Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the + * instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their + * target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group. + */ + setTargetPools(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the managed instance group is located. */ + zone: string; + }): Request; + } + interface InstanceGroupsResource { + /** + * Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read + * Adding instances for more information. + */ + addInstances(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the instance group where you are adding instances. */ + instanceGroup: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the instance group is located. */ + zone: string; + }): Request; + /** Retrieves the list of instance groups and sorts them by zone. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read + * Deleting an instance group for more information. + */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the instance group to delete. */ + instanceGroup: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the instance group is located. */ + zone: string; + }): Request; + /** Returns the specified instance group. Get a list of available instance groups by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the instance group. */ + instanceGroup: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the instance group is located. */ + zone: string; + }): Request; + /** Creates an instance group in the specified project using the parameters that are included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where you want to create the instance group. */ + zone: string; + }): Request; + /** Retrieves the list of instance groups that are located in the specified project and zone. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the instance group is located. */ + zone: string; + }): Request; + /** Lists the instances in the specified instance group. */ + listInstances(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** The name of the instance group from which you want to generate a list of included instances. */ + instanceGroup: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the instance group is located. */ + zone: string; + }): Request; + /** + * Removes one or more instances from the specified instance group, but does not delete those instances. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration + * before the VM instance is removed or deleted. + */ + removeInstances(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the instance group where the specified instances will be removed. */ + instanceGroup: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the instance group is located. */ + zone: string; + }): Request; + /** Sets the named ports for the specified instance group. */ + setNamedPorts(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the instance group where the named ports are updated. */ + instanceGroup: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone where the instance group is located. */ + zone: string; + }): Request; + } + interface InstanceTemplatesResource { + /** + * Deletes the specified instance template. If you delete an instance template that is being referenced from another instance group, the instance group + * will not be able to create or recreate virtual machine instances. Deleting an instance template is permanent and cannot be undone. + */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the instance template to delete. */ + instanceTemplate: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified instance template. Get a list of available instance templates by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the instance template. */ + instanceTemplate: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an + * existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template. + */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of instance templates that are contained within the specified project and zone. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface InstancesResource { + /** Adds an access config to an instance's network interface. */ + addAccessConfig(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The instance name for this request. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the network interface to add to this instance. */ + networkInterface: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Retrieves aggregated list of instances. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a + * disk at the same time. For more information, read Adding a persistent disk to your instance. + */ + attachDisk(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The instance name for this request. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance resource to delete. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Deletes an access config from an instance's network interface. */ + deleteAccessConfig(request: { + /** The name of the access config to delete. */ + accessConfig: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The instance name for this request. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the network interface. */ + networkInterface: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Detaches a disk from an instance. */ + detachDisk(request: { + /** Data format for the response. */ + alt?: string; + /** Disk device name to detach. */ + deviceName: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Instance name. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Returns the specified Instance resource. Get a list of available instances by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance resource to return. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Returns the specified instance's serial port output. */ + getSerialPortOutput(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance scoping this request. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Specifies which COM or serial port to retrieve data from. */ + port?: number; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Returns output starting from a specific byte position. Use this to page through output when the output is too large to return in a single request. For + * the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value returned in the previous call. + */ + start?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Creates an instance resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Retrieves the list of instances contained within the specified zone. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Performs a reset on the instance. For more information, see Resetting an instance. */ + reset(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance scoping this request. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Sets the auto-delete flag for a disk attached to an instance. */ + setDiskAutoDelete(request: { + /** Data format for the response. */ + alt?: string; + /** Whether to auto-delete the disk when the instance is deleted. */ + autoDelete: boolean; + /** The device name of the disk to modify. */ + deviceName: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The instance name. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. */ + setLabels(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance scoping this request. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. */ + setMachineResources(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance scoping this request. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Changes the machine type for a stopped instance to the machine type specified in the request. */ + setMachineType(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance scoping this request. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Sets metadata for the specified instance to the data included in the request. */ + setMetadata(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance scoping this request. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** + * Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read + * Specifying a Minimum CPU Platform. + */ + setMinCpuPlatform(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance scoping this request. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Sets an instance's scheduling options. */ + setScheduling(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Instance name. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance. */ + setServiceAccount(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance resource to start. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Sets tags for the specified instance to the data included in the request. */ + setTags(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance scoping this request. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. */ + start(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance resource to start. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. */ + startWithEncryptionKey(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance resource to start. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** + * Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, + * virtual machine usage charges while they are stopped, but any resources that the virtual machine is using, such as persistent disks and static IP + * addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance. + */ + stop(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance resource to stop. */ + instance: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + } + interface LicensesResource { + /** Returns the specified License resource. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Name of the License resource to return. */ + license: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface MachineTypesResource { + /** Retrieves an aggregated list of machine types. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified machine type. Get a list of available machine types by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Name of the machine type to return. */ + machineType: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + /** Retrieves a list of machine types available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The name of the zone for this request. */ + zone: string; + }): Request; + } + interface NetworksResource { + /** Adds a peering to the specified network. */ + addPeering(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Name of the network resource to add peering to. */ + network: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified network. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Name of the network to delete. */ + network: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified network. Get a list of available networks by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Name of the network to return. */ + network: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a network in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of networks available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Patches the specified network with the data included in the request. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Name of the network to update. */ + network: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Removes a peering from the specified network. */ + removePeering(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Name of the network resource to remove peering from. */ + network: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Switches the network mode from auto subnet mode to custom subnet mode. */ + switchToCustomMode(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Name of the network to be updated. */ + network: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ProjectsResource { + /** Disable this project as a shared VPC host project. */ + disableXpnHost(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Disable a serivce resource (a.k.a service project) associated with this host project. */ + disableXpnResource(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Enable this project as a shared VPC host project. */ + enableXpnHost(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service + * project. + */ + enableXpnResource(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified Project resource. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Get the shared VPC host project that this project links to. May be empty if no link exists. */ + getXpnHost(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Get service resources (a.k.a service project) associated with this host project. */ + getXpnResources(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + order_by?: string; + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** List all shared VPC host projects visible to the user in an organization. */ + listXpnHosts(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + order_by?: string; + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Moves a persistent disk from one zone to another. */ + moveDisk(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Moves an instance and its attached persistent disks from one zone to another. */ + moveInstance(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Sets metadata common to all instances within the specified project using the data included in the request. */ + setCommonInstanceMetadata(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the + * usage export feature will be disabled. + */ + setUsageExportBucket(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RegionAutoscalersResource { + /** Deletes the specified autoscaler. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the autoscaler to delete. */ + autoscaler: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified autoscaler. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the autoscaler to return. */ + autoscaler: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates an autoscaler in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of autoscalers contained within the specified region. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge + * patch format and processing rules. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the autoscaler to patch. */ + autoscaler?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an autoscaler in the specified project using the data included in the request. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the autoscaler to update. */ + autoscaler?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RegionBackendServicesResource { + /** Deletes the specified regional BackendService resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendService resource to delete. */ + backendService: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified regional BackendService resource. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendService resource to return. */ + backendService: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets the most recent health check results for this regional BackendService. */ + getHealth(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendService resource to which the queried instance belongs. */ + backendService: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and + * guidelines to keep in mind when creating a regional backend service. Read Restrictions and Guidelines for more information. + */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of regional BackendService resources available to the specified project in the given region. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in + * mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON + * merge patch format and processing rules. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendService resource to patch. */ + backendService: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in + * mind when updating a backend service. Read Restrictions and Guidelines for more information. + */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the BackendService resource to update. */ + backendService: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RegionCommitmentsResource { + /** Retrieves an aggregated list of commitments. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified commitment resource. Get a list of available commitments by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Name of the commitment to return. */ + commitment: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a commitment in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of commitments contained within the specified region. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RegionInstanceGroupManagersResource { + /** + * Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it + * does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed + * instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have + * not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + */ + abandonInstances(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified managed instance group and all of the instances in that group. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the managed instance group to delete. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which + * they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is + * marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action + * with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + */ + deleteInstances(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns all of the details about the specified managed instance group. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the managed instance group to return. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create + * instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the + * group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. + * + * A regional managed instance group can contain up to 2000 instances. + */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of managed instance groups that are contained within the specified region. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group + * has scheduled for its instances. + */ + listManagedInstances(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + filter?: string; + /** The name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + order_by?: string; + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current + * instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been + * recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + */ + recreateInstances(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the + * current instance template. If you decrease the size, the group schedules delete actions on one or more instances. The resize operation is marked DONE + * when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the + * creating or deleting actions with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. + */ + resize(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Number of instances that should exist in this instance group manager. */ + size: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. */ + setInstanceTemplate(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. */ + setTargetPools(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the managed instance group. */ + instanceGroupManager: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RegionInstanceGroupsResource { + /** Returns the specified instance group resource. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Name of the instance group resource to return. */ + instanceGroup: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of instance group resources contained within the specified region. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can + * list all instances or only the instances that are running. + */ + listInstances(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** Name of the regional instance group for which we want to list the instances. */ + instanceGroup: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Sets the named ports for the specified regional instance group. */ + setNamedPorts(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The name of the regional instance group where the named ports are updated. */ + instanceGroup: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RegionOperationsResource { + /** Deletes the specified region-specific Operations resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Name of the Operations resource to delete. */ + operation: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the specified region-specific Operations resource. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Name of the Operations resource to return. */ + operation: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of Operation resources contained within the specified region. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RegionsResource { + /** Returns the specified Region resource. Get a list of available regions by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region resource to return. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of region resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RoutersResource { + /** Retrieves an aggregated list of routers. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified Router resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the Router resource to delete. */ + router: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified Router resource. Get a list of available routers by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** Name of the Router resource to return. */ + router: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves runtime information of the specified router. */ + getRouterStatus(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** Name of the Router resource to query. */ + router: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a Router resource in the specified project and region using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of Router resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and + * processing rules. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the Router resource to patch. */ + router: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router. */ + preview(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** Name of the Router resource to query. */ + router: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the specified Router resource with the data included in the request. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the Router resource to update. */ + router: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RoutesResource { + /** Deletes the specified Route resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the Route resource to delete. */ + route: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified Route resource. Get a list of available routes by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the Route resource to return. */ + route: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a Route resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of Route resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SnapshotsResource { + /** + * Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If + * any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. + * + * For more information, see Deleting snaphots. + */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the Snapshot resource to delete. */ + snapshot: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified Snapshot resource. Get a list of available snapshots by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the Snapshot resource to return. */ + snapshot: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of Snapshot resources contained within the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation. */ + setLabels(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SslCertificatesResource { + /** Deletes the specified SslCertificate resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the SslCertificate resource to delete. */ + sslCertificate: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified SslCertificate resource. Get a list of available SSL certificates by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the SslCertificate resource to return. */ + sslCertificate: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a SslCertificate resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of SslCertificate resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SubnetworksResource { + /** Retrieves an aggregated list of subnetworks. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified subnetwork. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the Subnetwork resource to delete. */ + subnetwork: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Expands the IP CIDR range of the subnetwork to a specified value. */ + expandIpCidrRange(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the Subnetwork resource to update. */ + subnetwork: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified subnetwork. Get a list of available subnetworks list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** Name of the Subnetwork resource to return. */ + subnetwork: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a subnetwork in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of subnetworks available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access. */ + setPrivateIpGoogleAccess(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the Subnetwork resource. */ + subnetwork: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TargetHttpProxiesResource { + /** Deletes the specified TargetHttpProxy resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetHttpProxy resource to delete. */ + targetHttpProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified TargetHttpProxy resource. Get a list of available target HTTP proxies by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the TargetHttpProxy resource to return. */ + targetHttpProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a TargetHttpProxy resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of TargetHttpProxy resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Changes the URL map for TargetHttpProxy. */ + setUrlMap(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetHttpProxy to set a URL map for. */ + targetHttpProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TargetHttpsProxiesResource { + /** Deletes the specified TargetHttpsProxy resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetHttpsProxy resource to delete. */ + targetHttpsProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified TargetHttpsProxy resource. Get a list of available target HTTPS proxies by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the TargetHttpsProxy resource to return. */ + targetHttpsProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a TargetHttpsProxy resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of TargetHttpsProxy resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Replaces SslCertificates for TargetHttpsProxy. */ + setSslCertificates(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetHttpsProxy resource to set an SslCertificates resource for. */ + targetHttpsProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Changes the URL map for TargetHttpsProxy. */ + setUrlMap(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetHttpsProxy resource whose URL map is to be set. */ + targetHttpsProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TargetInstancesResource { + /** Retrieves an aggregated list of target instances. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified TargetInstance resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetInstance resource to delete. */ + targetInstance: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone scoping this request. */ + zone: string; + }): Request; + /** Returns the specified TargetInstance resource. Get a list of available target instances by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the TargetInstance resource to return. */ + targetInstance: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone scoping this request. */ + zone: string; + }): Request; + /** Creates a TargetInstance resource in the specified project and zone using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone scoping this request. */ + zone: string; + }): Request; + /** Retrieves a list of TargetInstance resources available to the specified project and zone. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone scoping this request. */ + zone: string; + }): Request; + } + interface TargetPoolsResource { + /** Adds health check URLs to a target pool. */ + addHealthCheck(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the target pool to add a health check to. */ + targetPool: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Adds an instance to a target pool. */ + addInstance(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetPool resource to add instances to. */ + targetPool: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves an aggregated list of target pools. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified target pool. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetPool resource to delete. */ + targetPool: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified target pool. Get a list of available target pools by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** Name of the TargetPool resource to return. */ + targetPool: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets the most recent health check results for each IP for the instance that is referenced by the given target pool. */ + getHealth(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** Name of the TargetPool resource to which the queried instance belongs. */ + targetPool: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a target pool in the specified project and region using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of target pools available to the specified project and region. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Removes health check URL from a target pool. */ + removeHealthCheck(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the target pool to remove health checks from. */ + targetPool: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Removes instance URL from a target pool. */ + removeInstance(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetPool resource to remove instances from. */ + targetPool: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Changes a backup target pool's configurations. */ + setBackup(request: { + /** Data format for the response. */ + alt?: string; + /** New failoverRatio value for the target pool. */ + failoverRatio?: number; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region scoping this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetPool resource to set a backup pool for. */ + targetPool: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TargetSslProxiesResource { + /** Deletes the specified TargetSslProxy resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetSslProxy resource to delete. */ + targetSslProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified TargetSslProxy resource. Get a list of available target SSL proxies by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the TargetSslProxy resource to return. */ + targetSslProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a TargetSslProxy resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of TargetSslProxy resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Changes the BackendService for TargetSslProxy. */ + setBackendService(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetSslProxy resource whose BackendService resource is to be set. */ + targetSslProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Changes the ProxyHeaderType for TargetSslProxy. */ + setProxyHeader(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetSslProxy resource whose ProxyHeader is to be set. */ + targetSslProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Changes SslCertificates for TargetSslProxy. */ + setSslCertificates(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetSslProxy resource whose SslCertificate resource is to be set. */ + targetSslProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TargetTcpProxiesResource { + /** Deletes the specified TargetTcpProxy resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetTcpProxy resource to delete. */ + targetTcpProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified TargetTcpProxy resource. Get a list of available target TCP proxies by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the TargetTcpProxy resource to return. */ + targetTcpProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a TargetTcpProxy resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of TargetTcpProxy resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Changes the BackendService for TargetTcpProxy. */ + setBackendService(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetTcpProxy resource whose BackendService resource is to be set. */ + targetTcpProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Changes the ProxyHeaderType for TargetTcpProxy. */ + setProxyHeader(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the TargetTcpProxy resource whose ProxyHeader is to be set. */ + targetTcpProxy: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TargetVpnGatewaysResource { + /** Retrieves an aggregated list of target VPN gateways. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified target VPN gateway. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the target VPN gateway to delete. */ + targetVpnGateway: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified target VPN gateway. Get a list of available target VPN gateways by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** Name of the target VPN gateway to return. */ + targetVpnGateway: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a target VPN gateway in the specified project and region using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of target VPN gateways available to the specified project and region. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UrlMapsResource { + /** Deletes the specified UrlMap resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the UrlMap resource to delete. */ + urlMap: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified UrlMap resource. Get a list of available URL maps by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the UrlMap resource to return. */ + urlMap: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a UrlMap resource in the specified project using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. */ + invalidateCache(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the UrlMap scoping this request. */ + urlMap: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of UrlMap resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format + * and processing rules. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the UrlMap resource to patch. */ + urlMap: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the specified UrlMap resource with the data included in the request. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** Name of the UrlMap resource to update. */ + urlMap: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. */ + validate(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the UrlMap resource to be validated as. */ + urlMap: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface VpnTunnelsResource { + /** Retrieves an aggregated list of VPN tunnels. */ + aggregatedList(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified VpnTunnel resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the VpnTunnel resource to delete. */ + vpnTunnel: string; + }): Request; + /** Returns the specified VpnTunnel resource. Get a list of available VPN tunnels by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the VpnTunnel resource to return. */ + vpnTunnel: string; + }): Request; + /** Creates a VpnTunnel resource in the specified project and region using the data included in the request. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** + * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the + * request if it has already been completed. + * + * For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, + * the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from + * accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + */ + requestId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of VpnTunnel resources contained in the specified project and region. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the region for this request. */ + region: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ZoneOperationsResource { + /** Deletes the specified zone-specific Operations resource. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Name of the Operations resource to delete. */ + operation: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone for this request. */ + zone: string; + }): Request; + /** Retrieves the specified zone-specific Operations resource. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Name of the Operations resource to return. */ + operation: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone for this request. */ + zone: string; + }): Request; + /** Retrieves a list of Operation resources contained within the specified zone. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone for request. */ + zone: string; + }): Request; + } + interface ZonesResource { + /** Returns the specified Zone resource. Get a list of available zones by making a list() request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Name of the zone resource to return. */ + zone: string; + }): Request; + /** Retrieves the list of Zone resources available to the specified project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.compute/readme.md b/types/gapi.client.compute/readme.md new file mode 100644 index 0000000000..fcee121864 --- /dev/null +++ b/types/gapi.client.compute/readme.md @@ -0,0 +1,1557 @@ +# TypeScript typings for Compute Engine API v1 +Creates and runs virtual machines on Google Cloud Platform. +For detailed description please check [documentation](https://developers.google.com/compute/docs/reference/latest/). + +## Installing + +Install typings for Compute Engine API: +``` +npm install @types/gapi.client.compute@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('compute', 'v1', () => { + // now we can use gapi.client.compute + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View and manage your Google Compute Engine resources + 'https://www.googleapis.com/auth/compute', + + // View your Google Compute Engine resources + 'https://www.googleapis.com/auth/compute.readonly', + + // Manage your data and permissions in Google Cloud Storage + 'https://www.googleapis.com/auth/devstorage.full_control', + + // View your data in Google Cloud Storage + 'https://www.googleapis.com/auth/devstorage.read_only', + + // Manage your data in Google Cloud Storage + 'https://www.googleapis.com/auth/devstorage.read_write', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Compute Engine API resources: + +```typescript + +/* +Retrieves an aggregated list of accelerator types. +*/ +await gapi.client.acceleratorTypes.aggregatedList({ project: "project", }); + +/* +Returns the specified accelerator type. Get a list of available accelerator types by making a list() request. +*/ +await gapi.client.acceleratorTypes.get({ acceleratorType: "acceleratorType", project: "project", zone: "zone", }); + +/* +Retrieves a list of accelerator types available to the specified project. +*/ +await gapi.client.acceleratorTypes.list({ project: "project", zone: "zone", }); + +/* +Retrieves an aggregated list of addresses. +*/ +await gapi.client.addresses.aggregatedList({ project: "project", }); + +/* +Deletes the specified address resource. +*/ +await gapi.client.addresses.delete({ address: "address", project: "project", region: "region", }); + +/* +Returns the specified address resource. +*/ +await gapi.client.addresses.get({ address: "address", project: "project", region: "region", }); + +/* +Creates an address resource in the specified project using the data included in the request. +*/ +await gapi.client.addresses.insert({ project: "project", region: "region", }); + +/* +Retrieves a list of addresses contained within the specified region. +*/ +await gapi.client.addresses.list({ project: "project", region: "region", }); + +/* +Retrieves an aggregated list of autoscalers. +*/ +await gapi.client.autoscalers.aggregatedList({ project: "project", }); + +/* +Deletes the specified autoscaler. +*/ +await gapi.client.autoscalers.delete({ autoscaler: "autoscaler", project: "project", zone: "zone", }); + +/* +Returns the specified autoscaler resource. Get a list of available autoscalers by making a list() request. +*/ +await gapi.client.autoscalers.get({ autoscaler: "autoscaler", project: "project", zone: "zone", }); + +/* +Creates an autoscaler in the specified project using the data included in the request. +*/ +await gapi.client.autoscalers.insert({ project: "project", zone: "zone", }); + +/* +Retrieves a list of autoscalers contained within the specified zone. +*/ +await gapi.client.autoscalers.list({ project: "project", zone: "zone", }); + +/* +Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +*/ +await gapi.client.autoscalers.patch({ project: "project", zone: "zone", }); + +/* +Updates an autoscaler in the specified project using the data included in the request. +*/ +await gapi.client.autoscalers.update({ project: "project", zone: "zone", }); + +/* +Deletes the specified BackendBucket resource. +*/ +await gapi.client.backendBuckets.delete({ backendBucket: "backendBucket", project: "project", }); + +/* +Returns the specified BackendBucket resource. Get a list of available backend buckets by making a list() request. +*/ +await gapi.client.backendBuckets.get({ backendBucket: "backendBucket", project: "project", }); + +/* +Creates a BackendBucket resource in the specified project using the data included in the request. +*/ +await gapi.client.backendBuckets.insert({ project: "project", }); + +/* +Retrieves the list of BackendBucket resources available to the specified project. +*/ +await gapi.client.backendBuckets.list({ project: "project", }); + +/* +Updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +*/ +await gapi.client.backendBuckets.patch({ backendBucket: "backendBucket", project: "project", }); + +/* +Updates the specified BackendBucket resource with the data included in the request. +*/ +await gapi.client.backendBuckets.update({ backendBucket: "backendBucket", project: "project", }); + +/* +Retrieves the list of all BackendService resources, regional and global, available to the specified project. +*/ +await gapi.client.backendServices.aggregatedList({ project: "project", }); + +/* +Deletes the specified BackendService resource. +*/ +await gapi.client.backendServices.delete({ backendService: "backendService", project: "project", }); + +/* +Returns the specified BackendService resource. Get a list of available backend services by making a list() request. +*/ +await gapi.client.backendServices.get({ backendService: "backendService", project: "project", }); + +/* +Gets the most recent health check results for this BackendService. +*/ +await gapi.client.backendServices.getHealth({ backendService: "backendService", project: "project", }); + +/* +Creates a BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a backend service. Read Restrictions and Guidelines for more information. +*/ +await gapi.client.backendServices.insert({ project: "project", }); + +/* +Retrieves the list of BackendService resources available to the specified project. +*/ +await gapi.client.backendServices.list({ project: "project", }); + +/* +Patches the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +*/ +await gapi.client.backendServices.patch({ backendService: "backendService", project: "project", }); + +/* +Updates the specified BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. +*/ +await gapi.client.backendServices.update({ backendService: "backendService", project: "project", }); + +/* +Retrieves an aggregated list of disk types. +*/ +await gapi.client.diskTypes.aggregatedList({ project: "project", }); + +/* +Returns the specified disk type. Get a list of available disk types by making a list() request. +*/ +await gapi.client.diskTypes.get({ diskType: "diskType", project: "project", zone: "zone", }); + +/* +Retrieves a list of disk types available to the specified project. +*/ +await gapi.client.diskTypes.list({ project: "project", zone: "zone", }); + +/* +Retrieves an aggregated list of persistent disks. +*/ +await gapi.client.disks.aggregatedList({ project: "project", }); + +/* +Creates a snapshot of a specified persistent disk. +*/ +await gapi.client.disks.createSnapshot({ disk: "disk", project: "project", zone: "zone", }); + +/* +Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. +*/ +await gapi.client.disks.delete({ disk: "disk", project: "project", zone: "zone", }); + +/* +Returns a specified persistent disk. Get a list of available persistent disks by making a list() request. +*/ +await gapi.client.disks.get({ disk: "disk", project: "project", zone: "zone", }); + +/* +Creates a persistent disk in the specified project using the data in the request. You can create a disk with a sourceImage, a sourceSnapshot, or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property. +*/ +await gapi.client.disks.insert({ project: "project", zone: "zone", }); + +/* +Retrieves a list of persistent disks contained within the specified zone. +*/ +await gapi.client.disks.list({ project: "project", zone: "zone", }); + +/* +Resizes the specified persistent disk. +*/ +await gapi.client.disks.resize({ disk: "disk", project: "project", zone: "zone", }); + +/* +Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. +*/ +await gapi.client.disks.setLabels({ project: "project", resource: "resource", zone: "zone", }); + +/* +Deletes the specified firewall. +*/ +await gapi.client.firewalls.delete({ firewall: "firewall", project: "project", }); + +/* +Returns the specified firewall. +*/ +await gapi.client.firewalls.get({ firewall: "firewall", project: "project", }); + +/* +Creates a firewall rule in the specified project using the data included in the request. +*/ +await gapi.client.firewalls.insert({ project: "project", }); + +/* +Retrieves the list of firewall rules available to the specified project. +*/ +await gapi.client.firewalls.list({ project: "project", }); + +/* +Updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +*/ +await gapi.client.firewalls.patch({ firewall: "firewall", project: "project", }); + +/* +Updates the specified firewall rule with the data included in the request. Using PUT method, can only update following fields of firewall rule: allowed, description, sourceRanges, sourceTags, targetTags. +*/ +await gapi.client.firewalls.update({ firewall: "firewall", project: "project", }); + +/* +Retrieves an aggregated list of forwarding rules. +*/ +await gapi.client.forwardingRules.aggregatedList({ project: "project", }); + +/* +Deletes the specified ForwardingRule resource. +*/ +await gapi.client.forwardingRules.delete({ forwardingRule: "forwardingRule", project: "project", region: "region", }); + +/* +Returns the specified ForwardingRule resource. +*/ +await gapi.client.forwardingRules.get({ forwardingRule: "forwardingRule", project: "project", region: "region", }); + +/* +Creates a ForwardingRule resource in the specified project and region using the data included in the request. +*/ +await gapi.client.forwardingRules.insert({ project: "project", region: "region", }); + +/* +Retrieves a list of ForwardingRule resources available to the specified project and region. +*/ +await gapi.client.forwardingRules.list({ project: "project", region: "region", }); + +/* +Changes target URL for forwarding rule. The new target should be of the same type as the old target. +*/ +await gapi.client.forwardingRules.setTarget({ forwardingRule: "forwardingRule", project: "project", region: "region", }); + +/* +Deletes the specified address resource. +*/ +await gapi.client.globalAddresses.delete({ address: "address", project: "project", }); + +/* +Returns the specified address resource. Get a list of available addresses by making a list() request. +*/ +await gapi.client.globalAddresses.get({ address: "address", project: "project", }); + +/* +Creates an address resource in the specified project using the data included in the request. +*/ +await gapi.client.globalAddresses.insert({ project: "project", }); + +/* +Retrieves a list of global addresses. +*/ +await gapi.client.globalAddresses.list({ project: "project", }); + +/* +Deletes the specified GlobalForwardingRule resource. +*/ +await gapi.client.globalForwardingRules.delete({ forwardingRule: "forwardingRule", project: "project", }); + +/* +Returns the specified GlobalForwardingRule resource. Get a list of available forwarding rules by making a list() request. +*/ +await gapi.client.globalForwardingRules.get({ forwardingRule: "forwardingRule", project: "project", }); + +/* +Creates a GlobalForwardingRule resource in the specified project using the data included in the request. +*/ +await gapi.client.globalForwardingRules.insert({ project: "project", }); + +/* +Retrieves a list of GlobalForwardingRule resources available to the specified project. +*/ +await gapi.client.globalForwardingRules.list({ project: "project", }); + +/* +Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target. +*/ +await gapi.client.globalForwardingRules.setTarget({ forwardingRule: "forwardingRule", project: "project", }); + +/* +Retrieves an aggregated list of all operations. +*/ +await gapi.client.globalOperations.aggregatedList({ project: "project", }); + +/* +Deletes the specified Operations resource. +*/ +await gapi.client.globalOperations.delete({ operation: "operation", project: "project", }); + +/* +Retrieves the specified Operations resource. Get a list of operations by making a list() request. +*/ +await gapi.client.globalOperations.get({ operation: "operation", project: "project", }); + +/* +Retrieves a list of Operation resources contained within the specified project. +*/ +await gapi.client.globalOperations.list({ project: "project", }); + +/* +Deletes the specified HealthCheck resource. +*/ +await gapi.client.healthChecks.delete({ healthCheck: "healthCheck", project: "project", }); + +/* +Returns the specified HealthCheck resource. Get a list of available health checks by making a list() request. +*/ +await gapi.client.healthChecks.get({ healthCheck: "healthCheck", project: "project", }); + +/* +Creates a HealthCheck resource in the specified project using the data included in the request. +*/ +await gapi.client.healthChecks.insert({ project: "project", }); + +/* +Retrieves the list of HealthCheck resources available to the specified project. +*/ +await gapi.client.healthChecks.list({ project: "project", }); + +/* +Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +*/ +await gapi.client.healthChecks.patch({ healthCheck: "healthCheck", project: "project", }); + +/* +Updates a HealthCheck resource in the specified project using the data included in the request. +*/ +await gapi.client.healthChecks.update({ healthCheck: "healthCheck", project: "project", }); + +/* +Deletes the specified HttpHealthCheck resource. +*/ +await gapi.client.httpHealthChecks.delete({ httpHealthCheck: "httpHealthCheck", project: "project", }); + +/* +Returns the specified HttpHealthCheck resource. Get a list of available HTTP health checks by making a list() request. +*/ +await gapi.client.httpHealthChecks.get({ httpHealthCheck: "httpHealthCheck", project: "project", }); + +/* +Creates a HttpHealthCheck resource in the specified project using the data included in the request. +*/ +await gapi.client.httpHealthChecks.insert({ project: "project", }); + +/* +Retrieves the list of HttpHealthCheck resources available to the specified project. +*/ +await gapi.client.httpHealthChecks.list({ project: "project", }); + +/* +Updates a HttpHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +*/ +await gapi.client.httpHealthChecks.patch({ httpHealthCheck: "httpHealthCheck", project: "project", }); + +/* +Updates a HttpHealthCheck resource in the specified project using the data included in the request. +*/ +await gapi.client.httpHealthChecks.update({ httpHealthCheck: "httpHealthCheck", project: "project", }); + +/* +Deletes the specified HttpsHealthCheck resource. +*/ +await gapi.client.httpsHealthChecks.delete({ httpsHealthCheck: "httpsHealthCheck", project: "project", }); + +/* +Returns the specified HttpsHealthCheck resource. Get a list of available HTTPS health checks by making a list() request. +*/ +await gapi.client.httpsHealthChecks.get({ httpsHealthCheck: "httpsHealthCheck", project: "project", }); + +/* +Creates a HttpsHealthCheck resource in the specified project using the data included in the request. +*/ +await gapi.client.httpsHealthChecks.insert({ project: "project", }); + +/* +Retrieves the list of HttpsHealthCheck resources available to the specified project. +*/ +await gapi.client.httpsHealthChecks.list({ project: "project", }); + +/* +Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +*/ +await gapi.client.httpsHealthChecks.patch({ httpsHealthCheck: "httpsHealthCheck", project: "project", }); + +/* +Updates a HttpsHealthCheck resource in the specified project using the data included in the request. +*/ +await gapi.client.httpsHealthChecks.update({ httpsHealthCheck: "httpsHealthCheck", project: "project", }); + +/* +Deletes the specified image. +*/ +await gapi.client.images.delete({ image: "image", project: "project", }); + +/* +Sets the deprecation status of an image. + +If an empty request body is given, clears the deprecation status instead. +*/ +await gapi.client.images.deprecate({ image: "image", project: "project", }); + +/* +Returns the specified image. Get a list of available images by making a list() request. +*/ +await gapi.client.images.get({ image: "image", project: "project", }); + +/* +Returns the latest image that is part of an image family and is not deprecated. +*/ +await gapi.client.images.getFromFamily({ family: "family", project: "project", }); + +/* +Creates an image in the specified project using the data included in the request. +*/ +await gapi.client.images.insert({ project: "project", }); + +/* +Retrieves the list of private images available to the specified project. Private images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. +*/ +await gapi.client.images.list({ project: "project", }); + +/* +Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation. +*/ +await gapi.client.images.setLabels({ project: "project", resource: "resource", }); + +/* +Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. + +If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + +You can specify a maximum of 1000 instances with this method per request. +*/ +await gapi.client.instanceGroupManagers.abandonInstances({ instanceGroupManager: "instanceGroupManager", project: "project", zone: "zone", }); + +/* +Retrieves the list of managed instance groups and groups them by zone. +*/ +await gapi.client.instanceGroupManagers.aggregatedList({ project: "project", }); + +/* +Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information. +*/ +await gapi.client.instanceGroupManagers.delete({ instanceGroupManager: "instanceGroupManager", project: "project", zone: "zone", }); + +/* +Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method. + +If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + +You can specify a maximum of 1000 instances with this method per request. +*/ +await gapi.client.instanceGroupManagers.deleteInstances({ instanceGroupManager: "instanceGroupManager", project: "project", zone: "zone", }); + +/* +Returns all of the details about the specified managed instance group. Get a list of available managed instance groups by making a list() request. +*/ +await gapi.client.instanceGroupManagers.get({ instanceGroupManager: "instanceGroupManager", project: "project", zone: "zone", }); + +/* +Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. + +A managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit. +*/ +await gapi.client.instanceGroupManagers.insert({ project: "project", zone: "zone", }); + +/* +Retrieves a list of managed instance groups that are contained within the specified project and zone. +*/ +await gapi.client.instanceGroupManagers.list({ project: "project", zone: "zone", }); + +/* +Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action. +*/ +await gapi.client.instanceGroupManagers.listManagedInstances({ instanceGroupManager: "instanceGroupManager", project: "project", zone: "zone", }); + +/* +Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + +If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + +You can specify a maximum of 1000 instances with this method per request. +*/ +await gapi.client.instanceGroupManagers.recreateInstances({ instanceGroupManager: "instanceGroupManager", project: "project", zone: "zone", }); + +/* +Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. + +If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +*/ +await gapi.client.instanceGroupManagers.resize({ instanceGroupManager: "instanceGroupManager", project: "project", size: 1, zone: "zone", }); + +/* +Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you recreate them. +*/ +await gapi.client.instanceGroupManagers.setInstanceTemplate({ instanceGroupManager: "instanceGroupManager", project: "project", zone: "zone", }); + +/* +Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group. +*/ +await gapi.client.instanceGroupManagers.setTargetPools({ instanceGroupManager: "instanceGroupManager", project: "project", zone: "zone", }); + +/* +Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read Adding instances for more information. +*/ +await gapi.client.instanceGroups.addInstances({ instanceGroup: "instanceGroup", project: "project", zone: "zone", }); + +/* +Retrieves the list of instance groups and sorts them by zone. +*/ +await gapi.client.instanceGroups.aggregatedList({ project: "project", }); + +/* +Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information. +*/ +await gapi.client.instanceGroups.delete({ instanceGroup: "instanceGroup", project: "project", zone: "zone", }); + +/* +Returns the specified instance group. Get a list of available instance groups by making a list() request. +*/ +await gapi.client.instanceGroups.get({ instanceGroup: "instanceGroup", project: "project", zone: "zone", }); + +/* +Creates an instance group in the specified project using the parameters that are included in the request. +*/ +await gapi.client.instanceGroups.insert({ project: "project", zone: "zone", }); + +/* +Retrieves the list of instance groups that are located in the specified project and zone. +*/ +await gapi.client.instanceGroups.list({ project: "project", zone: "zone", }); + +/* +Lists the instances in the specified instance group. +*/ +await gapi.client.instanceGroups.listInstances({ instanceGroup: "instanceGroup", project: "project", zone: "zone", }); + +/* +Removes one or more instances from the specified instance group, but does not delete those instances. + +If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration before the VM instance is removed or deleted. +*/ +await gapi.client.instanceGroups.removeInstances({ instanceGroup: "instanceGroup", project: "project", zone: "zone", }); + +/* +Sets the named ports for the specified instance group. +*/ +await gapi.client.instanceGroups.setNamedPorts({ instanceGroup: "instanceGroup", project: "project", zone: "zone", }); + +/* +Deletes the specified instance template. If you delete an instance template that is being referenced from another instance group, the instance group will not be able to create or recreate virtual machine instances. Deleting an instance template is permanent and cannot be undone. +*/ +await gapi.client.instanceTemplates.delete({ instanceTemplate: "instanceTemplate", project: "project", }); + +/* +Returns the specified instance template. Get a list of available instance templates by making a list() request. +*/ +await gapi.client.instanceTemplates.get({ instanceTemplate: "instanceTemplate", project: "project", }); + +/* +Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template. +*/ +await gapi.client.instanceTemplates.insert({ project: "project", }); + +/* +Retrieves a list of instance templates that are contained within the specified project and zone. +*/ +await gapi.client.instanceTemplates.list({ project: "project", }); + +/* +Adds an access config to an instance's network interface. +*/ +await gapi.client.instances.addAccessConfig({ instance: "instance", networkInterface: "networkInterface", project: "project", zone: "zone", }); + +/* +Retrieves aggregated list of instances. +*/ +await gapi.client.instances.aggregatedList({ project: "project", }); + +/* +Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance. +*/ +await gapi.client.instances.attachDisk({ instance: "instance", project: "project", zone: "zone", }); + +/* +Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance. +*/ +await gapi.client.instances.delete({ instance: "instance", project: "project", zone: "zone", }); + +/* +Deletes an access config from an instance's network interface. +*/ +await gapi.client.instances.deleteAccessConfig({ accessConfig: "accessConfig", instance: "instance", networkInterface: "networkInterface", project: "project", zone: "zone", }); + +/* +Detaches a disk from an instance. +*/ +await gapi.client.instances.detachDisk({ deviceName: "deviceName", instance: "instance", project: "project", zone: "zone", }); + +/* +Returns the specified Instance resource. Get a list of available instances by making a list() request. +*/ +await gapi.client.instances.get({ instance: "instance", project: "project", zone: "zone", }); + +/* +Returns the specified instance's serial port output. +*/ +await gapi.client.instances.getSerialPortOutput({ instance: "instance", project: "project", zone: "zone", }); + +/* +Creates an instance resource in the specified project using the data included in the request. +*/ +await gapi.client.instances.insert({ project: "project", zone: "zone", }); + +/* +Retrieves the list of instances contained within the specified zone. +*/ +await gapi.client.instances.list({ project: "project", zone: "zone", }); + +/* +Performs a reset on the instance. For more information, see Resetting an instance. +*/ +await gapi.client.instances.reset({ instance: "instance", project: "project", zone: "zone", }); + +/* +Sets the auto-delete flag for a disk attached to an instance. +*/ +await gapi.client.instances.setDiskAutoDelete({ autoDelete: , deviceName: "deviceName", instance: "instance", project: "project", zone: "zone", }); + +/* +Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. +*/ +await gapi.client.instances.setLabels({ instance: "instance", project: "project", zone: "zone", }); + +/* +Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. +*/ +await gapi.client.instances.setMachineResources({ instance: "instance", project: "project", zone: "zone", }); + +/* +Changes the machine type for a stopped instance to the machine type specified in the request. +*/ +await gapi.client.instances.setMachineType({ instance: "instance", project: "project", zone: "zone", }); + +/* +Sets metadata for the specified instance to the data included in the request. +*/ +await gapi.client.instances.setMetadata({ instance: "instance", project: "project", zone: "zone", }); + +/* +Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform. +*/ +await gapi.client.instances.setMinCpuPlatform({ instance: "instance", project: "project", zone: "zone", }); + +/* +Sets an instance's scheduling options. +*/ +await gapi.client.instances.setScheduling({ instance: "instance", project: "project", zone: "zone", }); + +/* +Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance. +*/ +await gapi.client.instances.setServiceAccount({ instance: "instance", project: "project", zone: "zone", }); + +/* +Sets tags for the specified instance to the data included in the request. +*/ +await gapi.client.instances.setTags({ instance: "instance", project: "project", zone: "zone", }); + +/* +Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. +*/ +await gapi.client.instances.start({ instance: "instance", project: "project", zone: "zone", }); + +/* +Starts an instance that was stopped using the using the instances().stop method. For more information, see Restart an instance. +*/ +await gapi.client.instances.startWithEncryptionKey({ instance: "instance", project: "project", zone: "zone", }); + +/* +Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur per-minute, virtual machine usage charges while they are stopped, but any resources that the virtual machine is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance. +*/ +await gapi.client.instances.stop({ instance: "instance", project: "project", zone: "zone", }); + +/* +Returns the specified License resource. +*/ +await gapi.client.licenses.get({ license: "license", project: "project", }); + +/* +Retrieves an aggregated list of machine types. +*/ +await gapi.client.machineTypes.aggregatedList({ project: "project", }); + +/* +Returns the specified machine type. Get a list of available machine types by making a list() request. +*/ +await gapi.client.machineTypes.get({ machineType: "machineType", project: "project", zone: "zone", }); + +/* +Retrieves a list of machine types available to the specified project. +*/ +await gapi.client.machineTypes.list({ project: "project", zone: "zone", }); + +/* +Adds a peering to the specified network. +*/ +await gapi.client.networks.addPeering({ network: "network", project: "project", }); + +/* +Deletes the specified network. +*/ +await gapi.client.networks.delete({ network: "network", project: "project", }); + +/* +Returns the specified network. Get a list of available networks by making a list() request. +*/ +await gapi.client.networks.get({ network: "network", project: "project", }); + +/* +Creates a network in the specified project using the data included in the request. +*/ +await gapi.client.networks.insert({ project: "project", }); + +/* +Retrieves the list of networks available to the specified project. +*/ +await gapi.client.networks.list({ project: "project", }); + +/* +Patches the specified network with the data included in the request. +*/ +await gapi.client.networks.patch({ network: "network", project: "project", }); + +/* +Removes a peering from the specified network. +*/ +await gapi.client.networks.removePeering({ network: "network", project: "project", }); + +/* +Switches the network mode from auto subnet mode to custom subnet mode. +*/ +await gapi.client.networks.switchToCustomMode({ network: "network", project: "project", }); + +/* +Disable this project as a shared VPC host project. +*/ +await gapi.client.projects.disableXpnHost({ project: "project", }); + +/* +Disable a serivce resource (a.k.a service project) associated with this host project. +*/ +await gapi.client.projects.disableXpnResource({ project: "project", }); + +/* +Enable this project as a shared VPC host project. +*/ +await gapi.client.projects.enableXpnHost({ project: "project", }); + +/* +Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project. +*/ +await gapi.client.projects.enableXpnResource({ project: "project", }); + +/* +Returns the specified Project resource. +*/ +await gapi.client.projects.get({ project: "project", }); + +/* +Get the shared VPC host project that this project links to. May be empty if no link exists. +*/ +await gapi.client.projects.getXpnHost({ project: "project", }); + +/* +Get service resources (a.k.a service project) associated with this host project. +*/ +await gapi.client.projects.getXpnResources({ project: "project", }); + +/* +List all shared VPC host projects visible to the user in an organization. +*/ +await gapi.client.projects.listXpnHosts({ project: "project", }); + +/* +Moves a persistent disk from one zone to another. +*/ +await gapi.client.projects.moveDisk({ project: "project", }); + +/* +Moves an instance and its attached persistent disks from one zone to another. +*/ +await gapi.client.projects.moveInstance({ project: "project", }); + +/* +Sets metadata common to all instances within the specified project using the data included in the request. +*/ +await gapi.client.projects.setCommonInstanceMetadata({ project: "project", }); + +/* +Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled. +*/ +await gapi.client.projects.setUsageExportBucket({ project: "project", }); + +/* +Deletes the specified autoscaler. +*/ +await gapi.client.regionAutoscalers.delete({ autoscaler: "autoscaler", project: "project", region: "region", }); + +/* +Returns the specified autoscaler. +*/ +await gapi.client.regionAutoscalers.get({ autoscaler: "autoscaler", project: "project", region: "region", }); + +/* +Creates an autoscaler in the specified project using the data included in the request. +*/ +await gapi.client.regionAutoscalers.insert({ project: "project", region: "region", }); + +/* +Retrieves a list of autoscalers contained within the specified region. +*/ +await gapi.client.regionAutoscalers.list({ project: "project", region: "region", }); + +/* +Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +*/ +await gapi.client.regionAutoscalers.patch({ project: "project", region: "region", }); + +/* +Updates an autoscaler in the specified project using the data included in the request. +*/ +await gapi.client.regionAutoscalers.update({ project: "project", region: "region", }); + +/* +Deletes the specified regional BackendService resource. +*/ +await gapi.client.regionBackendServices.delete({ backendService: "backendService", project: "project", region: "region", }); + +/* +Returns the specified regional BackendService resource. +*/ +await gapi.client.regionBackendServices.get({ backendService: "backendService", project: "project", region: "region", }); + +/* +Gets the most recent health check results for this regional BackendService. +*/ +await gapi.client.regionBackendServices.getHealth({ backendService: "backendService", project: "project", region: "region", }); + +/* +Creates a regional BackendService resource in the specified project using the data included in the request. There are several restrictions and guidelines to keep in mind when creating a regional backend service. Read Restrictions and Guidelines for more information. +*/ +await gapi.client.regionBackendServices.insert({ project: "project", region: "region", }); + +/* +Retrieves the list of regional BackendService resources available to the specified project in the given region. +*/ +await gapi.client.regionBackendServices.list({ project: "project", region: "region", }); + +/* +Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +*/ +await gapi.client.regionBackendServices.patch({ backendService: "backendService", project: "project", region: "region", }); + +/* +Updates the specified regional BackendService resource with the data included in the request. There are several restrictions and guidelines to keep in mind when updating a backend service. Read Restrictions and Guidelines for more information. +*/ +await gapi.client.regionBackendServices.update({ backendService: "backendService", project: "project", region: "region", }); + +/* +Retrieves an aggregated list of commitments. +*/ +await gapi.client.regionCommitments.aggregatedList({ project: "project", }); + +/* +Returns the specified commitment resource. Get a list of available commitments by making a list() request. +*/ +await gapi.client.regionCommitments.get({ commitment: "commitment", project: "project", region: "region", }); + +/* +Creates a commitment in the specified project using the data included in the request. +*/ +await gapi.client.regionCommitments.insert({ project: "project", region: "region", }); + +/* +Retrieves a list of commitments contained within the specified region. +*/ +await gapi.client.regionCommitments.list({ project: "project", region: "region", }); + +/* +Schedules a group action to remove the specified instances from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. + +If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + +You can specify a maximum of 1000 instances with this method per request. +*/ +await gapi.client.regionInstanceGroupManagers.abandonInstances({ instanceGroupManager: "instanceGroupManager", project: "project", region: "region", }); + +/* +Deletes the specified managed instance group and all of the instances in that group. +*/ +await gapi.client.regionInstanceGroupManagers.delete({ instanceGroupManager: "instanceGroupManager", project: "project", region: "region", }); + +/* +Schedules a group action to delete the specified instances in the managed instance group. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method. + +If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + +You can specify a maximum of 1000 instances with this method per request. +*/ +await gapi.client.regionInstanceGroupManagers.deleteInstances({ instanceGroupManager: "instanceGroupManager", project: "project", region: "region", }); + +/* +Returns all of the details about the specified managed instance group. +*/ +await gapi.client.regionInstanceGroupManagers.get({ instanceGroupManager: "instanceGroupManager", project: "project", region: "region", }); + +/* +Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. + +A regional managed instance group can contain up to 2000 instances. +*/ +await gapi.client.regionInstanceGroupManagers.insert({ project: "project", region: "region", }); + +/* +Retrieves the list of managed instance groups that are contained within the specified region. +*/ +await gapi.client.regionInstanceGroupManagers.list({ project: "project", region: "region", }); + +/* +Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances. +*/ +await gapi.client.regionInstanceGroupManagers.listManagedInstances({ instanceGroupManager: "instanceGroupManager", project: "project", region: "region", }); + +/* +Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method. + +If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + +You can specify a maximum of 1000 instances with this method per request. +*/ +await gapi.client.regionInstanceGroupManagers.recreateInstances({ instanceGroupManager: "instanceGroupManager", project: "project", region: "region", }); + +/* +Changes the intended size for the managed instance group. If you increase the size, the group schedules actions to create new instances using the current instance template. If you decrease the size, the group schedules delete actions on one or more instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. + +If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. +*/ +await gapi.client.regionInstanceGroupManagers.resize({ instanceGroupManager: "instanceGroupManager", project: "project", region: "region", size: 1, }); + +/* +Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. +*/ +await gapi.client.regionInstanceGroupManagers.setInstanceTemplate({ instanceGroupManager: "instanceGroupManager", project: "project", region: "region", }); + +/* +Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. +*/ +await gapi.client.regionInstanceGroupManagers.setTargetPools({ instanceGroupManager: "instanceGroupManager", project: "project", region: "region", }); + +/* +Returns the specified instance group resource. +*/ +await gapi.client.regionInstanceGroups.get({ instanceGroup: "instanceGroup", project: "project", region: "region", }); + +/* +Retrieves the list of instance group resources contained within the specified region. +*/ +await gapi.client.regionInstanceGroups.list({ project: "project", region: "region", }); + +/* +Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. +*/ +await gapi.client.regionInstanceGroups.listInstances({ instanceGroup: "instanceGroup", project: "project", region: "region", }); + +/* +Sets the named ports for the specified regional instance group. +*/ +await gapi.client.regionInstanceGroups.setNamedPorts({ instanceGroup: "instanceGroup", project: "project", region: "region", }); + +/* +Deletes the specified region-specific Operations resource. +*/ +await gapi.client.regionOperations.delete({ operation: "operation", project: "project", region: "region", }); + +/* +Retrieves the specified region-specific Operations resource. +*/ +await gapi.client.regionOperations.get({ operation: "operation", project: "project", region: "region", }); + +/* +Retrieves a list of Operation resources contained within the specified region. +*/ +await gapi.client.regionOperations.list({ project: "project", region: "region", }); + +/* +Returns the specified Region resource. Get a list of available regions by making a list() request. +*/ +await gapi.client.regions.get({ project: "project", region: "region", }); + +/* +Retrieves the list of region resources available to the specified project. +*/ +await gapi.client.regions.list({ project: "project", }); + +/* +Retrieves an aggregated list of routers. +*/ +await gapi.client.routers.aggregatedList({ project: "project", }); + +/* +Deletes the specified Router resource. +*/ +await gapi.client.routers.delete({ project: "project", region: "region", router: "router", }); + +/* +Returns the specified Router resource. Get a list of available routers by making a list() request. +*/ +await gapi.client.routers.get({ project: "project", region: "region", router: "router", }); + +/* +Retrieves runtime information of the specified router. +*/ +await gapi.client.routers.getRouterStatus({ project: "project", region: "region", router: "router", }); + +/* +Creates a Router resource in the specified project and region using the data included in the request. +*/ +await gapi.client.routers.insert({ project: "project", region: "region", }); + +/* +Retrieves a list of Router resources available to the specified project. +*/ +await gapi.client.routers.list({ project: "project", region: "region", }); + +/* +Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. +*/ +await gapi.client.routers.patch({ project: "project", region: "region", router: "router", }); + +/* +Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router. +*/ +await gapi.client.routers.preview({ project: "project", region: "region", router: "router", }); + +/* +Updates the specified Router resource with the data included in the request. +*/ +await gapi.client.routers.update({ project: "project", region: "region", router: "router", }); + +/* +Deletes the specified Route resource. +*/ +await gapi.client.routes.delete({ project: "project", route: "route", }); + +/* +Returns the specified Route resource. Get a list of available routes by making a list() request. +*/ +await gapi.client.routes.get({ project: "project", route: "route", }); + +/* +Creates a Route resource in the specified project using the data included in the request. +*/ +await gapi.client.routes.insert({ project: "project", }); + +/* +Retrieves the list of Route resources available to the specified project. +*/ +await gapi.client.routes.list({ project: "project", }); + +/* +Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. + +For more information, see Deleting snaphots. +*/ +await gapi.client.snapshots.delete({ project: "project", snapshot: "snapshot", }); + +/* +Returns the specified Snapshot resource. Get a list of available snapshots by making a list() request. +*/ +await gapi.client.snapshots.get({ project: "project", snapshot: "snapshot", }); + +/* +Retrieves the list of Snapshot resources contained within the specified project. +*/ +await gapi.client.snapshots.list({ project: "project", }); + +/* +Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation. +*/ +await gapi.client.snapshots.setLabels({ project: "project", resource: "resource", }); + +/* +Deletes the specified SslCertificate resource. +*/ +await gapi.client.sslCertificates.delete({ project: "project", sslCertificate: "sslCertificate", }); + +/* +Returns the specified SslCertificate resource. Get a list of available SSL certificates by making a list() request. +*/ +await gapi.client.sslCertificates.get({ project: "project", sslCertificate: "sslCertificate", }); + +/* +Creates a SslCertificate resource in the specified project using the data included in the request. +*/ +await gapi.client.sslCertificates.insert({ project: "project", }); + +/* +Retrieves the list of SslCertificate resources available to the specified project. +*/ +await gapi.client.sslCertificates.list({ project: "project", }); + +/* +Retrieves an aggregated list of subnetworks. +*/ +await gapi.client.subnetworks.aggregatedList({ project: "project", }); + +/* +Deletes the specified subnetwork. +*/ +await gapi.client.subnetworks.delete({ project: "project", region: "region", subnetwork: "subnetwork", }); + +/* +Expands the IP CIDR range of the subnetwork to a specified value. +*/ +await gapi.client.subnetworks.expandIpCidrRange({ project: "project", region: "region", subnetwork: "subnetwork", }); + +/* +Returns the specified subnetwork. Get a list of available subnetworks list() request. +*/ +await gapi.client.subnetworks.get({ project: "project", region: "region", subnetwork: "subnetwork", }); + +/* +Creates a subnetwork in the specified project using the data included in the request. +*/ +await gapi.client.subnetworks.insert({ project: "project", region: "region", }); + +/* +Retrieves a list of subnetworks available to the specified project. +*/ +await gapi.client.subnetworks.list({ project: "project", region: "region", }); + +/* +Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access. +*/ +await gapi.client.subnetworks.setPrivateIpGoogleAccess({ project: "project", region: "region", subnetwork: "subnetwork", }); + +/* +Deletes the specified TargetHttpProxy resource. +*/ +await gapi.client.targetHttpProxies.delete({ project: "project", targetHttpProxy: "targetHttpProxy", }); + +/* +Returns the specified TargetHttpProxy resource. Get a list of available target HTTP proxies by making a list() request. +*/ +await gapi.client.targetHttpProxies.get({ project: "project", targetHttpProxy: "targetHttpProxy", }); + +/* +Creates a TargetHttpProxy resource in the specified project using the data included in the request. +*/ +await gapi.client.targetHttpProxies.insert({ project: "project", }); + +/* +Retrieves the list of TargetHttpProxy resources available to the specified project. +*/ +await gapi.client.targetHttpProxies.list({ project: "project", }); + +/* +Changes the URL map for TargetHttpProxy. +*/ +await gapi.client.targetHttpProxies.setUrlMap({ project: "project", targetHttpProxy: "targetHttpProxy", }); + +/* +Deletes the specified TargetHttpsProxy resource. +*/ +await gapi.client.targetHttpsProxies.delete({ project: "project", targetHttpsProxy: "targetHttpsProxy", }); + +/* +Returns the specified TargetHttpsProxy resource. Get a list of available target HTTPS proxies by making a list() request. +*/ +await gapi.client.targetHttpsProxies.get({ project: "project", targetHttpsProxy: "targetHttpsProxy", }); + +/* +Creates a TargetHttpsProxy resource in the specified project using the data included in the request. +*/ +await gapi.client.targetHttpsProxies.insert({ project: "project", }); + +/* +Retrieves the list of TargetHttpsProxy resources available to the specified project. +*/ +await gapi.client.targetHttpsProxies.list({ project: "project", }); + +/* +Replaces SslCertificates for TargetHttpsProxy. +*/ +await gapi.client.targetHttpsProxies.setSslCertificates({ project: "project", targetHttpsProxy: "targetHttpsProxy", }); + +/* +Changes the URL map for TargetHttpsProxy. +*/ +await gapi.client.targetHttpsProxies.setUrlMap({ project: "project", targetHttpsProxy: "targetHttpsProxy", }); + +/* +Retrieves an aggregated list of target instances. +*/ +await gapi.client.targetInstances.aggregatedList({ project: "project", }); + +/* +Deletes the specified TargetInstance resource. +*/ +await gapi.client.targetInstances.delete({ project: "project", targetInstance: "targetInstance", zone: "zone", }); + +/* +Returns the specified TargetInstance resource. Get a list of available target instances by making a list() request. +*/ +await gapi.client.targetInstances.get({ project: "project", targetInstance: "targetInstance", zone: "zone", }); + +/* +Creates a TargetInstance resource in the specified project and zone using the data included in the request. +*/ +await gapi.client.targetInstances.insert({ project: "project", zone: "zone", }); + +/* +Retrieves a list of TargetInstance resources available to the specified project and zone. +*/ +await gapi.client.targetInstances.list({ project: "project", zone: "zone", }); + +/* +Adds health check URLs to a target pool. +*/ +await gapi.client.targetPools.addHealthCheck({ project: "project", region: "region", targetPool: "targetPool", }); + +/* +Adds an instance to a target pool. +*/ +await gapi.client.targetPools.addInstance({ project: "project", region: "region", targetPool: "targetPool", }); + +/* +Retrieves an aggregated list of target pools. +*/ +await gapi.client.targetPools.aggregatedList({ project: "project", }); + +/* +Deletes the specified target pool. +*/ +await gapi.client.targetPools.delete({ project: "project", region: "region", targetPool: "targetPool", }); + +/* +Returns the specified target pool. Get a list of available target pools by making a list() request. +*/ +await gapi.client.targetPools.get({ project: "project", region: "region", targetPool: "targetPool", }); + +/* +Gets the most recent health check results for each IP for the instance that is referenced by the given target pool. +*/ +await gapi.client.targetPools.getHealth({ project: "project", region: "region", targetPool: "targetPool", }); + +/* +Creates a target pool in the specified project and region using the data included in the request. +*/ +await gapi.client.targetPools.insert({ project: "project", region: "region", }); + +/* +Retrieves a list of target pools available to the specified project and region. +*/ +await gapi.client.targetPools.list({ project: "project", region: "region", }); + +/* +Removes health check URL from a target pool. +*/ +await gapi.client.targetPools.removeHealthCheck({ project: "project", region: "region", targetPool: "targetPool", }); + +/* +Removes instance URL from a target pool. +*/ +await gapi.client.targetPools.removeInstance({ project: "project", region: "region", targetPool: "targetPool", }); + +/* +Changes a backup target pool's configurations. +*/ +await gapi.client.targetPools.setBackup({ project: "project", region: "region", targetPool: "targetPool", }); + +/* +Deletes the specified TargetSslProxy resource. +*/ +await gapi.client.targetSslProxies.delete({ project: "project", targetSslProxy: "targetSslProxy", }); + +/* +Returns the specified TargetSslProxy resource. Get a list of available target SSL proxies by making a list() request. +*/ +await gapi.client.targetSslProxies.get({ project: "project", targetSslProxy: "targetSslProxy", }); + +/* +Creates a TargetSslProxy resource in the specified project using the data included in the request. +*/ +await gapi.client.targetSslProxies.insert({ project: "project", }); + +/* +Retrieves the list of TargetSslProxy resources available to the specified project. +*/ +await gapi.client.targetSslProxies.list({ project: "project", }); + +/* +Changes the BackendService for TargetSslProxy. +*/ +await gapi.client.targetSslProxies.setBackendService({ project: "project", targetSslProxy: "targetSslProxy", }); + +/* +Changes the ProxyHeaderType for TargetSslProxy. +*/ +await gapi.client.targetSslProxies.setProxyHeader({ project: "project", targetSslProxy: "targetSslProxy", }); + +/* +Changes SslCertificates for TargetSslProxy. +*/ +await gapi.client.targetSslProxies.setSslCertificates({ project: "project", targetSslProxy: "targetSslProxy", }); + +/* +Deletes the specified TargetTcpProxy resource. +*/ +await gapi.client.targetTcpProxies.delete({ project: "project", targetTcpProxy: "targetTcpProxy", }); + +/* +Returns the specified TargetTcpProxy resource. Get a list of available target TCP proxies by making a list() request. +*/ +await gapi.client.targetTcpProxies.get({ project: "project", targetTcpProxy: "targetTcpProxy", }); + +/* +Creates a TargetTcpProxy resource in the specified project using the data included in the request. +*/ +await gapi.client.targetTcpProxies.insert({ project: "project", }); + +/* +Retrieves the list of TargetTcpProxy resources available to the specified project. +*/ +await gapi.client.targetTcpProxies.list({ project: "project", }); + +/* +Changes the BackendService for TargetTcpProxy. +*/ +await gapi.client.targetTcpProxies.setBackendService({ project: "project", targetTcpProxy: "targetTcpProxy", }); + +/* +Changes the ProxyHeaderType for TargetTcpProxy. +*/ +await gapi.client.targetTcpProxies.setProxyHeader({ project: "project", targetTcpProxy: "targetTcpProxy", }); + +/* +Retrieves an aggregated list of target VPN gateways. +*/ +await gapi.client.targetVpnGateways.aggregatedList({ project: "project", }); + +/* +Deletes the specified target VPN gateway. +*/ +await gapi.client.targetVpnGateways.delete({ project: "project", region: "region", targetVpnGateway: "targetVpnGateway", }); + +/* +Returns the specified target VPN gateway. Get a list of available target VPN gateways by making a list() request. +*/ +await gapi.client.targetVpnGateways.get({ project: "project", region: "region", targetVpnGateway: "targetVpnGateway", }); + +/* +Creates a target VPN gateway in the specified project and region using the data included in the request. +*/ +await gapi.client.targetVpnGateways.insert({ project: "project", region: "region", }); + +/* +Retrieves a list of target VPN gateways available to the specified project and region. +*/ +await gapi.client.targetVpnGateways.list({ project: "project", region: "region", }); + +/* +Deletes the specified UrlMap resource. +*/ +await gapi.client.urlMaps.delete({ project: "project", urlMap: "urlMap", }); + +/* +Returns the specified UrlMap resource. Get a list of available URL maps by making a list() request. +*/ +await gapi.client.urlMaps.get({ project: "project", urlMap: "urlMap", }); + +/* +Creates a UrlMap resource in the specified project using the data included in the request. +*/ +await gapi.client.urlMaps.insert({ project: "project", }); + +/* +Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. +*/ +await gapi.client.urlMaps.invalidateCache({ project: "project", urlMap: "urlMap", }); + +/* +Retrieves the list of UrlMap resources available to the specified project. +*/ +await gapi.client.urlMaps.list({ project: "project", }); + +/* +Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. +*/ +await gapi.client.urlMaps.patch({ project: "project", urlMap: "urlMap", }); + +/* +Updates the specified UrlMap resource with the data included in the request. +*/ +await gapi.client.urlMaps.update({ project: "project", urlMap: "urlMap", }); + +/* +Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. +*/ +await gapi.client.urlMaps.validate({ project: "project", urlMap: "urlMap", }); + +/* +Retrieves an aggregated list of VPN tunnels. +*/ +await gapi.client.vpnTunnels.aggregatedList({ project: "project", }); + +/* +Deletes the specified VpnTunnel resource. +*/ +await gapi.client.vpnTunnels.delete({ project: "project", region: "region", vpnTunnel: "vpnTunnel", }); + +/* +Returns the specified VpnTunnel resource. Get a list of available VPN tunnels by making a list() request. +*/ +await gapi.client.vpnTunnels.get({ project: "project", region: "region", vpnTunnel: "vpnTunnel", }); + +/* +Creates a VpnTunnel resource in the specified project and region using the data included in the request. +*/ +await gapi.client.vpnTunnels.insert({ project: "project", region: "region", }); + +/* +Retrieves a list of VpnTunnel resources contained in the specified project and region. +*/ +await gapi.client.vpnTunnels.list({ project: "project", region: "region", }); + +/* +Deletes the specified zone-specific Operations resource. +*/ +await gapi.client.zoneOperations.delete({ operation: "operation", project: "project", zone: "zone", }); + +/* +Retrieves the specified zone-specific Operations resource. +*/ +await gapi.client.zoneOperations.get({ operation: "operation", project: "project", zone: "zone", }); + +/* +Retrieves a list of Operation resources contained within the specified zone. +*/ +await gapi.client.zoneOperations.list({ project: "project", zone: "zone", }); + +/* +Returns the specified Zone resource. Get a list of available zones by making a list() request. +*/ +await gapi.client.zones.get({ project: "project", zone: "zone", }); + +/* +Retrieves the list of Zone resources available to the specified project. +*/ +await gapi.client.zones.list({ project: "project", }); +``` \ No newline at end of file diff --git a/types/gapi.client.compute/tsconfig.json b/types/gapi.client.compute/tsconfig.json new file mode 100644 index 0000000000..496204435b --- /dev/null +++ b/types/gapi.client.compute/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.compute-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.compute/tslint.json b/types/gapi.client.compute/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.compute/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.consumersurveys/gapi.client.consumersurveys-tests.ts b/types/gapi.client.consumersurveys/gapi.client.consumersurveys-tests.ts new file mode 100644 index 0000000000..a374f6283a --- /dev/null +++ b/types/gapi.client.consumersurveys/gapi.client.consumersurveys-tests.ts @@ -0,0 +1,86 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('consumersurveys', 'v2', () => { + /** now we can use gapi.client.consumersurveys */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and edit your surveys and results */ + 'https://www.googleapis.com/auth/consumersurveys', + /** View the results for your surveys */ + 'https://www.googleapis.com/auth/consumersurveys.readonly', + /** View your email address */ + 'https://www.googleapis.com/auth/userinfo.email', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Retrieves a MobileAppPanel that is available to the authenticated user. */ + await gapi.client.mobileapppanels.get({ + panelId: "panelId", + }); + /** Lists the MobileAppPanels available to the authenticated user. */ + await gapi.client.mobileapppanels.list({ + maxResults: 1, + startIndex: 2, + token: "token", + }); + /** Updates a MobileAppPanel. Currently the only property that can be updated is the owners property. */ + await gapi.client.mobileapppanels.update({ + panelId: "panelId", + }); + /** + * Retrieves any survey results that have been produced so far. Results are formatted as an Excel file. You must add "?alt=media" to the URL as an + * argument to get results. + */ + await gapi.client.results.get({ + surveyUrlId: "surveyUrlId", + }); + /** Removes a survey from view in all user GET requests. */ + await gapi.client.surveys.delete({ + surveyUrlId: "surveyUrlId", + }); + /** Retrieves information about the specified survey. */ + await gapi.client.surveys.get({ + surveyUrlId: "surveyUrlId", + }); + /** Creates a survey. */ + await gapi.client.surveys.insert({ + }); + /** Lists the surveys owned by the authenticated user. */ + await gapi.client.surveys.list({ + maxResults: 1, + startIndex: 2, + token: "token", + }); + /** Begins running a survey. */ + await gapi.client.surveys.start({ + resourceId: "resourceId", + }); + /** Stops a running survey. */ + await gapi.client.surveys.stop({ + resourceId: "resourceId", + }); + /** Updates a survey. Currently the only property that can be updated is the owners property. */ + await gapi.client.surveys.update({ + surveyUrlId: "surveyUrlId", + }); + } +}); diff --git a/types/gapi.client.consumersurveys/index.d.ts b/types/gapi.client.consumersurveys/index.d.ts new file mode 100644 index 0000000000..41531fce6d --- /dev/null +++ b/types/gapi.client.consumersurveys/index.d.ts @@ -0,0 +1,397 @@ +// Type definitions for Google Consumer Surveys API v2 2.0 +// Project: undefined +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/consumersurveys/v2/rest + +/// + +declare namespace gapi.client { + /** Load Consumer Surveys API v2 */ + function load(name: "consumersurveys", version: "v2"): PromiseLike; + function load(name: "consumersurveys", version: "v2", callback: () => any): void; + + const mobileapppanels: consumersurveys.MobileapppanelsResource; + + const results: consumersurveys.ResultsResource; + + const surveys: consumersurveys.SurveysResource; + + namespace consumersurveys { + interface FieldMask { + fields?: FieldMask[]; + id?: number; + } + interface MobileAppPanel { + country?: string; + isPublicPanel?: boolean; + language?: string; + mobileAppPanelId?: string; + name?: string; + owners?: string[]; + } + interface MobileAppPanelsListResponse { + pageInfo?: PageInfo; + /** Unique request ID used for logging and debugging. Please include in any error reporting or troubleshooting requests. */ + requestId?: string; + /** An individual predefined panel of Opinion Rewards mobile users. */ + resources?: MobileAppPanel[]; + tokenPagination?: TokenPagination; + } + interface PageInfo { + resultPerPage?: number; + startIndex?: number; + totalResults?: number; + } + interface ResultsGetRequest { + resultMask?: ResultsMask; + } + interface ResultsMask { + fields?: FieldMask[]; + projection?: string; + } + interface Survey { + audience?: SurveyAudience; + cost?: SurveyCost; + customerData?: string; + description?: string; + owners?: string[]; + questions?: SurveyQuestion[]; + rejectionReason?: SurveyRejection; + state?: string; + surveyUrlId?: string; + title?: string; + wantedResponseCount?: number; + } + interface SurveyAudience { + ages?: string[]; + country?: string; + countrySubdivision?: string; + gender?: string; + languages?: string[]; + mobileAppPanelId?: string; + populationSource?: string; + } + interface SurveyCost { + costPerResponseNanos?: string; + currencyCode?: string; + maxCostPerResponseNanos?: string; + nanos?: string; + } + interface SurveyQuestion { + answerOrder?: string; + answers?: string[]; + hasOther?: boolean; + highValueLabel?: string; + images?: SurveyQuestionImage[]; + lastAnswerPositionPinned?: boolean; + lowValueLabel?: string; + mustPickSuggestion?: boolean; + numStars?: string; + openTextPlaceholder?: string; + openTextSuggestions?: string[]; + question?: string; + sentimentText?: string; + singleLineResponse?: boolean; + thresholdAnswers?: string[]; + type?: string; + unitOfMeasurementLabel?: string; + videoId?: string; + } + interface SurveyQuestionImage { + altText?: string; + data?: string; + url?: string; + } + interface SurveyRejection { + explanation?: string; + type?: string; + } + interface SurveyResults { + status?: string; + surveyUrlId?: string; + } + interface SurveysDeleteResponse { + /** Unique request ID used for logging and debugging. Please include in any error reporting or troubleshooting requests. */ + requestId?: string; + } + interface SurveysListResponse { + pageInfo?: PageInfo; + /** Unique request ID used for logging and debugging. Please include in any error reporting or troubleshooting requests. */ + requestId?: string; + /** An individual survey resource. */ + resources?: Survey[]; + tokenPagination?: TokenPagination; + } + interface SurveysStartRequest { + /** Threshold to start a survey automically if the quoted prices is less than or equal to this value. See Survey.Cost for more details. */ + maxCostPerResponseNanos?: string; + } + interface SurveysStartResponse { + /** Unique request ID used for logging and debugging. Please include in any error reporting or troubleshooting requests. */ + requestId?: string; + } + interface SurveysStopResponse { + /** Unique request ID used for logging and debugging. Please include in any error reporting or troubleshooting requests. */ + requestId?: string; + } + interface TokenPagination { + nextPageToken?: string; + previousPageToken?: string; + } + interface MobileapppanelsResource { + /** Retrieves a MobileAppPanel that is available to the authenticated user. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** External URL ID for the panel. */ + panelId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the MobileAppPanels available to the authenticated user. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + startIndex?: number; + token?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a MobileAppPanel. Currently the only property that can be updated is the owners property. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** External URL ID for the panel. */ + panelId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ResultsResource { + /** + * Retrieves any survey results that have been produced so far. Results are formatted as an Excel file. You must add "?alt=media" to the URL as an + * argument to get results. + */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** External URL ID for the survey. */ + surveyUrlId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SurveysResource { + /** Removes a survey from view in all user GET requests. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** External URL ID for the survey. */ + surveyUrlId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves information about the specified survey. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** External URL ID for the survey. */ + surveyUrlId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a survey. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the surveys owned by the authenticated user. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + startIndex?: number; + token?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Begins running a survey. */ + start(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + resourceId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Stops a running survey. */ + stop(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + resourceId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a survey. Currently the only property that can be updated is the owners property. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** External URL ID for the survey. */ + surveyUrlId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.consumersurveys/readme.md b/types/gapi.client.consumersurveys/readme.md new file mode 100644 index 0000000000..2c9ec3157f --- /dev/null +++ b/types/gapi.client.consumersurveys/readme.md @@ -0,0 +1,115 @@ +# TypeScript typings for Consumer Surveys API v2 +Creates and conducts surveys, lists the surveys that an authenticated user owns, and retrieves survey results and information about specified surveys. +For detailed description please check [documentation](undefined). + +## Installing + +Install typings for Consumer Surveys API: +``` +npm install @types/gapi.client.consumersurveys@v2 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('consumersurveys', 'v2', () => { + // now we can use gapi.client.consumersurveys + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and edit your surveys and results + 'https://www.googleapis.com/auth/consumersurveys', + + // View the results for your surveys + 'https://www.googleapis.com/auth/consumersurveys.readonly', + + // View your email address + 'https://www.googleapis.com/auth/userinfo.email', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Consumer Surveys API resources: + +```typescript + +/* +Retrieves a MobileAppPanel that is available to the authenticated user. +*/ +await gapi.client.mobileapppanels.get({ panelId: "panelId", }); + +/* +Lists the MobileAppPanels available to the authenticated user. +*/ +await gapi.client.mobileapppanels.list({ }); + +/* +Updates a MobileAppPanel. Currently the only property that can be updated is the owners property. +*/ +await gapi.client.mobileapppanels.update({ panelId: "panelId", }); + +/* +Retrieves any survey results that have been produced so far. Results are formatted as an Excel file. You must add "?alt=media" to the URL as an argument to get results. +*/ +await gapi.client.results.get({ surveyUrlId: "surveyUrlId", }); + +/* +Removes a survey from view in all user GET requests. +*/ +await gapi.client.surveys.delete({ surveyUrlId: "surveyUrlId", }); + +/* +Retrieves information about the specified survey. +*/ +await gapi.client.surveys.get({ surveyUrlId: "surveyUrlId", }); + +/* +Creates a survey. +*/ +await gapi.client.surveys.insert({ }); + +/* +Lists the surveys owned by the authenticated user. +*/ +await gapi.client.surveys.list({ }); + +/* +Begins running a survey. +*/ +await gapi.client.surveys.start({ resourceId: "resourceId", }); + +/* +Stops a running survey. +*/ +await gapi.client.surveys.stop({ resourceId: "resourceId", }); + +/* +Updates a survey. Currently the only property that can be updated is the owners property. +*/ +await gapi.client.surveys.update({ surveyUrlId: "surveyUrlId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.consumersurveys/tsconfig.json b/types/gapi.client.consumersurveys/tsconfig.json new file mode 100644 index 0000000000..e8c3646083 --- /dev/null +++ b/types/gapi.client.consumersurveys/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.consumersurveys-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.consumersurveys/tslint.json b/types/gapi.client.consumersurveys/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.consumersurveys/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.container/gapi.client.container-tests.ts b/types/gapi.client.container/gapi.client.container-tests.ts new file mode 100644 index 0000000000..7a30c61361 --- /dev/null +++ b/types/gapi.client.container/gapi.client.container-tests.ts @@ -0,0 +1,32 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('container', 'v1', () => { + /** now we can use gapi.client.container */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + } +}); diff --git a/types/gapi.client.container/index.d.ts b/types/gapi.client.container/index.d.ts new file mode 100644 index 0000000000..41fa31c25f --- /dev/null +++ b/types/gapi.client.container/index.d.ts @@ -0,0 +1,2201 @@ +// Type definitions for Google Google Container Engine API v1 1.0 +// Project: https://cloud.google.com/container-engine/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://container.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Google Container Engine API v1 */ + function load(name: "container", version: "v1"): PromiseLike; + function load(name: "container", version: "v1", callback: () => any): void; + + const projects: container.ProjectsResource; + + namespace container { + interface AcceleratorConfig { + /** The number of the accelerator cards exposed to an instance. */ + acceleratorCount?: string; + /** + * The accelerator type resource name. List of supported accelerators + * [here](/compute/docs/gpus/#Introduction) + */ + acceleratorType?: string; + } + interface AddonsConfig { + /** + * Configuration for the horizontal pod autoscaling feature, which + * increases or decreases the number of replica pods a replication controller + * has based on the resource usage of the existing pods. + */ + horizontalPodAutoscaling?: HorizontalPodAutoscaling; + /** + * Configuration for the HTTP (L7) load balancing controller addon, which + * makes it easy to set up HTTP load balancers for services in a cluster. + */ + httpLoadBalancing?: HttpLoadBalancing; + /** Configuration for the Kubernetes Dashboard. */ + kubernetesDashboard?: KubernetesDashboard; + /** + * Configuration for NetworkPolicy. This only tracks whether the addon + * is enabled or not on the Master, it does not track whether network policy + * is enabled for the nodes. + */ + networkPolicyConfig?: NetworkPolicyConfig; + } + interface AutoUpgradeOptions { + /** + * [Output only] This field is set when upgrades are about to commence + * with the approximate start time for the upgrades, in + * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + */ + autoUpgradeStartTime?: string; + /** + * [Output only] This field is set when upgrades are about to commence + * with the description of the upgrade. + */ + description?: string; + } + interface CidrBlock { + /** cidr_block must be specified in CIDR notation. */ + cidrBlock?: string; + /** display_name is an optional field for users to identify CIDR blocks. */ + displayName?: string; + } + interface ClientCertificateConfig { + /** Issue a client certificate. */ + issueClientCertificate?: boolean; + } + interface Cluster { + /** Configurations for the various addons available to run in the cluster. */ + addonsConfig?: AddonsConfig; + /** + * The IP address range of the container pods in this cluster, in + * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + * notation (e.g. `10.96.0.0/14`). Leave blank to have + * one automatically chosen or specify a `/14` block in `10.0.0.0/8`. + */ + clusterIpv4Cidr?: string; + /** + * [Output only] The time the cluster was created, in + * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + */ + createTime?: string; + /** [Output only] The current software version of the master endpoint. */ + currentMasterVersion?: string; + /** [Output only] The number of nodes currently in the cluster. */ + currentNodeCount?: number; + /** + * [Output only] The current version of the node software components. + * If they are currently at multiple versions because they're in the process + * of being upgraded, this reflects the minimum version of all nodes. + */ + currentNodeVersion?: string; + /** An optional description of this cluster. */ + description?: string; + /** + * Kubernetes alpha features are enabled on this cluster. This includes alpha + * API groups (e.g. v1alpha1) and features that may not be production ready in + * the kubernetes version of the master and nodes. + * The cluster has no SLA for uptime and master/node upgrades are disabled. + * Alpha enabled clusters are automatically deleted thirty days after + * creation. + */ + enableKubernetesAlpha?: boolean; + /** + * [Output only] The IP address of this cluster's master endpoint. + * The endpoint can be accessed from the internet at + * `https://username:password@endpoint/`. + * + * See the `masterAuth` property of this resource for username and + * password information. + */ + endpoint?: string; + /** + * [Output only] The time the cluster will be automatically + * deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + */ + expireTime?: string; + /** + * The initial Kubernetes version for this cluster. Valid versions are those + * found in validMasterVersions returned by getServerConfig. The version can + * be upgraded over time; such upgrades are reflected in + * currentMasterVersion and currentNodeVersion. + */ + initialClusterVersion?: string; + /** + * The number of nodes to create in this cluster. You must ensure that your + * Compute Engine resource quota + * is sufficient for this number of instances. You must also have available + * firewall and routes quota. + * For requests, this field should only be used in lieu of a + * "node_pool" object, since this configuration (along with the + * "node_config") will be used to create a "NodePool" object with an + * auto-generated name. Do not use this and a node_pool at the same time. + */ + initialNodeCount?: number; + /** + * [Output only] The resource URLs of [instance + * groups](/compute/docs/instance-groups/) associated with this + * cluster. + */ + instanceGroupUrls?: string[]; + /** Configuration for cluster IP allocation. */ + ipAllocationPolicy?: IPAllocationPolicy; + /** The fingerprint of the set of labels for this cluster. */ + labelFingerprint?: string; + /** Configuration for the legacy ABAC authorization mode. */ + legacyAbac?: LegacyAbac; + /** + * The list of Google Compute Engine + * [locations](/compute/docs/zones#available) in which the cluster's nodes + * should be located. + */ + locations?: string[]; + /** + * The logging service the cluster should use to write logs. + * Currently available options: + * + * * `logging.googleapis.com` - the Google Cloud Logging service. + * * `none` - no logs will be exported from the cluster. + * * if left as an empty string,`logging.googleapis.com` will be used. + */ + loggingService?: string; + /** Configure the maintenance policy for this cluster. */ + maintenancePolicy?: MaintenancePolicy; + /** The authentication information for accessing the master endpoint. */ + masterAuth?: MasterAuth; + /** + * Master authorized networks is a Beta feature. + * The configuration options for master authorized networks feature. + */ + masterAuthorizedNetworksConfig?: MasterAuthorizedNetworksConfig; + /** + * The monitoring service the cluster should use to write metrics. + * Currently available options: + * + * * `monitoring.googleapis.com` - the Google Cloud Monitoring service. + * * `none` - no metrics will be exported from the cluster. + * * if left as an empty string, `monitoring.googleapis.com` will be used. + */ + monitoringService?: string; + /** + * The name of this cluster. The name must be unique within this project + * and zone, and can be up to 40 characters with the following restrictions: + * + * * Lowercase letters, numbers, and hyphens only. + * * Must start with a letter. + * * Must end with a number or a letter. + */ + name?: string; + /** + * The name of the Google Compute Engine + * [network](/compute/docs/networks-and-firewalls#networks) to which the + * cluster is connected. If left unspecified, the `default` network + * will be used. + */ + network?: string; + /** Configuration options for the NetworkPolicy feature. */ + networkPolicy?: NetworkPolicy; + /** + * Parameters used in creating the cluster's nodes. + * See `nodeConfig` for the description of its properties. + * For requests, this field should only be used in lieu of a + * "node_pool" object, since this configuration (along with the + * "initial_node_count") will be used to create a "NodePool" object with an + * auto-generated name. Do not use this and a node_pool at the same time. + * For responses, this field will be populated with the node configuration of + * the first node pool. + * + * If unspecified, the defaults are used. + */ + nodeConfig?: NodeConfig; + /** + * [Output only] The size of the address space on each node for hosting + * containers. This is provisioned from within the `container_ipv4_cidr` + * range. + */ + nodeIpv4CidrSize?: number; + /** + * The node pools associated with this cluster. + * This field should not be set if "node_config" or "initial_node_count" are + * specified. + */ + nodePools?: NodePool[]; + /** + * The resource labels for the cluster to use to annotate any related + * Google Compute Engine resources. + */ + resourceLabels?: Record; + /** [Output only] Server-defined URL for the resource. */ + selfLink?: string; + /** + * [Output only] The IP address range of the Kubernetes services in + * this cluster, in + * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + * notation (e.g. `1.2.3.4/29`). Service addresses are + * typically put in the last `/16` from the container CIDR. + */ + servicesIpv4Cidr?: string; + /** [Output only] The current status of this cluster. */ + status?: string; + /** + * [Output only] Additional information about the current status of this + * cluster, if available. + */ + statusMessage?: string; + /** + * The name of the Google Compute Engine + * [subnetwork](/compute/docs/subnetworks) to which the + * cluster is connected. + */ + subnetwork?: string; + /** + * [Output only] The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone?: string; + } + interface ClusterUpdate { + /** Configurations for the various addons available to run in the cluster. */ + desiredAddonsConfig?: AddonsConfig; + /** + * The desired image type for the node pool. + * NOTE: Set the "desired_node_pool" field as well. + */ + desiredImageType?: string; + /** + * The desired list of Google Compute Engine + * [locations](/compute/docs/zones#available) in which the cluster's nodes + * should be located. Changing the locations a cluster is in will result + * in nodes being either created or removed from the cluster, depending on + * whether locations are being added or removed. + * + * This list must always include the cluster's primary zone. + */ + desiredLocations?: string[]; + /** + * Master authorized networks is a Beta feature. + * The desired configuration options for master authorized networks feature. + */ + desiredMasterAuthorizedNetworksConfig?: MasterAuthorizedNetworksConfig; + /** + * The Kubernetes version to change the master to. The only valid value is the + * latest supported version. Use "-" to have the server automatically select + * the latest version. + */ + desiredMasterVersion?: string; + /** + * The monitoring service the cluster should use to write metrics. + * Currently available options: + * + * * "monitoring.googleapis.com" - the Google Cloud Monitoring service + * * "none" - no metrics will be exported from the cluster + */ + desiredMonitoringService?: string; + /** + * Autoscaler configuration for the node pool specified in + * desired_node_pool_id. If there is only one pool in the + * cluster and desired_node_pool_id is not provided then + * the change applies to that single node pool. + */ + desiredNodePoolAutoscaling?: NodePoolAutoscaling; + /** + * The node pool to be upgraded. This field is mandatory if + * "desired_node_version", "desired_image_family" or + * "desired_node_pool_autoscaling" is specified and there is more than one + * node pool on the cluster. + */ + desiredNodePoolId?: string; + /** + * The Kubernetes version to change the nodes to (typically an + * upgrade). Use `-` to upgrade to the latest version supported by + * the server. + */ + desiredNodeVersion?: string; + } + interface CreateClusterRequest { + /** + * A [cluster + * resource](/container-engine/reference/rest/v1/projects.zones.clusters) + */ + cluster?: Cluster; + } + interface CreateNodePoolRequest { + /** The node pool to create. */ + nodePool?: NodePool; + } + interface DailyMaintenanceWindow { + /** + * [Output only] Duration of the time window, automatically chosen to be + * smallest possible in the given scenario. + * Duration will be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) + * format "PTnHnMnS". + */ + duration?: string; + /** + * Time within the maintenance window to start the maintenance operations. + * Time format should be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) + * format "HH:MM”, where HH : [00-23] and MM : [00-59] GMT. + */ + startTime?: string; + } + interface HorizontalPodAutoscaling { + /** + * Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. + * When enabled, it ensures that a Heapster pod is running in the cluster, + * which is also used by the Cloud Monitoring service. + */ + disabled?: boolean; + } + interface HttpLoadBalancing { + /** + * Whether the HTTP Load Balancing controller is enabled in the cluster. + * When enabled, it runs a small pod in the cluster that manages the load + * balancers. + */ + disabled?: boolean; + } + interface IPAllocationPolicy { + /** This field is deprecated, use cluster_ipv4_cidr_block. */ + clusterIpv4Cidr?: string; + /** + * The IP address range for the cluster pod IPs. If this field is set, then + * `cluster.cluster_ipv4_cidr` must be left blank. + * + * This field is only applicable when `use_ip_aliases` is true. + * + * Set to blank to have a range chosen with the default size. + * + * Set to /netmask (e.g. `/14`) to have a range chosen with a specific + * netmask. + * + * Set to a + * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + * notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + * `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + * to use. + */ + clusterIpv4CidrBlock?: string; + /** + * The name of the secondary range to be used for the cluster CIDR + * block. The secondary range will be used for pod IP + * addresses. This must be an existing secondary range associated + * with the cluster subnetwork. + * + * This field is only applicable with use_ip_aliases is true and + * create_subnetwork is false. + */ + clusterSecondaryRangeName?: string; + /** + * Whether a new subnetwork will be created automatically for the cluster. + * + * This field is only applicable when `use_ip_aliases` is true. + */ + createSubnetwork?: boolean; + /** This field is deprecated, use node_ipv4_cidr_block. */ + nodeIpv4Cidr?: string; + /** + * The IP address range of the instance IPs in this cluster. + * + * This is applicable only if `create_subnetwork` is true. + * + * Set to blank to have a range chosen with the default size. + * + * Set to /netmask (e.g. `/14`) to have a range chosen with a specific + * netmask. + * + * Set to a + * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + * notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + * `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + * to use. + */ + nodeIpv4CidrBlock?: string; + /** This field is deprecated, use services_ipv4_cidr_block. */ + servicesIpv4Cidr?: string; + /** + * The IP address range of the services IPs in this cluster. If blank, a range + * will be automatically chosen with the default size. + * + * This field is only applicable when `use_ip_aliases` is true. + * + * Set to blank to have a range chosen with the default size. + * + * Set to /netmask (e.g. `/14`) to have a range chosen with a specific + * netmask. + * + * Set to a + * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + * notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + * `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + * to use. + */ + servicesIpv4CidrBlock?: string; + /** + * The name of the secondary range to be used as for the services + * CIDR block. The secondary range will be used for service + * ClusterIPs. This must be an existing secondary range associated + * with the cluster subnetwork. + * + * This field is only applicable with use_ip_aliases is true and + * create_subnetwork is false. + */ + servicesSecondaryRangeName?: string; + /** + * A custom subnetwork name to be used if `create_subnetwork` is true. If + * this field is empty, then an automatic name will be chosen for the new + * subnetwork. + */ + subnetworkName?: string; + /** Whether alias IPs will be used for pod IPs in the cluster. */ + useIpAliases?: boolean; + } + interface KubernetesDashboard { + /** Whether the Kubernetes Dashboard is enabled for this cluster. */ + disabled?: boolean; + } + interface LegacyAbac { + /** + * Whether the ABAC authorizer is enabled for this cluster. When enabled, + * identities in the system, including service accounts, nodes, and + * controllers, will have statically granted permissions beyond those + * provided by the RBAC configuration or IAM. + */ + enabled?: boolean; + } + interface ListClustersResponse { + /** + * A list of clusters in the project in the specified zone, or + * across all ones. + */ + clusters?: Cluster[]; + /** + * If any zones are listed here, the list of clusters returned + * may be missing those zones. + */ + missingZones?: string[]; + } + interface ListNodePoolsResponse { + /** A list of node pools for a cluster. */ + nodePools?: NodePool[]; + } + interface ListOperationsResponse { + /** + * If any zones are listed here, the list of operations returned + * may be missing the operations from those zones. + */ + missingZones?: string[]; + /** A list of operations in the project in the specified zone. */ + operations?: Operation[]; + } + interface MaintenancePolicy { + /** Specifies the maintenance window in which maintenance may be performed. */ + window?: MaintenanceWindow; + } + interface MaintenanceWindow { + /** DailyMaintenanceWindow specifies a daily maintenance operation window. */ + dailyMaintenanceWindow?: DailyMaintenanceWindow; + } + interface MasterAuth { + /** + * [Output only] Base64-encoded public certificate used by clients to + * authenticate to the cluster endpoint. + */ + clientCertificate?: string; + /** + * Configuration for client certificate authentication on the cluster. If no + * configuration is specified, a client certificate is issued. + */ + clientCertificateConfig?: ClientCertificateConfig; + /** + * [Output only] Base64-encoded private key used by clients to authenticate + * to the cluster endpoint. + */ + clientKey?: string; + /** + * [Output only] Base64-encoded public certificate that is the root of + * trust for the cluster. + */ + clusterCaCertificate?: string; + /** + * The password to use for HTTP basic authentication to the master endpoint. + * Because the master endpoint is open to the Internet, you should create a + * strong password. If a password is provided for cluster creation, username + * must be non-empty. + */ + password?: string; + /** + * The username to use for HTTP basic authentication to the master endpoint. + * For clusters v1.6.0 and later, you can disable basic authentication by + * providing an empty username. + */ + username?: string; + } + interface MasterAuthorizedNetworksConfig { + /** + * cidr_blocks define up to 10 external networks that could access + * Kubernetes master through HTTPS. + */ + cidrBlocks?: CidrBlock[]; + /** Whether or not master authorized networks is enabled. */ + enabled?: boolean; + } + interface NetworkPolicy { + /** Whether network policy is enabled on the cluster. */ + enabled?: boolean; + /** The selected network policy provider. */ + provider?: string; + } + interface NetworkPolicyConfig { + /** Whether NetworkPolicy is enabled for this cluster. */ + disabled?: boolean; + } + interface NodeConfig { + /** + * A list of hardware accelerators to be attached to each node. + * See https://cloud.google.com/compute/docs/gpus for more information about + * support for GPUs. + */ + accelerators?: AcceleratorConfig[]; + /** + * Size of the disk attached to each node, specified in GB. + * The smallest allowed disk size is 10GB. + * + * If unspecified, the default disk size is 100GB. + */ + diskSizeGb?: number; + /** + * The image type to use for this node. Note that for a given image type, + * the latest version of it will be used. + */ + imageType?: string; + /** + * The map of Kubernetes labels (key/value pairs) to be applied to each node. + * These will added in addition to any default label(s) that + * Kubernetes may apply to the node. + * In case of conflict in label keys, the applied set may differ depending on + * the Kubernetes version -- it's best to assume the behavior is undefined + * and conflicts should be avoided. + * For more information, including usage and the valid values, see: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + */ + labels?: Record; + /** + * The number of local SSD disks to be attached to the node. + * + * The limit for this value is dependant upon the maximum number of + * disks available on a machine per zone. See: + * https://cloud.google.com/compute/docs/disks/local-ssd#local_ssd_limits + * for more information. + */ + localSsdCount?: number; + /** + * The name of a Google Compute Engine [machine + * type](/compute/docs/machine-types) (e.g. + * `n1-standard-1`). + * + * If unspecified, the default machine type is + * `n1-standard-1`. + */ + machineType?: string; + /** + * The metadata key/value pairs assigned to instances in the cluster. + * + * Keys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes + * in length. These are reflected as part of a URL in the metadata server. + * Additionally, to avoid ambiguity, keys must not conflict with any other + * metadata keys for the project or be one of the four reserved keys: + * "instance-template", "kube-env", "startup-script", and "user-data" + * + * Values are free-form strings, and only have meaning as interpreted by + * the image running in the instance. The only restriction placed on them is + * that each value's size must be less than or equal to 32 KB. + * + * The total size of all keys and values must be less than 512 KB. + */ + metadata?: Record; + /** + * Minimum CPU platform to be used by this instance. The instance may be + * scheduled on the specified or newer CPU platform. Applicable values are the + * friendly names of CPU platforms, such as + * minCpuPlatform: "Intel Haswell" or + * minCpuPlatform: "Intel Sandy Bridge". For more + * information, read [how to specify min CPU platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform) + */ + minCpuPlatform?: string; + /** + * The set of Google API scopes to be made available on all of the + * node VMs under the "default" service account. + * + * The following scopes are recommended, but not required, and by default are + * not included: + * + * * `https://www.googleapis.com/auth/compute` is required for mounting + * persistent storage on your nodes. + * * `https://www.googleapis.com/auth/devstorage.read_only` is required for + * communicating with **gcr.io** + * (the [Google Container Registry](/container-registry/)). + * + * If unspecified, no scopes are added, unless Cloud Logging or Cloud + * Monitoring are enabled, in which case their required scopes will be added. + */ + oauthScopes?: string[]; + /** + * Whether the nodes are created as preemptible VM instances. See: + * https://cloud.google.com/compute/docs/instances/preemptible for more + * information about preemptible VM instances. + */ + preemptible?: boolean; + /** + * The Google Cloud Platform Service Account to be used by the node VMs. If + * no Service Account is specified, the "default" service account is used. + */ + serviceAccount?: string; + /** + * The list of instance tags applied to all nodes. Tags are used to identify + * valid sources or targets for network firewalls and are specified by + * the client during cluster or node pool creation. Each tag within the list + * must comply with RFC1035. + */ + tags?: string[]; + } + interface NodeManagement { + /** + * A flag that specifies whether the node auto-repair is enabled for the node + * pool. If enabled, the nodes in this node pool will be monitored and, if + * they fail health checks too many times, an automatic repair action will be + * triggered. + */ + autoRepair?: boolean; + /** + * A flag that specifies whether node auto-upgrade is enabled for the node + * pool. If enabled, node auto-upgrade helps keep the nodes in your node pool + * up to date with the latest release version of Kubernetes. + */ + autoUpgrade?: boolean; + /** Specifies the Auto Upgrade knobs for the node pool. */ + upgradeOptions?: AutoUpgradeOptions; + } + interface NodePool { + /** + * Autoscaler configuration for this NodePool. Autoscaler is enabled + * only if a valid configuration is present. + */ + autoscaling?: NodePoolAutoscaling; + /** The node configuration of the pool. */ + config?: NodeConfig; + /** + * The initial node count for the pool. You must ensure that your + * Compute Engine resource quota + * is sufficient for this number of instances. You must also have available + * firewall and routes quota. + */ + initialNodeCount?: number; + /** + * [Output only] The resource URLs of [instance + * groups](/compute/docs/instance-groups/) associated with this + * node pool. + */ + instanceGroupUrls?: string[]; + /** NodeManagement configuration for this NodePool. */ + management?: NodeManagement; + /** The name of the node pool. */ + name?: string; + /** [Output only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output only] The status of the nodes in this pool instance. */ + status?: string; + /** + * [Output only] Additional information about the current status of this + * node pool instance, if available. + */ + statusMessage?: string; + /** [Output only] The version of the Kubernetes of this node. */ + version?: string; + } + interface NodePoolAutoscaling { + /** Is autoscaling enabled for this node pool. */ + enabled?: boolean; + /** + * Maximum number of nodes in the NodePool. Must be >= min_node_count. There + * has to enough quota to scale up the cluster. + */ + maxNodeCount?: number; + /** + * Minimum number of nodes in the NodePool. Must be >= 1 and <= + * max_node_count. + */ + minNodeCount?: number; + } + interface Operation { + /** Detailed operation progress, if available. */ + detail?: string; + /** + * [Output only] The time the operation completed, in + * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + */ + endTime?: string; + /** The server-assigned ID for the operation. */ + name?: string; + /** The operation type. */ + operationType?: string; + /** Server-defined URL for the resource. */ + selfLink?: string; + /** + * [Output only] The time the operation started, in + * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + */ + startTime?: string; + /** The current status of the operation. */ + status?: string; + /** If an error has occurred, a textual description of the error. */ + statusMessage?: string; + /** Server-defined URL for the target of the operation. */ + targetLink?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the operation + * is taking place. + */ + zone?: string; + } + interface ServerConfig { + /** Version of Kubernetes the service deploys by default. */ + defaultClusterVersion?: string; + /** Default image type. */ + defaultImageType?: string; + /** List of valid image types. */ + validImageTypes?: string[]; + /** List of valid master versions. */ + validMasterVersions?: string[]; + /** List of valid node upgrade target versions. */ + validNodeVersions?: string[]; + } + interface SetAddonsConfigRequest { + /** + * The desired configurations for the various addons available to run in the + * cluster. + */ + addonsConfig?: AddonsConfig; + } + interface SetLabelsRequest { + /** + * The fingerprint of the previous set of labels for this resource, + * used to detect conflicts. The fingerprint is initially generated by + * Container Engine and changes after every request to modify or update + * labels. You must always provide an up-to-date fingerprint hash when + * updating or changing labels. Make a get() request to the + * resource to get the latest fingerprint. + */ + labelFingerprint?: string; + /** The labels to set for that cluster. */ + resourceLabels?: Record; + } + interface SetLegacyAbacRequest { + /** Whether ABAC authorization will be enabled in the cluster. */ + enabled?: boolean; + } + interface SetLocationsRequest { + /** + * The desired list of Google Compute Engine + * [locations](/compute/docs/zones#available) in which the cluster's nodes + * should be located. Changing the locations a cluster is in will result + * in nodes being either created or removed from the cluster, depending on + * whether locations are being added or removed. + * + * This list must always include the cluster's primary zone. + */ + locations?: string[]; + } + interface SetLoggingServiceRequest { + /** + * The logging service the cluster should use to write metrics. + * Currently available options: + * + * * "logging.googleapis.com" - the Google Cloud Logging service + * * "none" - no metrics will be exported from the cluster + */ + loggingService?: string; + } + interface SetMaintenancePolicyRequest { + /** + * The maintenance policy to be set for the cluster. An empty field + * clears the existing maintenance policy. + */ + maintenancePolicy?: MaintenancePolicy; + } + interface SetMasterAuthRequest { + /** The exact form of action to be taken on the master auth. */ + action?: string; + /** A description of the update. */ + update?: MasterAuth; + } + interface SetMonitoringServiceRequest { + /** + * The monitoring service the cluster should use to write metrics. + * Currently available options: + * + * * "monitoring.googleapis.com" - the Google Cloud Monitoring service + * * "none" - no metrics will be exported from the cluster + */ + monitoringService?: string; + } + interface SetNetworkPolicyRequest { + /** Configuration options for the NetworkPolicy feature. */ + networkPolicy?: NetworkPolicy; + } + interface SetNodePoolAutoscalingRequest { + /** Autoscaling configuration for the node pool. */ + autoscaling?: NodePoolAutoscaling; + } + interface SetNodePoolManagementRequest { + /** NodeManagement configuration for the node pool. */ + management?: NodeManagement; + } + interface SetNodePoolSizeRequest { + /** The desired node count for the pool. */ + nodeCount?: number; + } + interface UpdateClusterRequest { + /** A description of the update. */ + update?: ClusterUpdate; + } + interface UpdateMasterRequest { + /** + * The Kubernetes version to change the master to. The only valid value is the + * latest supported version. Use "-" to have the server automatically select + * the latest version. + */ + masterVersion?: string; + } + interface UpdateNodePoolRequest { + /** The desired image type for the node pool. */ + imageType?: string; + /** + * The Kubernetes version to change the nodes to (typically an + * upgrade). Use `-` to upgrade to the latest version supported by + * the server. + */ + nodeVersion?: string; + } + interface NodePoolsResource { + /** Sets the autoscaling settings of a specific node pool. */ + autoscaling(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to upgrade. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the node pool to upgrade. */ + nodePoolId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Creates a node pool for a cluster. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Deletes a node pool from a cluster. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the node pool to delete. */ + nodePoolId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Retrieves the node pool requested. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the node pool. */ + nodePoolId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Lists the node pools for a cluster. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** + * Roll back the previously Aborted or Failed NodePool upgrade. + * This will be an no-op if the last upgrade successfully completed. + */ + rollback(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to rollback. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the node pool to rollback. */ + nodePoolId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Sets the NodeManagement options for a node pool. */ + setManagement(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to update. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the node pool to update. */ + nodePoolId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Sets the size of a specific node pool. */ + setSize(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to update. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the node pool to update. */ + nodePoolId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Updates the version and/or image type of a specific node pool. */ + update(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to upgrade. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the node pool to upgrade. */ + nodePoolId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + } + interface ClustersResource { + /** Sets the addons of a specific cluster. */ + addons(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to upgrade. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Completes master IP rotation. */ + completeIpRotation(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** + * Creates a cluster, consisting of the specified number and type of Google + * Compute Engine instances. + * + * By default, the cluster is created in the project's + * [default network](/compute/docs/networks-and-firewalls#networks). + * + * One firewall is added for the cluster. After cluster creation, + * the cluster creates routes for each node to allow the containers + * on that node to communicate with all other instances in the + * cluster. + * + * Finally, an entry is added to the project's global metadata indicating + * which CIDR range is being used by the cluster. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** + * Deletes the cluster, including the Kubernetes endpoint and all worker + * nodes. + * + * Firewalls and routes that were configured during cluster creation + * are also deleted. + * + * Other Google Compute Engine resources that might be in use by the cluster + * (e.g. load balancer resources) will not be deleted if they weren't present + * at the initial create time. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to delete. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Gets the details of a specific cluster. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to retrieve. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Enables or disables the ABAC authorization mechanism on a cluster. */ + legacyAbac(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to update. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** + * Lists all clusters owned by a project in either the specified zone or all + * zones. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides, or "-" for all zones. + */ + zone: string; + }): Request; + /** Sets the locations of a specific cluster. */ + locations(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to upgrade. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Sets the logging service of a specific cluster. */ + logging(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to upgrade. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Updates the master of a specific cluster. */ + master(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to upgrade. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Sets the monitoring service of a specific cluster. */ + monitoring(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to upgrade. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Sets labels on a cluster. */ + resourceLabels(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Sets the maintenance policy for a cluster. */ + setMaintenancePolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to update. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** + * Used to set master auth materials. Currently supports :- + * Changing the admin password of a specific cluster. + * This can be either via password generation or explicitly set the password. + */ + setMasterAuth(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to upgrade. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Enables/Disables Network Policy for a cluster. */ + setNetworkPolicy(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Start master IP rotation. */ + startIpRotation(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Updates the settings of a specific cluster. */ + update(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The name of the cluster to upgrade. */ + clusterId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + nodePools: NodePoolsResource; + } + interface OperationsResource { + /** Cancels the specified operation. */ + cancel(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The server-assigned `name` of the operation. */ + operationId: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the operation resides. + */ + zone: string; + }): Request<{}>; + /** Gets the specified operation. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The server-assigned `name` of the operation. */ + operationId: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster + * resides. + */ + zone: string; + }): Request; + /** Lists all operations in a project in a specific zone or all zones. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine [zone](/compute/docs/zones#available) + * to return operations for, or `-` for all zones. + */ + zone: string; + }): Request; + } + interface ZonesResource { + /** Returns configuration info about the Container Engine service. */ + getServerconfig(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * The name of the Google Compute Engine [zone](/compute/docs/zones#available) + * to return operations for. + */ + zone: string; + }): Request; + clusters: ClustersResource; + operations: OperationsResource; + } + interface ProjectsResource { + zones: ZonesResource; + } + } +} diff --git a/types/gapi.client.container/readme.md b/types/gapi.client.container/readme.md new file mode 100644 index 0000000000..a36149296e --- /dev/null +++ b/types/gapi.client.container/readme.md @@ -0,0 +1,54 @@ +# TypeScript typings for Google Container Engine API v1 +The Google Container Engine API is used for building and managing container based applications, powered by the open source Kubernetes technology. +For detailed description please check [documentation](https://cloud.google.com/container-engine/). + +## Installing + +Install typings for Google Container Engine API: +``` +npm install @types/gapi.client.container@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('container', 'v1', () => { + // now we can use gapi.client.container + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Container Engine API resources: + +```typescript +``` \ No newline at end of file diff --git a/types/gapi.client.container/tsconfig.json b/types/gapi.client.container/tsconfig.json new file mode 100644 index 0000000000..51ff6c98bb --- /dev/null +++ b/types/gapi.client.container/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.container-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.container/tslint.json b/types/gapi.client.container/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.container/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.content/gapi.client.content-tests.ts b/types/gapi.client.content/gapi.client.content-tests.ts new file mode 100644 index 0000000000..20b6ef8c93 --- /dev/null +++ b/types/gapi.client.content/gapi.client.content-tests.ts @@ -0,0 +1,387 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('content', 'v2', () => { + /** now we can use gapi.client.content */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** Manage your product listings and accounts for Google Shopping */ + 'https://www.googleapis.com/auth/content', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Returns information about the authenticated user. */ + await gapi.client.accounts.authinfo({ + }); + /** + * Claims the website of a Merchant Center sub-account. This method can only be called for accounts to which the managing account has access: either the + * managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + await gapi.client.accounts.claimwebsite({ + accountId: "accountId", + merchantId: "merchantId", + overwrite: true, + }); + /** Retrieves, inserts, updates, and deletes multiple Merchant Center (sub-)accounts in a single request. */ + await gapi.client.accounts.custombatch({ + dryRun: true, + }); + /** Deletes a Merchant Center sub-account. This method can only be called for multi-client accounts. */ + await gapi.client.accounts.delete({ + accountId: "accountId", + dryRun: true, + force: true, + merchantId: "merchantId", + }); + /** + * Retrieves a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account + * itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + await gapi.client.accounts.get({ + accountId: "accountId", + merchantId: "merchantId", + }); + /** Creates a Merchant Center sub-account. This method can only be called for multi-client accounts. */ + await gapi.client.accounts.insert({ + dryRun: true, + merchantId: "merchantId", + }); + /** Lists the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. */ + await gapi.client.accounts.list({ + maxResults: 1, + merchantId: "merchantId", + pageToken: "pageToken", + }); + /** + * Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account + * itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics. + */ + await gapi.client.accounts.patch({ + accountId: "accountId", + dryRun: true, + merchantId: "merchantId", + }); + /** + * Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account + * itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + await gapi.client.accounts.update({ + accountId: "accountId", + dryRun: true, + merchantId: "merchantId", + }); + await gapi.client.accountstatuses.custombatch({ + }); + /** + * Retrieves the status of a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the + * managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + await gapi.client.accountstatuses.get({ + accountId: "accountId", + merchantId: "merchantId", + }); + /** Lists the statuses of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. */ + await gapi.client.accountstatuses.list({ + maxResults: 1, + merchantId: "merchantId", + pageToken: "pageToken", + }); + /** Retrieves and updates tax settings of multiple accounts in a single request. */ + await gapi.client.accounttax.custombatch({ + dryRun: true, + }); + /** + * Retrieves the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing + * account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + await gapi.client.accounttax.get({ + accountId: "accountId", + merchantId: "merchantId", + }); + /** Lists the tax settings of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. */ + await gapi.client.accounttax.list({ + maxResults: 1, + merchantId: "merchantId", + pageToken: "pageToken", + }); + /** + * Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing + * account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch + * semantics. + */ + await gapi.client.accounttax.patch({ + accountId: "accountId", + dryRun: true, + merchantId: "merchantId", + }); + /** + * Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing + * account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + await gapi.client.accounttax.update({ + accountId: "accountId", + dryRun: true, + merchantId: "merchantId", + }); + await gapi.client.datafeeds.custombatch({ + dryRun: true, + }); + /** Deletes a datafeed configuration from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.datafeeds.delete({ + datafeedId: "datafeedId", + dryRun: true, + merchantId: "merchantId", + }); + /** Retrieves a datafeed configuration from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.datafeeds.get({ + datafeedId: "datafeedId", + merchantId: "merchantId", + }); + /** Registers a datafeed configuration with your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.datafeeds.insert({ + dryRun: true, + merchantId: "merchantId", + }); + /** Lists the datafeeds in your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.datafeeds.list({ + maxResults: 1, + merchantId: "merchantId", + pageToken: "pageToken", + }); + /** + * Updates a datafeed configuration of your Merchant Center account. This method can only be called for non-multi-client accounts. This method supports + * patch semantics. + */ + await gapi.client.datafeeds.patch({ + datafeedId: "datafeedId", + dryRun: true, + merchantId: "merchantId", + }); + /** Updates a datafeed configuration of your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.datafeeds.update({ + datafeedId: "datafeedId", + dryRun: true, + merchantId: "merchantId", + }); + await gapi.client.datafeedstatuses.custombatch({ + }); + /** Retrieves the status of a datafeed from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.datafeedstatuses.get({ + country: "country", + datafeedId: "datafeedId", + language: "language", + merchantId: "merchantId", + }); + /** Lists the statuses of the datafeeds in your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.datafeedstatuses.list({ + maxResults: 1, + merchantId: "merchantId", + pageToken: "pageToken", + }); + /** + * Updates price and availability for multiple products or stores in a single request. This operation does not update the expiration date of the products. + * This method can only be called for non-multi-client accounts. + */ + await gapi.client.inventory.custombatch({ + dryRun: true, + }); + /** + * Updates price and availability of a product in your Merchant Center account. This operation does not update the expiration date of the product. This + * method can only be called for non-multi-client accounts. + */ + await gapi.client.inventory.set({ + dryRun: true, + merchantId: "merchantId", + productId: "productId", + storeCode: "storeCode", + }); + /** Marks an order as acknowledged. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.acknowledge({ + merchantId: "merchantId", + orderId: "orderId", + }); + /** Sandbox only. Moves a test order from state "inProgress" to state "pendingShipment". This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.advancetestorder({ + merchantId: "merchantId", + orderId: "orderId", + }); + /** Cancels all line items in an order, making a full refund. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.cancel({ + merchantId: "merchantId", + orderId: "orderId", + }); + /** Cancels a line item, making a full refund. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.cancellineitem({ + merchantId: "merchantId", + orderId: "orderId", + }); + /** Sandbox only. Creates a test order. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.createtestorder({ + merchantId: "merchantId", + }); + /** Retrieves or modifies multiple orders in a single request. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.custombatch({ + }); + /** Retrieves an order from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.get({ + merchantId: "merchantId", + orderId: "orderId", + }); + /** Retrieves an order using merchant order id. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.getbymerchantorderid({ + merchantId: "merchantId", + merchantOrderId: "merchantOrderId", + }); + /** + * Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox. This method can only be called for + * non-multi-client accounts. + */ + await gapi.client.orders.gettestordertemplate({ + merchantId: "merchantId", + templateName: "templateName", + }); + /** Lists the orders in your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.list({ + acknowledged: true, + maxResults: 2, + merchantId: "merchantId", + orderBy: "orderBy", + pageToken: "pageToken", + placedDateEnd: "placedDateEnd", + placedDateStart: "placedDateStart", + statuses: "statuses", + }); + /** Refund a portion of the order, up to the full amount paid. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.refund({ + merchantId: "merchantId", + orderId: "orderId", + }); + /** Returns a line item. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.returnlineitem({ + merchantId: "merchantId", + orderId: "orderId", + }); + /** Marks line item(s) as shipped. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.shiplineitems({ + merchantId: "merchantId", + orderId: "orderId", + }); + /** Updates the merchant order ID for a given order. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.updatemerchantorderid({ + merchantId: "merchantId", + orderId: "orderId", + }); + /** Updates a shipment's status, carrier, and/or tracking ID. This method can only be called for non-multi-client accounts. */ + await gapi.client.orders.updateshipment({ + merchantId: "merchantId", + orderId: "orderId", + }); + /** Retrieves, inserts, and deletes multiple products in a single request. This method can only be called for non-multi-client accounts. */ + await gapi.client.products.custombatch({ + dryRun: true, + }); + /** Deletes a product from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.products.delete({ + dryRun: true, + merchantId: "merchantId", + productId: "productId", + }); + /** Retrieves a product from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.products.get({ + merchantId: "merchantId", + productId: "productId", + }); + /** + * Uploads a product to your Merchant Center account. If an item with the same channel, contentLanguage, offerId, and targetCountry already exists, this + * method updates that entry. This method can only be called for non-multi-client accounts. + */ + await gapi.client.products.insert({ + dryRun: true, + merchantId: "merchantId", + }); + /** Lists the products in your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.products.list({ + includeInvalidInsertedItems: true, + maxResults: 2, + merchantId: "merchantId", + pageToken: "pageToken", + }); + /** Gets the statuses of multiple products in a single request. This method can only be called for non-multi-client accounts. */ + await gapi.client.productstatuses.custombatch({ + includeAttributes: true, + }); + /** Gets the status of a product from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.productstatuses.get({ + includeAttributes: true, + merchantId: "merchantId", + productId: "productId", + }); + /** Lists the statuses of the products in your Merchant Center account. This method can only be called for non-multi-client accounts. */ + await gapi.client.productstatuses.list({ + includeAttributes: true, + includeInvalidInsertedItems: true, + maxResults: 3, + merchantId: "merchantId", + pageToken: "pageToken", + }); + /** Retrieves and updates the shipping settings of multiple accounts in a single request. */ + await gapi.client.shippingsettings.custombatch({ + dryRun: true, + }); + /** + * Retrieves the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the + * managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + await gapi.client.shippingsettings.get({ + accountId: "accountId", + merchantId: "merchantId", + }); + /** Retrieves supported carriers and carrier services for an account. */ + await gapi.client.shippingsettings.getsupportedcarriers({ + merchantId: "merchantId", + }); + /** Lists the shipping settings of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. */ + await gapi.client.shippingsettings.list({ + maxResults: 1, + merchantId: "merchantId", + pageToken: "pageToken", + }); + /** + * Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing + * account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch + * semantics. + */ + await gapi.client.shippingsettings.patch({ + accountId: "accountId", + dryRun: true, + merchantId: "merchantId", + }); + /** + * Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing + * account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + await gapi.client.shippingsettings.update({ + accountId: "accountId", + dryRun: true, + merchantId: "merchantId", + }); + } +}); diff --git a/types/gapi.client.content/index.d.ts b/types/gapi.client.content/index.d.ts new file mode 100644 index 0000000000..f3b3b51845 --- /dev/null +++ b/types/gapi.client.content/index.d.ts @@ -0,0 +1,3459 @@ +// Type definitions for Google Content API for Shopping v2 2.0 +// Project: https://developers.google.com/shopping-content +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/content/v2/rest + +/// + +declare namespace gapi.client { + /** Load Content API for Shopping v2 */ + function load(name: "content", version: "v2"): PromiseLike; + function load(name: "content", version: "v2", callback: () => any): void; + + const accounts: content.AccountsResource; + + const accountstatuses: content.AccountstatusesResource; + + const accounttax: content.AccounttaxResource; + + const datafeeds: content.DatafeedsResource; + + const datafeedstatuses: content.DatafeedstatusesResource; + + const inventory: content.InventoryResource; + + const orders: content.OrdersResource; + + const products: content.ProductsResource; + + const productstatuses: content.ProductstatusesResource; + + const shippingsettings: content.ShippingsettingsResource; + + namespace content { + interface Account { + /** Indicates whether the merchant sells adult content. */ + adultContent?: boolean; + /** + * List of linked AdWords accounts that are active or pending approval. To create a new link request, add a new link with status active to the list. It + * will remain in a pending state until approved or rejected either in the AdWords interface or through the AdWords API. To delete an active link, or to + * cancel a link request, remove it from the list. + */ + adwordsLinks?: AccountAdwordsLink[]; + /** Merchant Center account ID. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#account". */ + kind?: string; + /** Display name for the account. */ + name?: string; + /** URL for individual seller reviews, i.e., reviews for each child account. */ + reviewsUrl?: string; + /** Client-specific, locally-unique, internal ID for the child account. */ + sellerId?: string; + /** Users with access to the account. Every account (except for subaccounts) must have at least one admin user. */ + users?: AccountUser[]; + /** The merchant's website. */ + websiteUrl?: string; + /** + * List of linked YouTube channels that are active or pending approval. To create a new link request, add a new link with status active to the list. It + * will remain in a pending state until approved or rejected in the YT Creator Studio interface. To delete an active link, or to cancel a link request, + * remove it from the list. + */ + youtubeChannelLinks?: AccountYouTubeChannelLink[]; + } + interface AccountAdwordsLink { + /** Customer ID of the AdWords account. */ + adwordsId?: string; + /** + * Status of the link between this Merchant Center account and the AdWords account. Upon retrieval, it represents the actual status of the link and can be + * either active if it was approved in Google AdWords or pending if it's pending approval. Upon insertion, it represents the intended status of the link. + * Re-uploading a link with status active when it's still pending or with status pending when it's already active will have no effect: the status will + * remain unchanged. Re-uploading a link with deprecated status inactive is equivalent to not submitting the link at all and will delete the link if it + * was active or cancel the link request if it was pending. + */ + status?: string; + } + interface AccountIdentifier { + /** The aggregator ID, set for aggregators and subaccounts (in that case, it represents the aggregator of the subaccount). */ + aggregatorId?: string; + /** The merchant account ID, set for individual accounts and subaccounts. */ + merchantId?: string; + } + interface AccountStatus { + /** The ID of the account for which the status is reported. */ + accountId?: string; + /** A list of account level issues. */ + accountLevelIssues?: AccountStatusAccountLevelIssue[]; + /** A list of data quality issues. */ + dataQualityIssues?: AccountStatusDataQualityIssue[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#accountStatus". */ + kind?: string; + /** Whether the account's website is claimed or not. */ + websiteClaimed?: boolean; + } + interface AccountStatusAccountLevelIssue { + /** Country for which this issue is reported. */ + country?: string; + /** Additional details about the issue. */ + detail?: string; + /** Issue identifier. */ + id?: string; + /** Severity of the issue. */ + severity?: string; + /** Short description of the issue. */ + title?: string; + } + interface AccountStatusDataQualityIssue { + /** Country for which this issue is reported. */ + country?: string; + /** A more detailed description of the issue. */ + detail?: string; + /** Actual value displayed on the landing page. */ + displayedValue?: string; + /** Example items featuring the issue. */ + exampleItems?: AccountStatusExampleItem[]; + /** Issue identifier. */ + id?: string; + /** Last time the account was checked for this issue. */ + lastChecked?: string; + /** The attribute name that is relevant for the issue. */ + location?: string; + /** Number of items in the account found to have the said issue. */ + numItems?: number; + /** Severity of the problem. */ + severity?: string; + /** Submitted value that causes the issue. */ + submittedValue?: string; + } + interface AccountStatusExampleItem { + /** Unique item ID as specified in the uploaded product data. */ + itemId?: string; + /** Landing page of the item. */ + link?: string; + /** The item value that was submitted. */ + submittedValue?: string; + /** Title of the item. */ + title?: string; + /** The actual value on the landing page. */ + valueOnLandingPage?: string; + } + interface AccountTax { + /** The ID of the account to which these account tax settings belong. */ + accountId?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#accountTax". */ + kind?: string; + /** Tax rules. Updating the tax rules will enable US taxes (not reversible). Defining no rules is equivalent to not charging tax at all. */ + rules?: AccountTaxTaxRule[]; + } + interface AccountTaxTaxRule { + /** Country code in which tax is applicable. */ + country?: string; + /** State (or province) is which the tax is applicable, described by its location id (also called criteria id). */ + locationId?: string; + /** Explicit tax rate in percent, represented as a floating point number without the percentage character. Must not be negative. */ + ratePercent?: string; + /** If true, shipping charges are also taxed. */ + shippingTaxed?: boolean; + /** Whether the tax rate is taken from a global tax table or specified explicitly. */ + useGlobalRate?: boolean; + } + interface AccountUser { + /** Whether user is an admin. */ + admin?: boolean; + /** User's email address. */ + emailAddress?: string; + } + interface AccountYouTubeChannelLink { + /** Channel ID. */ + channelId?: string; + /** + * Status of the link between this Merchant Center account and the YouTube channel. Upon retrieval, it represents the actual status of the link and can be + * either active if it was approved in YT Creator Studio or pending if it's pending approval. Upon insertion, it represents the intended status of the + * link. Re-uploading a link with status active when it's still pending or with status pending when it's already active will have no effect: the status + * will remain unchanged. Re-uploading a link with deprecated status inactive is equivalent to not submitting the link at all and will delete the link if + * it was active or cancel the link request if it was pending. + */ + status?: string; + } + interface AccountsAuthInfoResponse { + /** + * The account identifiers corresponding to the authenticated user. + * - For an individual account: only the merchant ID is defined + * - For an aggregator: only the aggregator ID is defined + * - For a subaccount of an MCA: both the merchant ID and the aggregator ID are defined. + */ + accountIdentifiers?: AccountIdentifier[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#accountsAuthInfoResponse". */ + kind?: string; + } + interface AccountsClaimWebsiteResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#accountsClaimWebsiteResponse". */ + kind?: string; + } + interface AccountsCustomBatchRequest { + /** The request entries to be processed in the batch. */ + entries?: AccountsCustomBatchRequestEntry[]; + } + interface AccountsCustomBatchRequestEntry { + /** The account to create or update. Only defined if the method is insert or update. */ + account?: Account; + /** The ID of the targeted account. Only defined if the method is get, delete or claimwebsite. */ + accountId?: string; + /** An entry ID, unique within the batch request. */ + batchId?: number; + /** Whether the account should be deleted if the account has offers. Only applicable if the method is delete. */ + force?: boolean; + /** The ID of the managing account. */ + merchantId?: string; + method?: string; + /** Only applicable if the method is claimwebsite. Indicates whether or not to take the claim from another account in case there is a conflict. */ + overwrite?: boolean; + } + interface AccountsCustomBatchResponse { + /** The result of the execution of the batch requests. */ + entries?: AccountsCustomBatchResponseEntry[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#accountsCustomBatchResponse". */ + kind?: string; + } + interface AccountsCustomBatchResponseEntry { + /** The retrieved, created, or updated account. Not defined if the method was delete or claimwebsite. */ + account?: Account; + /** The ID of the request entry this entry responds to. */ + batchId?: number; + /** A list of errors defined if and only if the request failed. */ + errors?: Errors; + /** Identifies what kind of resource this is. Value: the fixed string "content#accountsCustomBatchResponseEntry". */ + kind?: string; + } + interface AccountsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#accountsListResponse". */ + kind?: string; + /** The token for the retrieval of the next page of accounts. */ + nextPageToken?: string; + resources?: Account[]; + } + interface AccountstatusesCustomBatchRequest { + /** The request entries to be processed in the batch. */ + entries?: AccountstatusesCustomBatchRequestEntry[]; + } + interface AccountstatusesCustomBatchRequestEntry { + /** The ID of the (sub-)account whose status to get. */ + accountId?: string; + /** An entry ID, unique within the batch request. */ + batchId?: number; + /** The ID of the managing account. */ + merchantId?: string; + /** The method (get). */ + method?: string; + } + interface AccountstatusesCustomBatchResponse { + /** The result of the execution of the batch requests. */ + entries?: AccountstatusesCustomBatchResponseEntry[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#accountstatusesCustomBatchResponse". */ + kind?: string; + } + interface AccountstatusesCustomBatchResponseEntry { + /** The requested account status. Defined if and only if the request was successful. */ + accountStatus?: AccountStatus; + /** The ID of the request entry this entry responds to. */ + batchId?: number; + /** A list of errors defined if and only if the request failed. */ + errors?: Errors; + } + interface AccountstatusesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#accountstatusesListResponse". */ + kind?: string; + /** The token for the retrieval of the next page of account statuses. */ + nextPageToken?: string; + resources?: AccountStatus[]; + } + interface AccounttaxCustomBatchRequest { + /** The request entries to be processed in the batch. */ + entries?: AccounttaxCustomBatchRequestEntry[]; + } + interface AccounttaxCustomBatchRequestEntry { + /** The ID of the account for which to get/update account tax settings. */ + accountId?: string; + /** The account tax settings to update. Only defined if the method is update. */ + accountTax?: AccountTax; + /** An entry ID, unique within the batch request. */ + batchId?: number; + /** The ID of the managing account. */ + merchantId?: string; + method?: string; + } + interface AccounttaxCustomBatchResponse { + /** The result of the execution of the batch requests. */ + entries?: AccounttaxCustomBatchResponseEntry[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#accounttaxCustomBatchResponse". */ + kind?: string; + } + interface AccounttaxCustomBatchResponseEntry { + /** The retrieved or updated account tax settings. */ + accountTax?: AccountTax; + /** The ID of the request entry this entry responds to. */ + batchId?: number; + /** A list of errors defined if and only if the request failed. */ + errors?: Errors; + /** Identifies what kind of resource this is. Value: the fixed string "content#accounttaxCustomBatchResponseEntry". */ + kind?: string; + } + interface AccounttaxListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#accounttaxListResponse". */ + kind?: string; + /** The token for the retrieval of the next page of account tax settings. */ + nextPageToken?: string; + resources?: AccountTax[]; + } + interface CarrierRate { + /** Carrier service, such as "UPS" or "Fedex". The list of supported carriers can be retrieved via the getSupportedCarriers method. Required. */ + carrierName?: string; + /** + * Carrier service, such as "ground" or "2 days". The list of supported services for a carrier can be retrieved via the getSupportedCarriers method. + * Required. + */ + carrierService?: string; + /** + * Additive shipping rate modifier. Can be negative. For example { "value": "1", "currency" : "USD" } adds $1 to the rate, { "value": "-3", "currency" : + * "USD" } removes $3 from the rate. Optional. + */ + flatAdjustment?: Price; + /** Name of the carrier rate. Must be unique per rate group. Required. */ + name?: string; + /** Shipping origin for this carrier rate. Required. */ + originPostalCode?: string; + /** + * Multiplicative shipping rate modifier as a number in decimal notation. Can be negative. For example "5.4" increases the rate by 5.4%, "-3" decreases + * the rate by 3%. Optional. + */ + percentageAdjustment?: string; + } + interface CarriersCarrier { + /** The CLDR country code of the carrier (e.g., "US"). Always present. */ + country?: string; + /** The name of the carrier (e.g., "UPS"). Always present. */ + name?: string; + /** A list of supported services (e.g., "ground") for that carrier. Contains at least one service. */ + services?: string[]; + } + interface Datafeed { + /** The two-letter ISO 639-1 language in which the attributes are defined in the data feed. */ + attributeLanguage?: string; + /** + * [DEPRECATED] Please use target.language instead. The two-letter ISO 639-1 language of the items in the feed. Must be a valid language for + * targetCountry. + */ + contentLanguage?: string; + /** The type of data feed. For product inventory feeds, only feeds for local stores, not online stores, are supported. */ + contentType?: string; + /** Fetch schedule for the feed file. */ + fetchSchedule?: DatafeedFetchSchedule; + /** The filename of the feed. All feeds must have a unique file name. */ + fileName?: string; + /** Format of the feed file. */ + format?: DatafeedFormat; + /** The ID of the data feed. */ + id?: string; + /** [DEPRECATED] Please use target.includedDestination instead. The list of intended destinations (corresponds to checked check boxes in Merchant Center). */ + intendedDestinations?: string[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#datafeed". */ + kind?: string; + /** A descriptive name of the data feed. */ + name?: string; + /** + * [DEPRECATED] Please use target.country instead. The country where the items in the feed will be included in the search index, represented as a CLDR + * territory code. + */ + targetCountry?: string; + /** The targets this feed should apply to (country, language, destinations). */ + targets?: DatafeedTarget[]; + } + interface DatafeedFetchSchedule { + /** The day of the month the feed file should be fetched (1-31). */ + dayOfMonth?: number; + /** + * The URL where the feed file can be fetched. Google Merchant Center will support automatic scheduled uploads using the HTTP, HTTPS, FTP, or SFTP + * protocols, so the value will need to be a valid link using one of those four protocols. + */ + fetchUrl?: string; + /** The hour of the day the feed file should be fetched (0-23). */ + hour?: number; + /** The minute of the hour the feed file should be fetched (0-59). Read-only. */ + minuteOfHour?: number; + /** An optional password for fetch_url. */ + password?: string; + /** Whether the scheduled fetch is paused or not. */ + paused?: boolean; + /** Time zone used for schedule. UTC by default. E.g., "America/Los_Angeles". */ + timeZone?: string; + /** An optional user name for fetch_url. */ + username?: string; + /** The day of the week the feed file should be fetched. */ + weekday?: string; + } + interface DatafeedFormat { + /** + * Delimiter for the separation of values in a delimiter-separated values feed. If not specified, the delimiter will be auto-detected. Ignored for non-DSV + * data feeds. + */ + columnDelimiter?: string; + /** Character encoding scheme of the data feed. If not specified, the encoding will be auto-detected. */ + fileEncoding?: string; + /** Specifies how double quotes are interpreted. If not specified, the mode will be auto-detected. Ignored for non-DSV data feeds. */ + quotingMode?: string; + } + interface DatafeedStatus { + /** The country for which the status is reported, represented as a CLDR territory code. */ + country?: string; + /** The ID of the feed for which the status is reported. */ + datafeedId?: string; + /** The list of errors occurring in the feed. */ + errors?: DatafeedStatusError[]; + /** The number of items in the feed that were processed. */ + itemsTotal?: string; + /** The number of items in the feed that were valid. */ + itemsValid?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#datafeedStatus". */ + kind?: string; + /** The two-letter ISO 639-1 language for which the status is reported. */ + language?: string; + /** The last date at which the feed was uploaded. */ + lastUploadDate?: string; + /** The processing status of the feed. */ + processingStatus?: string; + /** The list of errors occurring in the feed. */ + warnings?: DatafeedStatusError[]; + } + interface DatafeedStatusError { + /** The code of the error, e.g., "validation/invalid_value". */ + code?: string; + /** The number of occurrences of the error in the feed. */ + count?: string; + /** A list of example occurrences of the error, grouped by product. */ + examples?: DatafeedStatusExample[]; + /** The error message, e.g., "Invalid price". */ + message?: string; + } + interface DatafeedStatusExample { + /** The ID of the example item. */ + itemId?: string; + /** Line number in the data feed where the example is found. */ + lineNumber?: string; + /** The problematic value. */ + value?: string; + } + interface DatafeedTarget { + /** The country where the items in the feed will be included in the search index, represented as a CLDR territory code. */ + country?: string; + /** The list of destinations to exclude for this target (corresponds to unchecked check boxes in Merchant Center). */ + excludedDestinations?: string[]; + /** + * The list of destinations to include for this target (corresponds to checked check boxes in Merchant Center). Default destinations are always included + * unless provided in the excluded_destination field. + */ + includedDestinations?: string[]; + /** The two-letter ISO 639-1 language of the items in the feed. Must be a valid language for targets[].country. */ + language?: string; + } + interface DatafeedsCustomBatchRequest { + /** The request entries to be processed in the batch. */ + entries?: DatafeedsCustomBatchRequestEntry[]; + } + interface DatafeedsCustomBatchRequestEntry { + /** An entry ID, unique within the batch request. */ + batchId?: number; + /** The data feed to insert. */ + datafeed?: Datafeed; + /** The ID of the data feed to get or delete. */ + datafeedId?: string; + /** The ID of the managing account. */ + merchantId?: string; + method?: string; + } + interface DatafeedsCustomBatchResponse { + /** The result of the execution of the batch requests. */ + entries?: DatafeedsCustomBatchResponseEntry[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#datafeedsCustomBatchResponse". */ + kind?: string; + } + interface DatafeedsCustomBatchResponseEntry { + /** The ID of the request entry this entry responds to. */ + batchId?: number; + /** The requested data feed. Defined if and only if the request was successful. */ + datafeed?: Datafeed; + /** A list of errors defined if and only if the request failed. */ + errors?: Errors; + } + interface DatafeedsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#datafeedsListResponse". */ + kind?: string; + /** The token for the retrieval of the next page of datafeeds. */ + nextPageToken?: string; + resources?: Datafeed[]; + } + interface DatafeedstatusesCustomBatchRequest { + /** The request entries to be processed in the batch. */ + entries?: DatafeedstatusesCustomBatchRequestEntry[]; + } + interface DatafeedstatusesCustomBatchRequestEntry { + /** An entry ID, unique within the batch request. */ + batchId?: number; + /** + * The country for which to get the datafeed status. If this parameter is provided then language must also be provided. Note that for multi-target + * datafeeds this parameter is required. + */ + country?: string; + /** The ID of the data feed to get. */ + datafeedId?: string; + /** + * The language for which to get the datafeed status. If this parameter is provided then country must also be provided. Note that for multi-target + * datafeeds this parameter is required. + */ + language?: string; + /** The ID of the managing account. */ + merchantId?: string; + method?: string; + } + interface DatafeedstatusesCustomBatchResponse { + /** The result of the execution of the batch requests. */ + entries?: DatafeedstatusesCustomBatchResponseEntry[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#datafeedstatusesCustomBatchResponse". */ + kind?: string; + } + interface DatafeedstatusesCustomBatchResponseEntry { + /** The ID of the request entry this entry responds to. */ + batchId?: number; + /** The requested data feed status. Defined if and only if the request was successful. */ + datafeedStatus?: DatafeedStatus; + /** A list of errors defined if and only if the request failed. */ + errors?: Errors; + } + interface DatafeedstatusesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#datafeedstatusesListResponse". */ + kind?: string; + /** The token for the retrieval of the next page of datafeed statuses. */ + nextPageToken?: string; + resources?: DatafeedStatus[]; + } + interface DeliveryTime { + /** + * Maximum number of business days that is spent in transit. 0 means same day delivery, 1 means next day delivery. Must be greater than or equal to + * minTransitTimeInDays. Required. + */ + maxTransitTimeInDays?: number; + /** Minimum number of business days that is spent in transit. 0 means same day delivery, 1 means next day delivery. Required. */ + minTransitTimeInDays?: number; + } + interface Error { + /** The domain of the error. */ + domain?: string; + /** A description of the error. */ + message?: string; + /** The error code. */ + reason?: string; + } + interface Errors { + /** The HTTP status of the first error in errors. */ + code?: number; + /** A list of errors. */ + errors?: Error[]; + /** The message of the first error in errors. */ + message?: string; + } + interface Headers { + /** A list of location ID sets. Must be non-empty. Can only be set if all other fields are not set. */ + locations?: LocationIdSet[]; + /** + * A list of inclusive number of items upper bounds. The last value can be "infinity". For example ["10", "50", "infinity"] represents the headers "<= 10 + * items", " 50 items". Must be non-empty. Can only be set if all other fields are not set. + */ + numberOfItems?: string[]; + /** + * A list of postal group names. The last value can be "all other locations". Example: ["zone 1", "zone 2", "all other locations"]. The referred postal + * code groups must match the delivery country of the service. Must be non-empty. Can only be set if all other fields are not set. + */ + postalCodeGroupNames?: string[]; + /** + * be "infinity". For example [{"value": "10", "currency": "USD"}, {"value": "500", "currency": "USD"}, {"value": "infinity", "currency": "USD"}] + * represents the headers "<= $10", " $500". All prices within a service must have the same currency. Must be non-empty. Can only be set if all other + * fields are not set. + */ + prices?: Price[]; + /** + * be "infinity". For example [{"value": "10", "unit": "kg"}, {"value": "50", "unit": "kg"}, {"value": "infinity", "unit": "kg"}] represents the headers + * "<= 10kg", " 50kg". All weights within a service must have the same unit. Must be non-empty. Can only be set if all other fields are not set. + */ + weights?: Weight[]; + } + interface Installment { + /** The amount the buyer has to pay per month. */ + amount?: Price; + /** The number of installments the buyer has to pay. */ + months?: string; + } + interface Inventory { + /** The availability of the product. */ + availability?: string; + /** Number and amount of installments to pay for an item. Brazil only. */ + installment?: Installment; + /** Identifies what kind of resource this is. Value: the fixed string "content#inventory". */ + kind?: string; + /** Loyalty points that users receive after purchasing the item. Japan only. */ + loyaltyPoints?: LoyaltyPoints; + /** + * Store pickup information. Only supported for local inventory. Not setting pickup means "don't update" while setting it to the empty value ({} in JSON) + * means "delete". Otherwise, pickupMethod and pickupSla must be set together, unless pickupMethod is "not supported". + */ + pickup?: InventoryPickup; + /** The price of the product. */ + price?: Price; + /** The quantity of the product. Must be equal to or greater than zero. Supported only for local products. */ + quantity?: number; + /** The sale price of the product. Mandatory if sale_price_effective_date is defined. */ + salePrice?: Price; + /** A date range represented by a pair of ISO 8601 dates separated by a space, comma, or slash. Both dates might be specified as 'null' if undecided. */ + salePriceEffectiveDate?: string; + /** The quantity of the product that is reserved for sell-on-google ads. Supported only for online products. */ + sellOnGoogleQuantity?: number; + } + interface InventoryCustomBatchRequest { + /** The request entries to be processed in the batch. */ + entries?: InventoryCustomBatchRequestEntry[]; + } + interface InventoryCustomBatchRequestEntry { + /** An entry ID, unique within the batch request. */ + batchId?: number; + /** Price and availability of the product. */ + inventory?: Inventory; + /** The ID of the managing account. */ + merchantId?: string; + /** The ID of the product for which to update price and availability. */ + productId?: string; + /** The code of the store for which to update price and availability. Use online to update price and availability of an online product. */ + storeCode?: string; + } + interface InventoryCustomBatchResponse { + /** The result of the execution of the batch requests. */ + entries?: InventoryCustomBatchResponseEntry[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#inventoryCustomBatchResponse". */ + kind?: string; + } + interface InventoryCustomBatchResponseEntry { + /** The ID of the request entry this entry responds to. */ + batchId?: number; + /** A list of errors defined if and only if the request failed. */ + errors?: Errors; + /** Identifies what kind of resource this is. Value: the fixed string "content#inventoryCustomBatchResponseEntry". */ + kind?: string; + } + interface InventoryPickup { + /** + * Whether store pickup is available for this offer and whether the pickup option should be shown as buy, reserve, or not supported. Only supported for + * local inventory. Unless the value is "not supported", must be submitted together with pickupSla. + */ + pickupMethod?: string; + /** + * The expected date that an order will be ready for pickup, relative to when the order is placed. Only supported for local inventory. Must be submitted + * together with pickupMethod. + */ + pickupSla?: string; + } + interface InventorySetRequest { + /** The availability of the product. */ + availability?: string; + /** Number and amount of installments to pay for an item. Brazil only. */ + installment?: Installment; + /** Loyalty points that users receive after purchasing the item. Japan only. */ + loyaltyPoints?: LoyaltyPoints; + /** + * Store pickup information. Only supported for local inventory. Not setting pickup means "don't update" while setting it to the empty value ({} in JSON) + * means "delete". Otherwise, pickupMethod and pickupSla must be set together, unless pickupMethod is "not supported". + */ + pickup?: InventoryPickup; + /** The price of the product. */ + price?: Price; + /** The quantity of the product. Must be equal to or greater than zero. Supported only for local products. */ + quantity?: number; + /** The sale price of the product. Mandatory if sale_price_effective_date is defined. */ + salePrice?: Price; + /** A date range represented by a pair of ISO 8601 dates separated by a space, comma, or slash. Both dates might be specified as 'null' if undecided. */ + salePriceEffectiveDate?: string; + /** The quantity of the product that is reserved for sell-on-google ads. Supported only for online products. */ + sellOnGoogleQuantity?: number; + } + interface InventorySetResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#inventorySetResponse". */ + kind?: string; + } + interface LocationIdSet { + /** A non-empty list of location IDs. They must all be of the same location type (e.g., state). */ + locationIds?: string[]; + } + interface LoyaltyPoints { + /** Name of loyalty points program. It is recommended to limit the name to 12 full-width characters or 24 Roman characters. */ + name?: string; + /** The retailer's loyalty points in absolute value. */ + pointsValue?: string; + /** The ratio of a point when converted to currency. Google assumes currency based on Merchant Center settings. If ratio is left out, it defaults to 1.0. */ + ratio?: number; + } + interface Order { + /** Whether the order was acknowledged. */ + acknowledged?: boolean; + /** The channel type of the order: "purchaseOnGoogle" or "googleExpress". */ + channelType?: string; + /** The details of the customer who placed the order. */ + customer?: OrderCustomer; + /** The details for the delivery. */ + deliveryDetails?: OrderDeliveryDetails; + /** The REST id of the order. Globally unique. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#order". */ + kind?: string; + /** Line items that are ordered. */ + lineItems?: OrderLineItem[]; + merchantId?: string; + /** Merchant-provided id of the order. */ + merchantOrderId?: string; + /** + * The net amount for the order. For example, if an order was originally for a grand total of $100 and a refund was issued for $20, the net amount will be + * $80. + */ + netAmount?: Price; + /** The details of the payment method. */ + paymentMethod?: OrderPaymentMethod; + /** The status of the payment. */ + paymentStatus?: string; + /** The date when the order was placed, in ISO 8601 format. */ + placedDate?: string; + /** The details of the merchant provided promotions applied to the order. More details about the program are here. */ + promotions?: OrderPromotion[]; + /** Refunds for the order. */ + refunds?: OrderRefund[]; + /** Shipments of the order. */ + shipments?: OrderShipment[]; + /** The total cost of shipping for all items. */ + shippingCost?: Price; + /** The tax for the total shipping cost. */ + shippingCostTax?: Price; + /** The requested shipping option. */ + shippingOption?: string; + /** The status of the order. */ + status?: string; + } + interface OrderAddress { + /** CLDR country code (e.g. "US"). */ + country?: string; + /** + * Strings representing the lines of the printed label for mailing the order, for example: + * John Smith + * 1600 Amphitheatre Parkway + * Mountain View, CA, 94043 + * United States + */ + fullAddress?: string[]; + /** Whether the address is a post office box. */ + isPostOfficeBox?: boolean; + /** City, town or commune. May also include dependent localities or sublocalities (e.g. neighborhoods or suburbs). */ + locality?: string; + /** Postal Code or ZIP (e.g. "94043"). */ + postalCode?: string; + /** Name of the recipient. */ + recipientName?: string; + /** Top-level administrative subdivision of the country (e.g. "CA"). */ + region?: string; + /** Street-level part of the address. */ + streetAddress?: string[]; + } + interface OrderCancellation { + /** The actor that created the cancellation. */ + actor?: string; + /** Date on which the cancellation has been created, in ISO 8601 format. */ + creationDate?: string; + /** The quantity that was canceled. */ + quantity?: number; + /** + * The reason for the cancellation. Orders that are cancelled with a noInventory reason will lead to the removal of the product from POG until you make an + * update to that product. This will not affect your Shopping ads. + */ + reason?: string; + /** The explanation of the reason. */ + reasonText?: string; + } + interface OrderCustomer { + /** Email address of the customer. */ + email?: string; + /** + * If set, this indicates the user explicitly chose to opt in or out of providing marketing rights to the merchant. If unset, this indicates the user has + * already made this choice in a previous purchase, and was thus not shown the marketing right opt in/out checkbox during the checkout flow. + */ + explicitMarketingPreference?: boolean; + /** Full name of the customer. */ + fullName?: string; + } + interface OrderDeliveryDetails { + /** The delivery address */ + address?: OrderAddress; + /** The phone number of the person receiving the delivery. */ + phoneNumber?: string; + } + interface OrderLineItem { + /** Cancellations of the line item. */ + cancellations?: OrderCancellation[]; + /** The channel type of the order: "purchaseOnGoogle" or "googleExpress". */ + channelType?: string; + /** The id of the line item. */ + id?: string; + /** Total price for the line item. For example, if two items for $10 are purchased, the total price will be $20. */ + price?: Price; + /** Product data from the time of the order placement. */ + product?: OrderLineItemProduct; + /** Number of items canceled. */ + quantityCanceled?: number; + /** Number of items delivered. */ + quantityDelivered?: number; + /** Number of items ordered. */ + quantityOrdered?: number; + /** Number of items pending. */ + quantityPending?: number; + /** Number of items returned. */ + quantityReturned?: number; + /** Number of items shipped. */ + quantityShipped?: number; + /** Details of the return policy for the line item. */ + returnInfo?: OrderLineItemReturnInfo; + /** Returns of the line item. */ + returns?: OrderReturn[]; + /** Details of the requested shipping for the line item. */ + shippingDetails?: OrderLineItemShippingDetails; + /** Total tax amount for the line item. For example, if two items are purchased, and each have a cost tax of $2, the total tax amount will be $4. */ + tax?: Price; + } + interface OrderLineItemProduct { + /** Brand of the item. */ + brand?: string; + /** The item's channel (online or local). */ + channel?: string; + /** Condition or state of the item. */ + condition?: string; + /** The two-letter ISO 639-1 language code for the item. */ + contentLanguage?: string; + /** Global Trade Item Number (GTIN) of the item. */ + gtin?: string; + /** The REST id of the product. */ + id?: string; + /** URL of an image of the item. */ + imageLink?: string; + /** Shared identifier for all variants of the same product. */ + itemGroupId?: string; + /** Manufacturer Part Number (MPN) of the item. */ + mpn?: string; + /** An identifier of the item. */ + offerId?: string; + /** Price of the item. */ + price?: Price; + /** URL to the cached image shown to the user when order was placed. */ + shownImage?: string; + /** The CLDR territory code of the target country of the product. */ + targetCountry?: string; + /** The title of the product. */ + title?: string; + /** + * Variant attributes for the item. These are dimensions of the product, such as color, gender, material, pattern, and size. You can find a comprehensive + * list of variant attributes here. + */ + variantAttributes?: OrderLineItemProductVariantAttribute[]; + } + interface OrderLineItemProductVariantAttribute { + /** The dimension of the variant. */ + dimension?: string; + /** The value for the dimension. */ + value?: string; + } + interface OrderLineItemReturnInfo { + /** How many days later the item can be returned. */ + daysToReturn?: number; + /** Whether the item is returnable. */ + isReturnable?: boolean; + /** URL of the item return policy. */ + policyUrl?: string; + } + interface OrderLineItemShippingDetails { + /** The delivery by date, in ISO 8601 format. */ + deliverByDate?: string; + /** Details of the shipping method. */ + method?: OrderLineItemShippingDetailsMethod; + /** The ship by date, in ISO 8601 format. */ + shipByDate?: string; + } + interface OrderLineItemShippingDetailsMethod { + /** The carrier for the shipping. Optional. See shipments[].carrier for a list of acceptable values. */ + carrier?: string; + /** Maximum transit time. */ + maxDaysInTransit?: number; + /** The name of the shipping method. */ + methodName?: string; + /** Minimum transit time. */ + minDaysInTransit?: number; + } + interface OrderPaymentMethod { + /** The billing address. */ + billingAddress?: OrderAddress; + /** The card expiration month (January = 1, February = 2 etc.). */ + expirationMonth?: number; + /** The card expiration year (4-digit, e.g. 2015). */ + expirationYear?: number; + /** The last four digits of the card number. */ + lastFourDigits?: string; + /** The billing phone number. */ + phoneNumber?: string; + /** + * The type of instrument. + * + * Acceptable values are: + * - "AMEX" + * - "DISCOVER" + * - "JCB" + * - "MASTERCARD" + * - "UNIONPAY" + * - "VISA" + * - "" + */ + type?: string; + } + interface OrderPromotion { + benefits?: OrderPromotionBenefit[]; + /** + * The date and time frame when the promotion is active and ready for validation review. Note that the promotion live time may be delayed for a few hours + * due to the validation review. + * Start date and end date are separated by a forward slash (/). The start date is specified by the format (YYYY-MM-DD), followed by the letter ?T?, the + * time of the day when the sale starts (in Greenwich Mean Time, GMT), followed by an expression of the time zone for the sale. The end date is in the + * same format. + */ + effectiveDates?: string; + /** Optional. The text code that corresponds to the promotion when applied on the retailer?s website. */ + genericRedemptionCode?: string; + /** The unique ID of the promotion. */ + id?: string; + /** The full title of the promotion. */ + longTitle?: string; + /** Whether the promotion is applicable to all products or only specific products. */ + productApplicability?: string; + /** Indicates that the promotion is valid online. */ + redemptionChannel?: string; + } + interface OrderPromotionBenefit { + /** The discount in the order price when the promotion is applied. */ + discount?: Price; + /** The OfferId(s) that were purchased in this order and map to this specific benefit of the promotion. */ + offerIds?: string[]; + /** Further describes the benefit of the promotion. Note that we will expand on this enumeration as we support new promotion sub-types. */ + subType?: string; + /** The impact on tax when the promotion is applied. */ + taxImpact?: Price; + /** Describes whether the promotion applies to products (e.g. 20% off) or to shipping (e.g. Free Shipping). */ + type?: string; + } + interface OrderRefund { + /** The actor that created the refund. */ + actor?: string; + /** The amount that is refunded. */ + amount?: Price; + /** Date on which the item has been created, in ISO 8601 format. */ + creationDate?: string; + /** The reason for the refund. */ + reason?: string; + /** The explanation of the reason. */ + reasonText?: string; + } + interface OrderReturn { + /** The actor that created the refund. */ + actor?: string; + /** Date on which the item has been created, in ISO 8601 format. */ + creationDate?: string; + /** Quantity that is returned. */ + quantity?: number; + /** The reason for the return. */ + reason?: string; + /** The explanation of the reason. */ + reasonText?: string; + } + interface OrderShipment { + /** + * The carrier handling the shipment. + * + * Acceptable values are: + * - "gsx" + * - "ups" + * - "united parcel service" + * - "usps" + * - "united states postal service" + * - "fedex" + * - "dhl" + * - "ecourier" + * - "cxt" + * - "google" + * - "on trac" + * - "ontrac" + * - "on-trac" + * - "on_trac" + * - "delvic" + * - "dynamex" + * - "lasership" + * - "smartpost" + * - "fedex smartpost" + * - "mpx" + * - "uds" + * - "united delivery service" + */ + carrier?: string; + /** Date on which the shipment has been created, in ISO 8601 format. */ + creationDate?: string; + /** Date on which the shipment has been delivered, in ISO 8601 format. Present only if status is delievered */ + deliveryDate?: string; + /** The id of the shipment. */ + id?: string; + /** The line items that are shipped. */ + lineItems?: OrderShipmentLineItemShipment[]; + /** The status of the shipment. */ + status?: string; + /** The tracking id for the shipment. */ + trackingId?: string; + } + interface OrderShipmentLineItemShipment { + /** The id of the line item that is shipped. */ + lineItemId?: string; + /** The quantity that is shipped. */ + quantity?: number; + } + interface OrdersAcknowledgeRequest { + /** The ID of the operation. Unique across all operations for a given order. */ + operationId?: string; + } + interface OrdersAcknowledgeResponse { + /** The status of the execution. */ + executionStatus?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersAcknowledgeResponse". */ + kind?: string; + } + interface OrdersAdvanceTestOrderResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersAdvanceTestOrderResponse". */ + kind?: string; + } + interface OrdersCancelLineItemRequest { + /** + * Amount to refund for the cancelation. Optional. If not set, Google will calculate the default based on the price and tax of the items involved. The + * amount must not be larger than the net amount left on the order. + */ + amount?: Price; + /** The ID of the line item to cancel. */ + lineItemId?: string; + /** The ID of the operation. Unique across all operations for a given order. */ + operationId?: string; + /** The quantity to cancel. */ + quantity?: number; + /** The reason for the cancellation. */ + reason?: string; + /** The explanation of the reason. */ + reasonText?: string; + } + interface OrdersCancelLineItemResponse { + /** The status of the execution. */ + executionStatus?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersCancelLineItemResponse". */ + kind?: string; + } + interface OrdersCancelRequest { + /** The ID of the operation. Unique across all operations for a given order. */ + operationId?: string; + /** The reason for the cancellation. */ + reason?: string; + /** The explanation of the reason. */ + reasonText?: string; + } + interface OrdersCancelResponse { + /** The status of the execution. */ + executionStatus?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersCancelResponse". */ + kind?: string; + } + interface OrdersCreateTestOrderRequest { + /** + * The test order template to use. Specify as an alternative to testOrder as a shortcut for retrieving a template and then creating an order using that + * template. + */ + templateName?: string; + /** The test order to create. */ + testOrder?: TestOrder; + } + interface OrdersCreateTestOrderResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersCreateTestOrderResponse". */ + kind?: string; + /** The ID of the newly created test order. */ + orderId?: string; + } + interface OrdersCustomBatchRequest { + /** The request entries to be processed in the batch. */ + entries?: OrdersCustomBatchRequestEntry[]; + } + interface OrdersCustomBatchRequestEntry { + /** An entry ID, unique within the batch request. */ + batchId?: number; + /** Required for cancel method. */ + cancel?: OrdersCustomBatchRequestEntryCancel; + /** Required for cancelLineItem method. */ + cancelLineItem?: OrdersCustomBatchRequestEntryCancelLineItem; + /** The ID of the managing account. */ + merchantId?: string; + /** The merchant order id. Required for updateMerchantOrderId and getByMerchantOrderId methods. */ + merchantOrderId?: string; + /** The method to apply. */ + method?: string; + /** The ID of the operation. Unique across all operations for a given order. Required for all methods beside get and getByMerchantOrderId. */ + operationId?: string; + /** The ID of the order. Required for all methods beside getByMerchantOrderId. */ + orderId?: string; + /** Required for refund method. */ + refund?: OrdersCustomBatchRequestEntryRefund; + /** Required for returnLineItem method. */ + returnLineItem?: OrdersCustomBatchRequestEntryReturnLineItem; + /** Required for shipLineItems method. */ + shipLineItems?: OrdersCustomBatchRequestEntryShipLineItems; + /** Required for updateShipment method. */ + updateShipment?: OrdersCustomBatchRequestEntryUpdateShipment; + } + interface OrdersCustomBatchRequestEntryCancel { + /** The reason for the cancellation. */ + reason?: string; + /** The explanation of the reason. */ + reasonText?: string; + } + interface OrdersCustomBatchRequestEntryCancelLineItem { + /** + * Amount to refund for the cancelation. Optional. If not set, Google will calculate the default based on the price and tax of the items involved. The + * amount must not be larger than the net amount left on the order. + */ + amount?: Price; + /** The ID of the line item to cancel. */ + lineItemId?: string; + /** The quantity to cancel. */ + quantity?: number; + /** The reason for the cancellation. */ + reason?: string; + /** The explanation of the reason. */ + reasonText?: string; + } + interface OrdersCustomBatchRequestEntryRefund { + /** The amount that is refunded. */ + amount?: Price; + /** The reason for the refund. */ + reason?: string; + /** The explanation of the reason. */ + reasonText?: string; + } + interface OrdersCustomBatchRequestEntryReturnLineItem { + /** The ID of the line item to return. */ + lineItemId?: string; + /** The quantity to return. */ + quantity?: number; + /** The reason for the return. */ + reason?: string; + /** The explanation of the reason. */ + reasonText?: string; + } + interface OrdersCustomBatchRequestEntryShipLineItems { + /** + * Deprecated. Please use shipmentInfo instead. The carrier handling the shipment. See shipments[].carrier in the Orders resource representation for a + * list of acceptable values. + */ + carrier?: string; + /** Line items to ship. */ + lineItems?: OrderShipmentLineItemShipment[]; + /** Deprecated. Please use shipmentInfo instead. The ID of the shipment. */ + shipmentId?: string; + /** Shipment information. This field is repeated because a single line item can be shipped in several packages (and have several tracking IDs). */ + shipmentInfos?: OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo[]; + /** Deprecated. Please use shipmentInfo instead. The tracking id for the shipment. */ + trackingId?: string; + } + interface OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo { + /** The carrier handling the shipment. See shipments[].carrier in the Orders resource representation for a list of acceptable values. */ + carrier?: string; + /** The ID of the shipment. */ + shipmentId?: string; + /** The tracking id for the shipment. */ + trackingId?: string; + } + interface OrdersCustomBatchRequestEntryUpdateShipment { + /** + * The carrier handling the shipment. Not updated if missing. See shipments[].carrier in the Orders resource representation for a list of acceptable + * values. + */ + carrier?: string; + /** The ID of the shipment. */ + shipmentId?: string; + /** New status for the shipment. Not updated if missing. */ + status?: string; + /** The tracking id for the shipment. Not updated if missing. */ + trackingId?: string; + } + interface OrdersCustomBatchResponse { + /** The result of the execution of the batch requests. */ + entries?: OrdersCustomBatchResponseEntry[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersCustomBatchResponse". */ + kind?: string; + } + interface OrdersCustomBatchResponseEntry { + /** The ID of the request entry this entry responds to. */ + batchId?: number; + /** A list of errors defined if and only if the request failed. */ + errors?: Errors; + /** The status of the execution. Only defined if the method is not get or getByMerchantOrderId and if the request was successful. */ + executionStatus?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersCustomBatchResponseEntry". */ + kind?: string; + /** The retrieved order. Only defined if the method is get and if the request was successful. */ + order?: Order; + } + interface OrdersGetByMerchantOrderIdResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersGetByMerchantOrderIdResponse". */ + kind?: string; + /** The requested order. */ + order?: Order; + } + interface OrdersGetTestOrderTemplateResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersGetTestOrderTemplateResponse". */ + kind?: string; + /** The requested test order template. */ + template?: TestOrder; + } + interface OrdersListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersListResponse". */ + kind?: string; + /** The token for the retrieval of the next page of orders. */ + nextPageToken?: string; + resources?: Order[]; + } + interface OrdersRefundRequest { + /** The amount that is refunded. */ + amount?: Price; + /** The ID of the operation. Unique across all operations for a given order. */ + operationId?: string; + /** The reason for the refund. */ + reason?: string; + /** The explanation of the reason. */ + reasonText?: string; + } + interface OrdersRefundResponse { + /** The status of the execution. */ + executionStatus?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersRefundResponse". */ + kind?: string; + } + interface OrdersReturnLineItemRequest { + /** The ID of the line item to return. */ + lineItemId?: string; + /** The ID of the operation. Unique across all operations for a given order. */ + operationId?: string; + /** The quantity to return. */ + quantity?: number; + /** The reason for the return. */ + reason?: string; + /** The explanation of the reason. */ + reasonText?: string; + } + interface OrdersReturnLineItemResponse { + /** The status of the execution. */ + executionStatus?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersReturnLineItemResponse". */ + kind?: string; + } + interface OrdersShipLineItemsRequest { + /** + * Deprecated. Please use shipmentInfo instead. The carrier handling the shipment. See shipments[].carrier in the Orders resource representation for a + * list of acceptable values. + */ + carrier?: string; + /** Line items to ship. */ + lineItems?: OrderShipmentLineItemShipment[]; + /** The ID of the operation. Unique across all operations for a given order. */ + operationId?: string; + /** Deprecated. Please use shipmentInfo instead. The ID of the shipment. */ + shipmentId?: string; + /** Shipment information. This field is repeated because a single line item can be shipped in several packages (and have several tracking IDs). */ + shipmentInfos?: OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo[]; + /** Deprecated. Please use shipmentInfo instead. The tracking id for the shipment. */ + trackingId?: string; + } + interface OrdersShipLineItemsResponse { + /** The status of the execution. */ + executionStatus?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersShipLineItemsResponse". */ + kind?: string; + } + interface OrdersUpdateMerchantOrderIdRequest { + /** The merchant order id to be assigned to the order. Must be unique per merchant. */ + merchantOrderId?: string; + /** The ID of the operation. Unique across all operations for a given order. */ + operationId?: string; + } + interface OrdersUpdateMerchantOrderIdResponse { + /** The status of the execution. */ + executionStatus?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersUpdateMerchantOrderIdResponse". */ + kind?: string; + } + interface OrdersUpdateShipmentRequest { + /** + * The carrier handling the shipment. Not updated if missing. See shipments[].carrier in the Orders resource representation for a list of acceptable + * values. + */ + carrier?: string; + /** The ID of the operation. Unique across all operations for a given order. */ + operationId?: string; + /** The ID of the shipment. */ + shipmentId?: string; + /** New status for the shipment. Not updated if missing. */ + status?: string; + /** The tracking id for the shipment. Not updated if missing. */ + trackingId?: string; + } + interface OrdersUpdateShipmentResponse { + /** The status of the execution. */ + executionStatus?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#ordersUpdateShipmentResponse". */ + kind?: string; + } + interface PostalCodeGroup { + /** The CLDR territory code of the country the postal code group applies to. Required. */ + country?: string; + /** The name of the postal code group, referred to in headers. Required. */ + name?: string; + /** A range of postal codes. Required. */ + postalCodeRanges?: PostalCodeRange[]; + } + interface PostalCodeRange { + /** + * A postal code or a pattern of the form prefix* denoting the inclusive lower bound of the range defining the area. Examples values: "94108", "9410*", + * "9*". Required. + */ + postalCodeRangeBegin?: string; + /** + * A postal code or a pattern of the form prefix* denoting the inclusive upper bound of the range defining the area. It must have the same length as + * postalCodeRangeBegin: if postalCodeRangeBegin is a postal code then postalCodeRangeEnd must be a postal code too; if postalCodeRangeBegin is a pattern + * then postalCodeRangeEnd must be a pattern with the same prefix length. Optional: if not set, then the area is defined as being all the postal codes + * matching postalCodeRangeBegin. + */ + postalCodeRangeEnd?: string; + } + interface Price { + /** The currency of the price. */ + currency?: string; + /** The price represented as a number. */ + value?: string; + } + interface Product { + /** Additional URLs of images of the item. */ + additionalImageLinks?: string[]; + /** Additional categories of the item (formatted as in products feed specification). */ + additionalProductTypes?: string[]; + /** Set to true if the item is targeted towards adults. */ + adult?: boolean; + /** Used to group items in an arbitrary way. Only for CPA%, discouraged otherwise. */ + adwordsGrouping?: string; + /** Similar to adwords_grouping, but only works on CPC. */ + adwordsLabels?: string[]; + /** Allows advertisers to override the item URL when the product is shown within the context of Product Ads. */ + adwordsRedirect?: string; + /** Target age group of the item. */ + ageGroup?: string; + /** Specifies the intended aspects for the product. */ + aspects?: ProductAspect[]; + /** Availability status of the item. */ + availability?: string; + /** The day a pre-ordered product becomes available for delivery, in ISO 8601 format. */ + availabilityDate?: string; + /** Brand of the item. */ + brand?: string; + /** The item's channel (online or local). */ + channel?: string; + /** Color of the item. */ + color?: string; + /** Condition or state of the item. */ + condition?: string; + /** The two-letter ISO 639-1 language code for the item. */ + contentLanguage?: string; + /** + * A list of custom (merchant-provided) attributes. It can also be used for submitting any attribute of the feed specification in its generic form (e.g., + * { "name": "size type", "type": "text", "value": "regular" }). This is useful for submitting attributes not explicitly exposed by the API. + */ + customAttributes?: ProductCustomAttribute[]; + /** A list of custom (merchant-provided) custom attribute groups. */ + customGroups?: ProductCustomGroup[]; + /** Custom label 0 for custom grouping of items in a Shopping campaign. */ + customLabel0?: string; + /** Custom label 1 for custom grouping of items in a Shopping campaign. */ + customLabel1?: string; + /** Custom label 2 for custom grouping of items in a Shopping campaign. */ + customLabel2?: string; + /** Custom label 3 for custom grouping of items in a Shopping campaign. */ + customLabel3?: string; + /** Custom label 4 for custom grouping of items in a Shopping campaign. */ + customLabel4?: string; + /** Description of the item. */ + description?: string; + /** Specifies the intended destinations for the product. */ + destinations?: ProductDestination[]; + /** An identifier for an item for dynamic remarketing campaigns. */ + displayAdsId?: string; + /** URL directly to your item's landing page for dynamic remarketing campaigns. */ + displayAdsLink?: string; + /** Advertiser-specified recommendations. */ + displayAdsSimilarIds?: string[]; + /** Title of an item for dynamic remarketing campaigns. */ + displayAdsTitle?: string; + /** Offer margin for dynamic remarketing campaigns. */ + displayAdsValue?: number; + /** The energy efficiency class as defined in EU directive 2010/30/EU. */ + energyEfficiencyClass?: string; + /** + * Date on which the item should expire, as specified upon insertion, in ISO 8601 format. The actual expiration date in Google Shopping is exposed in + * productstatuses as googleExpirationDate and might be earlier if expirationDate is too far in the future. + */ + expirationDate?: string; + /** Target gender of the item. */ + gender?: string; + /** Google's category of the item (see Google product taxonomy). */ + googleProductCategory?: string; + /** Global Trade Item Number (GTIN) of the item. */ + gtin?: string; + /** The REST id of the product. */ + id?: string; + /** + * False when the item does not have unique product identifiers appropriate to its category, such as GTIN, MPN, and brand. Required according to the + * Unique Product Identifier Rules for all target countries except for Canada. + */ + identifierExists?: boolean; + /** URL of an image of the item. */ + imageLink?: string; + /** Number and amount of installments to pay for an item. Brazil only. */ + installment?: Installment; + /** Whether the item is a merchant-defined bundle. A bundle is a custom grouping of different products sold by a merchant for a single price. */ + isBundle?: boolean; + /** Shared identifier for all variants of the same product. */ + itemGroupId?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#product". */ + kind?: string; + /** URL directly linking to your item's page on your website. */ + link?: string; + /** Loyalty points that users receive after purchasing the item. Japan only. */ + loyaltyPoints?: LoyaltyPoints; + /** The material of which the item is made. */ + material?: string; + /** Maximal product handling time (in business days). */ + maxHandlingTime?: string; + /** Minimal product handling time (in business days). */ + minHandlingTime?: string; + /** Link to a mobile-optimized version of the landing page. */ + mobileLink?: string; + /** Manufacturer Part Number (MPN) of the item. */ + mpn?: string; + /** The number of identical products in a merchant-defined multipack. */ + multipack?: string; + /** + * An identifier of the item. Leading and trailing whitespaces are stripped and multiple whitespaces are replaced by a single whitespace upon submission. + * Only valid unicode characters are accepted. See the products feed specification for details. + */ + offerId?: string; + /** Whether an item is available for purchase only online. */ + onlineOnly?: boolean; + /** The item's pattern (e.g. polka dots). */ + pattern?: string; + /** Price of the item. */ + price?: Price; + /** Your category of the item (formatted as in products feed specification). */ + productType?: string; + /** The unique ID of a promotion. */ + promotionIds?: string[]; + /** Advertised sale price of the item. */ + salePrice?: Price; + /** Date range during which the item is on sale (see products feed specification). */ + salePriceEffectiveDate?: string; + /** The quantity of the product that is reserved for sell-on-google ads. */ + sellOnGoogleQuantity?: string; + /** Shipping rules. */ + shipping?: ProductShipping[]; + /** Height of the item for shipping. */ + shippingHeight?: ProductShippingDimension; + /** The shipping label of the product, used to group product in account-level shipping rules. */ + shippingLabel?: string; + /** Length of the item for shipping. */ + shippingLength?: ProductShippingDimension; + /** Weight of the item for shipping. */ + shippingWeight?: ProductShippingWeight; + /** Width of the item for shipping. */ + shippingWidth?: ProductShippingDimension; + /** System in which the size is specified. Recommended for apparel items. */ + sizeSystem?: string; + /** The cut of the item. Recommended for apparel items. */ + sizeType?: string; + /** Size of the item. */ + sizes?: string[]; + /** The CLDR territory code for the item. */ + targetCountry?: string; + /** Tax information. */ + taxes?: ProductTax[]; + /** Title of the item. */ + title?: string; + /** The preference of the denominator of the unit price. */ + unitPricingBaseMeasure?: ProductUnitPricingBaseMeasure; + /** The measure and dimension of an item. */ + unitPricingMeasure?: ProductUnitPricingMeasure; + /** The read-only list of intended destinations which passed validation. */ + validatedDestinations?: string[]; + /** Read-only warnings. */ + warnings?: Error[]; + } + interface ProductAspect { + /** The name of the aspect. */ + aspectName?: string; + /** The name of the destination. Leave out to apply to all destinations. */ + destinationName?: string; + /** Whether the aspect is required, excluded or should be validated. */ + intention?: string; + } + interface ProductCustomAttribute { + /** The name of the attribute. Underscores will be replaced by spaces upon insertion. */ + name?: string; + /** The type of the attribute. */ + type?: string; + /** Free-form unit of the attribute. Unit can only be used for values of type INT or FLOAT. */ + unit?: string; + /** The value of the attribute. */ + value?: string; + } + interface ProductCustomGroup { + /** The sub-attributes. */ + attributes?: ProductCustomAttribute[]; + /** The name of the group. Underscores will be replaced by spaces upon insertion. */ + name?: string; + } + interface ProductDestination { + /** The name of the destination. */ + destinationName?: string; + /** Whether the destination is required, excluded or should be validated. */ + intention?: string; + } + interface ProductShipping { + /** The CLDR territory code of the country to which an item will ship. */ + country?: string; + /** The location where the shipping is applicable, represented by a location group name. */ + locationGroupName?: string; + /** The numeric id of a location that the shipping rate applies to as defined in the AdWords API. */ + locationId?: string; + /** + * The postal code range that the shipping rate applies to, represented by a postal code, a postal code prefix followed by a * wildcard, a range between + * two postal codes or two postal code prefixes of equal length. + */ + postalCode?: string; + /** Fixed shipping price, represented as a number. */ + price?: Price; + /** The geographic region to which a shipping rate applies. */ + region?: string; + /** A free-form description of the service class or delivery speed. */ + service?: string; + } + interface ProductShippingDimension { + /** + * The unit of value. + * + * Acceptable values are: + * - "cm" + * - "in" + */ + unit?: string; + /** The dimension of the product used to calculate the shipping cost of the item. */ + value?: number; + } + interface ProductShippingWeight { + /** The unit of value. */ + unit?: string; + /** The weight of the product used to calculate the shipping cost of the item. */ + value?: number; + } + interface ProductStatus { + /** Date on which the item has been created, in ISO 8601 format. */ + creationDate?: string; + /** A list of data quality issues associated with the product. */ + dataQualityIssues?: ProductStatusDataQualityIssue[]; + /** The intended destinations for the product. */ + destinationStatuses?: ProductStatusDestinationStatus[]; + /** Date on which the item expires in Google Shopping, in ISO 8601 format. */ + googleExpirationDate?: string; + /** Identifies what kind of resource this is. Value: the fixed string "content#productStatus". */ + kind?: string; + /** Date on which the item has been last updated, in ISO 8601 format. */ + lastUpdateDate?: string; + /** The link to the product. */ + link?: string; + /** Product data after applying all the join inputs. */ + product?: Product; + /** The id of the product for which status is reported. */ + productId?: string; + /** The title of the product. */ + title?: string; + } + interface ProductStatusDataQualityIssue { + /** A more detailed error string. */ + detail?: string; + /** The fetch status for landing_page_errors. */ + fetchStatus?: string; + /** The id of the data quality issue. */ + id?: string; + /** The attribute name that is relevant for the issue. */ + location?: string; + /** The severity of the data quality issue. */ + severity?: string; + /** The time stamp of the data quality issue. */ + timestamp?: string; + /** The value of that attribute that was found on the landing page */ + valueOnLandingPage?: string; + /** The value the attribute had at time of evaluation. */ + valueProvided?: string; + } + interface ProductStatusDestinationStatus { + /** The destination's approval status. */ + approvalStatus?: string; + /** The name of the destination */ + destination?: string; + /** Whether the destination is required, excluded, selected by default or should be validated. */ + intention?: string; + } + interface ProductTax { + /** The country within which the item is taxed, specified as a CLDR territory code. */ + country?: string; + /** The numeric id of a location that the tax rate applies to as defined in the AdWords API. */ + locationId?: string; + /** + * The postal code range that the tax rate applies to, represented by a ZIP code, a ZIP code prefix using * wildcard, a range between two ZIP codes or two + * ZIP code prefixes of equal length. Examples: 94114, 94*, 94002-95460, 94*-95*. + */ + postalCode?: string; + /** The percentage of tax rate that applies to the item price. */ + rate?: number; + /** The geographic region to which the tax rate applies. */ + region?: string; + /** Set to true if tax is charged on shipping. */ + taxShip?: boolean; + } + interface ProductUnitPricingBaseMeasure { + /** The unit of the denominator. */ + unit?: string; + /** The denominator of the unit price. */ + value?: string; + } + interface ProductUnitPricingMeasure { + /** The unit of the measure. */ + unit?: string; + /** The measure of an item. */ + value?: number; + } + interface ProductsCustomBatchRequest { + /** The request entries to be processed in the batch. */ + entries?: ProductsCustomBatchRequestEntry[]; + } + interface ProductsCustomBatchRequestEntry { + /** An entry ID, unique within the batch request. */ + batchId?: number; + /** The ID of the managing account. */ + merchantId?: string; + method?: string; + /** The product to insert. Only required if the method is insert. */ + product?: Product; + /** The ID of the product to get or delete. Only defined if the method is get or delete. */ + productId?: string; + } + interface ProductsCustomBatchResponse { + /** The result of the execution of the batch requests. */ + entries?: ProductsCustomBatchResponseEntry[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#productsCustomBatchResponse". */ + kind?: string; + } + interface ProductsCustomBatchResponseEntry { + /** The ID of the request entry this entry responds to. */ + batchId?: number; + /** A list of errors defined if and only if the request failed. */ + errors?: Errors; + /** Identifies what kind of resource this is. Value: the fixed string "content#productsCustomBatchResponseEntry". */ + kind?: string; + /** The inserted product. Only defined if the method is insert and if the request was successful. */ + product?: Product; + } + interface ProductsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#productsListResponse". */ + kind?: string; + /** The token for the retrieval of the next page of products. */ + nextPageToken?: string; + resources?: Product[]; + } + interface ProductstatusesCustomBatchRequest { + /** The request entries to be processed in the batch. */ + entries?: ProductstatusesCustomBatchRequestEntry[]; + } + interface ProductstatusesCustomBatchRequestEntry { + /** An entry ID, unique within the batch request. */ + batchId?: number; + includeAttributes?: boolean; + /** The ID of the managing account. */ + merchantId?: string; + method?: string; + /** The ID of the product whose status to get. */ + productId?: string; + } + interface ProductstatusesCustomBatchResponse { + /** The result of the execution of the batch requests. */ + entries?: ProductstatusesCustomBatchResponseEntry[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#productstatusesCustomBatchResponse". */ + kind?: string; + } + interface ProductstatusesCustomBatchResponseEntry { + /** The ID of the request entry this entry responds to. */ + batchId?: number; + /** A list of errors, if the request failed. */ + errors?: Errors; + /** Identifies what kind of resource this is. Value: the fixed string "content#productstatusesCustomBatchResponseEntry". */ + kind?: string; + /** The requested product status. Only defined if the request was successful. */ + productStatus?: ProductStatus; + } + interface ProductstatusesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#productstatusesListResponse". */ + kind?: string; + /** The token for the retrieval of the next page of products statuses. */ + nextPageToken?: string; + resources?: ProductStatus[]; + } + interface RateGroup { + /** + * A list of shipping labels defining the products to which this rate group applies to. This is a disjunction: only one of the labels has to match for the + * rate group to apply. May only be empty for the last rate group of a service. Required. + */ + applicableShippingLabels?: string[]; + /** A list of carrier rates that can be referred to by mainTable or singleValue. */ + carrierRates?: CarrierRate[]; + /** A table defining the rate group, when singleValue is not expressive enough. Can only be set if singleValue is not set. */ + mainTable?: Table; + /** The value of the rate group (e.g. flat rate $10). Can only be set if mainTable and subtables are not set. */ + singleValue?: Value; + /** A list of subtables referred to by mainTable. Can only be set if mainTable is set. */ + subtables?: Table[]; + } + interface Row { + /** + * The list of cells that constitute the row. Must have the same length as columnHeaders for two-dimensional tables, a length of 1 for one-dimensional + * tables. Required. + */ + cells?: Value[]; + } + interface Service { + /** A boolean exposing the active status of the shipping service. Required. */ + active?: boolean; + /** The CLDR code of the currency to which this service applies. Must match that of the prices in rate groups. */ + currency?: string; + /** The CLDR territory code of the country to which the service applies. Required. */ + deliveryCountry?: string; + /** Time spent in various aspects from order to the delivery of the product. Required. */ + deliveryTime?: DeliveryTime; + /** + * Minimum order value for this service. If set, indicates that customers will have to spend at least this amount. All prices within a service must have + * the same currency. + */ + minimumOrderValue?: Price; + /** Free-form name of the service. Must be unique within target account. Required. */ + name?: string; + /** + * Shipping rate group definitions. Only the last one is allowed to have an empty applicableShippingLabels, which means "everything else". The other + * applicableShippingLabels must not overlap. + */ + rateGroups?: RateGroup[]; + } + interface ShippingSettings { + /** The ID of the account to which these account shipping settings belong. Ignored upon update, always present in get request responses. */ + accountId?: string; + /** A list of postal code groups that can be referred to in services. Optional. */ + postalCodeGroups?: PostalCodeGroup[]; + /** The target account's list of services. Optional. */ + services?: Service[]; + } + interface ShippingsettingsCustomBatchRequest { + /** The request entries to be processed in the batch. */ + entries?: ShippingsettingsCustomBatchRequestEntry[]; + } + interface ShippingsettingsCustomBatchRequestEntry { + /** The ID of the account for which to get/update account shipping settings. */ + accountId?: string; + /** An entry ID, unique within the batch request. */ + batchId?: number; + /** The ID of the managing account. */ + merchantId?: string; + method?: string; + /** The account shipping settings to update. Only defined if the method is update. */ + shippingSettings?: ShippingSettings; + } + interface ShippingsettingsCustomBatchResponse { + /** The result of the execution of the batch requests. */ + entries?: ShippingsettingsCustomBatchResponseEntry[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#shippingsettingsCustomBatchResponse". */ + kind?: string; + } + interface ShippingsettingsCustomBatchResponseEntry { + /** The ID of the request entry to which this entry responds. */ + batchId?: number; + /** A list of errors defined if, and only if, the request failed. */ + errors?: Errors; + /** Identifies what kind of resource this is. Value: the fixed string "content#shippingsettingsCustomBatchResponseEntry". */ + kind?: string; + /** The retrieved or updated account shipping settings. */ + shippingSettings?: ShippingSettings; + } + interface ShippingsettingsGetSupportedCarriersResponse { + /** A list of supported carriers. May be empty. */ + carriers?: CarriersCarrier[]; + /** Identifies what kind of resource this is. Value: the fixed string "content#shippingsettingsGetSupportedCarriersResponse". */ + kind?: string; + } + interface ShippingsettingsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "content#shippingsettingsListResponse". */ + kind?: string; + /** The token for the retrieval of the next page of shipping settings. */ + nextPageToken?: string; + resources?: ShippingSettings[]; + } + interface Table { + /** Headers of the table's columns. Optional: if not set then the table has only one dimension. */ + columnHeaders?: Headers; + /** Name of the table. Required for subtables, ignored for the main table. */ + name?: string; + /** Headers of the table's rows. Required. */ + rowHeaders?: Headers; + /** The list of rows that constitute the table. Must have the same length as rowHeaders. Required. */ + rows?: Row[]; + } + interface TestOrder { + /** The details of the customer who placed the order. */ + customer?: TestOrderCustomer; + /** Identifies what kind of resource this is. Value: the fixed string "content#testOrder". */ + kind?: string; + /** Line items that are ordered. At least one line item must be provided. */ + lineItems?: TestOrderLineItem[]; + /** The details of the payment method. */ + paymentMethod?: TestOrderPaymentMethod; + /** Identifier of one of the predefined delivery addresses for the delivery. */ + predefinedDeliveryAddress?: string; + /** The details of the merchant provided promotions applied to the order. More details about the program are here. */ + promotions?: OrderPromotion[]; + /** The total cost of shipping for all items. */ + shippingCost?: Price; + /** The tax for the total shipping cost. */ + shippingCostTax?: Price; + /** The requested shipping option. */ + shippingOption?: string; + } + interface TestOrderCustomer { + /** Email address of the customer. */ + email?: string; + /** + * If set, this indicates the user explicitly chose to opt in or out of providing marketing rights to the merchant. If unset, this indicates the user has + * already made this choice in a previous purchase, and was thus not shown the marketing right opt in/out checkbox during the checkout flow. Optional. + */ + explicitMarketingPreference?: boolean; + /** Full name of the customer. */ + fullName?: string; + } + interface TestOrderLineItem { + /** Product data from the time of the order placement. */ + product?: TestOrderLineItemProduct; + /** Number of items ordered. */ + quantityOrdered?: number; + /** Details of the return policy for the line item. */ + returnInfo?: OrderLineItemReturnInfo; + /** Details of the requested shipping for the line item. */ + shippingDetails?: OrderLineItemShippingDetails; + /** Unit tax for the line item. */ + unitTax?: Price; + } + interface TestOrderLineItemProduct { + /** Brand of the item. */ + brand?: string; + /** The item's channel. */ + channel?: string; + /** Condition or state of the item. */ + condition?: string; + /** The two-letter ISO 639-1 language code for the item. */ + contentLanguage?: string; + /** Global Trade Item Number (GTIN) of the item. Optional. */ + gtin?: string; + /** URL of an image of the item. */ + imageLink?: string; + /** Shared identifier for all variants of the same product. Optional. */ + itemGroupId?: string; + /** Manufacturer Part Number (MPN) of the item. Optional. */ + mpn?: string; + /** An identifier of the item. */ + offerId?: string; + /** The price for the product. */ + price?: Price; + /** The CLDR territory code of the target country of the product. */ + targetCountry?: string; + /** The title of the product. */ + title?: string; + /** Variant attributes for the item. Optional. */ + variantAttributes?: OrderLineItemProductVariantAttribute[]; + } + interface TestOrderPaymentMethod { + /** The card expiration month (January = 1, February = 2 etc.). */ + expirationMonth?: number; + /** The card expiration year (4-digit, e.g. 2015). */ + expirationYear?: number; + /** The last four digits of the card number. */ + lastFourDigits?: string; + /** The billing address. */ + predefinedBillingAddress?: string; + /** The type of instrument. Note that real orders might have different values than the four values accepted by createTestOrder. */ + type?: string; + } + interface Value { + /** The name of a carrier rate referring to a carrier rate defined in the same rate group. Can only be set if all other fields are not set. */ + carrierRateName?: string; + /** A flat rate. Can only be set if all other fields are not set. */ + flatRate?: Price; + /** If true, then the product can't ship. Must be true when set, can only be set if all other fields are not set. */ + noShipping?: boolean; + /** A percentage of the price represented as a number in decimal notation (e.g., "5.4"). Can only be set if all other fields are not set. */ + pricePercentage?: string; + /** The name of a subtable. Can only be set in table cells (i.e., not for single values), and only if all other fields are not set. */ + subtableName?: string; + } + interface Weight { + /** The weight unit. */ + unit?: string; + /** The weight represented as a number. */ + value?: string; + } + interface AccountsResource { + /** Returns information about the authenticated user. */ + authinfo(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Claims the website of a Merchant Center sub-account. This method can only be called for accounts to which the managing account has access: either the + * managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + claimwebsite(request: { + /** The ID of the account whose website is claimed. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Only available to selected merchants. When set to True, this flag removes any existing claim on the requested website by another account and replaces + * it with a claim from this account. + */ + overwrite?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves, inserts, updates, and deletes multiple Merchant Center (sub-)accounts in a single request. */ + custombatch(request: { + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes a Merchant Center sub-account. This method can only be called for multi-client accounts. */ + delete(request: { + /** The ID of the account. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Flag to delete sub-accounts with products. The default value is false. */ + force?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Retrieves a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account + * itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + get(request: { + /** The ID of the account. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a Merchant Center sub-account. This method can only be called for multi-client accounts. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of accounts to return in the response, used for paging. */ + maxResults?: number; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The token returned by the previous request. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account + * itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics. + */ + patch(request: { + /** The ID of the account. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account + * itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + update(request: { + /** The ID of the account. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AccountstatusesResource { + custombatch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Retrieves the status of a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the + * managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + get(request: { + /** The ID of the account. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the statuses of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of account statuses to return in the response, used for paging. */ + maxResults?: number; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The token returned by the previous request. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AccounttaxResource { + /** Retrieves and updates tax settings of multiple accounts in a single request. */ + custombatch(request: { + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Retrieves the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing + * account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + get(request: { + /** The ID of the account for which to get/update account tax settings. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the tax settings of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of tax settings to return in the response, used for paging. */ + maxResults?: number; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The token returned by the previous request. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing + * account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch + * semantics. + */ + patch(request: { + /** The ID of the account for which to get/update account tax settings. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing + * account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + update(request: { + /** The ID of the account for which to get/update account tax settings. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DatafeedsResource { + custombatch(request: { + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes a datafeed configuration from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + datafeedId: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a datafeed configuration from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + get(request: { + /** Data format for the response. */ + alt?: string; + datafeedId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Registers a datafeed configuration with your Merchant Center account. This method can only be called for non-multi-client accounts. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the datafeeds in your Merchant Center account. This method can only be called for non-multi-client accounts. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of products to return in the response, used for paging. */ + maxResults?: number; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The token returned by the previous request. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates a datafeed configuration of your Merchant Center account. This method can only be called for non-multi-client accounts. This method supports + * patch semantics. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + datafeedId: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a datafeed configuration of your Merchant Center account. This method can only be called for non-multi-client accounts. */ + update(request: { + /** Data format for the response. */ + alt?: string; + datafeedId: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DatafeedstatusesResource { + custombatch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the status of a datafeed from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** + * The country for which to get the datafeed status. If this parameter is provided then language must also be provided. Note that this parameter is + * required for feeds targeting multiple countries and languages, since a feed may have a different status for each target. + */ + country?: string; + datafeedId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The language for which to get the datafeed status. If this parameter is provided then country must also be provided. Note that this parameter is + * required for feeds targeting multiple countries and languages, since a feed may have a different status for each target. + */ + language?: string; + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the statuses of the datafeeds in your Merchant Center account. This method can only be called for non-multi-client accounts. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of products to return in the response, used for paging. */ + maxResults?: number; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The token returned by the previous request. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface InventoryResource { + /** + * Updates price and availability for multiple products or stores in a single request. This operation does not update the expiration date of the products. + * This method can only be called for non-multi-client accounts. + */ + custombatch(request: { + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates price and availability of a product in your Merchant Center account. This operation does not update the expiration date of the product. This + * method can only be called for non-multi-client accounts. + */ + set(request: { + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the product for which to update price and availability. */ + productId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The code of the store for which to update price and availability. Use online to update price and availability of an online product. */ + storeCode: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface OrdersResource { + /** Marks an order as acknowledged. This method can only be called for non-multi-client accounts. */ + acknowledge(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the order. */ + orderId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Sandbox only. Moves a test order from state "inProgress" to state "pendingShipment". This method can only be called for non-multi-client accounts. */ + advancetestorder(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the test order to modify. */ + orderId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Cancels all line items in an order, making a full refund. This method can only be called for non-multi-client accounts. */ + cancel(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the order to cancel. */ + orderId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Cancels a line item, making a full refund. This method can only be called for non-multi-client accounts. */ + cancellineitem(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the order. */ + orderId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Sandbox only. Creates a test order. This method can only be called for non-multi-client accounts. */ + createtestorder(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves or modifies multiple orders in a single request. This method can only be called for non-multi-client accounts. */ + custombatch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves an order from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the order. */ + orderId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves an order using merchant order id. This method can only be called for non-multi-client accounts. */ + getbymerchantorderid(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** The merchant order id to be looked for. */ + merchantOrderId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox. This method can only be called for + * non-multi-client accounts. + */ + gettestordertemplate(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The name of the template to retrieve. */ + templateName: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the orders in your Merchant Center account. This method can only be called for non-multi-client accounts. */ + list(request: { + /** + * Obtains orders that match the acknowledgement status. When set to true, obtains orders that have been acknowledged. When false, obtains orders that + * have not been acknowledged. + * We recommend using this filter set to false, in conjunction with the acknowledge call, such that only un-acknowledged orders are returned. + */ + acknowledged?: boolean; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of orders to return in the response, used for paging. The default value is 25 orders per page, and the maximum allowed value is 250 + * orders per page. + * Known issue: All List calls will return all Orders without limit regardless of the value of this field. + */ + maxResults?: number; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The ordering of the returned list. The only supported value are placedDate desc and placedDate asc for now, which returns orders sorted by placement + * date. "placedDate desc" stands for listing orders by placement date, from oldest to most recent. "placedDate asc" stands for listing orders by + * placement date, from most recent to oldest. In future releases we'll support other sorting criteria. + */ + orderBy?: string; + /** The token returned by the previous request. */ + pageToken?: string; + /** Obtains orders placed before this date (exclusively), in ISO 8601 format. */ + placedDateEnd?: string; + /** Obtains orders placed after this date (inclusively), in ISO 8601 format. */ + placedDateStart?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Obtains orders that match any of the specified statuses. Multiple values can be specified with comma separation. Additionally, please note that active + * is a shortcut for pendingShipment and partiallyShipped, and completed is a shortcut for shipped , partiallyDelivered, delivered, partiallyReturned, + * returned, and canceled. + */ + statuses?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Refund a portion of the order, up to the full amount paid. This method can only be called for non-multi-client accounts. */ + refund(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the order to refund. */ + orderId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns a line item. This method can only be called for non-multi-client accounts. */ + returnlineitem(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the order. */ + orderId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Marks line item(s) as shipped. This method can only be called for non-multi-client accounts. */ + shiplineitems(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the order. */ + orderId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the merchant order ID for a given order. This method can only be called for non-multi-client accounts. */ + updatemerchantorderid(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the order. */ + orderId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a shipment's status, carrier, and/or tracking ID. This method can only be called for non-multi-client accounts. */ + updateshipment(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the order. */ + orderId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ProductsResource { + /** Retrieves, inserts, and deletes multiple products in a single request. This method can only be called for non-multi-client accounts. */ + custombatch(request: { + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes a product from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the product. */ + productId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a product from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the product. */ + productId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Uploads a product to your Merchant Center account. If an item with the same channel, contentLanguage, offerId, and targetCountry already exists, this + * method updates that entry. This method can only be called for non-multi-client accounts. + */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the products in your Merchant Center account. This method can only be called for non-multi-client accounts. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Flag to include the invalid inserted items in the result of the list request. By default the invalid items are not shown (the default value is false). */ + includeInvalidInsertedItems?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of products to return in the response, used for paging. */ + maxResults?: number; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The token returned by the previous request. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ProductstatusesResource { + /** Gets the statuses of multiple products in a single request. This method can only be called for non-multi-client accounts. */ + custombatch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Flag to include full product data in the results of this request. The default value is false. */ + includeAttributes?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets the status of a product from your Merchant Center account. This method can only be called for non-multi-client accounts. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Flag to include full product data in the result of this get request. The default value is false. */ + includeAttributes?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the product. */ + productId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the statuses of the products in your Merchant Center account. This method can only be called for non-multi-client accounts. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Flag to include full product data in the results of the list request. The default value is false. */ + includeAttributes?: boolean; + /** Flag to include the invalid inserted items in the result of the list request. By default the invalid items are not shown (the default value is false). */ + includeInvalidInsertedItems?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of product statuses to return in the response, used for paging. */ + maxResults?: number; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The token returned by the previous request. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ShippingsettingsResource { + /** Retrieves and updates the shipping settings of multiple accounts in a single request. */ + custombatch(request: { + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Retrieves the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the + * managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + get(request: { + /** The ID of the account for which to get/update shipping settings. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves supported carriers and carrier services for an account. */ + getsupportedcarriers(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the account for which to retrieve the supported carriers. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the shipping settings of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The maximum number of shipping settings to return in the response, used for paging. */ + maxResults?: number; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The token returned by the previous request. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing + * account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch + * semantics. + */ + patch(request: { + /** The ID of the account for which to get/update shipping settings. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing + * account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. + */ + update(request: { + /** The ID of the account for which to get/update shipping settings. */ + accountId: string; + /** Data format for the response. */ + alt?: string; + /** Flag to run the request in dry-run mode. */ + dryRun?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The ID of the managing account. */ + merchantId: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.content/readme.md b/types/gapi.client.content/readme.md new file mode 100644 index 0000000000..043429370a --- /dev/null +++ b/types/gapi.client.content/readme.md @@ -0,0 +1,344 @@ +# TypeScript typings for Content API for Shopping v2 +Manages product items, inventory, and Merchant Center accounts for Google Shopping. +For detailed description please check [documentation](https://developers.google.com/shopping-content). + +## Installing + +Install typings for Content API for Shopping: +``` +npm install @types/gapi.client.content@v2 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('content', 'v2', () => { + // now we can use gapi.client.content + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // Manage your product listings and accounts for Google Shopping + 'https://www.googleapis.com/auth/content', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Content API for Shopping resources: + +```typescript + +/* +Returns information about the authenticated user. +*/ +await gapi.client.accounts.authinfo({ }); + +/* +Claims the website of a Merchant Center sub-account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. +*/ +await gapi.client.accounts.claimwebsite({ accountId: "accountId", merchantId: "merchantId", }); + +/* +Retrieves, inserts, updates, and deletes multiple Merchant Center (sub-)accounts in a single request. +*/ +await gapi.client.accounts.custombatch({ }); + +/* +Deletes a Merchant Center sub-account. This method can only be called for multi-client accounts. +*/ +await gapi.client.accounts.delete({ accountId: "accountId", merchantId: "merchantId", }); + +/* +Retrieves a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. +*/ +await gapi.client.accounts.get({ accountId: "accountId", merchantId: "merchantId", }); + +/* +Creates a Merchant Center sub-account. This method can only be called for multi-client accounts. +*/ +await gapi.client.accounts.insert({ merchantId: "merchantId", }); + +/* +Lists the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. +*/ +await gapi.client.accounts.list({ merchantId: "merchantId", }); + +/* +Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics. +*/ +await gapi.client.accounts.patch({ accountId: "accountId", merchantId: "merchantId", }); + +/* +Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. +*/ +await gapi.client.accounts.update({ accountId: "accountId", merchantId: "merchantId", }); + +/* +undefined +*/ +await gapi.client.accountstatuses.custombatch({ }); + +/* +Retrieves the status of a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. +*/ +await gapi.client.accountstatuses.get({ accountId: "accountId", merchantId: "merchantId", }); + +/* +Lists the statuses of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. +*/ +await gapi.client.accountstatuses.list({ merchantId: "merchantId", }); + +/* +Retrieves and updates tax settings of multiple accounts in a single request. +*/ +await gapi.client.accounttax.custombatch({ }); + +/* +Retrieves the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. +*/ +await gapi.client.accounttax.get({ accountId: "accountId", merchantId: "merchantId", }); + +/* +Lists the tax settings of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. +*/ +await gapi.client.accounttax.list({ merchantId: "merchantId", }); + +/* +Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics. +*/ +await gapi.client.accounttax.patch({ accountId: "accountId", merchantId: "merchantId", }); + +/* +Updates the tax settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. +*/ +await gapi.client.accounttax.update({ accountId: "accountId", merchantId: "merchantId", }); + +/* +undefined +*/ +await gapi.client.datafeeds.custombatch({ }); + +/* +Deletes a datafeed configuration from your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.datafeeds.delete({ datafeedId: "datafeedId", merchantId: "merchantId", }); + +/* +Retrieves a datafeed configuration from your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.datafeeds.get({ datafeedId: "datafeedId", merchantId: "merchantId", }); + +/* +Registers a datafeed configuration with your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.datafeeds.insert({ merchantId: "merchantId", }); + +/* +Lists the datafeeds in your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.datafeeds.list({ merchantId: "merchantId", }); + +/* +Updates a datafeed configuration of your Merchant Center account. This method can only be called for non-multi-client accounts. This method supports patch semantics. +*/ +await gapi.client.datafeeds.patch({ datafeedId: "datafeedId", merchantId: "merchantId", }); + +/* +Updates a datafeed configuration of your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.datafeeds.update({ datafeedId: "datafeedId", merchantId: "merchantId", }); + +/* +undefined +*/ +await gapi.client.datafeedstatuses.custombatch({ }); + +/* +Retrieves the status of a datafeed from your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.datafeedstatuses.get({ datafeedId: "datafeedId", merchantId: "merchantId", }); + +/* +Lists the statuses of the datafeeds in your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.datafeedstatuses.list({ merchantId: "merchantId", }); + +/* +Updates price and availability for multiple products or stores in a single request. This operation does not update the expiration date of the products. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.inventory.custombatch({ }); + +/* +Updates price and availability of a product in your Merchant Center account. This operation does not update the expiration date of the product. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.inventory.set({ merchantId: "merchantId", productId: "productId", storeCode: "storeCode", }); + +/* +Marks an order as acknowledged. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.acknowledge({ merchantId: "merchantId", orderId: "orderId", }); + +/* +Sandbox only. Moves a test order from state "inProgress" to state "pendingShipment". This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.advancetestorder({ merchantId: "merchantId", orderId: "orderId", }); + +/* +Cancels all line items in an order, making a full refund. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.cancel({ merchantId: "merchantId", orderId: "orderId", }); + +/* +Cancels a line item, making a full refund. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.cancellineitem({ merchantId: "merchantId", orderId: "orderId", }); + +/* +Sandbox only. Creates a test order. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.createtestorder({ merchantId: "merchantId", }); + +/* +Retrieves or modifies multiple orders in a single request. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.custombatch({ }); + +/* +Retrieves an order from your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.get({ merchantId: "merchantId", orderId: "orderId", }); + +/* +Retrieves an order using merchant order id. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.getbymerchantorderid({ merchantId: "merchantId", merchantOrderId: "merchantOrderId", }); + +/* +Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.gettestordertemplate({ merchantId: "merchantId", templateName: "templateName", }); + +/* +Lists the orders in your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.list({ merchantId: "merchantId", }); + +/* +Refund a portion of the order, up to the full amount paid. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.refund({ merchantId: "merchantId", orderId: "orderId", }); + +/* +Returns a line item. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.returnlineitem({ merchantId: "merchantId", orderId: "orderId", }); + +/* +Marks line item(s) as shipped. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.shiplineitems({ merchantId: "merchantId", orderId: "orderId", }); + +/* +Updates the merchant order ID for a given order. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.updatemerchantorderid({ merchantId: "merchantId", orderId: "orderId", }); + +/* +Updates a shipment's status, carrier, and/or tracking ID. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.orders.updateshipment({ merchantId: "merchantId", orderId: "orderId", }); + +/* +Retrieves, inserts, and deletes multiple products in a single request. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.products.custombatch({ }); + +/* +Deletes a product from your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.products.delete({ merchantId: "merchantId", productId: "productId", }); + +/* +Retrieves a product from your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.products.get({ merchantId: "merchantId", productId: "productId", }); + +/* +Uploads a product to your Merchant Center account. If an item with the same channel, contentLanguage, offerId, and targetCountry already exists, this method updates that entry. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.products.insert({ merchantId: "merchantId", }); + +/* +Lists the products in your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.products.list({ merchantId: "merchantId", }); + +/* +Gets the statuses of multiple products in a single request. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.productstatuses.custombatch({ }); + +/* +Gets the status of a product from your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.productstatuses.get({ merchantId: "merchantId", productId: "productId", }); + +/* +Lists the statuses of the products in your Merchant Center account. This method can only be called for non-multi-client accounts. +*/ +await gapi.client.productstatuses.list({ merchantId: "merchantId", }); + +/* +Retrieves and updates the shipping settings of multiple accounts in a single request. +*/ +await gapi.client.shippingsettings.custombatch({ }); + +/* +Retrieves the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. +*/ +await gapi.client.shippingsettings.get({ accountId: "accountId", merchantId: "merchantId", }); + +/* +Retrieves supported carriers and carrier services for an account. +*/ +await gapi.client.shippingsettings.getsupportedcarriers({ merchantId: "merchantId", }); + +/* +Lists the shipping settings of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. +*/ +await gapi.client.shippingsettings.list({ merchantId: "merchantId", }); + +/* +Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. This method supports patch semantics. +*/ +await gapi.client.shippingsettings.patch({ accountId: "accountId", merchantId: "merchantId", }); + +/* +Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself for any Merchant Center account, or any sub-account when the managing account is a multi-client account. +*/ +await gapi.client.shippingsettings.update({ accountId: "accountId", merchantId: "merchantId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.content/tsconfig.json b/types/gapi.client.content/tsconfig.json new file mode 100644 index 0000000000..566c98a224 --- /dev/null +++ b/types/gapi.client.content/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.content-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.content/tslint.json b/types/gapi.client.content/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.content/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.customsearch/gapi.client.customsearch-tests.ts b/types/gapi.client.customsearch/gapi.client.customsearch-tests.ts new file mode 100644 index 0000000000..6fc523681f --- /dev/null +++ b/types/gapi.client.customsearch/gapi.client.customsearch-tests.ts @@ -0,0 +1,50 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('customsearch', 'v1', () => { + /** now we can use gapi.client.customsearch */ + + run(); + }); + + async function run() { + /** Returns metadata about the search performed, metadata about the custom search engine used for the search, and the search results. */ + await gapi.client.cse.list({ + c2coff: "c2coff", + cr: "cr", + cx: "cx", + dateRestrict: "dateRestrict", + exactTerms: "exactTerms", + excludeTerms: "excludeTerms", + fileType: "fileType", + filter: "filter", + gl: "gl", + googlehost: "googlehost", + highRange: "highRange", + hl: "hl", + hq: "hq", + imgColorType: "imgColorType", + imgDominantColor: "imgDominantColor", + imgSize: "imgSize", + imgType: "imgType", + linkSite: "linkSite", + lowRange: "lowRange", + lr: "lr", + num: 21, + orTerms: "orTerms", + q: "q", + relatedSite: "relatedSite", + rights: "rights", + safe: "safe", + searchType: "searchType", + siteSearch: "siteSearch", + siteSearchFilter: "siteSearchFilter", + sort: "sort", + start: 31, + }); + } +}); diff --git a/types/gapi.client.customsearch/index.d.ts b/types/gapi.client.customsearch/index.d.ts new file mode 100644 index 0000000000..1722767845 --- /dev/null +++ b/types/gapi.client.customsearch/index.d.ts @@ -0,0 +1,226 @@ +// Type definitions for Google CustomSearch API v1 1.0 +// Project: https://developers.google.com/custom-search/v1/using_rest +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/customsearch/v1/rest + +/// + +declare namespace gapi.client { + /** Load CustomSearch API v1 */ + function load(name: "customsearch", version: "v1"): PromiseLike; + function load(name: "customsearch", version: "v1", callback: () => any): void; + + const cse: customsearch.CseResource; + + namespace customsearch { + interface Context { + facets?: Array>; + title?: string; + } + interface Promotion { + bodyLines?: Array<{ + htmlTitle?: string; + link?: string; + title?: string; + url?: string; + }>; + displayLink?: string; + htmlTitle?: string; + image?: { + height?: number; + source?: string; + width?: number; + }; + link?: string; + title?: string; + } + interface Query { + count?: number; + cr?: string; + cx?: string; + dateRestrict?: string; + disableCnTwTranslation?: string; + exactTerms?: string; + excludeTerms?: string; + fileType?: string; + filter?: string; + gl?: string; + googleHost?: string; + highRange?: string; + hl?: string; + hq?: string; + imgColorType?: string; + imgDominantColor?: string; + imgSize?: string; + imgType?: string; + inputEncoding?: string; + language?: string; + linkSite?: string; + lowRange?: string; + orTerms?: string; + outputEncoding?: string; + relatedSite?: string; + rights?: string; + safe?: string; + searchTerms?: string; + searchType?: string; + siteSearch?: string; + siteSearchFilter?: string; + sort?: string; + startIndex?: number; + startPage?: number; + title?: string; + totalResults?: string; + } + interface Result { + cacheId?: string; + displayLink?: string; + fileFormat?: string; + formattedUrl?: string; + htmlFormattedUrl?: string; + htmlSnippet?: string; + htmlTitle?: string; + image?: { + byteSize?: number; + contextLink?: string; + height?: number; + thumbnailHeight?: number; + thumbnailLink?: string; + thumbnailWidth?: number; + width?: number; + }; + kind?: string; + labels?: Array<{ + displayName?: string; + label_with_op?: string; + name?: string; + }>; + link?: string; + mime?: string; + pagemap?: Record>>; + snippet?: string; + title?: string; + } + interface Search { + context?: Context; + items?: Result[]; + kind?: string; + promotions?: Promotion[]; + queries?: Record; + searchInformation?: { + formattedSearchTime?: string; + formattedTotalResults?: string; + searchTime?: number; + totalResults?: string; + }; + spelling?: { + correctedQuery?: string; + htmlCorrectedQuery?: string; + }; + url?: { + template?: string; + type?: string; + }; + } + interface CseResource { + /** Returns metadata about the search performed, metadata about the custom search engine used for the search, and the search results. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Turns off the translation between zh-CN and zh-TW. */ + c2coff?: string; + /** Country restrict(s). */ + cr?: string; + /** The custom search engine ID to scope this search query */ + cx?: string; + /** Specifies all search results are from a time period */ + dateRestrict?: string; + /** Identifies a phrase that all documents in the search results must contain */ + exactTerms?: string; + /** Identifies a word or phrase that should not appear in any documents in the search results */ + excludeTerms?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Returns images of a specified type. Some of the allowed values are: bmp, gif, png, jpg, svg, pdf, ... */ + fileType?: string; + /** Controls turning on or off the duplicate content filter. */ + filter?: string; + /** Geolocation of end user. */ + gl?: string; + /** The local Google domain to use to perform the search. */ + googlehost?: string; + /** Creates a range in form as_nlo value..as_nhi value and attempts to append it to query */ + highRange?: string; + /** Sets the user interface language. */ + hl?: string; + /** Appends the extra query terms to the query. */ + hq?: string; + /** Returns black and white, grayscale, or color images: mono, gray, and color. */ + imgColorType?: string; + /** Returns images of a specific dominant color: yellow, green, teal, blue, purple, pink, white, gray, black and brown. */ + imgDominantColor?: string; + /** Returns images of a specified size, where size can be one of: icon, small, medium, large, xlarge, xxlarge, and huge. */ + imgSize?: string; + /** Returns images of a type, which can be one of: clipart, face, lineart, news, and photo. */ + imgType?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Specifies that all search results should contain a link to a particular URL */ + linkSite?: string; + /** Creates a range in form as_nlo value..as_nhi value and attempts to append it to query */ + lowRange?: string; + /** The language restriction for the search results */ + lr?: string; + /** Number of search results to return */ + num?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Provides additional search terms to check for in a document, where each document in the search results must contain at least one of the additional + * search terms + */ + orTerms?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Query */ + q: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Specifies that all search results should be pages that are related to the specified URL */ + relatedSite?: string; + /** + * Filters based on licensing. Supported values include: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived and combinations of + * these. + */ + rights?: string; + /** Search safety level */ + safe?: string; + /** Specifies the search type: image. */ + searchType?: string; + /** Specifies all search results should be pages from a given site */ + siteSearch?: string; + /** Controls whether to include or exclude results from the site named in the as_sitesearch parameter */ + siteSearchFilter?: string; + /** The sort expression to apply to the results */ + sort?: string; + /** The index of the first result to return */ + start?: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.customsearch/readme.md b/types/gapi.client.customsearch/readme.md new file mode 100644 index 0000000000..836af575ac --- /dev/null +++ b/types/gapi.client.customsearch/readme.md @@ -0,0 +1,40 @@ +# TypeScript typings for CustomSearch API v1 +Searches over a website or collection of websites +For detailed description please check [documentation](https://developers.google.com/custom-search/v1/using_rest). + +## Installing + +Install typings for CustomSearch API: +``` +npm install @types/gapi.client.customsearch@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('customsearch', 'v1', () => { + // now we can use gapi.client.customsearch + // ... +}); +``` + + + +After that you can use CustomSearch API resources: + +```typescript + +/* +Returns metadata about the search performed, metadata about the custom search engine used for the search, and the search results. +*/ +await gapi.client.cse.list({ q: "q", }); +``` \ No newline at end of file diff --git a/types/gapi.client.customsearch/tsconfig.json b/types/gapi.client.customsearch/tsconfig.json new file mode 100644 index 0000000000..9b5c4f447d --- /dev/null +++ b/types/gapi.client.customsearch/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.customsearch-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.customsearch/tslint.json b/types/gapi.client.customsearch/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.customsearch/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.dataflow/gapi.client.dataflow-tests.ts b/types/gapi.client.dataflow/gapi.client.dataflow-tests.ts new file mode 100644 index 0000000000..8223d7e49f --- /dev/null +++ b/types/gapi.client.dataflow/gapi.client.dataflow-tests.ts @@ -0,0 +1,42 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('dataflow', 'v1b3', () => { + /** now we can use gapi.client.dataflow */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View and manage your Google Compute Engine resources */ + 'https://www.googleapis.com/auth/compute', + /** View your Google Compute Engine resources */ + 'https://www.googleapis.com/auth/compute.readonly', + /** View your email address */ + 'https://www.googleapis.com/auth/userinfo.email', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Send a worker_message to the service. */ + await gapi.client.projects.workerMessages({ + projectId: "projectId", + }); + } +}); diff --git a/types/gapi.client.dataflow/index.d.ts b/types/gapi.client.dataflow/index.d.ts new file mode 100644 index 0000000000..6c04dad9ea --- /dev/null +++ b/types/gapi.client.dataflow/index.d.ts @@ -0,0 +1,3245 @@ +// Type definitions for Google Google Dataflow API v1b3 1.0 +// Project: https://cloud.google.com/dataflow +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://dataflow.googleapis.com/$discovery/rest?version=v1b3 + +/// + +declare namespace gapi.client { + /** Load Google Dataflow API v1b3 */ + function load(name: "dataflow", version: "v1b3"): PromiseLike; + function load(name: "dataflow", version: "v1b3", callback: () => any): void; + + const projects: dataflow.ProjectsResource; + + namespace dataflow { + interface ApproximateProgress { + /** Obsolete. */ + percentComplete?: number; + /** Obsolete. */ + position?: Position; + /** Obsolete. */ + remainingTime?: string; + } + interface ApproximateReportedProgress { + /** + * Total amount of parallelism in the portion of input of this task that has + * already been consumed and is no longer active. In the first two examples + * above (see remaining_parallelism), the value should be 29 or 2 + * respectively. The sum of remaining_parallelism and consumed_parallelism + * should equal the total amount of parallelism in this work item. If + * specified, must be finite. + */ + consumedParallelism?: ReportedParallelism; + /** + * Completion as fraction of the input consumed, from 0.0 (beginning, nothing + * consumed), to 1.0 (end of the input, entire input consumed). + */ + fractionConsumed?: number; + /** A Position within the work to represent a progress. */ + position?: Position; + /** + * Total amount of parallelism in the input of this task that remains, + * (i.e. can be delegated to this task and any new tasks via dynamic + * splitting). Always at least 1 for non-finished work items and 0 for + * finished. + * + * "Amount of parallelism" refers to how many non-empty parts of the input + * can be read in parallel. This does not necessarily equal number + * of records. An input that can be read in parallel down to the + * individual records is called "perfectly splittable". + * An example of non-perfectly parallelizable input is a block-compressed + * file format where a block of records has to be read as a whole, + * but different blocks can be read in parallel. + * + * Examples: + * * If we are processing record #30 (starting at 1) out of 50 in a perfectly + * splittable 50-record input, this value should be 21 (20 remaining + 1 + * current). + * * If we are reading through block 3 in a block-compressed file consisting + * of 5 blocks, this value should be 3 (since blocks 4 and 5 can be + * processed in parallel by new tasks via dynamic splitting and the current + * task remains processing block 3). + * * If we are reading through the last block in a block-compressed file, + * or reading or processing the last record in a perfectly splittable + * input, this value should be 1, because apart from the current task, no + * additional remainder can be split off. + */ + remainingParallelism?: ReportedParallelism; + } + interface ApproximateSplitRequest { + /** + * A fraction at which to split the work item, from 0.0 (beginning of the + * input) to 1.0 (end of the input). + */ + fractionConsumed?: number; + /** A Position at which to split the work item. */ + position?: Position; + } + interface AutoscalingEvent { + /** The current number of workers the job has. */ + currentNumWorkers?: string; + /** + * A message describing why the system decided to adjust the current + * number of workers, why it failed, or why the system decided to + * not make any changes to the number of workers. + */ + description?: StructuredMessage; + /** The type of autoscaling event to report. */ + eventType?: string; + /** The target number of workers the worker pool wants to resize to use. */ + targetNumWorkers?: string; + /** + * The time this event was emitted to indicate a new target or current + * num_workers value. + */ + time?: string; + } + interface AutoscalingSettings { + /** The algorithm to use for autoscaling. */ + algorithm?: string; + /** The maximum number of workers to cap scaling at. */ + maxNumWorkers?: number; + } + interface CPUTime { + /** + * Average CPU utilization rate (% non-idle cpu / second) since previous + * sample. + */ + rate?: number; + /** Timestamp of the measurement. */ + timestamp?: string; + /** + * Total active CPU time across all cores (ie., non-idle) in milliseconds + * since start-up. + */ + totalMs?: string; + } + interface ComponentSource { + /** Dataflow service generated name for this source. */ + name?: string; + /** + * User name for the original user transform or collection with which this + * source is most closely associated. + */ + originalTransformOrCollection?: string; + /** Human-readable name for this transform; may be user or system generated. */ + userName?: string; + } + interface ComponentTransform { + /** Dataflow service generated name for this source. */ + name?: string; + /** + * User name for the original user transform with which this transform is + * most closely associated. + */ + originalTransform?: string; + /** Human-readable name for this transform; may be user or system generated. */ + userName?: string; + } + interface ComputationTopology { + /** The ID of the computation. */ + computationId?: string; + /** The inputs to the computation. */ + inputs?: StreamLocation[]; + /** The key ranges processed by the computation. */ + keyRanges?: KeyRangeLocation[]; + /** The outputs from the computation. */ + outputs?: StreamLocation[]; + /** The state family values. */ + stateFamilies?: StateFamilyConfig[]; + /** The system stage name. */ + systemStageName?: string; + } + interface ConcatPosition { + /** Index of the inner source. */ + index?: number; + /** Position within the inner source. */ + position?: Position; + } + interface CounterMetadata { + /** Human-readable description of the counter semantics. */ + description?: string; + /** Counter aggregation kind. */ + kind?: string; + /** A string referring to the unit type. */ + otherUnits?: string; + /** System defined Units, see above enum. */ + standardUnits?: string; + } + interface CounterStructuredName { + /** Name of the optimized step being executed by the workers. */ + componentStepName?: string; + /** Name of the stage. An execution step contains multiple component steps. */ + executionStepName?: string; + /** + * Counter name. Not necessarily globally-unique, but unique within the + * context of the other fields. + * Required. + */ + name?: string; + /** One of the standard Origins defined above. */ + origin?: string; + /** A string containing a more specific namespace of the counter's origin. */ + originNamespace?: string; + /** The GroupByKey step name from the original graph. */ + originalShuffleStepName?: string; + /** + * System generated name of the original step in the user's graph, before + * optimization. + */ + originalStepName?: string; + /** Portion of this counter, either key or value. */ + portion?: string; + /** + * ID of a side input being read from/written to. Side inputs are identified + * by a pair of (reader, input_index). The reader is usually equal to the + * original name, but it may be different, if a ParDo emits it's Iterator / + * Map side input object. + */ + sideInput?: SideInputId; + /** ID of a particular worker. */ + workerId?: string; + } + interface CounterStructuredNameAndMetadata { + /** Metadata associated with a counter */ + metadata?: CounterMetadata; + /** Structured name of the counter. */ + name?: CounterStructuredName; + } + interface CounterUpdate { + /** Boolean value for And, Or. */ + boolean?: boolean; + /** + * True if this counter is reported as the total cumulative aggregate + * value accumulated since the worker started working on this WorkItem. + * By default this is false, indicating that this counter is reported + * as a delta. + */ + cumulative?: boolean; + /** Distribution data */ + distribution?: DistributionUpdate; + /** Floating point value for Sum, Max, Min. */ + floatingPoint?: number; + /** List of floating point numbers, for Set. */ + floatingPointList?: FloatingPointList; + /** Floating point mean aggregation value for Mean. */ + floatingPointMean?: FloatingPointMean; + /** Integer value for Sum, Max, Min. */ + integer?: SplitInt64; + /** List of integers, for Set. */ + integerList?: IntegerList; + /** Integer mean aggregation value for Mean. */ + integerMean?: IntegerMean; + /** Value for internally-defined counters used by the Dataflow service. */ + internal?: any; + /** Counter name and aggregation type. */ + nameAndKind?: NameAndKind; + /** + * The service-generated short identifier for this counter. + * The short_id -> (name, metadata) mapping is constant for the lifetime of + * a job. + */ + shortId?: string; + /** List of strings, for Set. */ + stringList?: StringList; + /** Counter structured name and metadata. */ + structuredNameAndMetadata?: CounterStructuredNameAndMetadata; + } + interface CreateJobFromTemplateRequest { + /** The runtime environment for the job. */ + environment?: RuntimeEnvironment; + /** + * Required. A Cloud Storage path to the template from which to + * create the job. + * Must be a valid Cloud Storage URL, beginning with `gs://`. + */ + gcsPath?: string; + /** Required. The job name to use for the created job. */ + jobName?: string; + /** The location to which to direct the request. */ + location?: string; + /** The runtime parameters to pass to the job. */ + parameters?: Record; + } + interface CustomSourceLocation { + /** Whether this source is stateful. */ + stateful?: boolean; + } + interface DataDiskAssignment { + /** + * Mounted data disks. The order is important a data disk's 0-based index in + * this list defines which persistent directory the disk is mounted to, for + * example the list of { "myproject-1014-104817-4c2-harness-0-disk-0" }, + * { "myproject-1014-104817-4c2-harness-0-disk-1" }. + */ + dataDisks?: string[]; + /** + * VM instance name the data disks mounted to, for example + * "myproject-1014-104817-4c2-harness-0". + */ + vmInstance?: string; + } + interface DerivedSource { + /** What source to base the produced source on (if any). */ + derivationMode?: string; + /** Specification of the source. */ + source?: Source; + } + interface Disk { + /** + * Disk storage type, as defined by Google Compute Engine. This + * must be a disk type appropriate to the project and zone in which + * the workers will run. If unknown or unspecified, the service + * will attempt to choose a reasonable default. + * + * For example, the standard persistent disk type is a resource name + * typically ending in "pd-standard". If SSD persistent disks are + * available, the resource name typically ends with "pd-ssd". The + * actual valid values are defined the Google Compute Engine API, + * not by the Cloud Dataflow API; consult the Google Compute Engine + * documentation for more information about determining the set of + * available disk types for a particular project and zone. + * + * Google Compute Engine Disk types are local to a particular + * project in a particular zone, and so the resource name will + * typically look something like this: + * + * compute.googleapis.com/projects/project-id/zones/zone/diskTypes/pd-standard + */ + diskType?: string; + /** Directory in a VM where disk is mounted. */ + mountPoint?: string; + /** + * Size of disk in GB. If zero or unspecified, the service will + * attempt to choose a reasonable default. + */ + sizeGb?: number; + } + interface DisplayData { + /** Contains value if the data is of a boolean type. */ + boolValue?: boolean; + /** Contains value if the data is of duration type. */ + durationValue?: string; + /** Contains value if the data is of float type. */ + floatValue?: number; + /** Contains value if the data is of int64 type. */ + int64Value?: string; + /** Contains value if the data is of java class type. */ + javaClassValue?: string; + /** + * The key identifying the display data. + * This is intended to be used as a label for the display data + * when viewed in a dax monitoring system. + */ + key?: string; + /** An optional label to display in a dax UI for the element. */ + label?: string; + /** + * The namespace for the key. This is usually a class name or programming + * language namespace (i.e. python module) which defines the display data. + * This allows a dax monitoring system to specially handle the data + * and perform custom rendering. + */ + namespace?: string; + /** + * A possible additional shorter value to display. + * For example a java_class_name_value of com.mypackage.MyDoFn + * will be stored with MyDoFn as the short_str_value and + * com.mypackage.MyDoFn as the java_class_name value. + * short_str_value can be displayed and java_class_name_value + * will be displayed as a tooltip. + */ + shortStrValue?: string; + /** Contains value if the data is of string type. */ + strValue?: string; + /** Contains value if the data is of timestamp type. */ + timestampValue?: string; + /** An optional full URL. */ + url?: string; + } + interface DistributionUpdate { + /** The count of the number of elements present in the distribution. */ + count?: SplitInt64; + /** (Optional) Histogram of value counts for the distribution. */ + histogram?: Histogram; + /** The maximum value present in the distribution. */ + max?: SplitInt64; + /** The minimum value present in the distribution. */ + min?: SplitInt64; + /** + * Use an int64 since we'd prefer the added precision. If overflow is a common + * problem we can detect it and use an additional int64 or a double. + */ + sum?: SplitInt64; + /** Use a double since the sum of squares is likely to overflow int64. */ + sumOfSquares?: number; + } + interface DynamicSourceSplit { + /** + * Primary part (continued to be processed by worker). + * Specified relative to the previously-current source. + * Becomes current. + */ + primary?: DerivedSource; + /** + * Residual part (returned to the pool of work). + * Specified relative to the previously-current source. + */ + residual?: DerivedSource; + } + interface Environment { + /** + * The type of cluster manager API to use. If unknown or + * unspecified, the service will attempt to choose a reasonable + * default. This should be in the form of the API service name, + * e.g. "compute.googleapis.com". + */ + clusterManagerApiService?: string; + /** + * The dataset for the current project where various workflow + * related tables are stored. + * + * The supported resource type is: + * + * Google BigQuery: + * bigquery.googleapis.com/{dataset} + */ + dataset?: string; + /** The list of experiments to enable. */ + experiments?: string[]; + /** Experimental settings. */ + internalExperiments?: Record; + /** + * The Cloud Dataflow SDK pipeline options specified by the user. These + * options are passed through the service and are used to recreate the + * SDK pipeline options on the worker in a language agnostic and platform + * independent way. + */ + sdkPipelineOptions?: Record; + /** Identity to run virtual machines as. Defaults to the default account. */ + serviceAccountEmail?: string; + /** + * The prefix of the resources the system should use for temporary + * storage. The system will append the suffix "/temp-{JOBNAME} to + * this resource prefix, where {JOBNAME} is the value of the + * job_name field. The resulting bucket and object prefix is used + * as the prefix of the resources used to store temporary data + * needed during the job execution. NOTE: This will override the + * value in taskrunner_settings. + * The supported resource type is: + * + * Google Cloud Storage: + * + * storage.googleapis.com/{bucket}/{object} + * bucket.storage.googleapis.com/{object} + */ + tempStoragePrefix?: string; + /** A description of the process that generated the request. */ + userAgent?: Record; + /** + * A structure describing which components and their versions of the service + * are required in order to run the job. + */ + version?: Record; + /** + * The worker pools. At least one "harness" worker pool must be + * specified in order for the job to have workers. + */ + workerPools?: WorkerPool[]; + } + interface ExecutionStageState { + /** The time at which the stage transitioned to this state. */ + currentStateTime?: string; + /** The name of the execution stage. */ + executionStageName?: string; + /** Executions stage states allow the same set of values as JobState. */ + executionStageState?: string; + } + interface ExecutionStageSummary { + /** Collections produced and consumed by component transforms of this stage. */ + componentSource?: ComponentSource[]; + /** Transforms that comprise this execution stage. */ + componentTransform?: ComponentTransform[]; + /** Dataflow service generated id for this stage. */ + id?: string; + /** Input sources for this stage. */ + inputSource?: StageSource[]; + /** Type of tranform this stage is executing. */ + kind?: string; + /** Dataflow service generated name for this stage. */ + name?: string; + /** Output sources for this stage. */ + outputSource?: StageSource[]; + } + interface FailedLocation { + /** The name of the failed location. */ + name?: string; + } + interface FlattenInstruction { + /** Describes the inputs to the flatten instruction. */ + inputs?: InstructionInput[]; + } + interface FloatingPointList { + /** Elements of the list. */ + elements?: number[]; + } + interface FloatingPointMean { + /** The number of values being aggregated. */ + count?: SplitInt64; + /** The sum of all values being aggregated. */ + sum?: number; + } + interface GetDebugConfigRequest { + /** + * The internal component id for which debug configuration is + * requested. + */ + componentId?: string; + /** The location which contains the job specified by job_id. */ + location?: string; + /** The worker id, i.e., VM hostname. */ + workerId?: string; + } + interface GetDebugConfigResponse { + /** The encoded debug configuration for the requested component. */ + config?: string; + } + interface GetTemplateResponse { + /** + * The template metadata describing the template name, available + * parameters, etc. + */ + metadata?: TemplateMetadata; + /** + * The status of the get template request. Any problems with the + * request will be indicated in the error_details. + */ + status?: Status; + } + interface Histogram { + /** + * Counts of values in each bucket. For efficiency, prefix and trailing + * buckets with count = 0 are elided. Buckets can store the full range of + * values of an unsigned long, with ULLONG_MAX falling into the 59th bucket + * with range [1e19, 2e19). + */ + bucketCounts?: string[]; + /** + * Starting index of first stored bucket. The non-inclusive upper-bound of + * the ith bucket is given by: + * pow(10,(i-first_bucket_offset)/3) * (1,2,5)[(i-first_bucket_offset)%3] + */ + firstBucketOffset?: number; + } + interface InstructionInput { + /** The output index (origin zero) within the producer. */ + outputNum?: number; + /** + * The index (origin zero) of the parallel instruction that produces + * the output to be consumed by this input. This index is relative + * to the list of instructions in this input's instruction's + * containing MapTask. + */ + producerInstructionIndex?: number; + } + interface InstructionOutput { + /** The codec to use to encode data being written via this output. */ + codec?: Record; + /** The user-provided name of this output. */ + name?: string; + /** + * For system-generated byte and mean byte metrics, certain instructions + * should only report the key size. + */ + onlyCountKeyBytes?: boolean; + /** + * For system-generated byte and mean byte metrics, certain instructions + * should only report the value size. + */ + onlyCountValueBytes?: boolean; + /** + * System-defined name for this output in the original workflow graph. + * Outputs that do not contribute to an original instruction do not set this. + */ + originalName?: string; + /** + * System-defined name of this output. + * Unique across the workflow. + */ + systemName?: string; + } + interface IntegerList { + /** Elements of the list. */ + elements?: SplitInt64[]; + } + interface IntegerMean { + /** The number of values being aggregated. */ + count?: SplitInt64; + /** The sum of all values being aggregated. */ + sum?: SplitInt64; + } + interface Job { + /** + * The client's unique identifier of the job, re-used across retried attempts. + * If this field is set, the service will ensure its uniqueness. + * The request to create a job will fail if the service has knowledge of a + * previously submitted job with the same client's ID and job name. + * The caller may use this field to ensure idempotence of job + * creation across retried attempts to create a job. + * By default, the field is empty and, in that case, the service ignores it. + */ + clientRequestId?: string; + /** + * The timestamp when the job was initially created. Immutable and set by the + * Cloud Dataflow service. + */ + createTime?: string; + /** + * The current state of the job. + * + * Jobs are created in the `JOB_STATE_STOPPED` state unless otherwise + * specified. + * + * A job in the `JOB_STATE_RUNNING` state may asynchronously enter a + * terminal state. After a job has reached a terminal state, no + * further state updates may be made. + * + * This field may be mutated by the Cloud Dataflow service; + * callers cannot mutate it. + */ + currentState?: string; + /** The timestamp associated with the current state. */ + currentStateTime?: string; + /** The environment for the job. */ + environment?: Environment; + /** Deprecated. */ + executionInfo?: JobExecutionInfo; + /** + * The unique ID of this job. + * + * This field is set by the Cloud Dataflow service when the Job is + * created, and is immutable for the life of the job. + */ + id?: string; + /** + * User-defined labels for this job. + * + * The labels map can contain no more than 64 entries. Entries of the labels + * map are UTF8 strings that comply with the following restrictions: + * + * * Keys must conform to regexp: \p{Ll}\p{Lo}{0,62} + * * Values must conform to regexp: [\p{Ll}\p{Lo}\p{N}_-]{0,63} + * * Both keys and values are additionally constrained to be <= 128 bytes in + * size. + */ + labels?: Record; + /** The location that contains this job. */ + location?: string; + /** + * The user-specified Cloud Dataflow job name. + * + * Only one Job with a given name may exist in a project at any + * given time. If a caller attempts to create a Job with the same + * name as an already-existing Job, the attempt returns the + * existing Job. + * + * The name must match the regular expression + * `[a-z]([-a-z0-9]{0,38}[a-z0-9])?` + */ + name?: string; + /** + * Preliminary field: The format of this data may change at any time. + * A description of the user pipeline and stages through which it is executed. + * Created by Cloud Dataflow service. Only retrieved with + * JOB_VIEW_DESCRIPTION or JOB_VIEW_ALL. + */ + pipelineDescription?: PipelineDescription; + /** The ID of the Cloud Platform project that the job belongs to. */ + projectId?: string; + /** + * If this job is an update of an existing job, this field is the job ID + * of the job it replaced. + * + * When sending a `CreateJobRequest`, you can update a job by specifying it + * here. The job named here is stopped, and its intermediate state is + * transferred to this job. + */ + replaceJobId?: string; + /** + * If another job is an update of this job (and thus, this job is in + * `JOB_STATE_UPDATED`), this field contains the ID of that job. + */ + replacedByJobId?: string; + /** + * The job's requested state. + * + * `UpdateJob` may be used to switch between the `JOB_STATE_STOPPED` and + * `JOB_STATE_RUNNING` states, by setting requested_state. `UpdateJob` may + * also be used to directly set a job's requested state to + * `JOB_STATE_CANCELLED` or `JOB_STATE_DONE`, irrevocably terminating the + * job if it has not already reached a terminal state. + */ + requestedState?: string; + /** + * This field may be mutated by the Cloud Dataflow service; + * callers cannot mutate it. + */ + stageStates?: ExecutionStageState[]; + /** The top-level steps that constitute the entire job. */ + steps?: Step[]; + /** + * A set of files the system should be aware of that are used + * for temporary storage. These temporary files will be + * removed on job completion. + * No duplicates are allowed. + * No file patterns are supported. + * + * The supported files are: + * + * Google Cloud Storage: + * + * storage.googleapis.com/{bucket}/{object} + * bucket.storage.googleapis.com/{object} + */ + tempFiles?: string[]; + /** + * The map of transform name prefixes of the job to be replaced to the + * corresponding name prefixes of the new job. + */ + transformNameMapping?: Record; + /** The type of Cloud Dataflow job. */ + type?: string; + } + interface JobExecutionInfo { + /** A mapping from each stage to the information about that stage. */ + stages?: Record; + } + interface JobExecutionStageInfo { + /** + * The steps associated with the execution stage. + * Note that stages may have several steps, and that a given step + * might be run by more than one stage. + */ + stepName?: string[]; + } + interface JobMessage { + /** Deprecated. */ + id?: string; + /** Importance level of the message. */ + messageImportance?: string; + /** The text of the message. */ + messageText?: string; + /** The timestamp of the message. */ + time?: string; + } + interface JobMetrics { + /** Timestamp as of which metric values are current. */ + metricTime?: string; + /** All metrics for this job. */ + metrics?: MetricUpdate[]; + } + interface KeyRangeDataDiskAssignment { + /** + * The name of the data disk where data for this range is stored. + * This name is local to the Google Cloud Platform project and uniquely + * identifies the disk within that project, for example + * "myproject-1014-104817-4c2-harness-0-disk-1". + */ + dataDisk?: string; + /** The end (exclusive) of the key range. */ + end?: string; + /** The start (inclusive) of the key range. */ + start?: string; + } + interface KeyRangeLocation { + /** + * The name of the data disk where data for this range is stored. + * This name is local to the Google Cloud Platform project and uniquely + * identifies the disk within that project, for example + * "myproject-1014-104817-4c2-harness-0-disk-1". + */ + dataDisk?: string; + /** + * The physical location of this range assignment to be used for + * streaming computation cross-worker message delivery. + */ + deliveryEndpoint?: string; + /** + * DEPRECATED. The location of the persistent state for this range, as a + * persistent directory in the worker local filesystem. + */ + deprecatedPersistentDirectory?: string; + /** The end (exclusive) of the key range. */ + end?: string; + /** The start (inclusive) of the key range. */ + start?: string; + } + interface LaunchTemplateParameters { + /** The runtime environment for the job. */ + environment?: RuntimeEnvironment; + /** Required. The job name to use for the created job. */ + jobName?: string; + /** The runtime parameters to pass to the job. */ + parameters?: Record; + } + interface LaunchTemplateResponse { + /** + * The job that was launched, if the request was not a dry run and + * the job was successfully launched. + */ + job?: Job; + } + interface LeaseWorkItemRequest { + /** The current timestamp at the worker. */ + currentWorkerTime?: string; + /** The location which contains the WorkItem's job. */ + location?: string; + /** The initial lease period. */ + requestedLeaseDuration?: string; + /** Filter for WorkItem type. */ + workItemTypes?: string[]; + /** + * Worker capabilities. WorkItems might be limited to workers with specific + * capabilities. + */ + workerCapabilities?: string[]; + /** + * Identifies the worker leasing work -- typically the ID of the + * virtual machine running the worker. + */ + workerId?: string; + } + interface LeaseWorkItemResponse { + /** A list of the leased WorkItems. */ + workItems?: WorkItem[]; + } + interface ListJobMessagesResponse { + /** Autoscaling events in ascending timestamp order. */ + autoscalingEvents?: AutoscalingEvent[]; + /** Messages in ascending timestamp order. */ + jobMessages?: JobMessage[]; + /** The token to obtain the next page of results if there are more. */ + nextPageToken?: string; + } + interface ListJobsResponse { + /** Zero or more messages describing locations that failed to respond. */ + failedLocation?: FailedLocation[]; + /** A subset of the requested job information. */ + jobs?: Job[]; + /** Set if there may be more results than fit in this response. */ + nextPageToken?: string; + } + interface MapTask { + /** The instructions in the MapTask. */ + instructions?: ParallelInstruction[]; + /** + * System-defined name of the stage containing this MapTask. + * Unique across the workflow. + */ + stageName?: string; + /** + * System-defined name of this MapTask. + * Unique across the workflow. + */ + systemName?: string; + } + interface MetricShortId { + /** + * The index of the corresponding metric in + * the ReportWorkItemStatusRequest. Required. + */ + metricIndex?: number; + /** The service-generated short identifier for the metric. */ + shortId?: string; + } + interface MetricStructuredName { + /** + * Zero or more labeled fields which identify the part of the job this + * metric is associated with, such as the name of a step or collection. + * + * For example, built-in counters associated with steps will have + * context['step'] = . Counters associated with PCollections + * in the SDK will have context['pcollection'] = . + */ + context?: Record; + /** Worker-defined metric name. */ + name?: string; + /** + * Origin (namespace) of metric name. May be blank for user-define metrics; + * will be "dataflow" for metrics defined by the Dataflow service or SDK. + */ + origin?: string; + } + interface MetricUpdate { + /** + * True if this metric is reported as the total cumulative aggregate + * value accumulated since the worker started working on this WorkItem. + * By default this is false, indicating that this metric is reported + * as a delta that is not associated with any WorkItem. + */ + cumulative?: boolean; + /** A struct value describing properties of a distribution of numeric values. */ + distribution?: any; + /** + * Worker-computed aggregate value for internal use by the Dataflow + * service. + */ + internal?: any; + /** + * Metric aggregation kind. The possible metric aggregation kinds are + * "Sum", "Max", "Min", "Mean", "Set", "And", "Or", and "Distribution". + * The specified aggregation kind is case-insensitive. + * + * If omitted, this is not an aggregated value but instead + * a single metric sample value. + */ + kind?: string; + /** + * Worker-computed aggregate value for the "Mean" aggregation kind. + * This holds the count of the aggregated values and is used in combination + * with mean_sum above to obtain the actual mean aggregate value. + * The only possible value type is Long. + */ + meanCount?: any; + /** + * Worker-computed aggregate value for the "Mean" aggregation kind. + * This holds the sum of the aggregated values and is used in combination + * with mean_count below to obtain the actual mean aggregate value. + * The only possible value types are Long and Double. + */ + meanSum?: any; + /** Name of the metric. */ + name?: MetricStructuredName; + /** + * Worker-computed aggregate value for aggregation kinds "Sum", "Max", "Min", + * "And", and "Or". The possible value types are Long, Double, and Boolean. + */ + scalar?: any; + /** + * Worker-computed aggregate value for the "Set" aggregation kind. The only + * possible value type is a list of Values whose type can be Long, Double, + * or String, according to the metric's type. All Values in the list must + * be of the same type. + */ + set?: any; + /** + * Timestamp associated with the metric value. Optional when workers are + * reporting work progress; it will be filled in responses from the + * metrics API. + */ + updateTime?: string; + } + interface MountedDataDisk { + /** + * The name of the data disk. + * This name is local to the Google Cloud Platform project and uniquely + * identifies the disk within that project, for example + * "myproject-1014-104817-4c2-harness-0-disk-1". + */ + dataDisk?: string; + } + interface MultiOutputInfo { + /** + * The id of the tag the user code will emit to this output by; this + * should correspond to the tag of some SideInputInfo. + */ + tag?: string; + } + interface NameAndKind { + /** Counter aggregation kind. */ + kind?: string; + /** Name of the counter. */ + name?: string; + } + interface Package { + /** + * The resource to read the package from. The supported resource type is: + * + * Google Cloud Storage: + * + * storage.googleapis.com/{bucket} + * bucket.storage.googleapis.com/ + */ + location?: string; + /** The name of the package. */ + name?: string; + } + interface ParDoInstruction { + /** The input. */ + input?: InstructionInput; + /** Information about each of the outputs, if user_fn is a MultiDoFn. */ + multiOutputInfos?: MultiOutputInfo[]; + /** The number of outputs. */ + numOutputs?: number; + /** Zero or more side inputs. */ + sideInputs?: SideInputInfo[]; + /** The user function to invoke. */ + userFn?: Record; + } + interface ParallelInstruction { + /** Additional information for Flatten instructions. */ + flatten?: FlattenInstruction; + /** User-provided name of this operation. */ + name?: string; + /** System-defined name for the operation in the original workflow graph. */ + originalName?: string; + /** Describes the outputs of the instruction. */ + outputs?: InstructionOutput[]; + /** Additional information for ParDo instructions. */ + parDo?: ParDoInstruction; + /** Additional information for PartialGroupByKey instructions. */ + partialGroupByKey?: PartialGroupByKeyInstruction; + /** Additional information for Read instructions. */ + read?: ReadInstruction; + /** + * System-defined name of this operation. + * Unique across the workflow. + */ + systemName?: string; + /** Additional information for Write instructions. */ + write?: WriteInstruction; + } + interface Parameter { + /** Key or name for this parameter. */ + key?: string; + /** Value for this parameter. */ + value?: any; + } + interface ParameterMetadata { + /** Required. The help text to display for the parameter. */ + helpText?: string; + /** Optional. Whether the parameter is optional. Defaults to false. */ + isOptional?: boolean; + /** Required. The label to display for the parameter. */ + label?: string; + /** Required. The name of the parameter. */ + name?: string; + /** Optional. Regexes that the parameter must match. */ + regexes?: string[]; + } + interface PartialGroupByKeyInstruction { + /** Describes the input to the partial group-by-key instruction. */ + input?: InstructionInput; + /** The codec to use for interpreting an element in the input PTable. */ + inputElementCodec?: Record; + /** + * If this instruction includes a combining function this is the name of the + * intermediate store between the GBK and the CombineValues. + */ + originalCombineValuesInputStoreName?: string; + /** + * If this instruction includes a combining function, this is the name of the + * CombineValues instruction lifted into this instruction. + */ + originalCombineValuesStepName?: string; + /** Zero or more side inputs. */ + sideInputs?: SideInputInfo[]; + /** The value combining function to invoke. */ + valueCombiningFn?: Record; + } + interface PipelineDescription { + /** Pipeline level display data. */ + displayData?: DisplayData[]; + /** Description of each stage of execution of the pipeline. */ + executionPipelineStage?: ExecutionStageSummary[]; + /** Description of each transform in the pipeline and collections between them. */ + originalPipelineTransform?: TransformSummary[]; + } + interface Position { + /** Position is a byte offset. */ + byteOffset?: string; + /** CloudPosition is a concat position. */ + concatPosition?: ConcatPosition; + /** + * Position is past all other positions. Also useful for the end + * position of an unbounded range. + */ + end?: boolean; + /** Position is a string key, ordered lexicographically. */ + key?: string; + /** Position is a record index. */ + recordIndex?: string; + /** + * CloudPosition is a base64 encoded BatchShufflePosition (with FIXED + * sharding). + */ + shufflePosition?: string; + } + interface PubsubLocation { + /** Indicates whether the pipeline allows late-arriving data. */ + dropLateData?: boolean; + /** + * If set, contains a pubsub label from which to extract record ids. + * If left empty, record deduplication will be strictly best effort. + */ + idLabel?: string; + /** + * A pubsub subscription, in the form of + * "pubsub.googleapis.com/subscriptions//" + */ + subscription?: string; + /** + * If set, contains a pubsub label from which to extract record timestamps. + * If left empty, record timestamps will be generated upon arrival. + */ + timestampLabel?: string; + /** + * A pubsub topic, in the form of + * "pubsub.googleapis.com/topics//" + */ + topic?: string; + /** + * If set, specifies the pubsub subscription that will be used for tracking + * custom time timestamps for watermark estimation. + */ + trackingSubscription?: string; + /** If true, then the client has requested to get pubsub attributes. */ + withAttributes?: boolean; + } + interface ReadInstruction { + /** The source to read from. */ + source?: Source; + } + interface ReportWorkItemStatusRequest { + /** The current timestamp at the worker. */ + currentWorkerTime?: string; + /** The location which contains the WorkItem's job. */ + location?: string; + /** + * The order is unimportant, except that the order of the + * WorkItemServiceState messages in the ReportWorkItemStatusResponse + * corresponds to the order of WorkItemStatus messages here. + */ + workItemStatuses?: WorkItemStatus[]; + /** + * The ID of the worker reporting the WorkItem status. If this + * does not match the ID of the worker which the Dataflow service + * believes currently has the lease on the WorkItem, the report + * will be dropped (with an error response). + */ + workerId?: string; + } + interface ReportWorkItemStatusResponse { + /** + * A set of messages indicating the service-side state for each + * WorkItem whose status was reported, in the same order as the + * WorkItemStatus messages in the ReportWorkItemStatusRequest which + * resulting in this response. + */ + workItemServiceStates?: WorkItemServiceState[]; + } + interface ReportedParallelism { + /** + * Specifies whether the parallelism is infinite. If true, "value" is + * ignored. + * Infinite parallelism means the service will assume that the work item + * can always be split into more non-empty work items by dynamic splitting. + * This is a work-around for lack of support for infinity by the current + * JSON-based Java RPC stack. + */ + isInfinite?: boolean; + /** Specifies the level of parallelism in case it is finite. */ + value?: number; + } + interface ResourceUtilizationReport { + /** CPU utilization samples. */ + cpuTime?: CPUTime[]; + } + interface RuntimeEnvironment { + /** + * Whether to bypass the safety checks for the job's temporary directory. + * Use with caution. + */ + bypassTempDirValidation?: boolean; + /** + * The machine type to use for the job. Defaults to the value from the + * template if not specified. + */ + machineType?: string; + /** + * The maximum number of Google Compute Engine instances to be made + * available to your pipeline during execution, from 1 to 1000. + */ + maxWorkers?: number; + /** The email address of the service account to run the job as. */ + serviceAccountEmail?: string; + /** + * The Cloud Storage path to use for temporary files. + * Must be a valid Cloud Storage URL, beginning with `gs://`. + */ + tempLocation?: string; + /** + * The Compute Engine [availability + * zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones) + * for launching worker instances to run your pipeline. + */ + zone?: string; + } + interface SendDebugCaptureRequest { + /** The internal component id for which debug information is sent. */ + componentId?: string; + /** The encoded debug information. */ + data?: string; + /** The location which contains the job specified by job_id. */ + location?: string; + /** The worker id, i.e., VM hostname. */ + workerId?: string; + } + interface SendWorkerMessagesRequest { + /** The location which contains the job */ + location?: string; + /** The WorkerMessages to send. */ + workerMessages?: WorkerMessage[]; + } + interface SendWorkerMessagesResponse { + /** The servers response to the worker messages. */ + workerMessageResponses?: WorkerMessageResponse[]; + } + interface SeqMapTask { + /** Information about each of the inputs. */ + inputs?: SideInputInfo[]; + /** The user-provided name of the SeqDo operation. */ + name?: string; + /** Information about each of the outputs. */ + outputInfos?: SeqMapTaskOutputInfo[]; + /** + * System-defined name of the stage containing the SeqDo operation. + * Unique across the workflow. + */ + stageName?: string; + /** + * System-defined name of the SeqDo operation. + * Unique across the workflow. + */ + systemName?: string; + /** The user function to invoke. */ + userFn?: Record; + } + interface SeqMapTaskOutputInfo { + /** The sink to write the output value to. */ + sink?: Sink; + /** The id of the TupleTag the user code will tag the output value by. */ + tag?: string; + } + interface ShellTask { + /** The shell command to run. */ + command?: string; + /** Exit code for the task. */ + exitCode?: number; + } + interface SideInputId { + /** The step that receives and usually consumes this side input. */ + declaringStepName?: string; + /** The index of the side input, from the list of non_parallel_inputs. */ + inputIndex?: number; + } + interface SideInputInfo { + /** How to interpret the source element(s) as a side input value. */ + kind?: Record; + /** + * The source(s) to read element(s) from to get the value of this side input. + * If more than one source, then the elements are taken from the + * sources, in the specified order if order matters. + * At least one source is required. + */ + sources?: Source[]; + /** + * The id of the tag the user code will access this side input by; + * this should correspond to the tag of some MultiOutputInfo. + */ + tag?: string; + } + interface Sink { + /** The codec to use to encode data written to the sink. */ + codec?: Record; + /** The sink to write to, plus its parameters. */ + spec?: Record; + } + interface Source { + /** + * While splitting, sources may specify the produced bundles + * as differences against another source, in order to save backend-side + * memory and allow bigger jobs. For details, see SourceSplitRequest. + * To support this use case, the full set of parameters of the source + * is logically obtained by taking the latest explicitly specified value + * of each parameter in the order: + * base_specs (later items win), spec (overrides anything in base_specs). + */ + baseSpecs?: Array>; + /** The codec to use to decode data read from the source. */ + codec?: Record; + /** + * Setting this value to true hints to the framework that the source + * doesn't need splitting, and using SourceSplitRequest on it would + * yield SOURCE_SPLIT_OUTCOME_USE_CURRENT. + * + * E.g. a file splitter may set this to true when splitting a single file + * into a set of byte ranges of appropriate size, and set this + * to false when splitting a filepattern into individual files. + * However, for efficiency, a file splitter may decide to produce + * file subranges directly from the filepattern to avoid a splitting + * round-trip. + * + * See SourceSplitRequest for an overview of the splitting process. + * + * This field is meaningful only in the Source objects populated + * by the user (e.g. when filling in a DerivedSource). + * Source objects supplied by the framework to the user don't have + * this field populated. + */ + doesNotNeedSplitting?: boolean; + /** + * Optionally, metadata for this source can be supplied right away, + * avoiding a SourceGetMetadataOperation roundtrip + * (see SourceOperationRequest). + * + * This field is meaningful only in the Source objects populated + * by the user (e.g. when filling in a DerivedSource). + * Source objects supplied by the framework to the user don't have + * this field populated. + */ + metadata?: SourceMetadata; + /** The source to read from, plus its parameters. */ + spec?: Record; + } + interface SourceFork { + /** DEPRECATED */ + primary?: SourceSplitShard; + /** DEPRECATED */ + primarySource?: DerivedSource; + /** DEPRECATED */ + residual?: SourceSplitShard; + /** DEPRECATED */ + residualSource?: DerivedSource; + } + interface SourceGetMetadataRequest { + /** Specification of the source whose metadata should be computed. */ + source?: Source; + } + interface SourceGetMetadataResponse { + /** The computed metadata. */ + metadata?: SourceMetadata; + } + interface SourceMetadata { + /** + * An estimate of the total size (in bytes) of the data that would be + * read from this source. This estimate is in terms of external storage + * size, before any decompression or other processing done by the reader. + */ + estimatedSizeBytes?: string; + /** + * Specifies that the size of this source is known to be infinite + * (this is a streaming source). + */ + infinite?: boolean; + /** + * Whether this source is known to produce key/value pairs with + * the (encoded) keys in lexicographically sorted order. + */ + producesSortedKeys?: boolean; + } + interface SourceOperationRequest { + /** Information about a request to get metadata about a source. */ + getMetadata?: SourceGetMetadataRequest; + /** Information about a request to split a source. */ + split?: SourceSplitRequest; + } + interface SourceOperationResponse { + /** A response to a request to get metadata about a source. */ + getMetadata?: SourceGetMetadataResponse; + /** A response to a request to split a source. */ + split?: SourceSplitResponse; + } + interface SourceSplitOptions { + /** + * The source should be split into a set of bundles where the estimated size + * of each is approximately this many bytes. + */ + desiredBundleSizeBytes?: string; + /** DEPRECATED in favor of desired_bundle_size_bytes. */ + desiredShardSizeBytes?: string; + } + interface SourceSplitRequest { + /** Hints for tuning the splitting process. */ + options?: SourceSplitOptions; + /** Specification of the source to be split. */ + source?: Source; + } + interface SourceSplitResponse { + /** + * If outcome is SPLITTING_HAPPENED, then this is a list of bundles + * into which the source was split. Otherwise this field is ignored. + * This list can be empty, which means the source represents an empty input. + */ + bundles?: DerivedSource[]; + /** + * Indicates whether splitting happened and produced a list of bundles. + * If this is USE_CURRENT_SOURCE_AS_IS, the current source should + * be processed "as is" without splitting. "bundles" is ignored in this case. + * If this is SPLITTING_HAPPENED, then "bundles" contains a list of + * bundles into which the source was split. + */ + outcome?: string; + /** DEPRECATED in favor of bundles. */ + shards?: SourceSplitShard[]; + } + interface SourceSplitShard { + /** DEPRECATED */ + derivationMode?: string; + /** DEPRECATED */ + source?: Source; + } + interface SplitInt64 { + /** The high order bits, including the sign: n >> 32. */ + highBits?: number; + /** The low order bits: n & 0xffffffff. */ + lowBits?: number; + } + interface StageSource { + /** Dataflow service generated name for this source. */ + name?: string; + /** + * User name for the original user transform or collection with which this + * source is most closely associated. + */ + originalTransformOrCollection?: string; + /** Size of the source, if measurable. */ + sizeBytes?: string; + /** Human-readable name for this source; may be user or system generated. */ + userName?: string; + } + interface StateFamilyConfig { + /** If true, this family corresponds to a read operation. */ + isRead?: boolean; + /** The state family value. */ + stateFamily?: string; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface Step { + /** The kind of step in the Cloud Dataflow job. */ + kind?: string; + /** + * The name that identifies the step. This must be unique for each + * step with respect to all other steps in the Cloud Dataflow job. + */ + name?: string; + /** + * Named properties associated with the step. Each kind of + * predefined step has its own required set of properties. + * Must be provided on Create. Only retrieved with JOB_VIEW_ALL. + */ + properties?: Record; + } + interface StreamLocation { + /** The stream is a custom source. */ + customSourceLocation?: CustomSourceLocation; + /** The stream is a pubsub stream. */ + pubsubLocation?: PubsubLocation; + /** The stream is a streaming side input. */ + sideInputLocation?: StreamingSideInputLocation; + /** + * The stream is part of another computation within the current + * streaming Dataflow job. + */ + streamingStageLocation?: StreamingStageLocation; + } + interface StreamingComputationConfig { + /** Unique identifier for this computation. */ + computationId?: string; + /** Instructions that comprise the computation. */ + instructions?: ParallelInstruction[]; + /** Stage name of this computation. */ + stageName?: string; + /** System defined name for this computation. */ + systemName?: string; + } + interface StreamingComputationRanges { + /** The ID of the computation. */ + computationId?: string; + /** Data disk assignments for ranges from this computation. */ + rangeAssignments?: KeyRangeDataDiskAssignment[]; + } + interface StreamingComputationTask { + /** Contains ranges of a streaming computation this task should apply to. */ + computationRanges?: StreamingComputationRanges[]; + /** Describes the set of data disks this task should apply to. */ + dataDisks?: MountedDataDisk[]; + /** A type of streaming computation task. */ + taskType?: string; + } + interface StreamingConfigTask { + /** Set of computation configuration information. */ + streamingComputationConfigs?: StreamingComputationConfig[]; + /** Map from user step names to state families. */ + userStepToStateFamilyNameMap?: Record; + /** + * If present, the worker must use this endpoint to communicate with Windmill + * Service dispatchers, otherwise the worker must continue to use whatever + * endpoint it had been using. + */ + windmillServiceEndpoint?: string; + /** + * If present, the worker must use this port to communicate with Windmill + * Service dispatchers. Only applicable when windmill_service_endpoint is + * specified. + */ + windmillServicePort?: string; + } + interface StreamingSetupTask { + /** The user has requested drain. */ + drain?: boolean; + /** + * The TCP port on which the worker should listen for messages from + * other streaming computation workers. + */ + receiveWorkPort?: number; + /** The global topology of the streaming Dataflow job. */ + streamingComputationTopology?: TopologyConfig; + /** + * The TCP port used by the worker to communicate with the Dataflow + * worker harness. + */ + workerHarnessPort?: number; + } + interface StreamingSideInputLocation { + /** Identifies the state family where this side input is stored. */ + stateFamily?: string; + /** Identifies the particular side input within the streaming Dataflow job. */ + tag?: string; + } + interface StreamingStageLocation { + /** + * Identifies the particular stream within the streaming Dataflow + * job. + */ + streamId?: string; + } + interface StringList { + /** Elements of the list. */ + elements?: string[]; + } + interface StructuredMessage { + /** + * Idenfier for this message type. Used by external systems to + * internationalize or personalize message. + */ + messageKey?: string; + /** Human-readable version of message. */ + messageText?: string; + /** The structured data associated with this message. */ + parameters?: Parameter[]; + } + interface TaskRunnerSettings { + /** Whether to also send taskrunner log info to stderr. */ + alsologtostderr?: boolean; + /** The location on the worker for task-specific subdirectories. */ + baseTaskDir?: string; + /** + * The base URL for the taskrunner to use when accessing Google Cloud APIs. + * + * When workers access Google Cloud APIs, they logically do so via + * relative URLs. If this field is specified, it supplies the base + * URL to use for resolving these relative URLs. The normative + * algorithm used is defined by RFC 1808, "Relative Uniform Resource + * Locators". + * + * If not specified, the default value is "http://www.googleapis.com/" + */ + baseUrl?: string; + /** The file to store preprocessing commands in. */ + commandlinesFileName?: string; + /** Whether to continue taskrunner if an exception is hit. */ + continueOnException?: boolean; + /** The API version of endpoint, e.g. "v1b3" */ + dataflowApiVersion?: string; + /** The command to launch the worker harness. */ + harnessCommand?: string; + /** The suggested backend language. */ + languageHint?: string; + /** The directory on the VM to store logs. */ + logDir?: string; + /** + * Whether to send taskrunner log info to Google Compute Engine VM serial + * console. + */ + logToSerialconsole?: boolean; + /** + * Indicates where to put logs. If this is not specified, the logs + * will not be uploaded. + * + * The supported resource type is: + * + * Google Cloud Storage: + * storage.googleapis.com/{bucket}/{object} + * bucket.storage.googleapis.com/{object} + */ + logUploadLocation?: string; + /** + * The OAuth2 scopes to be requested by the taskrunner in order to + * access the Cloud Dataflow API. + */ + oauthScopes?: string[]; + /** The settings to pass to the parallel worker harness. */ + parallelWorkerSettings?: WorkerSettings; + /** The streaming worker main class name. */ + streamingWorkerMainClass?: string; + /** + * The UNIX group ID on the worker VM to use for tasks launched by + * taskrunner; e.g. "wheel". + */ + taskGroup?: string; + /** + * The UNIX user ID on the worker VM to use for tasks launched by + * taskrunner; e.g. "root". + */ + taskUser?: string; + /** + * The prefix of the resources the taskrunner should use for + * temporary storage. + * + * The supported resource type is: + * + * Google Cloud Storage: + * storage.googleapis.com/{bucket}/{object} + * bucket.storage.googleapis.com/{object} + */ + tempStoragePrefix?: string; + /** The ID string of the VM. */ + vmId?: string; + /** The file to store the workflow in. */ + workflowFileName?: string; + } + interface TemplateMetadata { + /** Optional. A description of the template. */ + description?: string; + /** Required. The name of the template. */ + name?: string; + /** The parameters for the template. */ + parameters?: ParameterMetadata[]; + } + interface TopologyConfig { + /** The computations associated with a streaming Dataflow job. */ + computations?: ComputationTopology[]; + /** The disks assigned to a streaming Dataflow job. */ + dataDiskAssignments?: DataDiskAssignment[]; + /** The size (in bits) of keys that will be assigned to source messages. */ + forwardingKeyBits?: number; + /** Version number for persistent state. */ + persistentStateVersion?: number; + /** Maps user stage names to stable computation names. */ + userStageToComputationNameMap?: Record; + } + interface TransformSummary { + /** Transform-specific display data. */ + displayData?: DisplayData[]; + /** SDK generated id of this transform instance. */ + id?: string; + /** User names for all collection inputs to this transform. */ + inputCollectionName?: string[]; + /** Type of transform. */ + kind?: string; + /** User provided name for this transform instance. */ + name?: string; + /** User names for all collection outputs to this transform. */ + outputCollectionName?: string[]; + } + interface WorkItem { + /** Work item-specific configuration as an opaque blob. */ + configuration?: string; + /** Identifies this WorkItem. */ + id?: string; + /** The initial index to use when reporting the status of the WorkItem. */ + initialReportIndex?: string; + /** Identifies the workflow job this WorkItem belongs to. */ + jobId?: string; + /** Time when the lease on this Work will expire. */ + leaseExpireTime?: string; + /** Additional information for MapTask WorkItems. */ + mapTask?: MapTask; + /** + * Any required packages that need to be fetched in order to execute + * this WorkItem. + */ + packages?: Package[]; + /** Identifies the cloud project this WorkItem belongs to. */ + projectId?: string; + /** Recommended reporting interval. */ + reportStatusInterval?: string; + /** Additional information for SeqMapTask WorkItems. */ + seqMapTask?: SeqMapTask; + /** Additional information for ShellTask WorkItems. */ + shellTask?: ShellTask; + /** Additional information for source operation WorkItems. */ + sourceOperationTask?: SourceOperationRequest; + /** Additional information for StreamingComputationTask WorkItems. */ + streamingComputationTask?: StreamingComputationTask; + /** Additional information for StreamingConfigTask WorkItems. */ + streamingConfigTask?: StreamingConfigTask; + /** Additional information for StreamingSetupTask WorkItems. */ + streamingSetupTask?: StreamingSetupTask; + } + interface WorkItemServiceState { + /** + * Other data returned by the service, specific to the particular + * worker harness. + */ + harnessData?: Record; + /** Time at which the current lease will expire. */ + leaseExpireTime?: string; + /** + * The short ids that workers should use in subsequent metric updates. + * Workers should strive to use short ids whenever possible, but it is ok + * to request the short_id again if a worker lost track of it + * (e.g. if the worker is recovering from a crash). + * NOTE: it is possible that the response may have short ids for a subset + * of the metrics. + */ + metricShortId?: MetricShortId[]; + /** + * The index value to use for the next report sent by the worker. + * Note: If the report call fails for whatever reason, the worker should + * reuse this index for subsequent report attempts. + */ + nextReportIndex?: string; + /** New recommended reporting interval. */ + reportStatusInterval?: string; + /** + * The progress point in the WorkItem where the Dataflow service + * suggests that the worker truncate the task. + */ + splitRequest?: ApproximateSplitRequest; + /** DEPRECATED in favor of split_request. */ + suggestedStopPoint?: ApproximateProgress; + /** Obsolete, always empty. */ + suggestedStopPosition?: Position; + } + interface WorkItemStatus { + /** True if the WorkItem was completed (successfully or unsuccessfully). */ + completed?: boolean; + /** Worker output counters for this WorkItem. */ + counterUpdates?: CounterUpdate[]; + /** See documentation of stop_position. */ + dynamicSourceSplit?: DynamicSourceSplit; + /** + * Specifies errors which occurred during processing. If errors are + * provided, and completed = true, then the WorkItem is considered + * to have failed. + */ + errors?: Status[]; + /** DEPRECATED in favor of counter_updates. */ + metricUpdates?: MetricUpdate[]; + /** DEPRECATED in favor of reported_progress. */ + progress?: ApproximateProgress; + /** + * The report index. When a WorkItem is leased, the lease will + * contain an initial report index. When a WorkItem's status is + * reported to the system, the report should be sent with + * that report index, and the response will contain the index the + * worker should use for the next report. Reports received with + * unexpected index values will be rejected by the service. + * + * In order to preserve idempotency, the worker should not alter the + * contents of a report, even if the worker must submit the same + * report multiple times before getting back a response. The worker + * should not submit a subsequent report until the response for the + * previous report had been received from the service. + */ + reportIndex?: string; + /** The worker's progress through this WorkItem. */ + reportedProgress?: ApproximateReportedProgress; + /** Amount of time the worker requests for its lease. */ + requestedLeaseDuration?: string; + /** DEPRECATED in favor of dynamic_source_split. */ + sourceFork?: SourceFork; + /** + * If the work item represented a SourceOperationRequest, and the work + * is completed, contains the result of the operation. + */ + sourceOperationResponse?: SourceOperationResponse; + /** + * A worker may split an active map task in two parts, "primary" and + * "residual", continuing to process the primary part and returning the + * residual part into the pool of available work. + * This event is called a "dynamic split" and is critical to the dynamic + * work rebalancing feature. The two obtained sub-tasks are called + * "parts" of the split. + * The parts, if concatenated, must represent the same input as would + * be read by the current task if the split did not happen. + * The exact way in which the original task is decomposed into the two + * parts is specified either as a position demarcating them + * (stop_position), or explicitly as two DerivedSources, if this + * task consumes a user-defined source type (dynamic_source_split). + * + * The "current" task is adjusted as a result of the split: after a task + * with range [A, B) sends a stop_position update at C, its range is + * considered to be [A, C), e.g.: + * * Progress should be interpreted relative to the new range, e.g. + * "75% completed" means "75% of [A, C) completed" + * * The worker should interpret proposed_stop_position relative to the + * new range, e.g. "split at 68%" should be interpreted as + * "split at 68% of [A, C)". + * * If the worker chooses to split again using stop_position, only + * stop_positions in [A, C) will be accepted. + * * Etc. + * dynamic_source_split has similar semantics: e.g., if a task with + * source S splits using dynamic_source_split into {P, R} + * (where P and R must be together equivalent to S), then subsequent + * progress and proposed_stop_position should be interpreted relative + * to P, and in a potential subsequent dynamic_source_split into {P', R'}, + * P' and R' must be together equivalent to P, etc. + */ + stopPosition?: Position; + /** Total time the worker spent being throttled by external systems. */ + totalThrottlerWaitTimeSeconds?: number; + /** Identifies the WorkItem. */ + workItemId?: string; + } + interface WorkerHealthReport { + /** + * The pods running on the worker. See: + * http://kubernetes.io/v1.1/docs/api-reference/v1/definitions.html#_v1_pod + * + * This field is used by the worker to send the status of the indvidual + * containers running on each worker. + */ + pods?: Array>; + /** + * The interval at which the worker is sending health reports. + * The default value of 0 should be interpreted as the field is not being + * explicitly set by the worker. + */ + reportInterval?: string; + /** Whether the VM is healthy. */ + vmIsHealthy?: boolean; + /** The time the VM was booted. */ + vmStartupTime?: string; + } + interface WorkerHealthReportResponse { + /** + * A positive value indicates the worker should change its reporting interval + * to the specified value. + * + * The default value of zero means no change in report rate is requested by + * the server. + */ + reportInterval?: string; + } + interface WorkerMessage { + /** + * Labels are used to group WorkerMessages. + * For example, a worker_message about a particular container + * might have the labels: + * { "JOB_ID": "2015-04-22", + * "WORKER_ID": "wordcount-vm-2015…" + * "CONTAINER_TYPE": "worker", + * "CONTAINER_ID": "ac1234def"} + * Label tags typically correspond to Label enum values. However, for ease + * of development other strings can be used as tags. LABEL_UNSPECIFIED should + * not be used here. + */ + labels?: Record; + /** The timestamp of the worker_message. */ + time?: string; + /** The health of a worker. */ + workerHealthReport?: WorkerHealthReport; + /** A worker message code. */ + workerMessageCode?: WorkerMessageCode; + /** Resource metrics reported by workers. */ + workerMetrics?: ResourceUtilizationReport; + /** Shutdown notice by workers. */ + workerShutdownNotice?: WorkerShutdownNotice; + } + interface WorkerMessageCode { + /** + * The code is a string intended for consumption by a machine that identifies + * the type of message being sent. + * Examples: + * 1. "HARNESS_STARTED" might be used to indicate the worker harness has + * started. + * 2. "GCS_DOWNLOAD_ERROR" might be used to indicate an error downloading + * a GCS file as part of the boot process of one of the worker containers. + * + * This is a string and not an enum to make it easy to add new codes without + * waiting for an API change. + */ + code?: string; + /** + * Parameters contains specific information about the code. + * + * This is a struct to allow parameters of different types. + * + * Examples: + * 1. For a "HARNESS_STARTED" message parameters might provide the name + * of the worker and additional data like timing information. + * 2. For a "GCS_DOWNLOAD_ERROR" parameters might contain fields listing + * the GCS objects being downloaded and fields containing errors. + * + * In general complex data structures should be avoided. If a worker + * needs to send a specific and complicated data structure then please + * consider defining a new proto and adding it to the data oneof in + * WorkerMessageResponse. + * + * Conventions: + * Parameters should only be used for information that isn't typically passed + * as a label. + * hostname and other worker identifiers should almost always be passed + * as labels since they will be included on most messages. + */ + parameters?: Record; + } + interface WorkerMessageResponse { + /** The service's response to a worker's health report. */ + workerHealthReportResponse?: WorkerHealthReportResponse; + /** Service's response to reporting worker metrics (currently empty). */ + workerMetricsResponse?: any; + /** Service's response to shutdown notice (currently empty). */ + workerShutdownNoticeResponse?: any; + } + interface WorkerPool { + /** Settings for autoscaling of this WorkerPool. */ + autoscalingSettings?: AutoscalingSettings; + /** Data disks that are used by a VM in this workflow. */ + dataDisks?: Disk[]; + /** + * The default package set to install. This allows the service to + * select a default set of packages which are useful to worker + * harnesses written in a particular language. + */ + defaultPackageSet?: string; + /** + * Size of root disk for VMs, in GB. If zero or unspecified, the service will + * attempt to choose a reasonable default. + */ + diskSizeGb?: number; + /** Fully qualified source image for disks. */ + diskSourceImage?: string; + /** + * Type of root disk for VMs. If empty or unspecified, the service will + * attempt to choose a reasonable default. + */ + diskType?: string; + /** Configuration for VM IPs. */ + ipConfiguration?: string; + /** + * The kind of the worker pool; currently only `harness` and `shuffle` + * are supported. + */ + kind?: string; + /** + * Machine type (e.g. "n1-standard-1"). If empty or unspecified, the + * service will attempt to choose a reasonable default. + */ + machineType?: string; + /** Metadata to set on the Google Compute Engine VMs. */ + metadata?: Record; + /** + * Network to which VMs will be assigned. If empty or unspecified, + * the service will use the network "default". + */ + network?: string; + /** + * The number of threads per worker harness. If empty or unspecified, the + * service will choose a number of threads (according to the number of cores + * on the selected machine type for batch, or 1 by convention for streaming). + */ + numThreadsPerWorker?: number; + /** + * Number of Google Compute Engine workers in this pool needed to + * execute the job. If zero or unspecified, the service will + * attempt to choose a reasonable default. + */ + numWorkers?: number; + /** + * The action to take on host maintenance, as defined by the Google + * Compute Engine API. + */ + onHostMaintenance?: string; + /** Packages to be installed on workers. */ + packages?: Package[]; + /** Extra arguments for this worker pool. */ + poolArgs?: Record; + /** + * Subnetwork to which VMs will be assigned, if desired. Expected to be of + * the form "regions/REGION/subnetworks/SUBNETWORK". + */ + subnetwork?: string; + /** + * Settings passed through to Google Compute Engine workers when + * using the standard Dataflow task runner. Users should ignore + * this field. + */ + taskrunnerSettings?: TaskRunnerSettings; + /** + * Sets the policy for determining when to turndown worker pool. + * Allowed values are: `TEARDOWN_ALWAYS`, `TEARDOWN_ON_SUCCESS`, and + * `TEARDOWN_NEVER`. + * `TEARDOWN_ALWAYS` means workers are always torn down regardless of whether + * the job succeeds. `TEARDOWN_ON_SUCCESS` means workers are torn down + * if the job succeeds. `TEARDOWN_NEVER` means the workers are never torn + * down. + * + * If the workers are not torn down by the service, they will + * continue to run and use Google Compute Engine VM resources in the + * user's project until they are explicitly terminated by the user. + * Because of this, Google recommends using the `TEARDOWN_ALWAYS` + * policy except for small, manually supervised test jobs. + * + * If unknown or unspecified, the service will attempt to choose a reasonable + * default. + */ + teardownPolicy?: string; + /** + * Required. Docker container image that executes the Cloud Dataflow worker + * harness, residing in Google Container Registry. + */ + workerHarnessContainerImage?: string; + /** + * Zone to run the worker pools in. If empty or unspecified, the service + * will attempt to choose a reasonable default. + */ + zone?: string; + } + interface WorkerSettings { + /** + * The base URL for accessing Google Cloud APIs. + * + * When workers access Google Cloud APIs, they logically do so via + * relative URLs. If this field is specified, it supplies the base + * URL to use for resolving these relative URLs. The normative + * algorithm used is defined by RFC 1808, "Relative Uniform Resource + * Locators". + * + * If not specified, the default value is "http://www.googleapis.com/" + */ + baseUrl?: string; + /** Whether to send work progress updates to the service. */ + reportingEnabled?: boolean; + /** + * The Cloud Dataflow service path relative to the root URL, for example, + * "dataflow/v1b3/projects". + */ + servicePath?: string; + /** + * The Shuffle service path relative to the root URL, for example, + * "shuffle/v1beta1". + */ + shuffleServicePath?: string; + /** + * The prefix of the resources the system should use for temporary + * storage. + * + * The supported resource type is: + * + * Google Cloud Storage: + * + * storage.googleapis.com/{bucket}/{object} + * bucket.storage.googleapis.com/{object} + */ + tempStoragePrefix?: string; + /** The ID of the worker running this pipeline. */ + workerId?: string; + } + interface WorkerShutdownNotice { + /** + * The reason for the worker shutdown. + * Current possible values are: + * "UNKNOWN": shutdown reason is unknown. + * "PREEMPTION": shutdown reason is preemption. + * Other possible reasons may be added in the future. + */ + reason?: string; + } + interface WriteInstruction { + /** The input. */ + input?: InstructionInput; + /** The sink to write to. */ + sink?: Sink; + } + interface DebugResource { + /** Get encoded debug configuration for component. Not cacheable. */ + getConfig(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job id. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project id. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Send encoded debug capture data for component. */ + sendCapture(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job id. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project id. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + } + interface MessagesResource { + /** Request the job status. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Return only messages with timestamps < end_time. The default is now + * (i.e. return up to the latest messages available). + */ + endTime?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job to get messages about. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location which contains the job specified by job_id. */ + location?: string; + /** Filter to only get messages with importance >= level */ + minimumImportance?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * If specified, determines the maximum number of messages to + * return. If unspecified, the service may choose an appropriate + * default, or may return an arbitrarily large number of results. + */ + pageSize?: number; + /** + * If supplied, this should be the value of next_page_token returned + * by an earlier call. This will cause the next page of results to + * be returned. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** A project id. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * If specified, return only messages with timestamps >= start_time. + * The default is the job creation time (i.e. beginning of messages). + */ + startTime?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface WorkItemsResource { + /** Leases a dataflow WorkItem to run. */ + lease(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifies the workflow job this worker belongs to. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Identifies the project this worker belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Reports the status of dataflow WorkItems leased by a worker. */ + reportStatus(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job which the WorkItem is part of. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project which owns the WorkItem's job. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface JobsResource { + /** List the jobs of a project across all regions. */ + aggregated(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The kind of filter to use. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location that contains this job. */ + location?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * If there are many jobs, limit response to at most this many. + * The actual number of jobs returned will be the lesser of max_responses + * and an unspecified server-defined limit. + */ + pageSize?: number; + /** + * Set this to the 'next_page_token' field of a previous response + * to request additional results in a long list. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project which owns the jobs. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Level of information requested in response. Default is `JOB_VIEW_SUMMARY`. */ + view?: string; + }): Request; + /** Creates a Cloud Dataflow job. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location that contains this job. */ + location?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Deprecated. This field is now in the Job message. */ + replaceJobId?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** The level of information requested in response. */ + view?: string; + }): Request; + /** Gets the state of the specified Cloud Dataflow job. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job ID. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location that contains this job. */ + location?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** The level of information requested in response. */ + view?: string; + }): Request; + /** Request the job status. */ + getMetrics(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job to get messages for. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location which contains the job specified by job_id. */ + location?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** A project id. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Return only metric data that has changed since this time. + * Default is to return all information about all metrics for the job. + */ + startTime?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** List the jobs of a project in a given region. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The kind of filter to use. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location that contains this job. */ + location?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * If there are many jobs, limit response to at most this many. + * The actual number of jobs returned will be the lesser of max_responses + * and an unspecified server-defined limit. + */ + pageSize?: number; + /** + * Set this to the 'next_page_token' field of a previous response + * to request additional results in a long list. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project which owns the jobs. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Level of information requested in response. Default is `JOB_VIEW_SUMMARY`. */ + view?: string; + }): Request; + /** Updates the state of an existing Cloud Dataflow job. */ + update(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job ID. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location that contains this job. */ + location?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + debug: DebugResource; + messages: MessagesResource; + workItems: WorkItemsResource; + } + interface DebugResource { + /** Get encoded debug configuration for component. Not cacheable. */ + getConfig(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job id. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location which contains the job specified by job_id. */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project id. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Send encoded debug capture data for component. */ + sendCapture(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job id. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location which contains the job specified by job_id. */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project id. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + } + interface MessagesResource { + /** Request the job status. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * Return only messages with timestamps < end_time. The default is now + * (i.e. return up to the latest messages available). + */ + endTime?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job to get messages about. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location which contains the job specified by job_id. */ + location: string; + /** Filter to only get messages with importance >= level */ + minimumImportance?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * If specified, determines the maximum number of messages to + * return. If unspecified, the service may choose an appropriate + * default, or may return an arbitrarily large number of results. + */ + pageSize?: number; + /** + * If supplied, this should be the value of next_page_token returned + * by an earlier call. This will cause the next page of results to + * be returned. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** A project id. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * If specified, return only messages with timestamps >= start_time. + * The default is the job creation time (i.e. beginning of messages). + */ + startTime?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface WorkItemsResource { + /** Leases a dataflow WorkItem to run. */ + lease(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Identifies the workflow job this worker belongs to. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location which contains the WorkItem's job. */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Identifies the project this worker belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Reports the status of dataflow WorkItems leased by a worker. */ + reportStatus(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job which the WorkItem is part of. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location which contains the WorkItem's job. */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project which owns the WorkItem's job. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface JobsResource { + /** Creates a Cloud Dataflow job. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location that contains this job. */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Deprecated. This field is now in the Job message. */ + replaceJobId?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** The level of information requested in response. */ + view?: string; + }): Request; + /** Gets the state of the specified Cloud Dataflow job. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job ID. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location that contains this job. */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** The level of information requested in response. */ + view?: string; + }): Request; + /** Request the job status. */ + getMetrics(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job to get messages for. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location which contains the job specified by job_id. */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** A project id. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Return only metric data that has changed since this time. + * Default is to return all information about all metrics for the job. + */ + startTime?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** List the jobs of a project in a given region. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The kind of filter to use. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location that contains this job. */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * If there are many jobs, limit response to at most this many. + * The actual number of jobs returned will be the lesser of max_responses + * and an unspecified server-defined limit. + */ + pageSize?: number; + /** + * Set this to the 'next_page_token' field of a previous response + * to request additional results in a long list. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project which owns the jobs. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** Level of information requested in response. Default is `JOB_VIEW_SUMMARY`. */ + view?: string; + }): Request; + /** Updates the state of an existing Cloud Dataflow job. */ + update(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The job ID. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location that contains this job. */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + debug: DebugResource; + messages: MessagesResource; + workItems: WorkItemsResource; + } + interface TemplatesResource { + /** Creates a Cloud Dataflow job from a template. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location to which to direct the request. */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Get the template associated with a template. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Required. A Cloud Storage path to the template from which to + * create the job. + * Must be a valid Cloud Storage URL, beginning with `gs://`. + */ + gcsPath?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location to which to direct the request. */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** The view to retrieve. Defaults to METADATA_ONLY. */ + view?: string; + }): Request; + /** Launch a template. */ + launch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Required. A Cloud Storage path to the template from which to create + * the job. + * Must be valid Cloud Storage URL, beginning with 'gs://'. + */ + gcsPath?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location to which to direct the request. */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * If true, the request is validated but not actually executed. + * Defaults to false. + */ + validateOnly?: boolean; + }): Request; + } + interface LocationsResource { + /** Send a worker_message to the service. */ + workerMessages(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location which contains the job */ + location: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project to send the WorkerMessages to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + jobs: JobsResource; + templates: TemplatesResource; + } + interface TemplatesResource { + /** Creates a Cloud Dataflow job from a template. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Get the template associated with a template. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Required. A Cloud Storage path to the template from which to + * create the job. + * Must be a valid Cloud Storage URL, beginning with `gs://`. + */ + gcsPath?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location to which to direct the request. */ + location?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** The view to retrieve. Defaults to METADATA_ONLY. */ + view?: string; + }): Request; + /** Launch a template. */ + launch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Required. A Cloud Storage path to the template from which to create + * the job. + * Must be valid Cloud Storage URL, beginning with 'gs://'. + */ + gcsPath?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The location to which to direct the request. */ + location?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * If true, the request is validated but not actually executed. + * Defaults to false. + */ + validateOnly?: boolean; + }): Request; + } + interface ProjectsResource { + /** Send a worker_message to the service. */ + workerMessages(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project to send the WorkerMessages to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + jobs: JobsResource; + locations: LocationsResource; + templates: TemplatesResource; + } + } +} diff --git a/types/gapi.client.dataflow/readme.md b/types/gapi.client.dataflow/readme.md new file mode 100644 index 0000000000..d91dd9868b --- /dev/null +++ b/types/gapi.client.dataflow/readme.md @@ -0,0 +1,68 @@ +# TypeScript typings for Google Dataflow API v1b3 +Manages Google Cloud Dataflow projects on Google Cloud Platform. +For detailed description please check [documentation](https://cloud.google.com/dataflow). + +## Installing + +Install typings for Google Dataflow API: +``` +npm install @types/gapi.client.dataflow@v1b3 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('dataflow', 'v1b3', () => { + // now we can use gapi.client.dataflow + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View and manage your Google Compute Engine resources + 'https://www.googleapis.com/auth/compute', + + // View your Google Compute Engine resources + 'https://www.googleapis.com/auth/compute.readonly', + + // View your email address + 'https://www.googleapis.com/auth/userinfo.email', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Dataflow API resources: + +```typescript + +/* +Send a worker_message to the service. +*/ +await gapi.client.projects.workerMessages({ projectId: "projectId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.dataflow/tsconfig.json b/types/gapi.client.dataflow/tsconfig.json new file mode 100644 index 0000000000..08c1fced14 --- /dev/null +++ b/types/gapi.client.dataflow/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.dataflow-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.dataflow/tslint.json b/types/gapi.client.dataflow/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.dataflow/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.dataproc/gapi.client.dataproc-tests.ts b/types/gapi.client.dataproc/gapi.client.dataproc-tests.ts new file mode 100644 index 0000000000..b5408509e6 --- /dev/null +++ b/types/gapi.client.dataproc/gapi.client.dataproc-tests.ts @@ -0,0 +1,32 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('dataproc', 'v1', () => { + /** now we can use gapi.client.dataproc */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + } +}); diff --git a/types/gapi.client.dataproc/index.d.ts b/types/gapi.client.dataproc/index.d.ts new file mode 100644 index 0000000000..cc9f6fcb8f --- /dev/null +++ b/types/gapi.client.dataproc/index.d.ts @@ -0,0 +1,1225 @@ +// Type definitions for Google Google Cloud Dataproc API v1 1.0 +// Project: https://cloud.google.com/dataproc/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://dataproc.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Google Cloud Dataproc API v1 */ + function load(name: "dataproc", version: "v1"): PromiseLike; + function load(name: "dataproc", version: "v1", callback: () => any): void; + + const projects: dataproc.ProjectsResource; + + namespace dataproc { + interface AcceleratorConfig { + /** The number of the accelerator cards of this type exposed to this instance. */ + acceleratorCount?: number; + /** + * Full URL, partial URI, or short name of the accelerator type resource to expose to this instance. See Google Compute Engine AcceleratorTypes( + * /compute/docs/reference/beta/acceleratorTypes)Examples * + * https://www.googleapis.com/compute/beta/projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 * + * projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 * nvidia-tesla-k80 + */ + acceleratorTypeUri?: string; + } + interface Cluster { + /** Required. The cluster name. Cluster names within a project must be unique. Names of deleted clusters can be reused. */ + clusterName?: string; + /** Output-only. A cluster UUID (Unique Universal Identifier). Cloud Dataproc generates this value when it creates the cluster. */ + clusterUuid?: string; + /** Required. The cluster config. Note that Cloud Dataproc may set default values, and values may change when clusters are updated. */ + config?: ClusterConfig; + /** + * Optional. The labels to associate with this cluster. Label keys must contain 1 to 63 characters, and must conform to RFC 1035 + * (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035 + * (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be associated with a cluster. + */ + labels?: Record; + /** + * Contains cluster daemon metrics such as HDFS and YARN stats.Beta Feature: This report is available for testing purposes only. It may be changed before + * final release. + */ + metrics?: ClusterMetrics; + /** Required. The Google Cloud Platform project ID that the cluster belongs to. */ + projectId?: string; + /** Output-only. Cluster status. */ + status?: ClusterStatus; + /** Output-only. The previous cluster status. */ + statusHistory?: ClusterStatus[]; + } + interface ClusterConfig { + /** + * Optional. A Google Cloud Storage staging bucket used for sharing generated SSH keys and config. If you do not specify a staging bucket, Cloud Dataproc + * will determine an appropriate Cloud Storage location (US, ASIA, or EU) for your cluster's staging bucket according to the Google Compute Engine zone + * where your cluster is deployed, and then it will create and manage this project-level, per-location bucket for you. + */ + configBucket?: string; + /** Required. The shared Google Compute Engine config settings for all instances in a cluster. */ + gceClusterConfig?: GceClusterConfig; + /** + * Optional. Commands to execute on each node after config is completed. By default, executables are run on master and all worker nodes. You can test a + * node's role metadata to run an executable on a master or worker node, as shown below using curl (you can also use wget): + * ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role) + * if [[ "${ROLE}" == 'Master' ]]; then + * ... master specific actions ... + * else + * ... worker specific actions ... + * fi + */ + initializationActions?: NodeInitializationAction[]; + /** Optional. The Google Compute Engine config settings for the master instance in a cluster. */ + masterConfig?: InstanceGroupConfig; + /** Optional. The Google Compute Engine config settings for additional worker instances in a cluster. */ + secondaryWorkerConfig?: InstanceGroupConfig; + /** Optional. The config settings for software inside the cluster. */ + softwareConfig?: SoftwareConfig; + /** Optional. The Google Compute Engine config settings for worker instances in a cluster. */ + workerConfig?: InstanceGroupConfig; + } + interface ClusterMetrics { + /** The HDFS metrics. */ + hdfsMetrics?: Record; + /** The YARN metrics. */ + yarnMetrics?: Record; + } + interface ClusterOperationMetadata { + /** Output-only. Name of the cluster for the operation. */ + clusterName?: string; + /** Output-only. Cluster UUID for the operation. */ + clusterUuid?: string; + /** Output-only. Short description of operation. */ + description?: string; + /** Output-only. Labels associated with the operation */ + labels?: Record; + /** Output-only. The operation type. */ + operationType?: string; + /** Output-only. Current operation status. */ + status?: ClusterOperationStatus; + /** Output-only. The previous operation status. */ + statusHistory?: ClusterOperationStatus[]; + /** Output-only. Errors encountered during operation execution. */ + warnings?: string[]; + } + interface ClusterOperationStatus { + /** Output-only.A message containing any operation metadata details. */ + details?: string; + /** Output-only. A message containing the detailed operation state. */ + innerState?: string; + /** Output-only. A message containing the operation state. */ + state?: string; + /** Output-only. The time this state was entered. */ + stateStartTime?: string; + } + interface ClusterStatus { + /** Output-only. Optional details of cluster's state. */ + detail?: string; + /** Output-only. The cluster's state. */ + state?: string; + /** Output-only. Time when this state was entered. */ + stateStartTime?: string; + /** Output-only. Additional state information that includes status reported by the agent. */ + substate?: string; + } + interface DiagnoseClusterResults { + /** Output-only. The Google Cloud Storage URI of the diagnostic output. The output report is a plain text file with a summary of collected diagnostics. */ + outputUri?: string; + } + interface DiskConfig { + /** Optional. Size in GB of the boot disk (default is 500GB). */ + bootDiskSizeGb?: number; + /** + * Optional. Number of attached SSDs, from 0 to 4 (default is 0). If SSDs are not attached, the boot disk is used to store runtime logs and HDFS + * (https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data. If one or more SSDs are attached, this runtime bulk data is spread across them, and + * the boot disk contains only basic config and installed binaries. + */ + numLocalSsds?: number; + } + interface GceClusterConfig { + /** + * Optional. If true, all instances in the cluster will only have internal IP addresses. By default, clusters are not restricted to internal IP addresses, + * and will have ephemeral external IP addresses assigned to each instance. This internal_ip_only restriction can only be enabled for subnetwork enabled + * networks, and all off-cluster dependencies must be configured to be accessible without external IP addresses. + */ + internalIpOnly?: boolean; + /** + * The Google Compute Engine metadata entries to add to all instances (see Project and instance metadata + * (https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)). + */ + metadata?: Record; + /** + * Optional. The Google Compute Engine network to be used for machine communications. Cannot be specified with subnetwork_uri. If neither network_uri nor + * subnetwork_uri is specified, the "default" network of the project is used, if it exists. Cannot be a "Custom Subnet Network" (see Using Subnetworks for + * more information).A full URL, partial URI, or short name are valid. Examples: + * https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default + * projects/[project_id]/regions/global/default + * default + */ + networkUri?: string; + /** + * Optional. The service account of the instances. Defaults to the default Google Compute Engine service account. Custom service accounts need permissions + * equivalent to the folloing IAM roles: + * roles/logging.logWriter + * roles/storage.objectAdmin(see https://cloud.google.com/compute/docs/access/service-accounts#custom_service_accounts for more information). Example: + * [account_id]@[project_id].iam.gserviceaccount.com + */ + serviceAccount?: string; + /** + * Optional. The URIs of service account scopes to be included in Google Compute Engine instances. The following base set of scopes is always included: + * https://www.googleapis.com/auth/cloud.useraccounts.readonly + * https://www.googleapis.com/auth/devstorage.read_write + * https://www.googleapis.com/auth/logging.writeIf no scopes are specified, the following defaults are also provided: + * https://www.googleapis.com/auth/bigquery + * https://www.googleapis.com/auth/bigtable.admin.table + * https://www.googleapis.com/auth/bigtable.data + * https://www.googleapis.com/auth/devstorage.full_control + */ + serviceAccountScopes?: string[]; + /** + * Optional. The Google Compute Engine subnetwork to be used for machine communications. Cannot be specified with network_uri.A full URL, partial URI, or + * short name are valid. Examples: + * https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/sub0 + * projects/[project_id]/regions/us-east1/sub0 + * sub0 + */ + subnetworkUri?: string; + /** The Google Compute Engine tags to add to all instances (see Tagging instances). */ + tags?: string[]; + /** + * Optional. The zone where the Google Compute Engine cluster will be located. On a create request, it is required in the "global" region. If omitted in a + * non-global Cloud Dataproc region, the service will pick a zone in the corresponding Compute Engine region. On a get request, zone will always be + * present.A full URL, partial URI, or short name are valid. Examples: + * https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone] + * projects/[project_id]/zones/[zone] + * us-central1-f + */ + zoneUri?: string; + } + interface HadoopJob { + /** + * Optional. HCFS URIs of archives to be extracted in the working directory of Hadoop drivers and tasks. Supported file types: .jar, .tar, .tar.gz, .tgz, + * or .zip. + */ + archiveUris?: string[]; + /** + * Optional. The arguments to pass to the driver. Do not include arguments, such as -libjars or -Dfoo=bar, that can be set as job properties, since a + * collision may occur that causes an incorrect job submission. + */ + args?: string[]; + /** + * Optional. HCFS (Hadoop Compatible Filesystem) URIs of files to be copied to the working directory of Hadoop drivers and distributed tasks. Useful for + * naively parallel tasks. + */ + fileUris?: string[]; + /** Optional. Jar file URIs to add to the CLASSPATHs of the Hadoop driver and tasks. */ + jarFileUris?: string[]; + /** Optional. The runtime log config for job execution. */ + loggingConfig?: LoggingConfig; + /** The name of the driver's main class. The jar file containing the class must be in the default CLASSPATH or specified in jar_file_uris. */ + mainClass?: string; + /** + * The HCFS URI of the jar file containing the main class. Examples: 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar' + * 'hdfs:/tmp/test-samples/custom-wordcount.jar' 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar' + */ + mainJarFileUri?: string; + /** + * Optional. A mapping of property names to values, used to configure Hadoop. Properties that conflict with values set by the Cloud Dataproc API may be + * overwritten. Can include properties set in /etc/hadoop/conf/*-site and classes in user code. + */ + properties?: Record; + } + interface HiveJob { + /** + * Optional. Whether to continue executing queries if a query fails. The default value is false. Setting to true can be useful when executing independent + * parallel queries. + */ + continueOnFailure?: boolean; + /** Optional. HCFS URIs of jar files to add to the CLASSPATH of the Hive server and Hadoop MapReduce (MR) tasks. Can contain Hive SerDes and UDFs. */ + jarFileUris?: string[]; + /** + * Optional. A mapping of property names and values, used to configure Hive. Properties that conflict with values set by the Cloud Dataproc API may be + * overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, /etc/hive/conf/hive-site.xml, and classes in user code. + */ + properties?: Record; + /** The HCFS URI of the script that contains Hive queries. */ + queryFileUri?: string; + /** A list of queries. */ + queryList?: QueryList; + /** Optional. Mapping of query variable names to values (equivalent to the Hive command: SET name="value";). */ + scriptVariables?: Record; + } + interface InstanceGroupConfig { + /** + * Optional. The Google Compute Engine accelerator configuration for these instances.Beta Feature: This feature is still under development. It may be + * changed before final release. + */ + accelerators?: AcceleratorConfig[]; + /** Optional. Disk option config settings. */ + diskConfig?: DiskConfig; + /** Output-only. The Google Compute Engine image resource used for cluster instances. Inferred from SoftwareConfig.image_version. */ + imageUri?: string; + /** + * Optional. The list of instance names. Cloud Dataproc derives the names from cluster_name, num_instances, and the instance group if not set by user + * (recommended practice is to let Cloud Dataproc derive the name). + */ + instanceNames?: string[]; + /** Optional. Specifies that this instance group contains preemptible instances. */ + isPreemptible?: boolean; + /** + * Optional. The Google Compute Engine machine type used for cluster instances.A full URL, partial URI, or short name are valid. Examples: + * https://www.googleapis.com/compute/v1/projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2 + * projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2 + * n1-standard-2 + */ + machineTypeUri?: string; + /** Output-only. The config for Google Compute Engine Instance Group Manager that manages this group. This is only used for preemptible instance groups. */ + managedGroupConfig?: ManagedGroupConfig; + /** Optional. The number of VM instances in the instance group. For master instance groups, must be set to 1. */ + numInstances?: number; + } + interface Job { + /** + * Output-only. If present, the location of miscellaneous control files which may be used as part of job setup and handling. If not present, control files + * may be placed in the same location as driver_output_uri. + */ + driverControlFilesUri?: string; + /** Output-only. A URI pointing to the location of the stdout of the job's driver program. */ + driverOutputResourceUri?: string; + /** Job is a Hadoop job. */ + hadoopJob?: HadoopJob; + /** Job is a Hive job. */ + hiveJob?: HiveJob; + /** + * Optional. The labels to associate with this job. Label keys must contain 1 to 63 characters, and must conform to RFC 1035 + * (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035 + * (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be associated with a job. + */ + labels?: Record; + /** Job is a Pig job. */ + pigJob?: PigJob; + /** Required. Job information, including how, when, and where to run the job. */ + placement?: JobPlacement; + /** Job is a Pyspark job. */ + pysparkJob?: PySparkJob; + /** + * Optional. The fully qualified reference to the job, which can be used to obtain the equivalent REST path of the job resource. If this property is not + * specified when a job is created, the server generates a job_id. + */ + reference?: JobReference; + /** Optional. Job scheduling configuration. */ + scheduling?: JobScheduling; + /** Job is a Spark job. */ + sparkJob?: SparkJob; + /** Job is a SparkSql job. */ + sparkSqlJob?: SparkSqlJob; + /** + * Output-only. The job status. Additional application-specific status information may be contained in the type_job and + * yarn_applications fields. + */ + status?: JobStatus; + /** Output-only. The previous job status. */ + statusHistory?: JobStatus[]; + /** + * Output-only. The collection of YARN applications spun up by this job.Beta Feature: This report is available for testing purposes only. It may be + * changed before final release. + */ + yarnApplications?: YarnApplication[]; + } + interface JobPlacement { + /** Required. The name of the cluster where the job will be submitted. */ + clusterName?: string; + /** Output-only. A cluster UUID generated by the Cloud Dataproc service when the job is submitted. */ + clusterUuid?: string; + } + interface JobReference { + /** + * Optional. The job ID, which must be unique within the project. The job ID is generated by the server upon job submission or provided by the user as a + * means to perform retries without creating duplicate jobs. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or hyphens (-). + * The maximum length is 100 characters. + */ + jobId?: string; + /** Required. The ID of the Google Cloud Platform project that the job belongs to. */ + projectId?: string; + } + interface JobScheduling { + /** + * Optional. Maximum number of times per hour a driver may be restarted as a result of driver terminating with non-zero code before job is reported + * failed.A job may be reported as thrashing if driver exits with non-zero code 4 times within 10 minute window.Maximum value is 10. + */ + maxFailuresPerHour?: number; + } + interface JobStatus { + /** Output-only. Optional job state details, such as an error description if the state is ERROR. */ + details?: string; + /** Output-only. A state message specifying the overall job state. */ + state?: string; + /** Output-only. The time when this state was entered. */ + stateStartTime?: string; + /** Output-only. Additional state information, which includes status reported by the agent. */ + substate?: string; + } + interface ListClustersResponse { + /** Output-only. The clusters in the project. */ + clusters?: Cluster[]; + /** + * Output-only. This token is included in the response if there are more results to fetch. To fetch additional results, provide this value as the + * page_token in a subsequent ListClustersRequest. + */ + nextPageToken?: string; + } + interface ListJobsResponse { + /** Output-only. Jobs list. */ + jobs?: Job[]; + /** + * Optional. This token is included in the response if there are more results to fetch. To fetch additional results, provide this value as the page_token + * in a subsequent ListJobsRequest. + */ + nextPageToken?: string; + } + interface ListOperationsResponse { + /** The standard List next-page token. */ + nextPageToken?: string; + /** A list of operations that matches the specified filter in the request. */ + operations?: Operation[]; + } + interface LoggingConfig { + /** + * The per-package log levels for the driver. This may include "root" package name to configure rootLogger. Examples: 'com.google = FATAL', 'root = + * INFO', 'org.apache = DEBUG' + */ + driverLogLevels?: Record; + } + interface ManagedGroupConfig { + /** Output-only. The name of the Instance Group Manager for this group. */ + instanceGroupManagerName?: string; + /** Output-only. The name of the Instance Template used for the Managed Instance Group. */ + instanceTemplateName?: string; + } + interface NodeInitializationAction { + /** Required. Google Cloud Storage URI of executable file. */ + executableFile?: string; + /** + * Optional. Amount of time executable has to complete. Default is 10 minutes. Cluster creation fails with an explanatory error message (the name of the + * executable that caused the error and the exceeded timeout period) if the executable is not completed at end of the timeout period. + */ + executionTimeout?: string; + } + interface Operation { + /** If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available. */ + done?: boolean; + /** The error result of the operation in case of failure or cancellation. */ + error?: Status; + /** + * Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some + * services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. + */ + metadata?: Record; + /** + * The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should + * have the format of operations/some/unique/name. + */ + name?: string; + /** + * The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is + * google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response + * should have the type XxxResponse, where Xxx is the original method name. For example, if the original method name is TakeSnapshot(), the inferred + * response type is TakeSnapshotResponse. + */ + response?: Record; + } + interface PigJob { + /** + * Optional. Whether to continue executing queries if a query fails. The default value is false. Setting to true can be useful when executing independent + * parallel queries. + */ + continueOnFailure?: boolean; + /** Optional. HCFS URIs of jar files to add to the CLASSPATH of the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs. */ + jarFileUris?: string[]; + /** Optional. The runtime log config for job execution. */ + loggingConfig?: LoggingConfig; + /** + * Optional. A mapping of property names to values, used to configure Pig. Properties that conflict with values set by the Cloud Dataproc API may be + * overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, /etc/pig/conf/pig.properties, and classes in user code. + */ + properties?: Record; + /** The HCFS URI of the script that contains the Pig queries. */ + queryFileUri?: string; + /** A list of queries. */ + queryList?: QueryList; + /** Optional. Mapping of query variable names to values (equivalent to the Pig command: name=[value]). */ + scriptVariables?: Record; + } + interface PySparkJob { + /** Optional. HCFS URIs of archives to be extracted in the working directory of .jar, .tar, .tar.gz, .tgz, and .zip. */ + archiveUris?: string[]; + /** + * Optional. The arguments to pass to the driver. Do not include arguments, such as --conf, that can be set as job properties, since a collision may occur + * that causes an incorrect job submission. + */ + args?: string[]; + /** Optional. HCFS URIs of files to be copied to the working directory of Python drivers and distributed tasks. Useful for naively parallel tasks. */ + fileUris?: string[]; + /** Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Python driver and tasks. */ + jarFileUris?: string[]; + /** Optional. The runtime log config for job execution. */ + loggingConfig?: LoggingConfig; + /** Required. The HCFS URI of the main Python file to use as the driver. Must be a .py file. */ + mainPythonFileUri?: string; + /** + * Optional. A mapping of property names to values, used to configure PySpark. Properties that conflict with values set by the Cloud Dataproc API may be + * overwritten. Can include properties set in /etc/spark/conf/spark-defaults.conf and classes in user code. + */ + properties?: Record; + /** Optional. HCFS file URIs of Python files to pass to the PySpark framework. Supported file types: .py, .egg, and .zip. */ + pythonFileUris?: string[]; + } + interface QueryList { + /** + * Required. The queries to execute. You do not need to terminate a query with a semicolon. Multiple queries can be specified in one string by separating + * each with a semicolon. Here is an example of an Cloud Dataproc API snippet that uses a QueryList to specify a HiveJob: + * "hiveJob": { + * "queryList": { + * "queries": [ + * "query1", + * "query2", + * "query3;query4", + * ] + * } + * } + */ + queries?: string[]; + } + interface SoftwareConfig { + /** + * Optional. The version of software inside the cluster. It must match the regular expression [0-9]+\.[0-9]+. If unspecified, it defaults to the latest + * version (see Cloud Dataproc Versioning). + */ + imageVersion?: string; + /** + * Optional. The properties to set on daemon config files.Property keys are specified in prefix:property format, such as core:fs.defaultFS. The following + * are supported prefixes and their mappings: + * capacity-scheduler: capacity-scheduler.xml + * core: core-site.xml + * distcp: distcp-default.xml + * hdfs: hdfs-site.xml + * hive: hive-site.xml + * mapred: mapred-site.xml + * pig: pig.properties + * spark: spark-defaults.conf + * yarn: yarn-site.xmlFor more information, see Cluster properties. + */ + properties?: Record; + } + interface SparkJob { + /** + * Optional. HCFS URIs of archives to be extracted in the working directory of Spark drivers and tasks. Supported file types: .jar, .tar, .tar.gz, .tgz, + * and .zip. + */ + archiveUris?: string[]; + /** + * Optional. The arguments to pass to the driver. Do not include arguments, such as --conf, that can be set as job properties, since a collision may occur + * that causes an incorrect job submission. + */ + args?: string[]; + /** Optional. HCFS URIs of files to be copied to the working directory of Spark drivers and distributed tasks. Useful for naively parallel tasks. */ + fileUris?: string[]; + /** Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Spark driver and tasks. */ + jarFileUris?: string[]; + /** Optional. The runtime log config for job execution. */ + loggingConfig?: LoggingConfig; + /** The name of the driver's main class. The jar file that contains the class must be in the default CLASSPATH or specified in jar_file_uris. */ + mainClass?: string; + /** The HCFS URI of the jar file that contains the main class. */ + mainJarFileUri?: string; + /** + * Optional. A mapping of property names to values, used to configure Spark. Properties that conflict with values set by the Cloud Dataproc API may be + * overwritten. Can include properties set in /etc/spark/conf/spark-defaults.conf and classes in user code. + */ + properties?: Record; + } + interface SparkSqlJob { + /** Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH. */ + jarFileUris?: string[]; + /** Optional. The runtime log config for job execution. */ + loggingConfig?: LoggingConfig; + /** + * Optional. A mapping of property names to values, used to configure Spark SQL's SparkConf. Properties that conflict with values set by the Cloud + * Dataproc API may be overwritten. + */ + properties?: Record; + /** The HCFS URI of the script that contains SQL queries. */ + queryFileUri?: string; + /** A list of queries. */ + queryList?: QueryList; + /** Optional. Mapping of query variable names to values (equivalent to the Spark SQL command: SET name="value";). */ + scriptVariables?: Record; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** A list of messages that carry the error details. There is a common set of message types for APIs to use. */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface SubmitJobRequest { + /** Required. The job resource. */ + job?: Job; + } + interface YarnApplication { + /** Required. The application name. */ + name?: string; + /** Required. The numerical progress of the application, from 1 to 100. */ + progress?: number; + /** Required. The application state. */ + state?: string; + /** + * Optional. The HTTP URL of the ApplicationMaster, HistoryServer, or TimelineServer that provides application-specific information. The URL uses the + * internal hostname, and requires a proxy server for resolution and, possibly, access. + */ + trackingUrl?: string; + } + interface ClustersResource { + /** Creates a cluster in a project. */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Google Cloud Platform project that the cluster belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The Cloud Dataproc region in which to handle the request. */ + region: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Deletes a cluster in a project. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Required. The cluster name. */ + clusterName: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Google Cloud Platform project that the cluster belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The Cloud Dataproc region in which to handle the request. */ + region: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Gets cluster diagnostic information. After the operation completes, the Operation.response field contains DiagnoseClusterOutputLocation. */ + diagnose(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Required. The cluster name. */ + clusterName: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Google Cloud Platform project that the cluster belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The Cloud Dataproc region in which to handle the request. */ + region: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Gets the resource representation for a cluster in a project. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Required. The cluster name. */ + clusterName: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Google Cloud Platform project that the cluster belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The Cloud Dataproc region in which to handle the request. */ + region: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists all regions/{region}/clusters in a project. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Optional. A filter constraining the clusters to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where + * field is one of status.state, clusterName, or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be one of + * the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR, DELETING, or UPDATING. ACTIVE contains the CREATING, UPDATING, and RUNNING states. INACTIVE + * contains the DELETING and ERROR states. clusterName is the name of the cluster provided at creation time. Only the logical AND operator is supported; + * space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE AND clusterName = mycluster AND labels.env = + * staging AND labels.starred = * + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Optional. The standard List page size. */ + pageSize?: number; + /** Optional. The standard List page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Google Cloud Platform project that the cluster belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The Cloud Dataproc region in which to handle the request. */ + region: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Updates a cluster in a project. */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Required. The cluster name. */ + clusterName: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Google Cloud Platform project the cluster belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The Cloud Dataproc region in which to handle the request. */ + region: string; + /** + * Required. Specifies the path, relative to Cluster, of the field to update. For example, to change the number of workers in a cluster to 5, the + * update_mask parameter would be specified as config.worker_config.num_instances, and the PATCH request body would specify the new value, as follows: + * { + * "config":{ + * "workerConfig":{ + * "numInstances":"5" + * } + * } + * } + * Similarly, to change the number of preemptible workers in a cluster to 5, the update_mask parameter would be + * config.secondary_worker_config.num_instances, and the PATCH request body would be set as follows: + * { + * "config":{ + * "secondaryWorkerConfig":{ + * "numInstances":"5" + * } + * } + * } + * Note: Currently, only the following fields can be updated:
    + * + * + *
    MaskPurpose
    labels Update labels
    config.worker_config.num_instances Resize primary worker group
    config.secondary_worker_config.num_instances Resize secondary worker group
    + */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface JobsResource { + /** Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list or regions/{region}/jobs.get. */ + cancel(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Required. The job ID. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Google Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The Cloud Dataproc region in which to handle the request. */ + region: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Required. The job ID. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Google Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The Cloud Dataproc region in which to handle the request. */ + region: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Gets the resource representation for a job in a project. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Required. The job ID. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Google Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The Cloud Dataproc region in which to handle the request. */ + region: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists regions/{region}/jobs in a project. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Optional. If set, the returned jobs list includes only jobs that were submitted to the named cluster. */ + clusterName?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Optional. A filter constraining the jobs to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where + * field is status.state or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be either ACTIVE or INACTIVE. + * Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE + * AND labels.env = staging AND labels.starred = * + */ + filter?: string; + /** Optional. Specifies enumerated categories of jobs to list (default = match ALL jobs). */ + jobStateMatcher?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Optional. The number of results to return in each response. */ + pageSize?: number; + /** Optional. The page token, returned by a previous call, to request the next page of results. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Google Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The Cloud Dataproc region in which to handle the request. */ + region: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Updates a job in a project. */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Required. The job ID. */ + jobId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Google Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The Cloud Dataproc region in which to handle the request. */ + region: string; + /** + * Required. Specifies the path, relative to Job, of the field to update. For example, to update the labels of a Job the + * update_mask parameter would be specified as labels, and the PATCH request body would specify the new value. + * Note: Currently, labels is the only field that can be updated. + */ + updateMask?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Submits a job to a cluster. */ + submit(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Required. The ID of the Google Cloud Platform project that the job belongs to. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Required. The Cloud Dataproc region in which to handle the request. */ + region: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface OperationsResource { + /** + * Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If + * the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check + * whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; + * instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED. + */ + cancel(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource to be cancelled. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource to be deleted. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API + * service. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name + * binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API + * services can add a binding such as "/v1/{name=users/*}/operations" to their service configuration. For backwards compatibility, the default name + * includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection + * id. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The standard list filter. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation's parent resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The standard list page size. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface RegionsResource { + clusters: ClustersResource; + jobs: JobsResource; + operations: OperationsResource; + } + interface ProjectsResource { + regions: RegionsResource; + } + } +} diff --git a/types/gapi.client.dataproc/readme.md b/types/gapi.client.dataproc/readme.md new file mode 100644 index 0000000000..1688149759 --- /dev/null +++ b/types/gapi.client.dataproc/readme.md @@ -0,0 +1,54 @@ +# TypeScript typings for Google Cloud Dataproc API v1 +Manages Hadoop-based clusters and jobs on Google Cloud Platform. +For detailed description please check [documentation](https://cloud.google.com/dataproc/). + +## Installing + +Install typings for Google Cloud Dataproc API: +``` +npm install @types/gapi.client.dataproc@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('dataproc', 'v1', () => { + // now we can use gapi.client.dataproc + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Cloud Dataproc API resources: + +```typescript +``` \ No newline at end of file diff --git a/types/gapi.client.dataproc/tsconfig.json b/types/gapi.client.dataproc/tsconfig.json new file mode 100644 index 0000000000..83a765706a --- /dev/null +++ b/types/gapi.client.dataproc/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.dataproc-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.dataproc/tslint.json b/types/gapi.client.dataproc/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.dataproc/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.datastore/gapi.client.datastore-tests.ts b/types/gapi.client.datastore/gapi.client.datastore-tests.ts new file mode 100644 index 0000000000..ce0840ae65 --- /dev/null +++ b/types/gapi.client.datastore/gapi.client.datastore-tests.ts @@ -0,0 +1,64 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('datastore', 'v1', () => { + /** now we can use gapi.client.datastore */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View and manage your Google Cloud Datastore data */ + 'https://www.googleapis.com/auth/datastore', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** + * Allocates IDs for the given keys, which is useful for referencing an entity + * before it is inserted. + */ + await gapi.client.projects.allocateIds({ + projectId: "projectId", + }); + /** Begins a new transaction. */ + await gapi.client.projects.beginTransaction({ + projectId: "projectId", + }); + /** + * Commits a transaction, optionally creating, deleting or modifying some + * entities. + */ + await gapi.client.projects.commit({ + projectId: "projectId", + }); + /** Looks up entities by key. */ + await gapi.client.projects.lookup({ + projectId: "projectId", + }); + /** Rolls back a transaction. */ + await gapi.client.projects.rollback({ + projectId: "projectId", + }); + /** Queries for entities. */ + await gapi.client.projects.runQuery({ + projectId: "projectId", + }); + } +}); diff --git a/types/gapi.client.datastore/index.d.ts b/types/gapi.client.datastore/index.d.ts new file mode 100644 index 0000000000..83c124ce52 --- /dev/null +++ b/types/gapi.client.datastore/index.d.ts @@ -0,0 +1,1027 @@ +// Type definitions for Google Google Cloud Datastore API v1 1.0 +// Project: https://cloud.google.com/datastore/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://datastore.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Google Cloud Datastore API v1 */ + function load(name: "datastore", version: "v1"): PromiseLike; + function load(name: "datastore", version: "v1", callback: () => any): void; + + const projects: datastore.ProjectsResource; + + namespace datastore { + interface AllocateIdsRequest { + /** + * A list of keys with incomplete key paths for which to allocate IDs. + * No key may be reserved/read-only. + */ + keys?: Key[]; + } + interface AllocateIdsResponse { + /** + * The keys specified in the request (in the same order), each with + * its key path completed with a newly allocated ID. + */ + keys?: Key[]; + } + interface ArrayValue { + /** + * Values in the array. + * The order of this array may not be preserved if it contains a mix of + * indexed and unindexed values. + */ + values?: Value[]; + } + interface BeginTransactionRequest { + /** Options for a new transaction. */ + transactionOptions?: TransactionOptions; + } + interface BeginTransactionResponse { + /** The transaction identifier (always present). */ + transaction?: string; + } + interface CommitRequest { + /** The type of commit to perform. Defaults to `TRANSACTIONAL`. */ + mode?: string; + /** + * The mutations to perform. + * + * When mode is `TRANSACTIONAL`, mutations affecting a single entity are + * applied in order. The following sequences of mutations affecting a single + * entity are not permitted in a single `Commit` request: + * + * - `insert` followed by `insert` + * - `update` followed by `insert` + * - `upsert` followed by `insert` + * - `delete` followed by `update` + * + * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single + * entity. + */ + mutations?: Mutation[]; + /** + * The identifier of the transaction associated with the commit. A + * transaction identifier is returned by a call to + * Datastore.BeginTransaction. + */ + transaction?: string; + } + interface CommitResponse { + /** + * The number of index entries updated during the commit, or zero if none were + * updated. + */ + indexUpdates?: number; + /** + * The result of performing the mutations. + * The i-th mutation result corresponds to the i-th mutation in the request. + */ + mutationResults?: MutationResult[]; + } + interface CompositeFilter { + /** + * The list of filters to combine. + * Must contain at least one filter. + */ + filters?: Filter[]; + /** The operator for combining multiple filters. */ + op?: string; + } + interface Entity { + /** + * The entity's key. + * + * An entity must have a key, unless otherwise documented (for example, + * an entity in `Value.entity_value` may have no key). + * An entity's kind is its key path's last element's kind, + * or null if it has no key. + */ + key?: Key; + /** + * The entity's properties. + * The map's keys are property names. + * A property name matching regex `__.*__` is reserved. + * A reserved property name is forbidden in certain documented contexts. + * The name must not contain more than 500 characters. + * The name cannot be `""`. + */ + properties?: Record; + } + interface EntityResult { + /** + * A cursor that points to the position after the result entity. + * Set only when the `EntityResult` is part of a `QueryResultBatch` message. + */ + cursor?: string; + /** The resulting entity. */ + entity?: Entity; + /** + * The version of the entity, a strictly positive number that monotonically + * increases with changes to the entity. + * + * This field is set for `FULL` entity + * results. + * + * For missing entities in `LookupResponse`, this + * is the version of the snapshot that was used to look up the entity, and it + * is always set except for eventually consistent reads. + */ + version?: string; + } + interface Filter { + /** A composite filter. */ + compositeFilter?: CompositeFilter; + /** A filter on a property. */ + propertyFilter?: PropertyFilter; + } + interface GoogleDatastoreAdminV1beta1CommonMetadata { + /** The time the operation ended, either successfully or otherwise. */ + endTime?: string; + /** + * The client-assigned labels which were provided when the operation was + * created. May also include additional labels. + */ + labels?: Record; + /** + * The type of the operation. Can be used as a filter in + * ListOperationsRequest. + */ + operationType?: string; + /** The time that work began on the operation. */ + startTime?: string; + /** The current state of the Operation. */ + state?: string; + } + interface GoogleDatastoreAdminV1beta1EntityFilter { + /** If empty, then this represents all kinds. */ + kinds?: string[]; + /** + * An empty list represents all namespaces. This is the preferred + * usage for projects that don't use namespaces. + * + * An empty string element represents the default namespace. This should be + * used if the project has data in non-default namespaces, but doesn't want to + * include them. + * Each namespace in this list must be unique. + */ + namespaceIds?: string[]; + } + interface GoogleDatastoreAdminV1beta1ExportEntitiesMetadata { + /** Metadata common to all Datastore Admin operations. */ + common?: GoogleDatastoreAdminV1beta1CommonMetadata; + /** Description of which entities are being exported. */ + entityFilter?: GoogleDatastoreAdminV1beta1EntityFilter; + /** + * Location for the export metadata and data files. This will be the same + * value as the + * google.datastore.admin.v1beta1.ExportEntitiesRequest.output_url_prefix + * field. The final output location is provided in + * google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url. + */ + outputUrlPrefix?: string; + /** An estimate of the number of bytes processed. */ + progressBytes?: GoogleDatastoreAdminV1beta1Progress; + /** An estimate of the number of entities processed. */ + progressEntities?: GoogleDatastoreAdminV1beta1Progress; + } + interface GoogleDatastoreAdminV1beta1ExportEntitiesResponse { + /** + * Location of the output metadata file. This can be used to begin an import + * into Cloud Datastore (this project or another project). See + * google.datastore.admin.v1beta1.ImportEntitiesRequest.input_url. + * Only present if the operation completed successfully. + */ + outputUrl?: string; + } + interface GoogleDatastoreAdminV1beta1ImportEntitiesMetadata { + /** Metadata common to all Datastore Admin operations. */ + common?: GoogleDatastoreAdminV1beta1CommonMetadata; + /** Description of which entities are being imported. */ + entityFilter?: GoogleDatastoreAdminV1beta1EntityFilter; + /** + * The location of the import metadata file. This will be the same value as + * the google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url + * field. + */ + inputUrl?: string; + /** An estimate of the number of bytes processed. */ + progressBytes?: GoogleDatastoreAdminV1beta1Progress; + /** An estimate of the number of entities processed. */ + progressEntities?: GoogleDatastoreAdminV1beta1Progress; + } + interface GoogleDatastoreAdminV1beta1Progress { + /** + * The amount of work that has been completed. Note that this may be greater + * than work_estimated. + */ + workCompleted?: string; + /** + * An estimate of how much work needs to be performed. May be zero if the + * work estimate is unavailable. + */ + workEstimated?: string; + } + interface GoogleLongrunningListOperationsResponse { + /** The standard List next-page token. */ + nextPageToken?: string; + /** A list of operations that matches the specified filter in the request. */ + operations?: GoogleLongrunningOperation[]; + } + interface GoogleLongrunningOperation { + /** + * If the value is `false`, it means the operation is still in progress. + * If `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done?: boolean; + /** The error result of the operation in case of failure or cancellation. */ + error?: Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata?: Record; + /** + * The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name?: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` + * is the original method name. For example, if the original method name + * is `TakeSnapshot()`, the inferred response type is + * `TakeSnapshotResponse`. + */ + response?: Record; + } + interface GqlQuery { + /** + * When false, the query string must not contain any literals and instead must + * bind all values. For example, + * `SELECT * FROM Kind WHERE a = 'string literal'` is not allowed, while + * `SELECT * FROM Kind WHERE a = @value` is. + */ + allowLiterals?: boolean; + /** + * For each non-reserved named binding site in the query string, there must be + * a named parameter with that name, but not necessarily the inverse. + * + * Key must match regex `A-Za-z_$*`, must not match regex + * `__.*__`, and must not be `""`. + */ + namedBindings?: Record; + /** + * Numbered binding site @1 references the first numbered parameter, + * effectively using 1-based indexing, rather than the usual 0. + * + * For each binding site numbered i in `query_string`, there must be an i-th + * numbered parameter. The inverse must also be true. + */ + positionalBindings?: GqlQueryParameter[]; + /** + * A string of the format described + * [here](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). + */ + queryString?: string; + } + interface GqlQueryParameter { + /** + * A query cursor. Query cursors are returned in query + * result batches. + */ + cursor?: string; + /** A value parameter. */ + value?: Value; + } + interface Key { + /** + * Entities are partitioned into subsets, currently identified by a project + * ID and namespace ID. + * Queries are scoped to a single partition. + */ + partitionId?: PartitionId; + /** + * The entity path. + * An entity path consists of one or more elements composed of a kind and a + * string or numerical identifier, which identify entities. The first + * element identifies a _root entity_, the second element identifies + * a _child_ of the root entity, the third element identifies a child of the + * second entity, and so forth. The entities identified by all prefixes of + * the path are called the element's _ancestors_. + * + * An entity path is always fully complete: *all* of the entity's ancestors + * are required to be in the path along with the entity identifier itself. + * The only exception is that in some documented cases, the identifier in the + * last path element (for the entity) itself may be omitted. For example, + * the last path element of the key of `Mutation.insert` may have no + * identifier. + * + * A path can never be empty, and a path can have at most 100 elements. + */ + path?: PathElement[]; + } + interface KindExpression { + /** The name of the kind. */ + name?: string; + } + interface LatLng { + /** The latitude in degrees. It must be in the range [-90.0, +90.0]. */ + latitude?: number; + /** The longitude in degrees. It must be in the range [-180.0, +180.0]. */ + longitude?: number; + } + interface LookupRequest { + /** Keys of entities to look up. */ + keys?: Key[]; + /** The options for this lookup request. */ + readOptions?: ReadOptions; + } + interface LookupResponse { + /** + * A list of keys that were not looked up due to resource constraints. The + * order of results in this field is undefined and has no relation to the + * order of the keys in the input. + */ + deferred?: Key[]; + /** + * Entities found as `ResultType.FULL` entities. The order of results in this + * field is undefined and has no relation to the order of the keys in the + * input. + */ + found?: EntityResult[]; + /** + * Entities not found as `ResultType.KEY_ONLY` entities. The order of results + * in this field is undefined and has no relation to the order of the keys + * in the input. + */ + missing?: EntityResult[]; + } + interface Mutation { + /** + * The version of the entity that this mutation is being applied to. If this + * does not match the current version on the server, the mutation conflicts. + */ + baseVersion?: string; + /** + * The key of the entity to delete. The entity may or may not already exist. + * Must have a complete key path and must not be reserved/read-only. + */ + delete?: Key; + /** + * The entity to insert. The entity must not already exist. + * The entity key's final path element may be incomplete. + */ + insert?: Entity; + /** + * The entity to update. The entity must already exist. + * Must have a complete key path. + */ + update?: Entity; + /** + * The entity to upsert. The entity may or may not already exist. + * The entity key's final path element may be incomplete. + */ + upsert?: Entity; + } + interface MutationResult { + /** + * Whether a conflict was detected for this mutation. Always false when a + * conflict detection strategy field is not set in the mutation. + */ + conflictDetected?: boolean; + /** + * The automatically allocated key. + * Set only when the mutation allocated a key. + */ + key?: Key; + /** + * The version of the entity on the server after processing the mutation. If + * the mutation doesn't change anything on the server, then the version will + * be the version of the current entity or, if no entity is present, a version + * that is strictly greater than the version of any previous entity and less + * than the version of any possible future entity. + */ + version?: string; + } + interface PartitionId { + /** If not empty, the ID of the namespace to which the entities belong. */ + namespaceId?: string; + /** The ID of the project to which the entities belong. */ + projectId?: string; + } + interface PathElement { + /** + * The auto-allocated ID of the entity. + * Never equal to zero. Values less than zero are discouraged and may not + * be supported in the future. + */ + id?: string; + /** + * The kind of the entity. + * A kind matching regex `__.*__` is reserved/read-only. + * A kind must not contain more than 1500 bytes when UTF-8 encoded. + * Cannot be `""`. + */ + kind?: string; + /** + * The name of the entity. + * A name matching regex `__.*__` is reserved/read-only. + * A name must not be more than 1500 bytes when UTF-8 encoded. + * Cannot be `""`. + */ + name?: string; + } + interface Projection { + /** The property to project. */ + property?: PropertyReference; + } + interface PropertyFilter { + /** The operator to filter by. */ + op?: string; + /** The property to filter by. */ + property?: PropertyReference; + /** The value to compare the property to. */ + value?: Value; + } + interface PropertyOrder { + /** The direction to order by. Defaults to `ASCENDING`. */ + direction?: string; + /** The property to order by. */ + property?: PropertyReference; + } + interface PropertyReference { + /** + * The name of the property. + * If name includes "."s, it may be interpreted as a property name path. + */ + name?: string; + } + interface Query { + /** + * The properties to make distinct. The query results will contain the first + * result for each distinct combination of values for the given properties + * (if empty, all results are returned). + */ + distinctOn?: PropertyReference[]; + /** + * An ending point for the query results. Query cursors are + * returned in query result batches and + * [can only be used to limit the same query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). + */ + endCursor?: string; + /** The filter to apply. */ + filter?: Filter; + /** + * The kinds to query (if empty, returns entities of all kinds). + * Currently at most 1 kind may be specified. + */ + kind?: KindExpression[]; + /** + * The maximum number of results to return. Applies after all other + * constraints. Optional. + * Unspecified is interpreted as no limit. + * Must be >= 0 if specified. + */ + limit?: number; + /** + * The number of results to skip. Applies before limit, but after all other + * constraints. Optional. Must be >= 0 if specified. + */ + offset?: number; + /** The order to apply to the query results (if empty, order is unspecified). */ + order?: PropertyOrder[]; + /** The projection to return. Defaults to returning all properties. */ + projection?: Projection[]; + /** + * A starting point for the query results. Query cursors are + * returned in query result batches and + * [can only be used to continue the same query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). + */ + startCursor?: string; + } + interface QueryResultBatch { + /** A cursor that points to the position after the last result in the batch. */ + endCursor?: string; + /** The result type for every entity in `entity_results`. */ + entityResultType?: string; + /** The results for this batch. */ + entityResults?: EntityResult[]; + /** The state of the query after the current batch. */ + moreResults?: string; + /** + * A cursor that points to the position after the last skipped result. + * Will be set when `skipped_results` != 0. + */ + skippedCursor?: string; + /** The number of results skipped, typically because of an offset. */ + skippedResults?: number; + /** + * The version number of the snapshot this batch was returned from. + * This applies to the range of results from the query's `start_cursor` (or + * the beginning of the query if no cursor was given) to this batch's + * `end_cursor` (not the query's `end_cursor`). + * + * In a single transaction, subsequent query result batches for the same query + * can have a greater snapshot version number. Each batch's snapshot version + * is valid for all preceding batches. + * The value will be zero for eventually consistent queries. + */ + snapshotVersion?: string; + } + interface ReadOptions { + /** + * The non-transactional read consistency to use. + * Cannot be set to `STRONG` for global queries. + */ + readConsistency?: string; + /** + * The identifier of the transaction in which to read. A + * transaction identifier is returned by a call to + * Datastore.BeginTransaction. + */ + transaction?: string; + } + interface ReadWrite { + /** The transaction identifier of the transaction being retried. */ + previousTransaction?: string; + } + interface RollbackRequest { + /** + * The transaction identifier, returned by a call to + * Datastore.BeginTransaction. + */ + transaction?: string; + } + interface RunQueryRequest { + /** The GQL query to run. */ + gqlQuery?: GqlQuery; + /** + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + */ + partitionId?: PartitionId; + /** The query to run. */ + query?: Query; + /** The options for this query. */ + readOptions?: ReadOptions; + } + interface RunQueryResponse { + /** A batch of query results (always present). */ + batch?: QueryResultBatch; + /** The parsed form of the `GqlQuery` from the request, if it was set. */ + query?: Query; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface TransactionOptions { + /** The transaction should only allow reads. */ + readOnly?: any; + /** The transaction should allow both reads and writes. */ + readWrite?: ReadWrite; + } + interface Value { + /** + * An array value. + * Cannot contain another array value. + * A `Value` instance that sets field `array_value` must not set fields + * `meaning` or `exclude_from_indexes`. + */ + arrayValue?: ArrayValue; + /** + * A blob value. + * May have at most 1,000,000 bytes. + * When `exclude_from_indexes` is false, may have at most 1500 bytes. + * In JSON requests, must be base64-encoded. + */ + blobValue?: string; + /** A boolean value. */ + booleanValue?: boolean; + /** A double value. */ + doubleValue?: number; + /** + * An entity value. + * + * - May have no key. + * - May have a key with an incomplete key path. + * - May have a reserved/read-only key. + */ + entityValue?: Entity; + /** + * If the value should be excluded from all indexes including those defined + * explicitly. + */ + excludeFromIndexes?: boolean; + /** A geo point value representing a point on the surface of Earth. */ + geoPointValue?: LatLng; + /** An integer value. */ + integerValue?: string; + /** A key value. */ + keyValue?: Key; + /** The `meaning` field should only be populated for backwards compatibility. */ + meaning?: number; + /** A null value. */ + nullValue?: string; + /** + * A UTF-8 encoded string value. + * When `exclude_from_indexes` is false (it is indexed) , may have at most 1500 bytes. + * Otherwise, may be set to at least 1,000,000 bytes. + */ + stringValue?: string; + /** + * A timestamp value. + * When stored in the Datastore, precise only to microseconds; + * any additional precision is rounded down. + */ + timestampValue?: string; + } + interface OperationsResource { + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * Operations.GetOperation or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an Operation.error value with a google.rpc.Status.code of 1, + * corresponding to `Code.CANCELLED`. + */ + cancel(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource to be cancelled. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource to be deleted. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. + * + * NOTE: the `name` binding allows API services to override the binding + * to use different resource name schemes, such as `users/*/operations`. To + * override the binding, API services can add a binding such as + * `"/v1/{name=users/*}/operations"` to their service configuration. + * For backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding + * is the parent resource, without the operations collection id. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The standard list filter. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation's parent resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The standard list page size. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface ProjectsResource { + /** + * Allocates IDs for the given keys, which is useful for referencing an entity + * before it is inserted. + */ + allocateIds(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the project against which to make the request. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Begins a new transaction. */ + beginTransaction(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the project against which to make the request. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Commits a transaction, optionally creating, deleting or modifying some + * entities. + */ + commit(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the project against which to make the request. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Looks up entities by key. */ + lookup(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the project against which to make the request. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Rolls back a transaction. */ + rollback(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the project against which to make the request. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Queries for entities. */ + runQuery(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The ID of the project against which to make the request. */ + projectId: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + operations: OperationsResource; + } + } +} diff --git a/types/gapi.client.datastore/readme.md b/types/gapi.client.datastore/readme.md new file mode 100644 index 0000000000..4a9a9bff5d --- /dev/null +++ b/types/gapi.client.datastore/readme.md @@ -0,0 +1,90 @@ +# TypeScript typings for Google Cloud Datastore API v1 +Accesses the schemaless NoSQL database to provide fully managed, robust, scalable storage for your application. + +For detailed description please check [documentation](https://cloud.google.com/datastore/). + +## Installing + +Install typings for Google Cloud Datastore API: +``` +npm install @types/gapi.client.datastore@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('datastore', 'v1', () => { + // now we can use gapi.client.datastore + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View and manage your Google Cloud Datastore data + 'https://www.googleapis.com/auth/datastore', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Cloud Datastore API resources: + +```typescript + +/* +Allocates IDs for the given keys, which is useful for referencing an entity +before it is inserted. +*/ +await gapi.client.projects.allocateIds({ projectId: "projectId", }); + +/* +Begins a new transaction. +*/ +await gapi.client.projects.beginTransaction({ projectId: "projectId", }); + +/* +Commits a transaction, optionally creating, deleting or modifying some +entities. +*/ +await gapi.client.projects.commit({ projectId: "projectId", }); + +/* +Looks up entities by key. +*/ +await gapi.client.projects.lookup({ projectId: "projectId", }); + +/* +Rolls back a transaction. +*/ +await gapi.client.projects.rollback({ projectId: "projectId", }); + +/* +Queries for entities. +*/ +await gapi.client.projects.runQuery({ projectId: "projectId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.datastore/tsconfig.json b/types/gapi.client.datastore/tsconfig.json new file mode 100644 index 0000000000..a84cddd73f --- /dev/null +++ b/types/gapi.client.datastore/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.datastore-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.datastore/tslint.json b/types/gapi.client.datastore/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.datastore/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.deploymentmanager/gapi.client.deploymentmanager-tests.ts b/types/gapi.client.deploymentmanager/gapi.client.deploymentmanager-tests.ts new file mode 100644 index 0000000000..e15cf3611e --- /dev/null +++ b/types/gapi.client.deploymentmanager/gapi.client.deploymentmanager-tests.ts @@ -0,0 +1,154 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('deploymentmanager', 'v2', () => { + /** now we can use gapi.client.deploymentmanager */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform.read-only', + /** View and manage your Google Cloud Platform management resources and deployment status information */ + 'https://www.googleapis.com/auth/ndev.cloudman', + /** View your Google Cloud Platform management resources and deployment status information */ + 'https://www.googleapis.com/auth/ndev.cloudman.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Cancels and removes the preview currently associated with the deployment. */ + await gapi.client.deployments.cancelPreview({ + deployment: "deployment", + project: "project", + }); + /** Deletes a deployment and all of the resources in the deployment. */ + await gapi.client.deployments.delete({ + deletePolicy: "deletePolicy", + deployment: "deployment", + project: "project", + }); + /** Gets information about a specific deployment. */ + await gapi.client.deployments.get({ + deployment: "deployment", + project: "project", + }); + /** Gets the access control policy for a resource. May be empty if no such policy or resource exists. */ + await gapi.client.deployments.getIamPolicy({ + project: "project", + resource: "resource", + }); + /** Creates a deployment and all of the resources described by the deployment manifest. */ + await gapi.client.deployments.insert({ + preview: true, + project: "project", + }); + /** Lists all deployments for a given project. */ + await gapi.client.deployments.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Updates a deployment and all of the resources described by the deployment manifest. This method supports patch semantics. */ + await gapi.client.deployments.patch({ + createPolicy: "createPolicy", + deletePolicy: "deletePolicy", + deployment: "deployment", + preview: true, + project: "project", + }); + /** Sets the access control policy on the specified resource. Replaces any existing policy. */ + await gapi.client.deployments.setIamPolicy({ + project: "project", + resource: "resource", + }); + /** Stops an ongoing operation. This does not roll back any work that has already been completed, but prevents any new work from being started. */ + await gapi.client.deployments.stop({ + deployment: "deployment", + project: "project", + }); + /** Returns permissions that a caller has on the specified resource. */ + await gapi.client.deployments.testIamPermissions({ + project: "project", + resource: "resource", + }); + /** Updates a deployment and all of the resources described by the deployment manifest. */ + await gapi.client.deployments.update({ + createPolicy: "createPolicy", + deletePolicy: "deletePolicy", + deployment: "deployment", + preview: true, + project: "project", + }); + /** Gets information about a specific manifest. */ + await gapi.client.manifests.get({ + deployment: "deployment", + manifest: "manifest", + project: "project", + }); + /** Lists all manifests for a given deployment. */ + await gapi.client.manifests.list({ + deployment: "deployment", + filter: "filter", + maxResults: 3, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Gets information about a specific operation. */ + await gapi.client.operations.get({ + operation: "operation", + project: "project", + }); + /** Lists all operations for a project. */ + await gapi.client.operations.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Gets information about a single resource. */ + await gapi.client.resources.get({ + deployment: "deployment", + project: "project", + resource: "resource", + }); + /** Lists all resources in a given deployment. */ + await gapi.client.resources.list({ + deployment: "deployment", + filter: "filter", + maxResults: 3, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + /** Lists all resource types for Deployment Manager. */ + await gapi.client.types.list({ + filter: "filter", + maxResults: 2, + orderBy: "orderBy", + pageToken: "pageToken", + project: "project", + }); + } +}); diff --git a/types/gapi.client.deploymentmanager/index.d.ts b/types/gapi.client.deploymentmanager/index.d.ts new file mode 100644 index 0000000000..2528111b57 --- /dev/null +++ b/types/gapi.client.deploymentmanager/index.d.ts @@ -0,0 +1,1175 @@ +// Type definitions for Google Google Cloud Deployment Manager API v2 2.0 +// Project: https://cloud.google.com/deployment-manager/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/deploymentmanager/v2/rest + +/// + +declare namespace gapi.client { + /** Load Google Cloud Deployment Manager API v2 */ + function load(name: "deploymentmanager", version: "v2"): PromiseLike; + function load(name: "deploymentmanager", version: "v2", callback: () => any): void; + + const deployments: deploymentmanager.DeploymentsResource; + + const manifests: deploymentmanager.ManifestsResource; + + const operations: deploymentmanager.OperationsResource; + + const resources: deploymentmanager.ResourcesResource; + + const types: deploymentmanager.TypesResource; + + namespace deploymentmanager { + interface AuditConfig { + /** The configuration for logging of each type of permission. */ + auditLogConfigs?: AuditLogConfig[]; + exemptedMembers?: string[]; + /** + * Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a + * special value that covers all services. + */ + service?: string; + } + interface AuditLogConfig { + /** Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][]. */ + exemptedMembers?: string[]; + /** The log type that this config enables. */ + logType?: string; + } + interface AuthorizationLoggingOptions { + /** The type of the permission that was checked. */ + permissionType?: string; + } + interface Binding { + /** + * The condition that is associated with this binding. NOTE: an unsatisfied condition will not allow user access via current binding. Different bindings, + * including their conditions, are examined independently. This field is GOOGLE_INTERNAL. + */ + condition?: Expr; + /** + * Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values: + * + * * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. + * + * * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. + * + * * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`. + * + * + * + * * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. + * + * * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. + * + * + * + * * `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`. + */ + members?: string[]; + /** Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. */ + role?: string; + } + interface Condition { + /** Trusted attributes supplied by the IAM system. */ + iam?: string; + /** An operator to apply the subject with. */ + op?: string; + /** Trusted attributes discharged by the service. */ + svc?: string; + /** Trusted attributes supplied by any service that owns resources and uses the IAM system for access control. */ + sys?: string; + /** DEPRECATED. Use 'values' instead. */ + value?: string; + /** The objects of the condition. This is mutually exclusive with 'value'. */ + values?: string[]; + } + interface ConfigFile { + /** The contents of the file. */ + content?: string; + } + interface Deployment { + /** An optional user-provided description of the deployment. */ + description?: string; + /** + * Provides a fingerprint to use in requests to modify a deployment, such as update(), stop(), and cancelPreview() requests. A fingerprint is a randomly + * generated value that must be provided with update(), stop(), and cancelPreview() requests to perform optimistic locking. This ensures optimistic + * concurrency so that only one request happens at a time. + * + * The fingerprint is initially generated by Deployment Manager and changes after every request to modify data. To get the latest fingerprint value, + * perform a get() request to a deployment. + */ + fingerprint?: string; + /** Output only. Unique identifier for the resource; defined by the server. */ + id?: string; + /** Output only. Timestamp when the deployment was created, in RFC3339 text format . */ + insertTime?: string; + /** + * Map of labels; provided by the client when the resource is created or updated. Specifically: Label keys must be between 1 and 63 characters long and + * must conform to the following regular expression: [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 characters long and must conform to + * the regular expression ([a-z]([-a-z0-9]*[a-z0-9])?)? + */ + labels?: DeploymentLabelEntry[]; + /** Output only. URL of the manifest representing the last manifest that was successfully deployed. */ + manifest?: string; + /** + * Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be + * a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + */ + name?: string; + /** Output only. The Operation that most recently ran, or is currently running, on this deployment. */ + operation?: Operation; + /** Output only. Self link for the deployment. */ + selfLink?: string; + /** [Input Only] The parameters that define your deployment, including the deployment configuration and relevant templates. */ + target?: TargetConfiguration; + /** Output only. If Deployment Manager is currently updating or previewing an update to this deployment, the updated configuration appears here. */ + update?: DeploymentUpdate; + } + interface DeploymentLabelEntry { + key?: string; + value?: string; + } + interface DeploymentUpdate { + /** Output only. An optional user-provided description of the deployment after the current update has been applied. */ + description?: string; + /** + * Output only. Map of labels; provided by the client when the resource is created or updated. Specifically: Label keys must be between 1 and 63 + * characters long and must conform to the following regular expression: [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 characters long + * and must conform to the regular expression ([a-z]([-a-z0-9]*[a-z0-9])?)? + */ + labels?: DeploymentUpdateLabelEntry[]; + /** Output only. URL of the manifest representing the update configuration of this deployment. */ + manifest?: string; + } + interface DeploymentUpdateLabelEntry { + key?: string; + value?: string; + } + interface DeploymentsCancelPreviewRequest { + /** + * Specifies a fingerprint for cancelPreview() requests. A fingerprint is a randomly generated value that must be provided in cancelPreview() requests to + * perform optimistic locking. This ensures optimistic concurrency so that the deployment does not have conflicting requests (e.g. if someone attempts to + * make a new update request while another user attempts to cancel a preview, this would prevent one of the requests). + * + * The fingerprint is initially generated by Deployment Manager and changes after every request to modify a deployment. To get the latest fingerprint + * value, perform a get() request on the deployment. + */ + fingerprint?: string; + } + interface DeploymentsListResponse { + /** Output only. The deployments contained in this response. */ + deployments?: Deployment[]; + /** Output only. A token used to continue a truncated list request. */ + nextPageToken?: string; + } + interface DeploymentsStopRequest { + /** + * Specifies a fingerprint for stop() requests. A fingerprint is a randomly generated value that must be provided in stop() requests to perform optimistic + * locking. This ensures optimistic concurrency so that the deployment does not have conflicting requests (e.g. if someone attempts to make a new update + * request while another user attempts to stop an ongoing update request, this would prevent a collision). + * + * The fingerprint is initially generated by Deployment Manager and changes after every request to modify a deployment. To get the latest fingerprint + * value, perform a get() request on the deployment. + */ + fingerprint?: string; + } + interface Expr { + /** An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. */ + description?: string; + /** + * Textual representation of an expression in Common Expression Language syntax. + * + * The application context of the containing message determines which well-known feature set of CEL is supported. + */ + expression?: string; + /** An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file. */ + location?: string; + /** An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression. */ + title?: string; + } + interface ImportFile { + /** The contents of the file. */ + content?: string; + /** The name of the file. */ + name?: string; + } + interface LogConfig { + /** Cloud audit options. */ + cloudAudit?: LogConfigCloudAuditOptions; + /** Counter options. */ + counter?: LogConfigCounterOptions; + /** Data access options. */ + dataAccess?: LogConfigDataAccessOptions; + } + interface LogConfigCloudAuditOptions { + /** Information used by the Cloud Audit Logging pipeline. */ + authorizationLoggingOptions?: AuthorizationLoggingOptions; + /** The log_name to populate in the Cloud Audit Record. */ + logName?: string; + } + interface LogConfigCounterOptions { + /** The field value to attribute. */ + field?: string; + /** The metric to update. */ + metric?: string; + } + interface LogConfigDataAccessOptions { + /** Whether Gin logging should happen in a fail-closed manner at the caller. This is relevant only in the LocalIAM implementation, for now. */ + logMode?: string; + } + interface Manifest { + /** Output only. The YAML configuration for this manifest. */ + config?: ConfigFile; + /** Output only. The fully-expanded configuration file, including any templates and references. */ + expandedConfig?: string; + /** Output only. Unique identifier for the resource; defined by the server. */ + id?: string; + /** Output only. The imported files for this manifest. */ + imports?: ImportFile[]; + /** Output only. Timestamp when the manifest was created, in RFC3339 text format. */ + insertTime?: string; + /** Output only. The YAML layout for this manifest. */ + layout?: string; + /** + * Output only. + * + * The name of the manifest. + */ + name?: string; + /** Output only. Self link for the manifest. */ + selfLink?: string; + } + interface ManifestsListResponse { + /** Output only. Manifests contained in this list response. */ + manifests?: Manifest[]; + /** Output only. A token used to continue a truncated list request. */ + nextPageToken?: string; + } + interface Operation { + /** [Output Only] Reserved for future use. */ + clientOperationId?: string; + /** [Deprecated] This field is deprecated. */ + creationTimestamp?: string; + /** [Output Only] A textual description of the operation, which is set when the operation is created. */ + description?: string; + /** [Output Only] The time that this operation was completed. This value is in RFC3339 text format. */ + endTime?: string; + /** [Output Only] If errors are generated during processing of the operation, this field will be populated. */ + error?: { + /** [Output Only] The array of errors encountered while processing this operation. */ + errors?: Array<{ + /** [Output Only] The error type identifier for this error. */ + code?: string; + /** [Output Only] Indicates the field in the request that caused the error. This property is optional. */ + location?: string; + /** [Output Only] An optional, human-readable error message. */ + message?: string; + }>; + }; + /** [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. */ + httpErrorMessage?: string; + /** + * [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a 404 means the resource was not + * found. + */ + httpErrorStatusCode?: number; + /** [Output Only] The unique identifier for the resource. This identifier is defined by the server. */ + id?: string; + /** [Output Only] The time that this operation was requested. This value is in RFC3339 text format. */ + insertTime?: string; + /** [Output Only] Type of the resource. Always compute#operation for Operation resources. */ + kind?: string; + /** [Output Only] Name of the resource. */ + name?: string; + /** [Output Only] The type of operation, such as insert, update, or delete, and so on. */ + operationType?: string; + /** + * [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of + * operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation + * progresses. + */ + progress?: number; + /** [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. */ + region?: string; + /** [Output Only] Server-defined URL for the resource. */ + selfLink?: string; + /** [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. */ + startTime?: string; + /** [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. */ + status?: string; + /** [Output Only] An optional textual description of the current status of the operation. */ + statusMessage?: string; + /** [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. */ + targetId?: string; + /** + * [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk + * that the snapshot was created from. + */ + targetLink?: string; + /** [Output Only] User who requested the operation, for example: user@example.com. */ + user?: string; + /** [Output Only] If warning messages are generated during processing of the operation, this field will be populated. */ + warnings?: Array<{ + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }>; + /** [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations. */ + zone?: string; + } + interface OperationsListResponse { + /** Output only. A token used to continue a truncated list request. */ + nextPageToken?: string; + /** Output only. Operations contained in this list response. */ + operations?: Operation[]; + } + interface Policy { + /** Specifies cloud audit logging configuration for this policy. */ + auditConfigs?: AuditConfig[]; + /** Associates a list of `members` to a `role`. `bindings` with no members will result in an error. */ + bindings?: Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly + * suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is + * returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will + * be applied to the same version of the policy. + * + * If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly. + */ + etag?: string; + iamOwned?: boolean; + /** + * If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any + * DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any + * ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no + * rule applies, permission is denied. + */ + rules?: Rule[]; + /** Version of the `Policy`. The default version is 0. */ + version?: number; + } + interface Resource { + /** The Access Control Policy set on this resource. */ + accessControl?: ResourceAccessControl; + /** Output only. The evaluated properties of the resource with references expanded. Returned as serialized YAML. */ + finalProperties?: string; + /** Output only. Unique identifier for the resource; defined by the server. */ + id?: string; + /** Output only. Timestamp when the resource was created or acquired, in RFC3339 text format . */ + insertTime?: string; + /** Output only. URL of the manifest representing the current configuration of this resource. */ + manifest?: string; + /** Output only. The name of the resource as it appears in the YAML config. */ + name?: string; + /** Output only. The current properties of the resource before any references have been filled in. Returned as serialized YAML. */ + properties?: string; + /** Output only. The type of the resource, for example compute.v1.instance, or cloudfunctions.v1beta1.function. */ + type?: string; + /** Output only. If Deployment Manager is currently updating or previewing an update to this resource, the updated configuration appears here. */ + update?: ResourceUpdate; + /** Output only. Timestamp when the resource was updated, in RFC3339 text format . */ + updateTime?: string; + /** Output only. The URL of the actual resource. */ + url?: string; + /** Output only. If warning messages are generated during processing of this resource, this field will be populated. */ + warnings?: Array<{ + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }>; + } + interface ResourceAccessControl { + /** The GCP IAM Policy to set on the resource. */ + gcpIamPolicy?: string; + } + interface ResourceUpdate { + /** The Access Control Policy to set on this resource after updating the resource itself. */ + accessControl?: ResourceAccessControl; + /** Output only. If errors are generated during update of the resource, this field will be populated. */ + error?: { + /** [Output Only] The array of errors encountered while processing this operation. */ + errors?: Array<{ + /** [Output Only] The error type identifier for this error. */ + code?: string; + /** [Output Only] Indicates the field in the request that caused the error. This property is optional. */ + location?: string; + /** [Output Only] An optional, human-readable error message. */ + message?: string; + }>; + }; + /** Output only. The expanded properties of the resource with reference values expanded. Returned as serialized YAML. */ + finalProperties?: string; + /** Output only. The intent of the resource: PREVIEW, UPDATE, or CANCEL. */ + intent?: string; + /** Output only. URL of the manifest representing the update configuration of this resource. */ + manifest?: string; + /** Output only. The set of updated properties for this resource, before references are expanded. Returned as serialized YAML. */ + properties?: string; + /** Output only. The state of the resource. */ + state?: string; + /** Output only. If warning messages are generated during processing of this resource, this field will be populated. */ + warnings?: Array<{ + /** [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. */ + code?: string; + /** + * [Output Only] Metadata about this warning in key: value format. For example: + * "data": [ { "key": "scope", "value": "zones/us-east1-d" } + */ + data?: Array<{ + /** + * [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for + * a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and + * a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled + * for IP forwarding). + */ + key?: string; + /** [Output Only] A warning data value corresponding to the key. */ + value?: string; + }>; + /** [Output Only] A human-readable description of the warning code. */ + message?: string; + }>; + } + interface ResourcesListResponse { + /** A token used to continue a truncated list request. */ + nextPageToken?: string; + /** Resources contained in this list response. */ + resources?: Resource[]; + } + interface Rule { + /** Required */ + action?: string; + /** Additional restrictions that must be met. All conditions must pass for the rule to match. */ + conditions?: Condition[]; + /** Human-readable description of the rule. */ + description?: string; + /** If one or more 'in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries. */ + ins?: string[]; + /** The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action. */ + logConfigs?: LogConfig[]; + /** If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries. */ + notIns?: string[]; + /** + * A permission is a string of form '..' (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, and a verb part of '*' (e.g., + * 'storage.buckets.*') matches all verbs. + */ + permissions?: string[]; + } + interface TargetConfiguration { + /** The configuration to use for this deployment. */ + config?: ConfigFile; + /** + * Specifies any files to import for this configuration. This can be used to import templates or other files. For example, you might import a text file in + * order to use the file in a template. + */ + imports?: ImportFile[]; + } + interface TestPermissionsRequest { + /** The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. */ + permissions?: string[]; + } + interface TestPermissionsResponse { + /** A subset of `TestPermissionsRequest.permissions` that the caller is allowed. */ + permissions?: string[]; + } + interface Type { + /** Output only. Unique identifier for the resource; defined by the server. */ + id?: string; + /** Output only. Timestamp when the type was created, in RFC3339 text format. */ + insertTime?: string; + /** Name of the type. */ + name?: string; + /** Output only. The Operation that most recently ran, or is currently running, on this type. */ + operation?: Operation; + /** Output only. Self link for the type. */ + selfLink?: string; + } + interface TypesListResponse { + /** A token used to continue a truncated list request. */ + nextPageToken?: string; + /** Output only. A list of resource types supported by Deployment Manager. */ + types?: Type[]; + } + interface DeploymentsResource { + /** Cancels and removes the preview currently associated with the deployment. */ + cancelPreview(request: { + /** Data format for the response. */ + alt?: string; + /** The name of the deployment for this request. */ + deployment: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes a deployment and all of the resources in the deployment. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Sets the policy to use for deleting resources. */ + deletePolicy?: string; + /** The name of the deployment for this request. */ + deployment: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets information about a specific deployment. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The name of the deployment for this request. */ + deployment: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets the access control policy for a resource. May be empty if no such policy or resource exists. */ + getIamPolicy(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a deployment and all of the resources described by the deployment manifest. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * If set to true, creates a deployment and creates "shell" resources but does not actually instantiate these resources. This allows you to preview what + * your deployment looks like. After previewing a deployment, you can deploy your resources by making a request with the update() method or you can use + * the cancelPreview() method to cancel the preview altogether. Note that the deployment will still exist after you cancel the preview and you must + * separately delete this deployment if you want to remove it. + */ + preview?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all deployments for a given project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a deployment and all of the resources described by the deployment manifest. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Sets the policy to use for creating new resources. */ + createPolicy?: string; + /** Sets the policy to use for deleting resources. */ + deletePolicy?: string; + /** The name of the deployment for this request. */ + deployment: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * If set to true, updates the deployment and creates and updates the "shell" resources but does not actually alter or instantiate these resources. This + * allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must + * provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request + * with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview + * and you must separately delete this deployment if you want to remove it. + */ + preview?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Sets the access control policy on the specified resource. Replaces any existing policy. */ + setIamPolicy(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Stops an ongoing operation. This does not roll back any work that has already been completed, but prevents any new work from being started. */ + stop(request: { + /** Data format for the response. */ + alt?: string; + /** The name of the deployment for this request. */ + deployment: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns permissions that a caller has on the specified resource. */ + testIamPermissions(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a deployment and all of the resources described by the deployment manifest. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Sets the policy to use for creating new resources. */ + createPolicy?: string; + /** Sets the policy to use for deleting resources. */ + deletePolicy?: string; + /** The name of the deployment for this request. */ + deployment: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * If set to true, updates the deployment and creates and updates the "shell" resources but does not actually alter or instantiate these resources. This + * allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must + * provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request + * with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview + * and you must separately delete this deployment if you want to remove it. + */ + preview?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ManifestsResource { + /** Gets information about a specific manifest. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The name of the deployment for this request. */ + deployment: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the manifest for this request. */ + manifest: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all manifests for a given deployment. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The name of the deployment for this request. */ + deployment: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface OperationsResource { + /** Gets information about a specific operation. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The name of the operation for this request. */ + operation: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all operations for a project. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ResourcesResource { + /** Gets information about a single resource. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The name of the deployment for this request. */ + deployment: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The name of the resource for this request. */ + resource: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists all resources in a given deployment. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The name of the deployment for this request. */ + deployment: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TypesResource { + /** Lists all resource types for Deployment Manager. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string. + * + * The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string + * must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of + * field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The + * literal value must match the entire field. + * + * For example, to filter for instances that do not have a name of example-instance, you would use name ne example-instance. + * + * You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering + * on nested fields to take advantage of labels to organize and search for results based on label values. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq + * us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a + * nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the + * creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation + * is returned first. + * + * Currently, only sorting by name or creationTimestamp desc is supported. + */ + orderBy?: string; + /** Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The project ID for this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.deploymentmanager/readme.md b/types/gapi.client.deploymentmanager/readme.md new file mode 100644 index 0000000000..b14c3e91e7 --- /dev/null +++ b/types/gapi.client.deploymentmanager/readme.md @@ -0,0 +1,153 @@ +# TypeScript typings for Google Cloud Deployment Manager API v2 +Declares, configures, and deploys complex solutions on Google Cloud Platform. +For detailed description please check [documentation](https://cloud.google.com/deployment-manager/). + +## Installing + +Install typings for Google Cloud Deployment Manager API: +``` +npm install @types/gapi.client.deploymentmanager@v2 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('deploymentmanager', 'v2', () => { + // now we can use gapi.client.deploymentmanager + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform.read-only', + + // View and manage your Google Cloud Platform management resources and deployment status information + 'https://www.googleapis.com/auth/ndev.cloudman', + + // View your Google Cloud Platform management resources and deployment status information + 'https://www.googleapis.com/auth/ndev.cloudman.readonly', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Cloud Deployment Manager API resources: + +```typescript + +/* +Cancels and removes the preview currently associated with the deployment. +*/ +await gapi.client.deployments.cancelPreview({ deployment: "deployment", project: "project", }); + +/* +Deletes a deployment and all of the resources in the deployment. +*/ +await gapi.client.deployments.delete({ deployment: "deployment", project: "project", }); + +/* +Gets information about a specific deployment. +*/ +await gapi.client.deployments.get({ deployment: "deployment", project: "project", }); + +/* +Gets the access control policy for a resource. May be empty if no such policy or resource exists. +*/ +await gapi.client.deployments.getIamPolicy({ project: "project", resource: "resource", }); + +/* +Creates a deployment and all of the resources described by the deployment manifest. +*/ +await gapi.client.deployments.insert({ project: "project", }); + +/* +Lists all deployments for a given project. +*/ +await gapi.client.deployments.list({ project: "project", }); + +/* +Updates a deployment and all of the resources described by the deployment manifest. This method supports patch semantics. +*/ +await gapi.client.deployments.patch({ deployment: "deployment", project: "project", }); + +/* +Sets the access control policy on the specified resource. Replaces any existing policy. +*/ +await gapi.client.deployments.setIamPolicy({ project: "project", resource: "resource", }); + +/* +Stops an ongoing operation. This does not roll back any work that has already been completed, but prevents any new work from being started. +*/ +await gapi.client.deployments.stop({ deployment: "deployment", project: "project", }); + +/* +Returns permissions that a caller has on the specified resource. +*/ +await gapi.client.deployments.testIamPermissions({ project: "project", resource: "resource", }); + +/* +Updates a deployment and all of the resources described by the deployment manifest. +*/ +await gapi.client.deployments.update({ deployment: "deployment", project: "project", }); + +/* +Gets information about a specific manifest. +*/ +await gapi.client.manifests.get({ deployment: "deployment", manifest: "manifest", project: "project", }); + +/* +Lists all manifests for a given deployment. +*/ +await gapi.client.manifests.list({ deployment: "deployment", project: "project", }); + +/* +Gets information about a specific operation. +*/ +await gapi.client.operations.get({ operation: "operation", project: "project", }); + +/* +Lists all operations for a project. +*/ +await gapi.client.operations.list({ project: "project", }); + +/* +Gets information about a single resource. +*/ +await gapi.client.resources.get({ deployment: "deployment", project: "project", resource: "resource", }); + +/* +Lists all resources in a given deployment. +*/ +await gapi.client.resources.list({ deployment: "deployment", project: "project", }); + +/* +Lists all resource types for Deployment Manager. +*/ +await gapi.client.types.list({ project: "project", }); +``` \ No newline at end of file diff --git a/types/gapi.client.deploymentmanager/tsconfig.json b/types/gapi.client.deploymentmanager/tsconfig.json new file mode 100644 index 0000000000..76527cf87c --- /dev/null +++ b/types/gapi.client.deploymentmanager/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.deploymentmanager-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.deploymentmanager/tslint.json b/types/gapi.client.deploymentmanager/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.deploymentmanager/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.dfareporting/gapi.client.dfareporting-tests.ts b/types/gapi.client.dfareporting/gapi.client.dfareporting-tests.ts new file mode 100644 index 0000000000..eef00757ac --- /dev/null +++ b/types/gapi.client.dfareporting/gapi.client.dfareporting-tests.ts @@ -0,0 +1,1301 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('dfareporting', 'v2.8', () => { + /** now we can use gapi.client.dfareporting */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** Manage DoubleClick Digital Marketing conversions */ + 'https://www.googleapis.com/auth/ddmconversions', + /** View and manage DoubleClick for Advertisers reports */ + 'https://www.googleapis.com/auth/dfareporting', + /** View and manage your DoubleClick Campaign Manager's (DCM) display ad campaigns */ + 'https://www.googleapis.com/auth/dfatrafficking', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Gets the account's active ad summary by account ID. */ + await gapi.client.accountActiveAdSummaries.get({ + profileId: "profileId", + summaryAccountId: "summaryAccountId", + }); + /** Gets one account permission group by ID. */ + await gapi.client.accountPermissionGroups.get({ + id: "id", + profileId: "profileId", + }); + /** Retrieves the list of account permission groups. */ + await gapi.client.accountPermissionGroups.list({ + profileId: "profileId", + }); + /** Gets one account permission by ID. */ + await gapi.client.accountPermissions.get({ + id: "id", + profileId: "profileId", + }); + /** Retrieves the list of account permissions. */ + await gapi.client.accountPermissions.list({ + profileId: "profileId", + }); + /** Gets one account user profile by ID. */ + await gapi.client.accountUserProfiles.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new account user profile. */ + await gapi.client.accountUserProfiles.insert({ + profileId: "profileId", + }); + /** Retrieves a list of account user profiles, possibly filtered. This method supports paging. */ + await gapi.client.accountUserProfiles.list({ + active: true, + ids: "ids", + maxResults: 3, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + subaccountId: "subaccountId", + userRoleId: "userRoleId", + }); + /** Updates an existing account user profile. This method supports patch semantics. */ + await gapi.client.accountUserProfiles.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing account user profile. */ + await gapi.client.accountUserProfiles.update({ + profileId: "profileId", + }); + /** Gets one account by ID. */ + await gapi.client.accounts.get({ + id: "id", + profileId: "profileId", + }); + /** Retrieves the list of accounts, possibly filtered. This method supports paging. */ + await gapi.client.accounts.list({ + active: true, + ids: "ids", + maxResults: 3, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing account. This method supports patch semantics. */ + await gapi.client.accounts.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing account. */ + await gapi.client.accounts.update({ + profileId: "profileId", + }); + /** Gets one ad by ID. */ + await gapi.client.ads.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new ad. */ + await gapi.client.ads.insert({ + profileId: "profileId", + }); + /** Retrieves a list of ads, possibly filtered. This method supports paging. */ + await gapi.client.ads.list({ + active: true, + advertiserId: "advertiserId", + archived: true, + audienceSegmentIds: "audienceSegmentIds", + campaignIds: "campaignIds", + compatibility: "compatibility", + creativeIds: "creativeIds", + creativeOptimizationConfigurationIds: "creativeOptimizationConfigurationIds", + dynamicClickTracker: true, + ids: "ids", + landingPageIds: "landingPageIds", + maxResults: 12, + overriddenEventTagId: "overriddenEventTagId", + pageToken: "pageToken", + placementIds: "placementIds", + profileId: "profileId", + remarketingListIds: "remarketingListIds", + searchString: "searchString", + sizeIds: "sizeIds", + sortField: "sortField", + sortOrder: "sortOrder", + sslCompliant: true, + sslRequired: true, + type: "type", + }); + /** Updates an existing ad. This method supports patch semantics. */ + await gapi.client.ads.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing ad. */ + await gapi.client.ads.update({ + profileId: "profileId", + }); + /** Deletes an existing advertiser group. */ + await gapi.client.advertiserGroups.delete({ + id: "id", + profileId: "profileId", + }); + /** Gets one advertiser group by ID. */ + await gapi.client.advertiserGroups.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new advertiser group. */ + await gapi.client.advertiserGroups.insert({ + profileId: "profileId", + }); + /** Retrieves a list of advertiser groups, possibly filtered. This method supports paging. */ + await gapi.client.advertiserGroups.list({ + ids: "ids", + maxResults: 2, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing advertiser group. This method supports patch semantics. */ + await gapi.client.advertiserGroups.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing advertiser group. */ + await gapi.client.advertiserGroups.update({ + profileId: "profileId", + }); + /** Gets one advertiser by ID. */ + await gapi.client.advertisers.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new advertiser. */ + await gapi.client.advertisers.insert({ + profileId: "profileId", + }); + /** Retrieves a list of advertisers, possibly filtered. This method supports paging. */ + await gapi.client.advertisers.list({ + advertiserGroupIds: "advertiserGroupIds", + floodlightConfigurationIds: "floodlightConfigurationIds", + ids: "ids", + includeAdvertisersWithoutGroupsOnly: true, + maxResults: 5, + onlyParent: true, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + status: "status", + subaccountId: "subaccountId", + }); + /** Updates an existing advertiser. This method supports patch semantics. */ + await gapi.client.advertisers.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing advertiser. */ + await gapi.client.advertisers.update({ + profileId: "profileId", + }); + /** Retrieves a list of browsers. */ + await gapi.client.browsers.list({ + profileId: "profileId", + }); + /** + * Associates a creative with the specified campaign. This method creates a default ad with dimensions matching the creative in the campaign if such a + * default ad does not exist already. + */ + await gapi.client.campaignCreativeAssociations.insert({ + campaignId: "campaignId", + profileId: "profileId", + }); + /** Retrieves the list of creative IDs associated with the specified campaign. This method supports paging. */ + await gapi.client.campaignCreativeAssociations.list({ + campaignId: "campaignId", + maxResults: 2, + pageToken: "pageToken", + profileId: "profileId", + sortOrder: "sortOrder", + }); + /** Gets one campaign by ID. */ + await gapi.client.campaigns.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new campaign. */ + await gapi.client.campaigns.insert({ + defaultLandingPageName: "defaultLandingPageName", + defaultLandingPageUrl: "defaultLandingPageUrl", + profileId: "profileId", + }); + /** Retrieves a list of campaigns, possibly filtered. This method supports paging. */ + await gapi.client.campaigns.list({ + advertiserGroupIds: "advertiserGroupIds", + advertiserIds: "advertiserIds", + archived: true, + atLeastOneOptimizationActivity: true, + excludedIds: "excludedIds", + ids: "ids", + maxResults: 7, + overriddenEventTagId: "overriddenEventTagId", + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + subaccountId: "subaccountId", + }); + /** Updates an existing campaign. This method supports patch semantics. */ + await gapi.client.campaigns.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing campaign. */ + await gapi.client.campaigns.update({ + profileId: "profileId", + }); + /** Gets one change log by ID. */ + await gapi.client.changeLogs.get({ + id: "id", + profileId: "profileId", + }); + /** Retrieves a list of change logs. This method supports paging. */ + await gapi.client.changeLogs.list({ + action: "action", + ids: "ids", + maxChangeTime: "maxChangeTime", + maxResults: 4, + minChangeTime: "minChangeTime", + objectIds: "objectIds", + objectType: "objectType", + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + userProfileIds: "userProfileIds", + }); + /** Retrieves a list of cities, possibly filtered. */ + await gapi.client.cities.list({ + countryDartIds: "countryDartIds", + dartIds: "dartIds", + namePrefix: "namePrefix", + profileId: "profileId", + regionDartIds: "regionDartIds", + }); + /** Gets one connection type by ID. */ + await gapi.client.connectionTypes.get({ + id: "id", + profileId: "profileId", + }); + /** Retrieves a list of connection types. */ + await gapi.client.connectionTypes.list({ + profileId: "profileId", + }); + /** Deletes an existing content category. */ + await gapi.client.contentCategories.delete({ + id: "id", + profileId: "profileId", + }); + /** Gets one content category by ID. */ + await gapi.client.contentCategories.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new content category. */ + await gapi.client.contentCategories.insert({ + profileId: "profileId", + }); + /** Retrieves a list of content categories, possibly filtered. This method supports paging. */ + await gapi.client.contentCategories.list({ + ids: "ids", + maxResults: 2, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing content category. This method supports patch semantics. */ + await gapi.client.contentCategories.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing content category. */ + await gapi.client.contentCategories.update({ + profileId: "profileId", + }); + /** Inserts conversions. */ + await gapi.client.conversions.batchinsert({ + profileId: "profileId", + }); + /** Updates existing conversions. */ + await gapi.client.conversions.batchupdate({ + profileId: "profileId", + }); + /** Gets one country by ID. */ + await gapi.client.countries.get({ + dartId: "dartId", + profileId: "profileId", + }); + /** Retrieves a list of countries. */ + await gapi.client.countries.list({ + profileId: "profileId", + }); + /** Inserts a new creative asset. */ + await gapi.client.creativeAssets.insert({ + advertiserId: "advertiserId", + profileId: "profileId", + }); + /** Deletes an existing creative field value. */ + await gapi.client.creativeFieldValues.delete({ + creativeFieldId: "creativeFieldId", + id: "id", + profileId: "profileId", + }); + /** Gets one creative field value by ID. */ + await gapi.client.creativeFieldValues.get({ + creativeFieldId: "creativeFieldId", + id: "id", + profileId: "profileId", + }); + /** Inserts a new creative field value. */ + await gapi.client.creativeFieldValues.insert({ + creativeFieldId: "creativeFieldId", + profileId: "profileId", + }); + /** Retrieves a list of creative field values, possibly filtered. This method supports paging. */ + await gapi.client.creativeFieldValues.list({ + creativeFieldId: "creativeFieldId", + ids: "ids", + maxResults: 3, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing creative field value. This method supports patch semantics. */ + await gapi.client.creativeFieldValues.patch({ + creativeFieldId: "creativeFieldId", + id: "id", + profileId: "profileId", + }); + /** Updates an existing creative field value. */ + await gapi.client.creativeFieldValues.update({ + creativeFieldId: "creativeFieldId", + profileId: "profileId", + }); + /** Deletes an existing creative field. */ + await gapi.client.creativeFields.delete({ + id: "id", + profileId: "profileId", + }); + /** Gets one creative field by ID. */ + await gapi.client.creativeFields.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new creative field. */ + await gapi.client.creativeFields.insert({ + profileId: "profileId", + }); + /** Retrieves a list of creative fields, possibly filtered. This method supports paging. */ + await gapi.client.creativeFields.list({ + advertiserIds: "advertiserIds", + ids: "ids", + maxResults: 3, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing creative field. This method supports patch semantics. */ + await gapi.client.creativeFields.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing creative field. */ + await gapi.client.creativeFields.update({ + profileId: "profileId", + }); + /** Gets one creative group by ID. */ + await gapi.client.creativeGroups.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new creative group. */ + await gapi.client.creativeGroups.insert({ + profileId: "profileId", + }); + /** Retrieves a list of creative groups, possibly filtered. This method supports paging. */ + await gapi.client.creativeGroups.list({ + advertiserIds: "advertiserIds", + groupNumber: 2, + ids: "ids", + maxResults: 4, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing creative group. This method supports patch semantics. */ + await gapi.client.creativeGroups.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing creative group. */ + await gapi.client.creativeGroups.update({ + profileId: "profileId", + }); + /** Gets one creative by ID. */ + await gapi.client.creatives.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new creative. */ + await gapi.client.creatives.insert({ + profileId: "profileId", + }); + /** Retrieves a list of creatives, possibly filtered. This method supports paging. */ + await gapi.client.creatives.list({ + active: true, + advertiserId: "advertiserId", + archived: true, + campaignId: "campaignId", + companionCreativeIds: "companionCreativeIds", + creativeFieldIds: "creativeFieldIds", + ids: "ids", + maxResults: 8, + pageToken: "pageToken", + profileId: "profileId", + renderingIds: "renderingIds", + searchString: "searchString", + sizeIds: "sizeIds", + sortField: "sortField", + sortOrder: "sortOrder", + studioCreativeId: "studioCreativeId", + types: "types", + }); + /** Updates an existing creative. This method supports patch semantics. */ + await gapi.client.creatives.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing creative. */ + await gapi.client.creatives.update({ + profileId: "profileId", + }); + /** Retrieves list of report dimension values for a list of filters. */ + await gapi.client.dimensionValues.query({ + maxResults: 1, + pageToken: "pageToken", + profileId: "profileId", + }); + /** Gets one directory site contact by ID. */ + await gapi.client.directorySiteContacts.get({ + id: "id", + profileId: "profileId", + }); + /** Retrieves a list of directory site contacts, possibly filtered. This method supports paging. */ + await gapi.client.directorySiteContacts.list({ + directorySiteIds: "directorySiteIds", + ids: "ids", + maxResults: 3, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Gets one directory site by ID. */ + await gapi.client.directorySites.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new directory site. */ + await gapi.client.directorySites.insert({ + profileId: "profileId", + }); + /** Retrieves a list of directory sites, possibly filtered. This method supports paging. */ + await gapi.client.directorySites.list({ + acceptsInStreamVideoPlacements: true, + acceptsInterstitialPlacements: true, + acceptsPublisherPaidPlacements: true, + active: true, + countryId: "countryId", + dfpNetworkCode: "dfpNetworkCode", + ids: "ids", + maxResults: 8, + pageToken: "pageToken", + parentId: "parentId", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Deletes an existing dynamic targeting key. */ + await gapi.client.dynamicTargetingKeys.delete({ + name: "name", + objectId: "objectId", + objectType: "objectType", + profileId: "profileId", + }); + /** + * Inserts a new dynamic targeting key. Keys must be created at the advertiser level before being assigned to the advertiser's ads, creatives, or + * placements. There is a maximum of 1000 keys per advertiser, out of which a maximum of 20 keys can be assigned per ad, creative, or placement. + */ + await gapi.client.dynamicTargetingKeys.insert({ + profileId: "profileId", + }); + /** Retrieves a list of dynamic targeting keys. */ + await gapi.client.dynamicTargetingKeys.list({ + advertiserId: "advertiserId", + names: "names", + objectId: "objectId", + objectType: "objectType", + profileId: "profileId", + }); + /** Deletes an existing event tag. */ + await gapi.client.eventTags.delete({ + id: "id", + profileId: "profileId", + }); + /** Gets one event tag by ID. */ + await gapi.client.eventTags.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new event tag. */ + await gapi.client.eventTags.insert({ + profileId: "profileId", + }); + /** Retrieves a list of event tags, possibly filtered. */ + await gapi.client.eventTags.list({ + adId: "adId", + advertiserId: "advertiserId", + campaignId: "campaignId", + definitionsOnly: true, + enabled: true, + eventTagTypes: "eventTagTypes", + ids: "ids", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing event tag. This method supports patch semantics. */ + await gapi.client.eventTags.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing event tag. */ + await gapi.client.eventTags.update({ + profileId: "profileId", + }); + /** Retrieves a report file by its report ID and file ID. This method supports media download. */ + await gapi.client.files.get({ + fileId: "fileId", + reportId: "reportId", + }); + /** Lists files for a user profile. */ + await gapi.client.files.list({ + maxResults: 1, + pageToken: "pageToken", + profileId: "profileId", + scope: "scope", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Deletes an existing floodlight activity. */ + await gapi.client.floodlightActivities.delete({ + id: "id", + profileId: "profileId", + }); + /** Generates a tag for a floodlight activity. */ + await gapi.client.floodlightActivities.generatetag({ + floodlightActivityId: "floodlightActivityId", + profileId: "profileId", + }); + /** Gets one floodlight activity by ID. */ + await gapi.client.floodlightActivities.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new floodlight activity. */ + await gapi.client.floodlightActivities.insert({ + profileId: "profileId", + }); + /** Retrieves a list of floodlight activities, possibly filtered. This method supports paging. */ + await gapi.client.floodlightActivities.list({ + advertiserId: "advertiserId", + floodlightActivityGroupIds: "floodlightActivityGroupIds", + floodlightActivityGroupName: "floodlightActivityGroupName", + floodlightActivityGroupTagString: "floodlightActivityGroupTagString", + floodlightActivityGroupType: "floodlightActivityGroupType", + floodlightConfigurationId: "floodlightConfigurationId", + ids: "ids", + maxResults: 8, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + tagString: "tagString", + }); + /** Updates an existing floodlight activity. This method supports patch semantics. */ + await gapi.client.floodlightActivities.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing floodlight activity. */ + await gapi.client.floodlightActivities.update({ + profileId: "profileId", + }); + /** Gets one floodlight activity group by ID. */ + await gapi.client.floodlightActivityGroups.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new floodlight activity group. */ + await gapi.client.floodlightActivityGroups.insert({ + profileId: "profileId", + }); + /** Retrieves a list of floodlight activity groups, possibly filtered. This method supports paging. */ + await gapi.client.floodlightActivityGroups.list({ + advertiserId: "advertiserId", + floodlightConfigurationId: "floodlightConfigurationId", + ids: "ids", + maxResults: 4, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + type: "type", + }); + /** Updates an existing floodlight activity group. This method supports patch semantics. */ + await gapi.client.floodlightActivityGroups.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing floodlight activity group. */ + await gapi.client.floodlightActivityGroups.update({ + profileId: "profileId", + }); + /** Gets one floodlight configuration by ID. */ + await gapi.client.floodlightConfigurations.get({ + id: "id", + profileId: "profileId", + }); + /** Retrieves a list of floodlight configurations, possibly filtered. */ + await gapi.client.floodlightConfigurations.list({ + ids: "ids", + profileId: "profileId", + }); + /** Updates an existing floodlight configuration. This method supports patch semantics. */ + await gapi.client.floodlightConfigurations.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing floodlight configuration. */ + await gapi.client.floodlightConfigurations.update({ + profileId: "profileId", + }); + /** Gets one inventory item by ID. */ + await gapi.client.inventoryItems.get({ + id: "id", + profileId: "profileId", + projectId: "projectId", + }); + /** Retrieves a list of inventory items, possibly filtered. This method supports paging. */ + await gapi.client.inventoryItems.list({ + ids: "ids", + inPlan: true, + maxResults: 3, + orderId: "orderId", + pageToken: "pageToken", + profileId: "profileId", + projectId: "projectId", + siteId: "siteId", + sortField: "sortField", + sortOrder: "sortOrder", + type: "type", + }); + /** Deletes an existing campaign landing page. */ + await gapi.client.landingPages.delete({ + campaignId: "campaignId", + id: "id", + profileId: "profileId", + }); + /** Gets one campaign landing page by ID. */ + await gapi.client.landingPages.get({ + campaignId: "campaignId", + id: "id", + profileId: "profileId", + }); + /** Inserts a new landing page for the specified campaign. */ + await gapi.client.landingPages.insert({ + campaignId: "campaignId", + profileId: "profileId", + }); + /** Retrieves the list of landing pages for the specified campaign. */ + await gapi.client.landingPages.list({ + campaignId: "campaignId", + profileId: "profileId", + }); + /** Updates an existing campaign landing page. This method supports patch semantics. */ + await gapi.client.landingPages.patch({ + campaignId: "campaignId", + id: "id", + profileId: "profileId", + }); + /** Updates an existing campaign landing page. */ + await gapi.client.landingPages.update({ + campaignId: "campaignId", + profileId: "profileId", + }); + /** Retrieves a list of languages. */ + await gapi.client.languages.list({ + profileId: "profileId", + }); + /** Retrieves a list of metros. */ + await gapi.client.metros.list({ + profileId: "profileId", + }); + /** Gets one mobile carrier by ID. */ + await gapi.client.mobileCarriers.get({ + id: "id", + profileId: "profileId", + }); + /** Retrieves a list of mobile carriers. */ + await gapi.client.mobileCarriers.list({ + profileId: "profileId", + }); + /** Gets one operating system version by ID. */ + await gapi.client.operatingSystemVersions.get({ + id: "id", + profileId: "profileId", + }); + /** Retrieves a list of operating system versions. */ + await gapi.client.operatingSystemVersions.list({ + profileId: "profileId", + }); + /** Gets one operating system by DART ID. */ + await gapi.client.operatingSystems.get({ + dartId: "dartId", + profileId: "profileId", + }); + /** Retrieves a list of operating systems. */ + await gapi.client.operatingSystems.list({ + profileId: "profileId", + }); + /** Gets one order document by ID. */ + await gapi.client.orderDocuments.get({ + id: "id", + profileId: "profileId", + projectId: "projectId", + }); + /** Retrieves a list of order documents, possibly filtered. This method supports paging. */ + await gapi.client.orderDocuments.list({ + approved: true, + ids: "ids", + maxResults: 3, + orderId: "orderId", + pageToken: "pageToken", + profileId: "profileId", + projectId: "projectId", + searchString: "searchString", + siteId: "siteId", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Gets one order by ID. */ + await gapi.client.orders.get({ + id: "id", + profileId: "profileId", + projectId: "projectId", + }); + /** Retrieves a list of orders, possibly filtered. This method supports paging. */ + await gapi.client.orders.list({ + ids: "ids", + maxResults: 2, + pageToken: "pageToken", + profileId: "profileId", + projectId: "projectId", + searchString: "searchString", + siteId: "siteId", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Gets one placement group by ID. */ + await gapi.client.placementGroups.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new placement group. */ + await gapi.client.placementGroups.insert({ + profileId: "profileId", + }); + /** Retrieves a list of placement groups, possibly filtered. This method supports paging. */ + await gapi.client.placementGroups.list({ + advertiserIds: "advertiserIds", + archived: true, + campaignIds: "campaignIds", + contentCategoryIds: "contentCategoryIds", + directorySiteIds: "directorySiteIds", + ids: "ids", + maxEndDate: "maxEndDate", + maxResults: 8, + maxStartDate: "maxStartDate", + minEndDate: "minEndDate", + minStartDate: "minStartDate", + pageToken: "pageToken", + placementGroupType: "placementGroupType", + placementStrategyIds: "placementStrategyIds", + pricingTypes: "pricingTypes", + profileId: "profileId", + searchString: "searchString", + siteIds: "siteIds", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing placement group. This method supports patch semantics. */ + await gapi.client.placementGroups.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing placement group. */ + await gapi.client.placementGroups.update({ + profileId: "profileId", + }); + /** Deletes an existing placement strategy. */ + await gapi.client.placementStrategies.delete({ + id: "id", + profileId: "profileId", + }); + /** Gets one placement strategy by ID. */ + await gapi.client.placementStrategies.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new placement strategy. */ + await gapi.client.placementStrategies.insert({ + profileId: "profileId", + }); + /** Retrieves a list of placement strategies, possibly filtered. This method supports paging. */ + await gapi.client.placementStrategies.list({ + ids: "ids", + maxResults: 2, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing placement strategy. This method supports patch semantics. */ + await gapi.client.placementStrategies.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing placement strategy. */ + await gapi.client.placementStrategies.update({ + profileId: "profileId", + }); + /** Generates tags for a placement. */ + await gapi.client.placements.generatetags({ + campaignId: "campaignId", + placementIds: "placementIds", + profileId: "profileId", + tagFormats: "tagFormats", + }); + /** Gets one placement by ID. */ + await gapi.client.placements.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new placement. */ + await gapi.client.placements.insert({ + profileId: "profileId", + }); + /** Retrieves a list of placements, possibly filtered. This method supports paging. */ + await gapi.client.placements.list({ + advertiserIds: "advertiserIds", + archived: true, + campaignIds: "campaignIds", + compatibilities: "compatibilities", + contentCategoryIds: "contentCategoryIds", + directorySiteIds: "directorySiteIds", + groupIds: "groupIds", + ids: "ids", + maxEndDate: "maxEndDate", + maxResults: 10, + maxStartDate: "maxStartDate", + minEndDate: "minEndDate", + minStartDate: "minStartDate", + pageToken: "pageToken", + paymentSource: "paymentSource", + placementStrategyIds: "placementStrategyIds", + pricingTypes: "pricingTypes", + profileId: "profileId", + searchString: "searchString", + siteIds: "siteIds", + sizeIds: "sizeIds", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing placement. This method supports patch semantics. */ + await gapi.client.placements.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing placement. */ + await gapi.client.placements.update({ + profileId: "profileId", + }); + /** Gets one platform type by ID. */ + await gapi.client.platformTypes.get({ + id: "id", + profileId: "profileId", + }); + /** Retrieves a list of platform types. */ + await gapi.client.platformTypes.list({ + profileId: "profileId", + }); + /** Gets one postal code by ID. */ + await gapi.client.postalCodes.get({ + code: "code", + profileId: "profileId", + }); + /** Retrieves a list of postal codes. */ + await gapi.client.postalCodes.list({ + profileId: "profileId", + }); + /** Gets one project by ID. */ + await gapi.client.projects.get({ + id: "id", + profileId: "profileId", + }); + /** Retrieves a list of projects, possibly filtered. This method supports paging. */ + await gapi.client.projects.list({ + advertiserIds: "advertiserIds", + ids: "ids", + maxResults: 3, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Retrieves a list of regions. */ + await gapi.client.regions.list({ + profileId: "profileId", + }); + /** Gets one remarketing list share by remarketing list ID. */ + await gapi.client.remarketingListShares.get({ + profileId: "profileId", + remarketingListId: "remarketingListId", + }); + /** Updates an existing remarketing list share. This method supports patch semantics. */ + await gapi.client.remarketingListShares.patch({ + profileId: "profileId", + remarketingListId: "remarketingListId", + }); + /** Updates an existing remarketing list share. */ + await gapi.client.remarketingListShares.update({ + profileId: "profileId", + }); + /** Gets one remarketing list by ID. */ + await gapi.client.remarketingLists.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new remarketing list. */ + await gapi.client.remarketingLists.insert({ + profileId: "profileId", + }); + /** Retrieves a list of remarketing lists, possibly filtered. This method supports paging. */ + await gapi.client.remarketingLists.list({ + active: true, + advertiserId: "advertiserId", + floodlightActivityId: "floodlightActivityId", + maxResults: 4, + name: "name", + pageToken: "pageToken", + profileId: "profileId", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing remarketing list. This method supports patch semantics. */ + await gapi.client.remarketingLists.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing remarketing list. */ + await gapi.client.remarketingLists.update({ + profileId: "profileId", + }); + /** Deletes a report by its ID. */ + await gapi.client.reports.delete({ + profileId: "profileId", + reportId: "reportId", + }); + /** Retrieves a report by its ID. */ + await gapi.client.reports.get({ + profileId: "profileId", + reportId: "reportId", + }); + /** Creates a report. */ + await gapi.client.reports.insert({ + profileId: "profileId", + }); + /** Retrieves list of reports. */ + await gapi.client.reports.list({ + maxResults: 1, + pageToken: "pageToken", + profileId: "profileId", + scope: "scope", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates a report. This method supports patch semantics. */ + await gapi.client.reports.patch({ + profileId: "profileId", + reportId: "reportId", + }); + /** Runs a report. */ + await gapi.client.reports.run({ + profileId: "profileId", + reportId: "reportId", + synchronous: true, + }); + /** Updates a report. */ + await gapi.client.reports.update({ + profileId: "profileId", + reportId: "reportId", + }); + /** Gets one site by ID. */ + await gapi.client.sites.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new site. */ + await gapi.client.sites.insert({ + profileId: "profileId", + }); + /** Retrieves a list of sites, possibly filtered. This method supports paging. */ + await gapi.client.sites.list({ + acceptsInStreamVideoPlacements: true, + acceptsInterstitialPlacements: true, + acceptsPublisherPaidPlacements: true, + adWordsSite: true, + approved: true, + campaignIds: "campaignIds", + directorySiteIds: "directorySiteIds", + ids: "ids", + maxResults: 9, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + subaccountId: "subaccountId", + unmappedSite: true, + }); + /** Updates an existing site. This method supports patch semantics. */ + await gapi.client.sites.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing site. */ + await gapi.client.sites.update({ + profileId: "profileId", + }); + /** Gets one size by ID. */ + await gapi.client.sizes.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new size. */ + await gapi.client.sizes.insert({ + profileId: "profileId", + }); + /** Retrieves a list of sizes, possibly filtered. */ + await gapi.client.sizes.list({ + height: 1, + iabStandard: true, + ids: "ids", + profileId: "profileId", + width: 5, + }); + /** Gets one subaccount by ID. */ + await gapi.client.subaccounts.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new subaccount. */ + await gapi.client.subaccounts.insert({ + profileId: "profileId", + }); + /** Gets a list of subaccounts, possibly filtered. This method supports paging. */ + await gapi.client.subaccounts.list({ + ids: "ids", + maxResults: 2, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing subaccount. This method supports patch semantics. */ + await gapi.client.subaccounts.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing subaccount. */ + await gapi.client.subaccounts.update({ + profileId: "profileId", + }); + /** Gets one remarketing list by ID. */ + await gapi.client.targetableRemarketingLists.get({ + id: "id", + profileId: "profileId", + }); + /** Retrieves a list of targetable remarketing lists, possibly filtered. This method supports paging. */ + await gapi.client.targetableRemarketingLists.list({ + active: true, + advertiserId: "advertiserId", + maxResults: 3, + name: "name", + pageToken: "pageToken", + profileId: "profileId", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Gets one targeting template by ID. */ + await gapi.client.targetingTemplates.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new targeting template. */ + await gapi.client.targetingTemplates.insert({ + profileId: "profileId", + }); + /** Retrieves a list of targeting templates, optionally filtered. This method supports paging. */ + await gapi.client.targetingTemplates.list({ + advertiserId: "advertiserId", + ids: "ids", + maxResults: 3, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + }); + /** Updates an existing targeting template. This method supports patch semantics. */ + await gapi.client.targetingTemplates.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing targeting template. */ + await gapi.client.targetingTemplates.update({ + profileId: "profileId", + }); + /** Gets one user profile by ID. */ + await gapi.client.userProfiles.get({ + profileId: "profileId", + }); + /** Retrieves list of user profiles for a user. */ + await gapi.client.userProfiles.list({ + }); + /** Gets one user role permission group by ID. */ + await gapi.client.userRolePermissionGroups.get({ + id: "id", + profileId: "profileId", + }); + /** Gets a list of all supported user role permission groups. */ + await gapi.client.userRolePermissionGroups.list({ + profileId: "profileId", + }); + /** Gets one user role permission by ID. */ + await gapi.client.userRolePermissions.get({ + id: "id", + profileId: "profileId", + }); + /** Gets a list of user role permissions, possibly filtered. */ + await gapi.client.userRolePermissions.list({ + ids: "ids", + profileId: "profileId", + }); + /** Deletes an existing user role. */ + await gapi.client.userRoles.delete({ + id: "id", + profileId: "profileId", + }); + /** Gets one user role by ID. */ + await gapi.client.userRoles.get({ + id: "id", + profileId: "profileId", + }); + /** Inserts a new user role. */ + await gapi.client.userRoles.insert({ + profileId: "profileId", + }); + /** Retrieves a list of user roles, possibly filtered. This method supports paging. */ + await gapi.client.userRoles.list({ + accountUserRoleOnly: true, + ids: "ids", + maxResults: 3, + pageToken: "pageToken", + profileId: "profileId", + searchString: "searchString", + sortField: "sortField", + sortOrder: "sortOrder", + subaccountId: "subaccountId", + }); + /** Updates an existing user role. This method supports patch semantics. */ + await gapi.client.userRoles.patch({ + id: "id", + profileId: "profileId", + }); + /** Updates an existing user role. */ + await gapi.client.userRoles.update({ + profileId: "profileId", + }); + /** Gets one video format by ID. */ + await gapi.client.videoFormats.get({ + id: 1, + profileId: "profileId", + }); + /** Lists available video formats. */ + await gapi.client.videoFormats.list({ + profileId: "profileId", + }); + } +}); diff --git a/types/gapi.client.dfareporting/index.d.ts b/types/gapi.client.dfareporting/index.d.ts new file mode 100644 index 0000000000..e8050193e4 --- /dev/null +++ b/types/gapi.client.dfareporting/index.d.ts @@ -0,0 +1,9850 @@ +// Type definitions for Google DCM/DFA Reporting And Trafficking API v2.8 2.8 +// Project: https://developers.google.com/doubleclick-advertisers/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/dfareporting/v2.8/rest + +/// + +declare namespace gapi.client { + /** Load DCM/DFA Reporting And Trafficking API v2.8 */ + function load(name: "dfareporting", version: "v2.8"): PromiseLike; + function load(name: "dfareporting", version: "v2.8", callback: () => any): void; + + const accountActiveAdSummaries: dfareporting.AccountActiveAdSummariesResource; + + const accountPermissionGroups: dfareporting.AccountPermissionGroupsResource; + + const accountPermissions: dfareporting.AccountPermissionsResource; + + const accountUserProfiles: dfareporting.AccountUserProfilesResource; + + const accounts: dfareporting.AccountsResource; + + const ads: dfareporting.AdsResource; + + const advertiserGroups: dfareporting.AdvertiserGroupsResource; + + const advertisers: dfareporting.AdvertisersResource; + + const browsers: dfareporting.BrowsersResource; + + const campaignCreativeAssociations: dfareporting.CampaignCreativeAssociationsResource; + + const campaigns: dfareporting.CampaignsResource; + + const changeLogs: dfareporting.ChangeLogsResource; + + const cities: dfareporting.CitiesResource; + + const connectionTypes: dfareporting.ConnectionTypesResource; + + const contentCategories: dfareporting.ContentCategoriesResource; + + const conversions: dfareporting.ConversionsResource; + + const countries: dfareporting.CountriesResource; + + const creativeAssets: dfareporting.CreativeAssetsResource; + + const creativeFieldValues: dfareporting.CreativeFieldValuesResource; + + const creativeFields: dfareporting.CreativeFieldsResource; + + const creativeGroups: dfareporting.CreativeGroupsResource; + + const creatives: dfareporting.CreativesResource; + + const dimensionValues: dfareporting.DimensionValuesResource; + + const directorySiteContacts: dfareporting.DirectorySiteContactsResource; + + const directorySites: dfareporting.DirectorySitesResource; + + const dynamicTargetingKeys: dfareporting.DynamicTargetingKeysResource; + + const eventTags: dfareporting.EventTagsResource; + + const files: dfareporting.FilesResource; + + const floodlightActivities: dfareporting.FloodlightActivitiesResource; + + const floodlightActivityGroups: dfareporting.FloodlightActivityGroupsResource; + + const floodlightConfigurations: dfareporting.FloodlightConfigurationsResource; + + const inventoryItems: dfareporting.InventoryItemsResource; + + const landingPages: dfareporting.LandingPagesResource; + + const languages: dfareporting.LanguagesResource; + + const metros: dfareporting.MetrosResource; + + const mobileCarriers: dfareporting.MobileCarriersResource; + + const operatingSystemVersions: dfareporting.OperatingSystemVersionsResource; + + const operatingSystems: dfareporting.OperatingSystemsResource; + + const orderDocuments: dfareporting.OrderDocumentsResource; + + const orders: dfareporting.OrdersResource; + + const placementGroups: dfareporting.PlacementGroupsResource; + + const placementStrategies: dfareporting.PlacementStrategiesResource; + + const placements: dfareporting.PlacementsResource; + + const platformTypes: dfareporting.PlatformTypesResource; + + const postalCodes: dfareporting.PostalCodesResource; + + const projects: dfareporting.ProjectsResource; + + const regions: dfareporting.RegionsResource; + + const remarketingListShares: dfareporting.RemarketingListSharesResource; + + const remarketingLists: dfareporting.RemarketingListsResource; + + const reports: dfareporting.ReportsResource; + + const sites: dfareporting.SitesResource; + + const sizes: dfareporting.SizesResource; + + const subaccounts: dfareporting.SubaccountsResource; + + const targetableRemarketingLists: dfareporting.TargetableRemarketingListsResource; + + const targetingTemplates: dfareporting.TargetingTemplatesResource; + + const userProfiles: dfareporting.UserProfilesResource; + + const userRolePermissionGroups: dfareporting.UserRolePermissionGroupsResource; + + const userRolePermissions: dfareporting.UserRolePermissionsResource; + + const userRoles: dfareporting.UserRolesResource; + + const videoFormats: dfareporting.VideoFormatsResource; + + namespace dfareporting { + interface Account { + /** Account permissions assigned to this account. */ + accountPermissionIds?: string[]; + /** Profile for this account. This is a read-only field that can be left blank. */ + accountProfile?: string; + /** Whether this account is active. */ + active?: boolean; + /** Maximum number of active ads allowed for this account. */ + activeAdsLimitTier?: string; + /** Whether to serve creatives with Active View tags. If disabled, viewability data will not be available for any impressions. */ + activeViewOptOut?: boolean; + /** User role permissions available to the user roles of this account. */ + availablePermissionIds?: string[]; + /** ID of the country associated with this account. */ + countryId?: string; + /** + * ID of currency associated with this account. This is a required field. + * Acceptable values are: + * - "1" for USD + * - "2" for GBP + * - "3" for ESP + * - "4" for SEK + * - "5" for CAD + * - "6" for JPY + * - "7" for DEM + * - "8" for AUD + * - "9" for FRF + * - "10" for ITL + * - "11" for DKK + * - "12" for NOK + * - "13" for FIM + * - "14" for ZAR + * - "15" for IEP + * - "16" for NLG + * - "17" for EUR + * - "18" for KRW + * - "19" for TWD + * - "20" for SGD + * - "21" for CNY + * - "22" for HKD + * - "23" for NZD + * - "24" for MYR + * - "25" for BRL + * - "26" for PTE + * - "27" for MXP + * - "28" for CLP + * - "29" for TRY + * - "30" for ARS + * - "31" for PEN + * - "32" for ILS + * - "33" for CHF + * - "34" for VEF + * - "35" for COP + * - "36" for GTQ + * - "37" for PLN + * - "39" for INR + * - "40" for THB + * - "41" for IDR + * - "42" for CZK + * - "43" for RON + * - "44" for HUF + * - "45" for RUB + * - "46" for AED + * - "47" for BGN + * - "48" for HRK + * - "49" for MXN + */ + currencyId?: string; + /** Default placement dimensions for this account. */ + defaultCreativeSizeId?: string; + /** Description of this account. */ + description?: string; + /** ID of this account. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#account". */ + kind?: string; + /** + * Locale of this account. + * Acceptable values are: + * - "cs" (Czech) + * - "de" (German) + * - "en" (English) + * - "en-GB" (English United Kingdom) + * - "es" (Spanish) + * - "fr" (French) + * - "it" (Italian) + * - "ja" (Japanese) + * - "ko" (Korean) + * - "pl" (Polish) + * - "pt-BR" (Portuguese Brazil) + * - "ru" (Russian) + * - "sv" (Swedish) + * - "tr" (Turkish) + * - "zh-CN" (Chinese Simplified) + * - "zh-TW" (Chinese Traditional) + */ + locale?: string; + /** Maximum image size allowed for this account, in kilobytes. Value must be greater than or equal to 1. */ + maximumImageSize?: string; + /** Name of this account. This is a required field, and must be less than 128 characters long and be globally unique. */ + name?: string; + /** Whether campaigns created in this account will be enabled for Nielsen OCR reach ratings by default. */ + nielsenOcrEnabled?: boolean; + /** Reporting configuration of this account. */ + reportsConfiguration?: ReportsConfiguration; + /** Share Path to Conversion reports with Twitter. */ + shareReportsWithTwitter?: boolean; + /** File size limit in kilobytes of Rich Media teaser creatives. Acceptable values are 1 to 10240, inclusive. */ + teaserSizeLimit?: string; + } + interface AccountActiveAdSummary { + /** ID of the account. */ + accountId?: string; + /** Ads that have been activated for the account */ + activeAds?: string; + /** Maximum number of active ads allowed for the account. */ + activeAdsLimitTier?: string; + /** Ads that can be activated for the account. */ + availableAds?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#accountActiveAdSummary". */ + kind?: string; + } + interface AccountPermission { + /** + * Account profiles associated with this account permission. + * + * Possible values are: + * - "ACCOUNT_PROFILE_BASIC" + * - "ACCOUNT_PROFILE_STANDARD" + */ + accountProfiles?: string[]; + /** ID of this account permission. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#accountPermission". */ + kind?: string; + /** Administrative level required to enable this account permission. */ + level?: string; + /** Name of this account permission. */ + name?: string; + /** Permission group of this account permission. */ + permissionGroupId?: string; + } + interface AccountPermissionGroup { + /** ID of this account permission group. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#accountPermissionGroup". */ + kind?: string; + /** Name of this account permission group. */ + name?: string; + } + interface AccountPermissionGroupsListResponse { + /** Account permission group collection. */ + accountPermissionGroups?: AccountPermissionGroup[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#accountPermissionGroupsListResponse". */ + kind?: string; + } + interface AccountPermissionsListResponse { + /** Account permission collection. */ + accountPermissions?: AccountPermission[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#accountPermissionsListResponse". */ + kind?: string; + } + interface AccountUserProfile { + /** Account ID of the user profile. This is a read-only field that can be left blank. */ + accountId?: string; + /** Whether this user profile is active. This defaults to false, and must be set true on insert for the user profile to be usable. */ + active?: boolean; + /** Filter that describes which advertisers are visible to the user profile. */ + advertiserFilter?: ObjectFilter; + /** Filter that describes which campaigns are visible to the user profile. */ + campaignFilter?: ObjectFilter; + /** Comments for this user profile. */ + comments?: string; + /** Email of the user profile. The email addresss must be linked to a Google Account. This field is required on insertion and is read-only after insertion. */ + email?: string; + /** ID of the user profile. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#accountUserProfile". */ + kind?: string; + /** + * Locale of the user profile. This is a required field. + * Acceptable values are: + * - "cs" (Czech) + * - "de" (German) + * - "en" (English) + * - "en-GB" (English United Kingdom) + * - "es" (Spanish) + * - "fr" (French) + * - "it" (Italian) + * - "ja" (Japanese) + * - "ko" (Korean) + * - "pl" (Polish) + * - "pt-BR" (Portuguese Brazil) + * - "ru" (Russian) + * - "sv" (Swedish) + * - "tr" (Turkish) + * - "zh-CN" (Chinese Simplified) + * - "zh-TW" (Chinese Traditional) + */ + locale?: string; + /** + * Name of the user profile. This is a required field. Must be less than 64 characters long, must be globally unique, and cannot contain whitespace or any + * of the following characters: "&;"#%,". + */ + name?: string; + /** Filter that describes which sites are visible to the user profile. */ + siteFilter?: ObjectFilter; + /** Subaccount ID of the user profile. This is a read-only field that can be left blank. */ + subaccountId?: string; + /** Trafficker type of this user profile. */ + traffickerType?: string; + /** User type of the user profile. This is a read-only field that can be left blank. */ + userAccessType?: string; + /** Filter that describes which user roles are visible to the user profile. */ + userRoleFilter?: ObjectFilter; + /** User role ID of the user profile. This is a required field. */ + userRoleId?: string; + } + interface AccountUserProfilesListResponse { + /** Account user profile collection. */ + accountUserProfiles?: AccountUserProfile[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#accountUserProfilesListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface AccountsListResponse { + /** Account collection. */ + accounts?: Account[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#accountsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface Activities { + /** List of activity filters. The dimension values need to be all either of type "dfa:activity" or "dfa:activityGroup". */ + filters?: DimensionValue[]; + /** The kind of resource this is, in this case dfareporting#activities. */ + kind?: string; + /** List of names of floodlight activity metrics. */ + metricNames?: string[]; + } + interface Ad { + /** Account ID of this ad. This is a read-only field that can be left blank. */ + accountId?: string; + /** Whether this ad is active. When true, archived must be false. */ + active?: boolean; + /** Advertiser ID of this ad. This is a required field on insertion. */ + advertiserId?: string; + /** Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. */ + advertiserIdDimensionValue?: DimensionValue; + /** Whether this ad is archived. When true, active must be false. */ + archived?: boolean; + /** Audience segment ID that is being targeted for this ad. Applicable when type is AD_SERVING_STANDARD_AD. */ + audienceSegmentId?: string; + /** Campaign ID of this ad. This is a required field on insertion. */ + campaignId?: string; + /** Dimension value for the ID of the campaign. This is a read-only, auto-generated field. */ + campaignIdDimensionValue?: DimensionValue; + /** Click-through URL for this ad. This is a required field on insertion. Applicable when type is AD_SERVING_CLICK_TRACKER. */ + clickThroughUrl?: ClickThroughUrl; + /** Click-through URL suffix properties for this ad. Applies to the URL in the ad or (if overriding ad properties) the URL in the creative. */ + clickThroughUrlSuffixProperties?: ClickThroughUrlSuffixProperties; + /** Comments for this ad. */ + comments?: string; + /** + * Compatibility of this ad. Applicable when type is AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to either rendering on desktop or on + * mobile devices or in mobile apps for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are only used for existing default ads. New + * mobile placements must be assigned DISPLAY or DISPLAY_INTERSTITIAL and default ads created for those placements will be limited to those compatibility + * types. IN_STREAM_VIDEO refers to rendering in-stream video ads developed with the VAST standard. + */ + compatibility?: string; + /** Information about the creation of this ad. This is a read-only field. */ + createInfo?: LastModifiedInfo; + /** + * Creative group assignments for this ad. Applicable when type is AD_SERVING_CLICK_TRACKER. Only one assignment per creative group number is allowed for + * a maximum of two assignments. + */ + creativeGroupAssignments?: CreativeGroupAssignment[]; + /** + * Creative rotation for this ad. Applicable when type is AD_SERVING_DEFAULT_AD, AD_SERVING_STANDARD_AD, or AD_SERVING_TRACKING. When type is + * AD_SERVING_DEFAULT_AD, this field should have exactly one creativeAssignment. + */ + creativeRotation?: CreativeRotation; + /** + * Time and day targeting information for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is + * AD_SERVING_STANDARD_AD. + */ + dayPartTargeting?: DayPartTargeting; + /** Default click-through event tag properties for this ad. */ + defaultClickThroughEventTagProperties?: DefaultClickThroughEventTagProperties; + /** + * Delivery schedule information for this ad. Applicable when type is AD_SERVING_STANDARD_AD or AD_SERVING_TRACKING. This field along with subfields + * priority and impressionRatio are required on insertion when type is AD_SERVING_STANDARD_AD. + */ + deliverySchedule?: DeliverySchedule; + /** + * Whether this ad is a dynamic click tracker. Applicable when type is AD_SERVING_CLICK_TRACKER. This is a required field on insert, and is read-only + * after insert. + */ + dynamicClickTracker?: boolean; + /** Date and time that this ad should stop serving. Must be later than the start time. This is a required field on insertion. */ + endTime?: string; + /** Event tag overrides for this ad. */ + eventTagOverrides?: EventTagOverride[]; + /** + * Geographical targeting information for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is + * AD_SERVING_STANDARD_AD. + */ + geoTargeting?: GeoTargeting; + /** ID of this ad. This is a read-only, auto-generated field. */ + id?: string; + /** Dimension value for the ID of this ad. This is a read-only, auto-generated field. */ + idDimensionValue?: DimensionValue; + /** + * Key-value targeting information for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is + * AD_SERVING_STANDARD_AD. + */ + keyValueTargetingExpression?: KeyValueTargetingExpression; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#ad". */ + kind?: string; + /** + * Language targeting information for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is + * AD_SERVING_STANDARD_AD. + */ + languageTargeting?: LanguageTargeting; + /** Information about the most recent modification of this ad. This is a read-only field. */ + lastModifiedInfo?: LastModifiedInfo; + /** Name of this ad. This is a required field and must be less than 256 characters long. */ + name?: string; + /** Placement assignments for this ad. */ + placementAssignments?: PlacementAssignment[]; + /** + * Remarketing list targeting expression for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is + * AD_SERVING_STANDARD_AD. + */ + remarketingListExpression?: ListTargetingExpression; + /** Size of this ad. Applicable when type is AD_SERVING_DEFAULT_AD. */ + size?: Size; + /** Whether this ad is ssl compliant. This is a read-only field that is auto-generated when the ad is inserted or updated. */ + sslCompliant?: boolean; + /** Whether this ad requires ssl. This is a read-only field that is auto-generated when the ad is inserted or updated. */ + sslRequired?: boolean; + /** Date and time that this ad should start serving. If creating an ad, this field must be a time in the future. This is a required field on insertion. */ + startTime?: string; + /** Subaccount ID of this ad. This is a read-only field that can be left blank. */ + subaccountId?: string; + /** + * Targeting template ID, used to apply preconfigured targeting information to this ad. This cannot be set while any of dayPartTargeting, geoTargeting, + * keyValueTargetingExpression, languageTargeting, remarketingListExpression, or technologyTargeting are set. Applicable when type is + * AD_SERVING_STANDARD_AD. + */ + targetingTemplateId?: string; + /** + * Technology platform targeting information for this ad. This field must be left blank if the ad is using a targeting template. Applicable when type is + * AD_SERVING_STANDARD_AD. + */ + technologyTargeting?: TechnologyTargeting; + /** Type of ad. This is a required field on insertion. Note that default ads (AD_SERVING_DEFAULT_AD) cannot be created directly (see Creative resource). */ + type?: string; + } + interface AdBlockingConfiguration { + /** Click-through URL used by brand-neutral ads. This is a required field when overrideClickThroughUrl is set to true. */ + clickThroughUrl?: string; + /** + * ID of a creative bundle to use for this campaign. If set, brand-neutral ads will select creatives from this bundle. Otherwise, a default transparent + * pixel will be used. + */ + creativeBundleId?: string; + /** + * Whether this campaign has enabled ad blocking. When true, ad blocking is enabled for placements in the campaign, but this may be overridden by site and + * placement settings. When false, ad blocking is disabled for all placements under the campaign, regardless of site and placement settings. + */ + enabled?: boolean; + /** + * Whether the brand-neutral ad's click-through URL comes from the campaign's creative bundle or the override URL. Must be set to true if ad blocking is + * enabled and no creative bundle is configured. + */ + overrideClickThroughUrl?: boolean; + } + interface AdSlot { + /** Comment for this ad slot. */ + comment?: string; + /** + * Ad slot compatibility. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop, mobile devices or in mobile apps for regular or + * interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads + * developed with the VAST standard. + */ + compatibility?: string; + /** Height of this ad slot. */ + height?: string; + /** ID of the placement from an external platform that is linked to this ad slot. */ + linkedPlacementId?: string; + /** Name of this ad slot. */ + name?: string; + /** Payment source type of this ad slot. */ + paymentSourceType?: string; + /** Primary ad slot of a roadblock inventory item. */ + primary?: boolean; + /** Width of this ad slot. */ + width?: string; + } + interface AdsListResponse { + /** Ad collection. */ + ads?: Ad[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#adsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface Advertiser { + /** Account ID of this advertiser.This is a read-only field that can be left blank. */ + accountId?: string; + /** + * ID of the advertiser group this advertiser belongs to. You can group advertisers for reporting purposes, allowing you to see aggregated information for + * all advertisers in each group. + */ + advertiserGroupId?: string; + /** Suffix added to click-through URL of ad creative associations under this advertiser. Must be less than 129 characters long. */ + clickThroughUrlSuffix?: string; + /** ID of the click-through event tag to apply by default to the landing pages of this advertiser's campaigns. */ + defaultClickThroughEventTagId?: string; + /** Default email address used in sender field for tag emails. */ + defaultEmail?: string; + /** + * Floodlight configuration ID of this advertiser. The floodlight configuration ID will be created automatically, so on insert this field should be left + * blank. This field can be set to another advertiser's floodlight configuration ID in order to share that advertiser's floodlight configuration with this + * advertiser, so long as: + * - This advertiser's original floodlight configuration is not already associated with floodlight activities or floodlight activity groups. + * - This advertiser's original floodlight configuration is not already shared with another advertiser. + */ + floodlightConfigurationId?: string; + /** Dimension value for the ID of the floodlight configuration. This is a read-only, auto-generated field. */ + floodlightConfigurationIdDimensionValue?: DimensionValue; + /** ID of this advertiser. This is a read-only, auto-generated field. */ + id?: string; + /** Dimension value for the ID of this advertiser. This is a read-only, auto-generated field. */ + idDimensionValue?: DimensionValue; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#advertiser". */ + kind?: string; + /** Name of this advertiser. This is a required field and must be less than 256 characters long and unique among advertisers of the same account. */ + name?: string; + /** + * Original floodlight configuration before any sharing occurred. Set the floodlightConfigurationId of this advertiser to + * originalFloodlightConfigurationId to unshare the advertiser's current floodlight configuration. You cannot unshare an advertiser's floodlight + * configuration if the shared configuration has activities associated with any campaign or placement. + */ + originalFloodlightConfigurationId?: string; + /** Status of this advertiser. */ + status?: string; + /** Subaccount ID of this advertiser.This is a read-only field that can be left blank. */ + subaccountId?: string; + /** Suspension status of this advertiser. */ + suspended?: boolean; + } + interface AdvertiserGroup { + /** Account ID of this advertiser group. This is a read-only field that can be left blank. */ + accountId?: string; + /** ID of this advertiser group. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#advertiserGroup". */ + kind?: string; + /** + * Name of this advertiser group. This is a required field and must be less than 256 characters long and unique among advertiser groups of the same + * account. + */ + name?: string; + } + interface AdvertiserGroupsListResponse { + /** Advertiser group collection. */ + advertiserGroups?: AdvertiserGroup[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#advertiserGroupsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface AdvertisersListResponse { + /** Advertiser collection. */ + advertisers?: Advertiser[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#advertisersListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface AudienceSegment { + /** + * Weight allocated to this segment. The weight assigned will be understood in proportion to the weights assigned to other segments in the same segment + * group. Acceptable values are 1 to 1000, inclusive. + */ + allocation?: number; + /** ID of this audience segment. This is a read-only, auto-generated field. */ + id?: string; + /** Name of this audience segment. This is a required field and must be less than 65 characters long. */ + name?: string; + } + interface AudienceSegmentGroup { + /** Audience segments assigned to this group. The number of segments must be between 2 and 100. */ + audienceSegments?: AudienceSegment[]; + /** ID of this audience segment group. This is a read-only, auto-generated field. */ + id?: string; + /** Name of this audience segment group. This is a required field and must be less than 65 characters long. */ + name?: string; + } + interface Browser { + /** ID referring to this grouping of browser and version numbers. This is the ID used for targeting. */ + browserVersionId?: string; + /** DART ID of this browser. This is the ID used when generating reports. */ + dartId?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#browser". */ + kind?: string; + /** + * Major version number (leftmost number) of this browser. For example, for Chrome 5.0.376.86 beta, this field should be set to 5. An asterisk (*) may be + * used to target any version number, and a question mark (?) may be used to target cases where the version number cannot be identified. For example, + * Chrome *.* targets any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where + * the ad server knows the browser is Firefox but can't tell which version it is. + */ + majorVersion?: string; + /** + * Minor version number (number after first dot on left) of this browser. For example, for Chrome 5.0.375.86 beta, this field should be set to 0. An + * asterisk (*) may be used to target any version number, and a question mark (?) may be used to target cases where the version number cannot be + * identified. For example, Chrome *.* targets any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets Chrome 3.1, 3.5, but not 4.0. Firefox + * ?.? targets cases where the ad server knows the browser is Firefox but can't tell which version it is. + */ + minorVersion?: string; + /** Name of this browser. */ + name?: string; + } + interface BrowsersListResponse { + /** Browser collection. */ + browsers?: Browser[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#browsersListResponse". */ + kind?: string; + } + interface Campaign { + /** Account ID of this campaign. This is a read-only field that can be left blank. */ + accountId?: string; + /** Ad blocking settings for this campaign. */ + adBlockingConfiguration?: AdBlockingConfiguration; + /** Additional creative optimization configurations for the campaign. */ + additionalCreativeOptimizationConfigurations?: CreativeOptimizationConfiguration[]; + /** Advertiser group ID of the associated advertiser. */ + advertiserGroupId?: string; + /** Advertiser ID of this campaign. This is a required field. */ + advertiserId?: string; + /** Dimension value for the advertiser ID of this campaign. This is a read-only, auto-generated field. */ + advertiserIdDimensionValue?: DimensionValue; + /** Whether this campaign has been archived. */ + archived?: boolean; + /** Audience segment groups assigned to this campaign. Cannot have more than 300 segment groups. */ + audienceSegmentGroups?: AudienceSegmentGroup[]; + /** Billing invoice code included in the DCM client billing invoices associated with the campaign. */ + billingInvoiceCode?: string; + /** Click-through URL suffix override properties for this campaign. */ + clickThroughUrlSuffixProperties?: ClickThroughUrlSuffixProperties; + /** Arbitrary comments about this campaign. Must be less than 256 characters long. */ + comment?: string; + /** Information about the creation of this campaign. This is a read-only field. */ + createInfo?: LastModifiedInfo; + /** List of creative group IDs that are assigned to the campaign. */ + creativeGroupIds?: string[]; + /** Creative optimization configuration for the campaign. */ + creativeOptimizationConfiguration?: CreativeOptimizationConfiguration; + /** Click-through event tag ID override properties for this campaign. */ + defaultClickThroughEventTagProperties?: DefaultClickThroughEventTagProperties; + /** + * Date on which the campaign will stop running. On insert, the end date must be today or a future date. The end date must be later than or be the same as + * the start date. If, for example, you set 6/25/2015 as both the start and end dates, the effective campaign run date is just that day only, 6/25/2015. + * The hours, minutes, and seconds of the end date should not be set, as doing so will result in an error. This is a required field. + */ + endDate?: string; + /** Overrides that can be used to activate or deactivate advertiser event tags. */ + eventTagOverrides?: EventTagOverride[]; + /** External ID for this campaign. */ + externalId?: string; + /** ID of this campaign. This is a read-only auto-generated field. */ + id?: string; + /** Dimension value for the ID of this campaign. This is a read-only, auto-generated field. */ + idDimensionValue?: DimensionValue; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#campaign". */ + kind?: string; + /** Information about the most recent modification of this campaign. This is a read-only field. */ + lastModifiedInfo?: LastModifiedInfo; + /** Lookback window settings for the campaign. */ + lookbackConfiguration?: LookbackConfiguration; + /** Name of this campaign. This is a required field and must be less than 256 characters long and unique among campaigns of the same advertiser. */ + name?: string; + /** Whether Nielsen reports are enabled for this campaign. */ + nielsenOcrEnabled?: boolean; + /** + * Date on which the campaign starts running. The start date can be any date. The hours, minutes, and seconds of the start date should not be set, as + * doing so will result in an error. This is a required field. + */ + startDate?: string; + /** Subaccount ID of this campaign. This is a read-only field that can be left blank. */ + subaccountId?: string; + /** Campaign trafficker contact emails. */ + traffickerEmails?: string[]; + } + interface CampaignCreativeAssociation { + /** ID of the creative associated with the campaign. This is a required field. */ + creativeId?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#campaignCreativeAssociation". */ + kind?: string; + } + interface CampaignCreativeAssociationsListResponse { + /** Campaign creative association collection */ + campaignCreativeAssociations?: CampaignCreativeAssociation[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#campaignCreativeAssociationsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface CampaignsListResponse { + /** Campaign collection. */ + campaigns?: Campaign[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#campaignsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface ChangeLog { + /** Account ID of the modified object. */ + accountId?: string; + /** Action which caused the change. */ + action?: string; + /** Time when the object was modified. */ + changeTime?: string; + /** Field name of the object which changed. */ + fieldName?: string; + /** ID of this change log. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#changeLog". */ + kind?: string; + /** New value of the object field. */ + newValue?: string; + /** ID of the object of this change log. The object could be a campaign, placement, ad, or other type. */ + objectId?: string; + /** Object type of the change log. */ + objectType?: string; + /** Old value of the object field. */ + oldValue?: string; + /** Subaccount ID of the modified object. */ + subaccountId?: string; + /** + * Transaction ID of this change log. When a single API call results in many changes, each change will have a separate ID in the change log but will share + * the same transactionId. + */ + transactionId?: string; + /** ID of the user who modified the object. */ + userProfileId?: string; + /** User profile name of the user who modified the object. */ + userProfileName?: string; + } + interface ChangeLogsListResponse { + /** Change log collection. */ + changeLogs?: ChangeLog[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#changeLogsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface CitiesListResponse { + /** City collection. */ + cities?: City[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#citiesListResponse". */ + kind?: string; + } + interface City { + /** Country code of the country to which this city belongs. */ + countryCode?: string; + /** DART ID of the country to which this city belongs. */ + countryDartId?: string; + /** DART ID of this city. This is the ID used for targeting and generating reports. */ + dartId?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#city". */ + kind?: string; + /** Metro region code of the metro region (DMA) to which this city belongs. */ + metroCode?: string; + /** ID of the metro region (DMA) to which this city belongs. */ + metroDmaId?: string; + /** Name of this city. */ + name?: string; + /** Region code of the region to which this city belongs. */ + regionCode?: string; + /** DART ID of the region to which this city belongs. */ + regionDartId?: string; + } + interface ClickTag { + /** + * Advertiser event name associated with the click tag. This field is used by DISPLAY_IMAGE_GALLERY and HTML5_BANNER creatives. Applicable to DISPLAY when + * the primary asset type is not HTML_IMAGE. + */ + eventName?: string; + /** + * Parameter name for the specified click tag. For DISPLAY_IMAGE_GALLERY creative assets, this field must match the value of the creative asset's + * creativeAssetId.name field. + */ + name?: string; + /** Parameter value for the specified click tag. This field contains a click-through url. */ + value?: string; + } + interface ClickThroughUrl { + /** + * Read-only convenience field representing the actual URL that will be used for this click-through. The URL is computed as follows: + * - If defaultLandingPage is enabled then the campaign's default landing page URL is assigned to this field. + * - If defaultLandingPage is not enabled and a landingPageId is specified then that landing page's URL is assigned to this field. + * - If neither of the above cases apply, then the customClickThroughUrl is assigned to this field. + */ + computedClickThroughUrl?: string; + /** Custom click-through URL. Applicable if the defaultLandingPage field is set to false and the landingPageId field is left unset. */ + customClickThroughUrl?: string; + /** Whether the campaign default landing page is used. */ + defaultLandingPage?: boolean; + /** ID of the landing page for the click-through URL. Applicable if the defaultLandingPage field is set to false. */ + landingPageId?: string; + } + interface ClickThroughUrlSuffixProperties { + /** Click-through URL suffix to apply to all ads in this entity's scope. Must be less than 128 characters long. */ + clickThroughUrlSuffix?: string; + /** Whether this entity should override the inherited click-through URL suffix with its own defined value. */ + overrideInheritedSuffix?: boolean; + } + interface CompanionClickThroughOverride { + /** Click-through URL of this companion click-through override. */ + clickThroughUrl?: ClickThroughUrl; + /** ID of the creative for this companion click-through override. */ + creativeId?: string; + } + interface CompanionSetting { + /** Whether companions are disabled for this placement. */ + companionsDisabled?: boolean; + /** Whitelist of companion sizes to be served to this placement. Set this list to null or empty to serve all companion sizes. */ + enabledSizes?: Size[]; + /** Whether to serve only static images as companions. */ + imageOnly?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#companionSetting". */ + kind?: string; + } + interface CompatibleFields { + /** Contains items that are compatible to be selected for a report of type "CROSS_DIMENSION_REACH". */ + crossDimensionReachReportCompatibleFields?: CrossDimensionReachReportCompatibleFields; + /** Contains items that are compatible to be selected for a report of type "FLOODLIGHT". */ + floodlightReportCompatibleFields?: FloodlightReportCompatibleFields; + /** The kind of resource this is, in this case dfareporting#compatibleFields. */ + kind?: string; + /** Contains items that are compatible to be selected for a report of type "PATH_TO_CONVERSION". */ + pathToConversionReportCompatibleFields?: PathToConversionReportCompatibleFields; + /** Contains items that are compatible to be selected for a report of type "REACH". */ + reachReportCompatibleFields?: ReachReportCompatibleFields; + /** Contains items that are compatible to be selected for a report of type "STANDARD". */ + reportCompatibleFields?: ReportCompatibleFields; + } + interface ConnectionType { + /** ID of this connection type. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#connectionType". */ + kind?: string; + /** Name of this connection type. */ + name?: string; + } + interface ConnectionTypesListResponse { + /** Collection of connection types such as broadband and mobile. */ + connectionTypes?: ConnectionType[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#connectionTypesListResponse". */ + kind?: string; + } + interface ContentCategoriesListResponse { + /** Content category collection. */ + contentCategories?: ContentCategory[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#contentCategoriesListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface ContentCategory { + /** Account ID of this content category. This is a read-only field that can be left blank. */ + accountId?: string; + /** ID of this content category. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#contentCategory". */ + kind?: string; + /** + * Name of this content category. This is a required field and must be less than 256 characters long and unique among content categories of the same + * account. + */ + name?: string; + } + interface Conversion { + /** Whether the conversion was directed toward children. */ + childDirectedTreatment?: boolean; + /** Custom floodlight variables. */ + customVariables?: CustomFloodlightVariable[]; + /** + * The alphanumeric encrypted user ID. When set, encryptionInfo should also be specified. This field is mutually exclusive with + * encryptedUserIdCandidates[], mobileDeviceId and gclid. This or encryptedUserIdCandidates[] or mobileDeviceId or gclid is a required field. + */ + encryptedUserId?: string; + /** + * A list of the alphanumeric encrypted user IDs. Any user ID with exposure prior to the conversion timestamp will be used in the inserted conversion. If + * no such user ID is found then the conversion will be rejected with NO_COOKIE_MATCH_FOUND error. When set, encryptionInfo should also be specified. This + * field may only be used when calling batchinsert; it is not supported by batchupdate. This field is mutually exclusive with encryptedUserId, + * mobileDeviceId and gclid. This or encryptedUserId or mobileDeviceId or gclid is a required field. + */ + encryptedUserIdCandidates?: string[]; + /** Floodlight Activity ID of this conversion. This is a required field. */ + floodlightActivityId?: string; + /** Floodlight Configuration ID of this conversion. This is a required field. */ + floodlightConfigurationId?: string; + /** + * The Google click ID. This field is mutually exclusive with encryptedUserId, encryptedUserIdCandidates[] and mobileDeviceId. This or encryptedUserId or + * encryptedUserIdCandidates[] or mobileDeviceId is a required field. + */ + gclid?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#conversion". */ + kind?: string; + /** Whether Limit Ad Tracking is enabled. When set to true, the conversion will be used for reporting but not targeting. This will prevent remarketing. */ + limitAdTracking?: boolean; + /** + * The mobile device ID. This field is mutually exclusive with encryptedUserId, encryptedUserIdCandidates[] and gclid. This or encryptedUserId or + * encryptedUserIdCandidates[] or gclid is a required field. + */ + mobileDeviceId?: string; + /** The ordinal of the conversion. Use this field to control how conversions of the same user and day are de-duplicated. This is a required field. */ + ordinal?: string; + /** The quantity of the conversion. */ + quantity?: string; + /** The timestamp of conversion, in Unix epoch micros. This is a required field. */ + timestampMicros?: string; + /** The value of the conversion. */ + value?: number; + } + interface ConversionError { + /** The error code. */ + code?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#conversionError". */ + kind?: string; + /** A description of the error. */ + message?: string; + } + interface ConversionStatus { + /** The original conversion that was inserted or updated. */ + conversion?: Conversion; + /** A list of errors related to this conversion. */ + errors?: ConversionError[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#conversionStatus". */ + kind?: string; + } + interface ConversionsBatchInsertRequest { + /** The set of conversions to insert. */ + conversions?: Conversion[]; + /** + * Describes how encryptedUserId or encryptedUserIdCandidates[] is encrypted. This is a required field if encryptedUserId or encryptedUserIdCandidates[] + * is used. + */ + encryptionInfo?: EncryptionInfo; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#conversionsBatchInsertRequest". */ + kind?: string; + } + interface ConversionsBatchInsertResponse { + /** Indicates that some or all conversions failed to insert. */ + hasFailures?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#conversionsBatchInsertResponse". */ + kind?: string; + /** The insert status of each conversion. Statuses are returned in the same order that conversions are inserted. */ + status?: ConversionStatus[]; + } + interface ConversionsBatchUpdateRequest { + /** The set of conversions to update. */ + conversions?: Conversion[]; + /** Describes how encryptedUserId is encrypted. This is a required field if encryptedUserId is used. */ + encryptionInfo?: EncryptionInfo; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#conversionsBatchUpdateRequest". */ + kind?: string; + } + interface ConversionsBatchUpdateResponse { + /** Indicates that some or all conversions failed to update. */ + hasFailures?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#conversionsBatchUpdateResponse". */ + kind?: string; + /** The update status of each conversion. Statuses are returned in the same order that conversions are updated. */ + status?: ConversionStatus[]; + } + interface CountriesListResponse { + /** Country collection. */ + countries?: Country[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#countriesListResponse". */ + kind?: string; + } + interface Country { + /** Country code. */ + countryCode?: string; + /** DART ID of this country. This is the ID used for targeting and generating reports. */ + dartId?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#country". */ + kind?: string; + /** Name of this country. */ + name?: string; + /** Whether ad serving supports secure servers in this country. */ + sslEnabled?: boolean; + } + interface Creative { + /** Account ID of this creative. This field, if left unset, will be auto-generated for both insert and update operations. Applicable to all creative types. */ + accountId?: string; + /** Whether the creative is active. Applicable to all creative types. */ + active?: boolean; + /** Ad parameters user for VPAID creative. This is a read-only field. Applicable to the following creative types: all VPAID. */ + adParameters?: string; + /** + * Keywords for a Rich Media creative. Keywords let you customize the creative settings of a Rich Media ad running on your site without having to contact + * the advertiser. You can use keywords to dynamically change the look or functionality of a creative. Applicable to the following creative types: all + * RICH_MEDIA, and all VPAID. + */ + adTagKeys?: string[]; + /** Advertiser ID of this creative. This is a required field. Applicable to all creative types. */ + advertiserId?: string; + /** + * Whether script access is allowed for this creative. This is a read-only and deprecated field which will automatically be set to true on update. + * Applicable to the following creative types: FLASH_INPAGE. + */ + allowScriptAccess?: boolean; + /** Whether the creative is archived. Applicable to all creative types. */ + archived?: boolean; + /** Type of artwork used for the creative. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID. */ + artworkType?: string; + /** Source application where creative was authored. Presently, only DBM authored creatives will have this field set. Applicable to all creative types. */ + authoringSource?: string; + /** Authoring tool for HTML5 banner creatives. This is a read-only field. Applicable to the following creative types: HTML5_BANNER. */ + authoringTool?: string; + /** Whether images are automatically advanced for image gallery creatives. Applicable to the following creative types: DISPLAY_IMAGE_GALLERY. */ + autoAdvanceImages?: boolean; + /** + * The 6-character HTML color code, beginning with #, for the background of the window area where the Flash file is displayed. Default is white. + * Applicable to the following creative types: FLASH_INPAGE. + */ + backgroundColor?: string; + /** + * Click-through URL for backup image. Applicable to the following creative types: FLASH_INPAGE and HTML5_BANNER. Applicable to DISPLAY when the primary + * asset type is not HTML_IMAGE. + */ + backupImageClickThroughUrl?: string; + /** + * List of feature dependencies that will cause a backup image to be served if the browser that serves the ad does not support them. Feature dependencies + * are features that a browser must be able to support in order to render your HTML5 creative asset correctly. This field is initially auto-generated to + * contain all features detected by DCM for all the assets of this creative and can then be modified by the client. To reset this field, copy over all the + * creativeAssets' detected features. Applicable to the following creative types: HTML5_BANNER. Applicable to DISPLAY when the primary asset type is not + * HTML_IMAGE. + */ + backupImageFeatures?: string[]; + /** Reporting label used for HTML5 banner backup image. Applicable to the following creative types: DISPLAY when the primary asset type is not HTML_IMAGE. */ + backupImageReportingLabel?: string; + /** + * Target window for backup image. Applicable to the following creative types: FLASH_INPAGE and HTML5_BANNER. Applicable to DISPLAY when the primary asset + * type is not HTML_IMAGE. + */ + backupImageTargetWindow?: TargetWindow; + /** + * Click tags of the creative. For DISPLAY, FLASH_INPAGE, and HTML5_BANNER creatives, this is a subset of detected click tags for the assets associated + * with this creative. After creating a flash asset, detected click tags will be returned in the creativeAssetMetadata. When inserting the creative, + * populate the creative clickTags field using the creativeAssetMetadata.clickTags field. For DISPLAY_IMAGE_GALLERY creatives, there should be exactly one + * entry in this list for each image creative asset. A click tag is matched with a corresponding creative asset by matching the clickTag.name field with + * the creativeAsset.assetIdentifier.name field. Applicable to the following creative types: DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER. Applicable + * to DISPLAY when the primary asset type is not HTML_IMAGE. + */ + clickTags?: ClickTag[]; + /** Industry standard ID assigned to creative for reach and frequency. Applicable to INSTREAM_VIDEO_REDIRECT creatives. */ + commercialId?: string; + /** + * List of companion creatives assigned to an in-Stream videocreative. Acceptable values include IDs of existing flash and image creatives. Applicable to + * the following creative types: all VPAID and all INSTREAM_VIDEO with dynamicAssetSelection set to false. + */ + companionCreatives?: string[]; + /** + * Compatibilities associated with this creative. This is a read-only field. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on + * mobile devices or in mobile apps for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. Only + * pre-existing creatives may have these compatibilities since new creatives will either be assigned DISPLAY or DISPLAY_INTERSTITIAL instead. + * IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard. Applicable to all creative types. + * + * Acceptable values are: + * - "APP" + * - "APP_INTERSTITIAL" + * - "IN_STREAM_VIDEO" + * - "DISPLAY" + * - "DISPLAY_INTERSTITIAL" + */ + compatibility?: string[]; + /** + * Whether Flash assets associated with the creative need to be automatically converted to HTML5. This flag is enabled by default and users can choose to + * disable it if they don't want the system to generate and use HTML5 asset for this creative. Applicable to the following creative type: FLASH_INPAGE. + * Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + */ + convertFlashToHtml5?: boolean; + /** + * List of counter events configured for the creative. For DISPLAY_IMAGE_GALLERY creatives, these are read-only and auto-generated from clickTags. + * Applicable to the following creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID. + */ + counterCustomEvents?: CreativeCustomEvent[]; + /** Required if dynamicAssetSelection is true. */ + creativeAssetSelection?: CreativeAssetSelection; + /** Assets associated with a creative. Applicable to all but the following creative types: INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and REDIRECT */ + creativeAssets?: CreativeAsset[]; + /** Creative field assignments for this creative. Applicable to all creative types. */ + creativeFieldAssignments?: CreativeFieldAssignment[]; + /** + * Custom key-values for a Rich Media creative. Key-values let you customize the creative settings of a Rich Media ad running on your site without having + * to contact the advertiser. You can use key-values to dynamically change the look or functionality of a creative. Applicable to the following creative + * types: all RICH_MEDIA, and all VPAID. + */ + customKeyValues?: string[]; + /** + * Set this to true to enable the use of rules to target individual assets in this creative. When set to true creativeAssetSelection must be set. This + * also controls asset-level companions. When this is true, companion creatives should be assigned to creative assets. Learn more. Applicable to + * INSTREAM_VIDEO creatives. + */ + dynamicAssetSelection?: boolean; + /** + * List of exit events configured for the creative. For DISPLAY and DISPLAY_IMAGE_GALLERY creatives, these are read-only and auto-generated from + * clickTags, For DISPLAY, an event is also created from the backupImageReportingLabel. Applicable to the following creative types: DISPLAY_IMAGE_GALLERY, + * all RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + */ + exitCustomEvents?: CreativeCustomEvent[]; + /** + * OpenWindow FSCommand of this creative. This lets the SWF file communicate with either Flash Player or the program hosting Flash Player, such as a web + * browser. This is only triggered if allowScriptAccess field is true. Applicable to the following creative types: FLASH_INPAGE. + */ + fsCommand?: FsCommand; + /** + * HTML code for the creative. This is a required field when applicable. This field is ignored if htmlCodeLocked is true. Applicable to the following + * creative types: all CUSTOM, FLASH_INPAGE, and HTML5_BANNER, and all RICH_MEDIA. + */ + htmlCode?: string; + /** + * Whether HTML code is DCM-generated or manually entered. Set to true to ignore changes to htmlCode. Applicable to the following creative types: + * FLASH_INPAGE and HTML5_BANNER. + */ + htmlCodeLocked?: boolean; + /** ID of this creative. This is a read-only, auto-generated field. Applicable to all creative types. */ + id?: string; + /** Dimension value for the ID of this creative. This is a read-only field. Applicable to all creative types. */ + idDimensionValue?: DimensionValue; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#creative". */ + kind?: string; + /** Creative last modification information. This is a read-only field. Applicable to all creative types. */ + lastModifiedInfo?: LastModifiedInfo; + /** + * Latest Studio trafficked creative ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative + * types: all RICH_MEDIA, and all VPAID. + */ + latestTraffickedCreativeId?: string; + /** Name of the creative. This is a required field and must be less than 256 characters long. Applicable to all creative types. */ + name?: string; + /** Override CSS value for rich media creatives. Applicable to the following creative types: all RICH_MEDIA. */ + overrideCss?: string; + /** Amount of time to play the video before counting a view. Applicable to the following creative types: all INSTREAM_VIDEO. */ + progressOffset?: VideoOffset; + /** + * URL of hosted image or hosted video or another ad tag. For INSTREAM_VIDEO_REDIRECT creatives this is the in-stream video redirect URL. The standard for + * a VAST (Video Ad Serving Template) ad response allows for a redirect link to another VAST 2.0 or 3.0 call. This is a required field when applicable. + * Applicable to the following creative types: DISPLAY_REDIRECT, INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and INSTREAM_VIDEO_REDIRECT + */ + redirectUrl?: string; + /** ID of current rendering version. This is a read-only field. Applicable to all creative types. */ + renderingId?: string; + /** Dimension value for the rendering ID of this creative. This is a read-only field. Applicable to all creative types. */ + renderingIdDimensionValue?: DimensionValue; + /** + * The minimum required Flash plugin version for this creative. For example, 11.2.202.235. This is a read-only field. Applicable to the following creative + * types: all RICH_MEDIA, and all VPAID. + */ + requiredFlashPluginVersion?: string; + /** + * The internal Flash version for this creative as calculated by DoubleClick Studio. This is a read-only field. Applicable to the following creative + * types: FLASH_INPAGE all RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + */ + requiredFlashVersion?: number; + /** + * Size associated with this creative. When inserting or updating a creative either the size ID field or size width and height fields can be used. This is + * a required field when applicable; however for IMAGE, FLASH_INPAGE creatives, and for DISPLAY creatives with a primary asset of type HTML_IMAGE, if left + * blank, this field will be automatically set using the actual size of the associated image assets. Applicable to the following creative types: DISPLAY, + * DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all RICH_MEDIA. + */ + size?: Size; + /** Amount of time to play the video before the skip button appears. Applicable to the following creative types: all INSTREAM_VIDEO. */ + skipOffset?: VideoOffset; + /** Whether the user can choose to skip the creative. Applicable to the following creative types: all INSTREAM_VIDEO and all VPAID. */ + skippable?: boolean; + /** Whether the creative is SSL-compliant. This is a read-only field. Applicable to all creative types. */ + sslCompliant?: boolean; + /** Whether creative should be treated as SSL compliant even if the system scan shows it's not. Applicable to all creative types. */ + sslOverride?: boolean; + /** + * Studio advertiser ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: all + * RICH_MEDIA, and all VPAID. + */ + studioAdvertiserId?: string; + /** + * Studio creative ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: all + * RICH_MEDIA, and all VPAID. + */ + studioCreativeId?: string; + /** + * Studio trafficked creative ID associated with rich media and VPAID creatives. This is a read-only field. Applicable to the following creative types: + * all RICH_MEDIA, and all VPAID. + */ + studioTraffickedCreativeId?: string; + /** + * Subaccount ID of this creative. This field, if left unset, will be auto-generated for both insert and update operations. Applicable to all creative + * types. + */ + subaccountId?: string; + /** Third-party URL used to record backup image impressions. Applicable to the following creative types: all RICH_MEDIA. */ + thirdPartyBackupImageImpressionsUrl?: string; + /** Third-party URL used to record rich media impressions. Applicable to the following creative types: all RICH_MEDIA. */ + thirdPartyRichMediaImpressionsUrl?: string; + /** Third-party URLs for tracking in-stream video creative events. Applicable to the following creative types: all INSTREAM_VIDEO and all VPAID. */ + thirdPartyUrls?: ThirdPartyTrackingUrl[]; + /** + * List of timer events configured for the creative. For DISPLAY_IMAGE_GALLERY creatives, these are read-only and auto-generated from clickTags. + * Applicable to the following creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary asset is not + * HTML_IMAGE. + */ + timerCustomEvents?: CreativeCustomEvent[]; + /** Combined size of all creative assets. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA, and all VPAID. */ + totalFileSize?: string; + /** + * Type of this creative. This is a required field. Applicable to all creative types. + * + * Note: FLASH_INPAGE, HTML5_BANNER, and IMAGE are only used for existing creatives. New creatives should use DISPLAY as a replacement for these types. + */ + type?: string; + /** A Universal Ad ID as per the VAST 4.0 spec. Applicable to the following creative types: INSTREAM_VIDEO and VPAID. */ + universalAdId?: UniversalAdId; + /** + * The version number helps you keep track of multiple versions of your creative in your reports. The version number will always be auto-generated during + * insert operations to start at 1. For tracking creatives the version cannot be incremented and will always remain at 1. For all other creative types the + * version can be incremented only by 1 during update operations. In addition, the version will be automatically incremented by 1 when undergoing Rich + * Media creative merging. Applicable to all creative types. + */ + version?: number; + /** Description of the video ad. Applicable to the following creative types: all INSTREAM_VIDEO and all VPAID. */ + videoDescription?: string; + /** + * Creative video duration in seconds. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO, all RICH_MEDIA, and all + * VPAID. + */ + videoDuration?: number; + } + interface CreativeAsset { + /** + * Whether ActionScript3 is enabled for the flash asset. This is a read-only field. Applicable to the following creative type: FLASH_INPAGE. Applicable to + * DISPLAY when the primary asset type is not HTML_IMAGE. + */ + actionScript3?: boolean; + /** + * Whether the video asset is active. This is a read-only field for VPAID_NON_LINEAR_VIDEO assets. Applicable to the following creative types: + * INSTREAM_VIDEO and all VPAID. + */ + active?: boolean; + /** + * Possible alignments for an asset. This is a read-only field. Applicable to the following creative types: + * RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL. + */ + alignment?: string; + /** Artwork type of rich media creative. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA. */ + artworkType?: string; + /** + * Identifier of this asset. This is the same identifier returned during creative asset insert operation. This is a required field. Applicable to all but + * the following creative types: all REDIRECT and TRACKING_TEXT. + */ + assetIdentifier?: CreativeAssetId; + /** Exit event configured for the backup image. Applicable to the following creative types: all RICH_MEDIA. */ + backupImageExit?: CreativeCustomEvent; + /** Detected bit-rate for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. */ + bitRate?: number; + /** Rich media child asset type. This is a read-only field. Applicable to the following creative types: all VPAID. */ + childAssetType?: string; + /** + * Size of an asset when collapsed. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA and all VPAID. Additionally, + * applicable to assets whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN. + */ + collapsedSize?: Size; + /** + * List of companion creatives assigned to an in-stream video creative asset. Acceptable values include IDs of existing flash and image creatives. + * Applicable to INSTREAM_VIDEO creative type with dynamicAssetSelection set to true. + */ + companionCreativeIds?: string[]; + /** + * Custom start time in seconds for making the asset visible. Applicable to the following creative types: all RICH_MEDIA. Value must be greater than or + * equal to 0. + */ + customStartTimeValue?: number; + /** + * List of feature dependencies for the creative asset that are detected by DCM. Feature dependencies are features that a browser must be able to support + * in order to render your HTML5 creative correctly. This is a read-only, auto-generated field. Applicable to the following creative types: HTML5_BANNER. + * Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + */ + detectedFeatures?: string[]; + /** Type of rich media asset. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA. */ + displayType?: string; + /** + * Duration in seconds for which an asset will be displayed. Applicable to the following creative types: INSTREAM_VIDEO and VPAID_LINEAR_VIDEO. Value must + * be greater than or equal to 1. + */ + duration?: number; + /** Duration type for which an asset will be displayed. Applicable to the following creative types: all RICH_MEDIA. */ + durationType?: string; + /** Detected expanded dimension for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. */ + expandedDimension?: Size; + /** + * File size associated with this creative asset. This is a read-only field. Applicable to all but the following creative types: all REDIRECT and + * TRACKING_TEXT. + */ + fileSize?: string; + /** + * Flash version of the asset. This is a read-only field. Applicable to the following creative types: FLASH_INPAGE, all RICH_MEDIA, and all VPAID. + * Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + */ + flashVersion?: number; + /** Whether to hide Flash objects flag for an asset. Applicable to the following creative types: all RICH_MEDIA. */ + hideFlashObjects?: boolean; + /** Whether to hide selection boxes flag for an asset. Applicable to the following creative types: all RICH_MEDIA. */ + hideSelectionBoxes?: boolean; + /** Whether the asset is horizontally locked. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA. */ + horizontallyLocked?: boolean; + /** + * Numeric ID of this creative asset. This is a required field and should not be modified. Applicable to all but the following creative types: all + * REDIRECT and TRACKING_TEXT. + */ + id?: string; + /** Dimension value for the ID of the asset. This is a read-only, auto-generated field. */ + idDimensionValue?: DimensionValue; + /** Detected MIME type for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. */ + mimeType?: string; + /** + * Offset position for an asset in collapsed mode. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA and all VPAID. + * Additionally, only applicable to assets whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN. + */ + offset?: OffsetPosition; + /** Whether the backup asset is original or changed by the user in DCM. Applicable to the following creative types: all RICH_MEDIA. */ + originalBackup?: boolean; + /** Offset position for an asset. Applicable to the following creative types: all RICH_MEDIA. */ + position?: OffsetPosition; + /** Offset left unit for an asset. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA. */ + positionLeftUnit?: string; + /** + * Offset top unit for an asset. This is a read-only field if the asset displayType is ASSET_DISPLAY_TYPE_OVERLAY. Applicable to the following creative + * types: all RICH_MEDIA. + */ + positionTopUnit?: string; + /** Progressive URL for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. */ + progressiveServingUrl?: string; + /** + * Whether the asset pushes down other content. Applicable to the following creative types: all RICH_MEDIA. Additionally, only applicable when the asset + * offsets are 0, the collapsedSize.width matches size.width, and the collapsedSize.height is less than size.height. + */ + pushdown?: boolean; + /** + * Pushdown duration in seconds for an asset. Applicable to the following creative types: all RICH_MEDIA.Additionally, only applicable when the asset + * pushdown field is true, the offsets are 0, the collapsedSize.width matches size.width, and the collapsedSize.height is less than size.height. + * Acceptable values are 0 to 9.99, inclusive. + */ + pushdownDuration?: number; + /** + * Role of the asset in relation to creative. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT. This is a required + * field. + * PRIMARY applies to DISPLAY, FLASH_INPAGE, HTML5_BANNER, IMAGE, DISPLAY_IMAGE_GALLERY, all RICH_MEDIA (which may contain multiple primary assets), and + * all VPAID creatives. + * BACKUP_IMAGE applies to FLASH_INPAGE, HTML5_BANNER, all RICH_MEDIA, and all VPAID creatives. Applicable to DISPLAY when the primary asset type is not + * HTML_IMAGE. + * ADDITIONAL_IMAGE and ADDITIONAL_FLASH apply to FLASH_INPAGE creatives. + * OTHER refers to assets from sources other than DCM, such as Studio uploaded assets, applicable to all RICH_MEDIA and all VPAID creatives. + * PARENT_VIDEO refers to videos uploaded by the user in DCM and is applicable to INSTREAM_VIDEO and VPAID_LINEAR_VIDEO creatives. + * TRANSCODED_VIDEO refers to videos transcoded by DCM from PARENT_VIDEO assets and is applicable to INSTREAM_VIDEO and VPAID_LINEAR_VIDEO creatives. + * ALTERNATE_VIDEO refers to the DCM representation of child asset videos from Studio, and is applicable to VPAID_LINEAR_VIDEO creatives. These cannot be + * added or removed within DCM. + * For VPAID_LINEAR_VIDEO creatives, PARENT_VIDEO, TRANSCODED_VIDEO and ALTERNATE_VIDEO assets that are marked active serve as backup in case the VPAID + * creative cannot be served. Only PARENT_VIDEO assets can be added or removed for an INSTREAM_VIDEO or VPAID_LINEAR_VIDEO creative. + */ + role?: string; + /** + * Size associated with this creative asset. This is a required field when applicable; however for IMAGE and FLASH_INPAGE, creatives if left blank, this + * field will be automatically set using the actual size of the associated image asset. Applicable to the following creative types: DISPLAY_IMAGE_GALLERY, + * FLASH_INPAGE, HTML5_BANNER, IMAGE, and all RICH_MEDIA. Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + */ + size?: Size; + /** Whether the asset is SSL-compliant. This is a read-only field. Applicable to all but the following creative types: all REDIRECT and TRACKING_TEXT. */ + sslCompliant?: boolean; + /** Initial wait time type before making the asset visible. Applicable to the following creative types: all RICH_MEDIA. */ + startTimeType?: string; + /** Streaming URL for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. */ + streamingServingUrl?: string; + /** Whether the asset is transparent. Applicable to the following creative types: all RICH_MEDIA. Additionally, only applicable to HTML5 assets. */ + transparency?: boolean; + /** Whether the asset is vertically locked. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA. */ + verticallyLocked?: boolean; + /** Detected video duration for video asset. This is a read-only field. Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. */ + videoDuration?: number; + /** + * Window mode options for flash assets. Applicable to the following creative types: FLASH_INPAGE, RICH_MEDIA_DISPLAY_EXPANDING, RICH_MEDIA_IM_EXPAND, + * RICH_MEDIA_DISPLAY_BANNER, and RICH_MEDIA_INPAGE_FLOATING. + */ + windowMode?: string; + /** + * zIndex value of an asset. Applicable to the following creative types: all RICH_MEDIA.Additionally, only applicable to assets whose displayType is NOT + * one of the following types: ASSET_DISPLAY_TYPE_INPAGE or ASSET_DISPLAY_TYPE_OVERLAY. Acceptable values are -999999999 to 999999999, inclusive. + */ + zIndex?: number; + /** File name of zip file. This is a read-only field. Applicable to the following creative types: HTML5_BANNER. */ + zipFilename?: string; + /** Size of zip file. This is a read-only field. Applicable to the following creative types: HTML5_BANNER. */ + zipFilesize?: string; + } + interface CreativeAssetId { + /** + * Name of the creative asset. This is a required field while inserting an asset. After insertion, this assetIdentifier is used to identify the uploaded + * asset. Characters in the name must be alphanumeric or one of the following: ".-_ ". Spaces are allowed. + */ + name?: string; + /** Type of asset to upload. This is a required field. FLASH and IMAGE are no longer supported for new uploads. All image assets should use HTML_IMAGE. */ + type?: string; + } + interface CreativeAssetMetadata { + /** ID of the creative asset. This is a required field. */ + assetIdentifier?: CreativeAssetId; + /** List of detected click tags for assets. This is a read-only auto-generated field. */ + clickTags?: ClickTag[]; + /** + * List of feature dependencies for the creative asset that are detected by DCM. Feature dependencies are features that a browser must be able to support + * in order to render your HTML5 creative correctly. This is a read-only, auto-generated field. + */ + detectedFeatures?: string[]; + /** Numeric ID of the asset. This is a read-only, auto-generated field. */ + id?: string; + /** Dimension value for the numeric ID of the asset. This is a read-only, auto-generated field. */ + idDimensionValue?: DimensionValue; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#creativeAssetMetadata". */ + kind?: string; + /** + * Rules validated during code generation that generated a warning. This is a read-only, auto-generated field. + * + * Possible values are: + * - "ADMOB_REFERENCED" + * - "ASSET_FORMAT_UNSUPPORTED_DCM" + * - "ASSET_INVALID" + * - "CLICK_TAG_HARD_CODED" + * - "CLICK_TAG_INVALID" + * - "CLICK_TAG_IN_GWD" + * - "CLICK_TAG_MISSING" + * - "CLICK_TAG_MORE_THAN_ONE" + * - "CLICK_TAG_NON_TOP_LEVEL" + * - "COMPONENT_UNSUPPORTED_DCM" + * - "ENABLER_UNSUPPORTED_METHOD_DCM" + * - "EXTERNAL_FILE_REFERENCED" + * - "FILE_DETAIL_EMPTY" + * - "FILE_TYPE_INVALID" + * - "GWD_PROPERTIES_INVALID" + * - "HTML5_FEATURE_UNSUPPORTED" + * - "LINKED_FILE_NOT_FOUND" + * - "MAX_FLASH_VERSION_11" + * - "MRAID_REFERENCED" + * - "NOT_SSL_COMPLIANT" + * - "ORPHANED_ASSET" + * - "PRIMARY_HTML_MISSING" + * - "SVG_INVALID" + * - "ZIP_INVALID" + */ + warnedValidationRules?: string[]; + } + interface CreativeAssetSelection { + /** + * A creativeAssets[].id. This should refer to one of the parent assets in this creative, and will be served if none of the rules match. This is a + * required field. + */ + defaultAssetId?: string; + /** + * Rules determine which asset will be served to a viewer. Rules will be evaluated in the order in which they are stored in this list. This list must + * contain at least one rule. Applicable to INSTREAM_VIDEO creatives. + */ + rules?: Rule[]; + } + interface CreativeAssignment { + /** Whether this creative assignment is active. When true, the creative will be included in the ad's rotation. */ + active?: boolean; + /** + * Whether applicable event tags should fire when this creative assignment is rendered. If this value is unset when the ad is inserted or updated, it will + * default to true for all creative types EXCEPT for INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and INSTREAM_VIDEO. + */ + applyEventTags?: boolean; + /** Click-through URL of the creative assignment. */ + clickThroughUrl?: ClickThroughUrl; + /** Companion creative overrides for this creative assignment. Applicable to video ads. */ + companionCreativeOverrides?: CompanionClickThroughOverride[]; + /** Creative group assignments for this creative assignment. Only one assignment per creative group number is allowed for a maximum of two assignments. */ + creativeGroupAssignments?: CreativeGroupAssignment[]; + /** ID of the creative to be assigned. This is a required field. */ + creativeId?: string; + /** Dimension value for the ID of the creative. This is a read-only, auto-generated field. */ + creativeIdDimensionValue?: DimensionValue; + /** Date and time that the assigned creative should stop serving. Must be later than the start time. */ + endTime?: string; + /** + * Rich media exit overrides for this creative assignment. + * Applicable when the creative type is any of the following: + * - DISPLAY + * - RICH_MEDIA_INPAGE + * - RICH_MEDIA_INPAGE_FLOATING + * - RICH_MEDIA_IM_EXPAND + * - RICH_MEDIA_EXPANDING + * - RICH_MEDIA_INTERSTITIAL_FLOAT + * - RICH_MEDIA_MOBILE_IN_APP + * - RICH_MEDIA_MULTI_FLOATING + * - RICH_MEDIA_PEEL_DOWN + * - VPAID_LINEAR + * - VPAID_NON_LINEAR + */ + richMediaExitOverrides?: RichMediaExitOverride[]; + /** + * Sequence number of the creative assignment, applicable when the rotation type is CREATIVE_ROTATION_TYPE_SEQUENTIAL. Acceptable values are 1 to 65535, + * inclusive. + */ + sequence?: number; + /** Whether the creative to be assigned is SSL-compliant. This is a read-only field that is auto-generated when the ad is inserted or updated. */ + sslCompliant?: boolean; + /** Date and time that the assigned creative should start serving. */ + startTime?: string; + /** Weight of the creative assignment, applicable when the rotation type is CREATIVE_ROTATION_TYPE_RANDOM. Value must be greater than or equal to 1. */ + weight?: number; + } + interface CreativeCustomEvent { + /** Unique ID of this event used by DDM Reporting and Data Transfer. This is a read-only field. */ + advertiserCustomEventId?: string; + /** User-entered name for the event. */ + advertiserCustomEventName?: string; + /** Type of the event. This is a read-only field. */ + advertiserCustomEventType?: string; + /** Artwork label column, used to link events in DCM back to events in Studio. This is a required field and should not be modified after insertion. */ + artworkLabel?: string; + /** Artwork type used by the creative.This is a read-only field. */ + artworkType?: string; + /** Exit URL of the event. This field is used only for exit events. */ + exitUrl?: string; + /** ID of this event. This is a required field and should not be modified after insertion. */ + id?: string; + /** Properties for rich media popup windows. This field is used only for exit events. */ + popupWindowProperties?: PopupWindowProperties; + /** Target type used by the event. */ + targetType?: string; + /** Video reporting ID, used to differentiate multiple videos in a single creative. This is a read-only field. */ + videoReportingId?: string; + } + interface CreativeField { + /** Account ID of this creative field. This is a read-only field that can be left blank. */ + accountId?: string; + /** Advertiser ID of this creative field. This is a required field on insertion. */ + advertiserId?: string; + /** Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. */ + advertiserIdDimensionValue?: DimensionValue; + /** ID of this creative field. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#creativeField". */ + kind?: string; + /** + * Name of this creative field. This is a required field and must be less than 256 characters long and unique among creative fields of the same + * advertiser. + */ + name?: string; + /** Subaccount ID of this creative field. This is a read-only field that can be left blank. */ + subaccountId?: string; + } + interface CreativeFieldAssignment { + /** ID of the creative field. */ + creativeFieldId?: string; + /** ID of the creative field value. */ + creativeFieldValueId?: string; + } + interface CreativeFieldValue { + /** ID of this creative field value. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#creativeFieldValue". */ + kind?: string; + /** Value of this creative field value. It needs to be less than 256 characters in length and unique per creative field. */ + value?: string; + } + interface CreativeFieldValuesListResponse { + /** Creative field value collection. */ + creativeFieldValues?: CreativeFieldValue[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#creativeFieldValuesListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface CreativeFieldsListResponse { + /** Creative field collection. */ + creativeFields?: CreativeField[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#creativeFieldsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface CreativeGroup { + /** Account ID of this creative group. This is a read-only field that can be left blank. */ + accountId?: string; + /** Advertiser ID of this creative group. This is a required field on insertion. */ + advertiserId?: string; + /** Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. */ + advertiserIdDimensionValue?: DimensionValue; + /** + * Subgroup of the creative group. Assign your creative groups to a subgroup in order to filter or manage them more easily. This field is required on + * insertion and is read-only after insertion. Acceptable values are 1 to 2, inclusive. + */ + groupNumber?: number; + /** ID of this creative group. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#creativeGroup". */ + kind?: string; + /** + * Name of this creative group. This is a required field and must be less than 256 characters long and unique among creative groups of the same + * advertiser. + */ + name?: string; + /** Subaccount ID of this creative group. This is a read-only field that can be left blank. */ + subaccountId?: string; + } + interface CreativeGroupAssignment { + /** ID of the creative group to be assigned. */ + creativeGroupId?: string; + /** Creative group number of the creative group assignment. */ + creativeGroupNumber?: string; + } + interface CreativeGroupsListResponse { + /** Creative group collection. */ + creativeGroups?: CreativeGroup[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#creativeGroupsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface CreativeOptimizationConfiguration { + /** ID of this creative optimization config. This field is auto-generated when the campaign is inserted or updated. It can be null for existing campaigns. */ + id?: string; + /** Name of this creative optimization config. This is a required field and must be less than 129 characters long. */ + name?: string; + /** List of optimization activities associated with this configuration. */ + optimizationActivitys?: OptimizationActivity[]; + /** Optimization model for this configuration. */ + optimizationModel?: string; + } + interface CreativeRotation { + /** Creative assignments in this creative rotation. */ + creativeAssignments?: CreativeAssignment[]; + /** + * Creative optimization configuration that is used by this ad. It should refer to one of the existing optimization configurations in the ad's campaign. + * If it is unset or set to 0, then the campaign's default optimization configuration will be used for this ad. + */ + creativeOptimizationConfigurationId?: string; + /** Type of creative rotation. Can be used to specify whether to use sequential or random rotation. */ + type?: string; + /** Strategy for calculating weights. Used with CREATIVE_ROTATION_TYPE_RANDOM. */ + weightCalculationStrategy?: string; + } + interface CreativeSettings { + /** Header text for iFrames for this site. Must be less than or equal to 2000 characters long. */ + iFrameFooter?: string; + /** Header text for iFrames for this site. Must be less than or equal to 2000 characters long. */ + iFrameHeader?: string; + } + interface CreativesListResponse { + /** Creative collection. */ + creatives?: Creative[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#creativesListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface CrossDimensionReachReportCompatibleFields { + /** Dimensions which are compatible to be selected in the "breakdown" section of the report. */ + breakdown?: Dimension[]; + /** Dimensions which are compatible to be selected in the "dimensionFilters" section of the report. */ + dimensionFilters?: Dimension[]; + /** The kind of resource this is, in this case dfareporting#crossDimensionReachReportCompatibleFields. */ + kind?: string; + /** Metrics which are compatible to be selected in the "metricNames" section of the report. */ + metrics?: Metric[]; + /** Metrics which are compatible to be selected in the "overlapMetricNames" section of the report. */ + overlapMetrics?: Metric[]; + } + interface CustomFloodlightVariable { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#customFloodlightVariable". */ + kind?: string; + /** The type of custom floodlight variable to supply a value for. These map to the "u[1-20]=" in the tags. */ + type?: string; + /** The value of the custom floodlight variable. The length of string must not exceed 50 characters. */ + value?: string; + } + interface CustomRichMediaEvents { + /** List of custom rich media event IDs. Dimension values must be all of type dfa:richMediaEventTypeIdAndName. */ + filteredEventIds?: DimensionValue[]; + /** The kind of resource this is, in this case dfareporting#customRichMediaEvents. */ + kind?: string; + } + interface DateRange { + /** The end date of the date range, inclusive. A string of the format: "yyyy-MM-dd". */ + endDate?: string; + /** The kind of resource this is, in this case dfareporting#dateRange. */ + kind?: string; + /** The date range relative to the date of when the report is run. */ + relativeDateRange?: string; + /** The start date of the date range, inclusive. A string of the format: "yyyy-MM-dd". */ + startDate?: string; + } + interface DayPartTargeting { + /** + * Days of the week when the ad will serve. + * + * Acceptable values are: + * - "SUNDAY" + * - "MONDAY" + * - "TUESDAY" + * - "WEDNESDAY" + * - "THURSDAY" + * - "FRIDAY" + * - "SATURDAY" + */ + daysOfWeek?: string[]; + /** + * Hours of the day when the ad will serve, where 0 is midnight to 1 AM and 23 is 11 PM to midnight. Can be specified with days of week, in which case the + * ad would serve during these hours on the specified days. For example if Monday, Wednesday, Friday are the days of week specified and 9-10am, 3-5pm + * (hours 9, 15, and 16) is specified, the ad would serve Monday, Wednesdays, and Fridays at 9-10am and 3-5pm. Acceptable values are 0 to 23, inclusive. + */ + hoursOfDay?: number[]; + /** Whether or not to use the user's local time. If false, the America/New York time zone applies. */ + userLocalTime?: boolean; + } + interface DefaultClickThroughEventTagProperties { + /** ID of the click-through event tag to apply to all ads in this entity's scope. */ + defaultClickThroughEventTagId?: string; + /** Whether this entity should override the inherited default click-through event tag with its own defined value. */ + overrideInheritedEventTag?: boolean; + } + interface DeliverySchedule { + /** Limit on the number of times an individual user can be served the ad within a specified period of time. */ + frequencyCap?: FrequencyCap; + /** + * Whether or not hard cutoff is enabled. If true, the ad will not serve after the end date and time. Otherwise the ad will continue to be served until it + * has reached its delivery goals. + */ + hardCutoff?: boolean; + /** + * Impression ratio for this ad. This ratio determines how often each ad is served relative to the others. For example, if ad A has an impression ratio of + * 1 and ad B has an impression ratio of 3, then DCM will serve ad B three times as often as ad A. Acceptable values are 1 to 10, inclusive. + */ + impressionRatio?: string; + /** Serving priority of an ad, with respect to other ads. The lower the priority number, the greater the priority with which it is served. */ + priority?: string; + } + interface DfpSettings { + /** DFP network code for this directory site. */ + dfpNetworkCode?: string; + /** DFP network name for this directory site. */ + dfpNetworkName?: string; + /** Whether this directory site accepts programmatic placements. */ + programmaticPlacementAccepted?: boolean; + /** Whether this directory site accepts publisher-paid tags. */ + pubPaidPlacementAccepted?: boolean; + /** Whether this directory site is available only via DoubleClick Publisher Portal. */ + publisherPortalOnly?: boolean; + } + interface Dimension { + /** The kind of resource this is, in this case dfareporting#dimension. */ + kind?: string; + /** The dimension name, e.g. dfa:advertiser */ + name?: string; + } + interface DimensionFilter { + /** The name of the dimension to filter. */ + dimensionName?: string; + /** The kind of resource this is, in this case dfareporting#dimensionFilter. */ + kind?: string; + /** The value of the dimension to filter. */ + value?: string; + } + interface DimensionValue { + /** The name of the dimension. */ + dimensionName?: string; + /** The eTag of this response for caching purposes. */ + etag?: string; + /** The ID associated with the value if available. */ + id?: string; + /** The kind of resource this is, in this case dfareporting#dimensionValue. */ + kind?: string; + /** + * Determines how the 'value' field is matched when filtering. If not specified, defaults to EXACT. If set to WILDCARD_EXPRESSION, '*' is allowed as a + * placeholder for variable length character sequences, and it can be escaped with a backslash. Note, only paid search dimensions ('dfa:paidSearch*') + * allow a matchType other than EXACT. + */ + matchType?: string; + /** The value of the dimension. */ + value?: string; + } + interface DimensionValueList { + /** The eTag of this response for caching purposes. */ + etag?: string; + /** The dimension values returned in this response. */ + items?: DimensionValue[]; + /** The kind of list this is, in this case dfareporting#dimensionValueList. */ + kind?: string; + /** + * Continuation token used to page through dimension values. To retrieve the next page of results, set the next request's "pageToken" to the value of this + * field. The page token is only valid for a limited amount of time and should not be persisted. + */ + nextPageToken?: string; + } + interface DimensionValueRequest { + /** The name of the dimension for which values should be requested. */ + dimensionName?: string; + /** The end date of the date range for which to retrieve dimension values. A string of the format "yyyy-MM-dd". */ + endDate?: string; + /** The list of filters by which to filter values. The filters are ANDed. */ + filters?: DimensionFilter[]; + /** The kind of request this is, in this case dfareporting#dimensionValueRequest. */ + kind?: string; + /** The start date of the date range for which to retrieve dimension values. A string of the format "yyyy-MM-dd". */ + startDate?: string; + } + interface DirectorySite { + /** Whether this directory site is active. */ + active?: boolean; + /** Directory site contacts. */ + contactAssignments?: DirectorySiteContactAssignment[]; + /** Country ID of this directory site. This is a read-only field. */ + countryId?: string; + /** + * Currency ID of this directory site. This is a read-only field. + * Possible values are: + * - "1" for USD + * - "2" for GBP + * - "3" for ESP + * - "4" for SEK + * - "5" for CAD + * - "6" for JPY + * - "7" for DEM + * - "8" for AUD + * - "9" for FRF + * - "10" for ITL + * - "11" for DKK + * - "12" for NOK + * - "13" for FIM + * - "14" for ZAR + * - "15" for IEP + * - "16" for NLG + * - "17" for EUR + * - "18" for KRW + * - "19" for TWD + * - "20" for SGD + * - "21" for CNY + * - "22" for HKD + * - "23" for NZD + * - "24" for MYR + * - "25" for BRL + * - "26" for PTE + * - "27" for MXP + * - "28" for CLP + * - "29" for TRY + * - "30" for ARS + * - "31" for PEN + * - "32" for ILS + * - "33" for CHF + * - "34" for VEF + * - "35" for COP + * - "36" for GTQ + * - "37" for PLN + * - "39" for INR + * - "40" for THB + * - "41" for IDR + * - "42" for CZK + * - "43" for RON + * - "44" for HUF + * - "45" for RUB + * - "46" for AED + * - "47" for BGN + * - "48" for HRK + * - "49" for MXN + */ + currencyId?: string; + /** Description of this directory site. This is a read-only field. */ + description?: string; + /** ID of this directory site. This is a read-only, auto-generated field. */ + id?: string; + /** Dimension value for the ID of this directory site. This is a read-only, auto-generated field. */ + idDimensionValue?: DimensionValue; + /** + * Tag types for regular placements. + * + * Acceptable values are: + * - "STANDARD" + * - "IFRAME_JAVASCRIPT_INPAGE" + * - "INTERNAL_REDIRECT_INPAGE" + * - "JAVASCRIPT_INPAGE" + */ + inpageTagFormats?: string[]; + /** + * Tag types for interstitial placements. + * + * Acceptable values are: + * - "IFRAME_JAVASCRIPT_INTERSTITIAL" + * - "INTERNAL_REDIRECT_INTERSTITIAL" + * - "JAVASCRIPT_INTERSTITIAL" + */ + interstitialTagFormats?: string[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#directorySite". */ + kind?: string; + /** Name of this directory site. */ + name?: string; + /** Parent directory site ID. */ + parentId?: string; + /** Directory site settings. */ + settings?: DirectorySiteSettings; + /** URL of this directory site. */ + url?: string; + } + interface DirectorySiteContact { + /** Address of this directory site contact. */ + address?: string; + /** Email address of this directory site contact. */ + email?: string; + /** First name of this directory site contact. */ + firstName?: string; + /** ID of this directory site contact. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#directorySiteContact". */ + kind?: string; + /** Last name of this directory site contact. */ + lastName?: string; + /** Phone number of this directory site contact. */ + phone?: string; + /** Directory site contact role. */ + role?: string; + /** Title or designation of this directory site contact. */ + title?: string; + /** Directory site contact type. */ + type?: string; + } + interface DirectorySiteContactAssignment { + /** ID of this directory site contact. This is a read-only, auto-generated field. */ + contactId?: string; + /** + * Visibility of this directory site contact assignment. When set to PUBLIC this contact assignment is visible to all account and agency users; when set + * to PRIVATE it is visible only to the site. + */ + visibility?: string; + } + interface DirectorySiteContactsListResponse { + /** Directory site contact collection */ + directorySiteContacts?: DirectorySiteContact[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#directorySiteContactsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface DirectorySiteSettings { + /** Whether this directory site has disabled active view creatives. */ + activeViewOptOut?: boolean; + /** Directory site DFP settings. */ + dfpSettings?: DfpSettings; + /** Whether this site accepts in-stream video ads. */ + instreamVideoPlacementAccepted?: boolean; + /** Whether this site accepts interstitial ads. */ + interstitialPlacementAccepted?: boolean; + /** Whether this directory site has disabled Nielsen OCR reach ratings. */ + nielsenOcrOptOut?: boolean; + /** Whether this directory site has disabled generation of Verification ins tags. */ + verificationTagOptOut?: boolean; + /** Whether this directory site has disabled active view for in-stream video creatives. This is a read-only field. */ + videoActiveViewOptOut?: boolean; + } + interface DirectorySitesListResponse { + /** Directory site collection. */ + directorySites?: DirectorySite[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#directorySitesListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface DynamicTargetingKey { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#dynamicTargetingKey". */ + kind?: string; + /** + * Name of this dynamic targeting key. This is a required field. Must be less than 256 characters long and cannot contain commas. All characters are + * converted to lowercase. + */ + name?: string; + /** ID of the object of this dynamic targeting key. This is a required field. */ + objectId?: string; + /** Type of the object of this dynamic targeting key. This is a required field. */ + objectType?: string; + } + interface DynamicTargetingKeysListResponse { + /** Dynamic targeting key collection. */ + dynamicTargetingKeys?: DynamicTargetingKey[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#dynamicTargetingKeysListResponse". */ + kind?: string; + } + interface EncryptionInfo { + /** The encryption entity ID. This should match the encryption configuration for ad serving or Data Transfer. */ + encryptionEntityId?: string; + /** The encryption entity type. This should match the encryption configuration for ad serving or Data Transfer. */ + encryptionEntityType?: string; + /** Describes whether the encrypted cookie was received from ad serving (the %m macro) or from Data Transfer. */ + encryptionSource?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#encryptionInfo". */ + kind?: string; + } + interface EventTag { + /** Account ID of this event tag. This is a read-only field that can be left blank. */ + accountId?: string; + /** Advertiser ID of this event tag. This field or the campaignId field is required on insertion. */ + advertiserId?: string; + /** Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. */ + advertiserIdDimensionValue?: DimensionValue; + /** Campaign ID of this event tag. This field or the advertiserId field is required on insertion. */ + campaignId?: string; + /** Dimension value for the ID of the campaign. This is a read-only, auto-generated field. */ + campaignIdDimensionValue?: DimensionValue; + /** Whether this event tag should be automatically enabled for all of the advertiser's campaigns and ads. */ + enabledByDefault?: boolean; + /** + * Whether to remove this event tag from ads that are trafficked through DoubleClick Bid Manager to Ad Exchange. This may be useful if the event tag uses + * a pixel that is unapproved for Ad Exchange bids on one or more networks, such as the Google Display Network. + */ + excludeFromAdxRequests?: boolean; + /** ID of this event tag. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#eventTag". */ + kind?: string; + /** Name of this event tag. This is a required field and must be less than 256 characters long. */ + name?: string; + /** Site filter type for this event tag. If no type is specified then the event tag will be applied to all sites. */ + siteFilterType?: string; + /** Filter list of site IDs associated with this event tag. The siteFilterType determines whether this is a whitelist or blacklist filter. */ + siteIds?: string[]; + /** Whether this tag is SSL-compliant or not. This is a read-only field. */ + sslCompliant?: boolean; + /** Status of this event tag. Must be ENABLED for this event tag to fire. This is a required field. */ + status?: string; + /** Subaccount ID of this event tag. This is a read-only field that can be left blank. */ + subaccountId?: string; + /** + * Event tag type. Can be used to specify whether to use a third-party pixel, a third-party JavaScript URL, or a third-party click-through URL for either + * impression or click tracking. This is a required field. + */ + type?: string; + /** + * Payload URL for this event tag. The URL on a click-through event tag should have a landing page URL appended to the end of it. This field is required + * on insertion. + */ + url?: string; + /** + * Number of times the landing page URL should be URL-escaped before being appended to the click-through event tag URL. Only applies to click-through + * event tags as specified by the event tag type. + */ + urlEscapeLevels?: number; + } + interface EventTagOverride { + /** Whether this override is enabled. */ + enabled?: boolean; + /** ID of this event tag override. This is a read-only, auto-generated field. */ + id?: string; + } + interface EventTagsListResponse { + /** Event tag collection. */ + eventTags?: EventTag[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#eventTagsListResponse". */ + kind?: string; + } + interface File { + /** The date range for which the file has report data. The date range will always be the absolute date range for which the report is run. */ + dateRange?: DateRange; + /** The eTag of this response for caching purposes. */ + etag?: string; + /** The filename of the file. */ + fileName?: string; + /** The output format of the report. Only available once the file is available. */ + format?: string; + /** The unique ID of this report file. */ + id?: string; + /** The kind of resource this is, in this case dfareporting#file. */ + kind?: string; + /** The timestamp in milliseconds since epoch when this file was last modified. */ + lastModifiedTime?: string; + /** The ID of the report this file was generated from. */ + reportId?: string; + /** The status of the report file. */ + status?: string; + /** The URLs where the completed report file can be downloaded. */ + urls?: { + /** The URL for downloading the report data through the API. */ + apiUrl?: string; + /** The URL for downloading the report data through a browser. */ + browserUrl?: string; + }; + } + interface FileList { + /** The eTag of this response for caching purposes. */ + etag?: string; + /** The files returned in this response. */ + items?: File[]; + /** The kind of list this is, in this case dfareporting#fileList. */ + kind?: string; + /** + * Continuation token used to page through files. To retrieve the next page of results, set the next request's "pageToken" to the value of this field. The + * page token is only valid for a limited amount of time and should not be persisted. + */ + nextPageToken?: string; + } + interface Flight { + /** Inventory item flight end date. */ + endDate?: string; + /** Rate or cost of this flight. */ + rateOrCost?: string; + /** Inventory item flight start date. */ + startDate?: string; + /** Units of this flight. */ + units?: string; + } + interface FloodlightActivitiesGenerateTagResponse { + /** Generated tag for this floodlight activity. */ + floodlightActivityTag?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#floodlightActivitiesGenerateTagResponse". */ + kind?: string; + } + interface FloodlightActivitiesListResponse { + /** Floodlight activity collection. */ + floodlightActivities?: FloodlightActivity[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#floodlightActivitiesListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface FloodlightActivity { + /** Account ID of this floodlight activity. This is a read-only field that can be left blank. */ + accountId?: string; + /** + * Advertiser ID of this floodlight activity. If this field is left blank, the value will be copied over either from the activity group's advertiser or + * the existing activity's advertiser. + */ + advertiserId?: string; + /** Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. */ + advertiserIdDimensionValue?: DimensionValue; + /** + * Code type used for cache busting in the generated tag. Applicable only when floodlightActivityGroupType is COUNTER and countingMethod is + * STANDARD_COUNTING or UNIQUE_COUNTING. + */ + cacheBustingType?: string; + /** Counting method for conversions for this floodlight activity. This is a required field. */ + countingMethod?: string; + /** Dynamic floodlight tags. */ + defaultTags?: FloodlightActivityDynamicTag[]; + /** URL where this tag will be deployed. If specified, must be less than 256 characters long. */ + expectedUrl?: string; + /** Floodlight activity group ID of this floodlight activity. This is a required field. */ + floodlightActivityGroupId?: string; + /** Name of the associated floodlight activity group. This is a read-only field. */ + floodlightActivityGroupName?: string; + /** Tag string of the associated floodlight activity group. This is a read-only field. */ + floodlightActivityGroupTagString?: string; + /** Type of the associated floodlight activity group. This is a read-only field. */ + floodlightActivityGroupType?: string; + /** + * Floodlight configuration ID of this floodlight activity. If this field is left blank, the value will be copied over either from the activity group's + * floodlight configuration or from the existing activity's floodlight configuration. + */ + floodlightConfigurationId?: string; + /** Dimension value for the ID of the floodlight configuration. This is a read-only, auto-generated field. */ + floodlightConfigurationIdDimensionValue?: DimensionValue; + /** Whether this activity is archived. */ + hidden?: boolean; + /** ID of this floodlight activity. This is a read-only, auto-generated field. */ + id?: string; + /** Dimension value for the ID of this floodlight activity. This is a read-only, auto-generated field. */ + idDimensionValue?: DimensionValue; + /** Whether the image tag is enabled for this activity. */ + imageTagEnabled?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#floodlightActivity". */ + kind?: string; + /** Name of this floodlight activity. This is a required field. Must be less than 129 characters long and cannot contain quotes. */ + name?: string; + /** General notes or implementation instructions for the tag. */ + notes?: string; + /** Publisher dynamic floodlight tags. */ + publisherTags?: FloodlightActivityPublisherDynamicTag[]; + /** Whether this tag should use SSL. */ + secure?: boolean; + /** Whether the floodlight activity is SSL-compliant. This is a read-only field, its value detected by the system from the floodlight tags. */ + sslCompliant?: boolean; + /** Whether this floodlight activity must be SSL-compliant. */ + sslRequired?: boolean; + /** Subaccount ID of this floodlight activity. This is a read-only field that can be left blank. */ + subaccountId?: string; + /** Tag format type for the floodlight activity. If left blank, the tag format will default to HTML. */ + tagFormat?: string; + /** + * Value of the cat= paramter in the floodlight tag, which the ad servers use to identify the activity. This is optional: if empty, a new tag string will + * be generated for you. This string must be 1 to 8 characters long, with valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must also be + * unique among activities of the same activity group. This field is read-only after insertion. + */ + tagString?: string; + /** + * List of the user-defined variables used by this conversion tag. These map to the "u[1-100]=" in the tags. Each of these can have a user defined type. + * Acceptable values are U1 to U100, inclusive. + */ + userDefinedVariableTypes?: string[]; + } + interface FloodlightActivityDynamicTag { + /** ID of this dynamic tag. This is a read-only, auto-generated field. */ + id?: string; + /** Name of this tag. */ + name?: string; + /** Tag code. */ + tag?: string; + } + interface FloodlightActivityGroup { + /** Account ID of this floodlight activity group. This is a read-only field that can be left blank. */ + accountId?: string; + /** + * Advertiser ID of this floodlight activity group. If this field is left blank, the value will be copied over either from the floodlight configuration's + * advertiser or from the existing activity group's advertiser. + */ + advertiserId?: string; + /** Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. */ + advertiserIdDimensionValue?: DimensionValue; + /** Floodlight configuration ID of this floodlight activity group. This is a required field. */ + floodlightConfigurationId?: string; + /** Dimension value for the ID of the floodlight configuration. This is a read-only, auto-generated field. */ + floodlightConfigurationIdDimensionValue?: DimensionValue; + /** ID of this floodlight activity group. This is a read-only, auto-generated field. */ + id?: string; + /** Dimension value for the ID of this floodlight activity group. This is a read-only, auto-generated field. */ + idDimensionValue?: DimensionValue; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#floodlightActivityGroup". */ + kind?: string; + /** Name of this floodlight activity group. This is a required field. Must be less than 65 characters long and cannot contain quotes. */ + name?: string; + /** Subaccount ID of this floodlight activity group. This is a read-only field that can be left blank. */ + subaccountId?: string; + /** + * Value of the type= parameter in the floodlight tag, which the ad servers use to identify the activity group that the activity belongs to. This is + * optional: if empty, a new tag string will be generated for you. This string must be 1 to 8 characters long, with valid characters being + * [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among activity groups of the same floodlight configuration. This field is read-only after + * insertion. + */ + tagString?: string; + /** Type of the floodlight activity group. This is a required field that is read-only after insertion. */ + type?: string; + } + interface FloodlightActivityGroupsListResponse { + /** Floodlight activity group collection. */ + floodlightActivityGroups?: FloodlightActivityGroup[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#floodlightActivityGroupsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface FloodlightActivityPublisherDynamicTag { + /** Whether this tag is applicable only for click-throughs. */ + clickThrough?: boolean; + /** + * Directory site ID of this dynamic tag. This is a write-only field that can be used as an alternative to the siteId field. When this resource is + * retrieved, only the siteId field will be populated. + */ + directorySiteId?: string; + /** Dynamic floodlight tag. */ + dynamicTag?: FloodlightActivityDynamicTag; + /** Site ID of this dynamic tag. */ + siteId?: string; + /** Dimension value for the ID of the site. This is a read-only, auto-generated field. */ + siteIdDimensionValue?: DimensionValue; + /** Whether this tag is applicable only for view-throughs. */ + viewThrough?: boolean; + } + interface FloodlightConfiguration { + /** Account ID of this floodlight configuration. This is a read-only field that can be left blank. */ + accountId?: string; + /** Advertiser ID of the parent advertiser of this floodlight configuration. */ + advertiserId?: string; + /** Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. */ + advertiserIdDimensionValue?: DimensionValue; + /** Whether advertiser data is shared with Google Analytics. */ + analyticsDataSharingEnabled?: boolean; + /** + * Whether the exposure-to-conversion report is enabled. This report shows detailed pathway information on up to 10 of the most recent ad exposures seen + * by a user before converting. + */ + exposureToConversionEnabled?: boolean; + /** Day that will be counted as the first day of the week in reports. This is a required field. */ + firstDayOfWeek?: string; + /** ID of this floodlight configuration. This is a read-only, auto-generated field. */ + id?: string; + /** Dimension value for the ID of this floodlight configuration. This is a read-only, auto-generated field. */ + idDimensionValue?: DimensionValue; + /** Whether in-app attribution tracking is enabled. */ + inAppAttributionTrackingEnabled?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#floodlightConfiguration". */ + kind?: string; + /** Lookback window settings for this floodlight configuration. */ + lookbackConfiguration?: LookbackConfiguration; + /** Types of attribution options for natural search conversions. */ + naturalSearchConversionAttributionOption?: string; + /** Settings for DCM Omniture integration. */ + omnitureSettings?: OmnitureSettings; + /** Subaccount ID of this floodlight configuration. This is a read-only field that can be left blank. */ + subaccountId?: string; + /** Configuration settings for dynamic and image floodlight tags. */ + tagSettings?: TagSettings; + /** List of third-party authentication tokens enabled for this configuration. */ + thirdPartyAuthenticationTokens?: ThirdPartyAuthenticationToken[]; + /** List of user defined variables enabled for this configuration. */ + userDefinedVariableConfigurations?: UserDefinedVariableConfiguration[]; + } + interface FloodlightConfigurationsListResponse { + /** Floodlight configuration collection. */ + floodlightConfigurations?: FloodlightConfiguration[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#floodlightConfigurationsListResponse". */ + kind?: string; + } + interface FloodlightReportCompatibleFields { + /** Dimensions which are compatible to be selected in the "dimensionFilters" section of the report. */ + dimensionFilters?: Dimension[]; + /** Dimensions which are compatible to be selected in the "dimensions" section of the report. */ + dimensions?: Dimension[]; + /** The kind of resource this is, in this case dfareporting#floodlightReportCompatibleFields. */ + kind?: string; + /** Metrics which are compatible to be selected in the "metricNames" section of the report. */ + metrics?: Metric[]; + } + interface FrequencyCap { + /** Duration of time, in seconds, for this frequency cap. The maximum duration is 90 days. Acceptable values are 1 to 7776000, inclusive. */ + duration?: string; + /** Number of times an individual user can be served the ad within the specified duration. Acceptable values are 1 to 15, inclusive. */ + impressions?: string; + } + interface FsCommand { + /** Distance from the left of the browser.Applicable when positionOption is DISTANCE_FROM_TOP_LEFT_CORNER. */ + left?: number; + /** Position in the browser where the window will open. */ + positionOption?: string; + /** Distance from the top of the browser. Applicable when positionOption is DISTANCE_FROM_TOP_LEFT_CORNER. */ + top?: number; + /** Height of the window. */ + windowHeight?: number; + /** Width of the window. */ + windowWidth?: number; + } + interface GeoTargeting { + /** + * Cities to be targeted. For each city only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If + * targeting a city, do not target or exclude the country of the city, and do not target the metro or region of the city. + */ + cities?: City[]; + /** + * Countries to be targeted or excluded from targeting, depending on the setting of the excludeCountries field. For each country only dartId is required. + * The other fields are populated automatically when the ad is inserted or updated. If targeting or excluding a country, do not target regions, cities, + * metros, or postal codes in the same country. + */ + countries?: Country[]; + /** + * Whether or not to exclude the countries in the countries field from targeting. If false, the countries field refers to countries which will be targeted + * by the ad. + */ + excludeCountries?: boolean; + /** + * Metros to be targeted. For each metro only dmaId is required. The other fields are populated automatically when the ad is inserted or updated. If + * targeting a metro, do not target or exclude the country of the metro. + */ + metros?: Metro[]; + /** + * Postal codes to be targeted. For each postal code only id is required. The other fields are populated automatically when the ad is inserted or updated. + * If targeting a postal code, do not target or exclude the country of the postal code. + */ + postalCodes?: PostalCode[]; + /** + * Regions to be targeted. For each region only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If + * targeting a region, do not target or exclude the country of the region. + */ + regions?: Region[]; + } + interface InventoryItem { + /** Account ID of this inventory item. */ + accountId?: string; + /** + * Ad slots of this inventory item. If this inventory item represents a standalone placement, there will be exactly one ad slot. If this inventory item + * represents a placement group, there will be more than one ad slot, each representing one child placement in that placement group. + */ + adSlots?: AdSlot[]; + /** Advertiser ID of this inventory item. */ + advertiserId?: string; + /** Content category ID of this inventory item. */ + contentCategoryId?: string; + /** Estimated click-through rate of this inventory item. */ + estimatedClickThroughRate?: string; + /** Estimated conversion rate of this inventory item. */ + estimatedConversionRate?: string; + /** ID of this inventory item. */ + id?: string; + /** Whether this inventory item is in plan. */ + inPlan?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#inventoryItem". */ + kind?: string; + /** Information about the most recent modification of this inventory item. */ + lastModifiedInfo?: LastModifiedInfo; + /** + * Name of this inventory item. For standalone inventory items, this is the same name as that of its only ad slot. For group inventory items, this can + * differ from the name of any of its ad slots. + */ + name?: string; + /** Negotiation channel ID of this inventory item. */ + negotiationChannelId?: string; + /** Order ID of this inventory item. */ + orderId?: string; + /** Placement strategy ID of this inventory item. */ + placementStrategyId?: string; + /** Pricing of this inventory item. */ + pricing?: Pricing; + /** Project ID of this inventory item. */ + projectId?: string; + /** RFP ID of this inventory item. */ + rfpId?: string; + /** ID of the site this inventory item is associated with. */ + siteId?: string; + /** Subaccount ID of this inventory item. */ + subaccountId?: string; + /** Type of inventory item. */ + type?: string; + } + interface InventoryItemsListResponse { + /** Inventory item collection */ + inventoryItems?: InventoryItem[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#inventoryItemsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + } + interface KeyValueTargetingExpression { + /** Keyword expression being targeted by the ad. */ + expression?: string; + } + interface LandingPage { + /** + * Whether or not this landing page will be assigned to any ads or creatives that do not have a landing page assigned explicitly. Only one default landing + * page is allowed per campaign. + */ + default?: boolean; + /** ID of this landing page. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#landingPage". */ + kind?: string; + /** + * Name of this landing page. This is a required field. It must be less than 256 characters long, and must be unique among landing pages of the same + * campaign. + */ + name?: string; + /** URL of this landing page. This is a required field. */ + url?: string; + } + interface LandingPagesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#landingPagesListResponse". */ + kind?: string; + /** Landing page collection */ + landingPages?: LandingPage[]; + } + interface Language { + /** Language ID of this language. This is the ID used for targeting and generating reports. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#language". */ + kind?: string; + /** + * Format of language code is an ISO 639 two-letter language code optionally followed by an underscore followed by an ISO 3166 code. Examples are "en" for + * English or "zh_CN" for Simplified Chinese. + */ + languageCode?: string; + /** Name of this language. */ + name?: string; + } + interface LanguageTargeting { + /** + * Languages that this ad targets. For each language only languageId is required. The other fields are populated automatically when the ad is inserted or + * updated. + */ + languages?: Language[]; + } + interface LanguagesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#languagesListResponse". */ + kind?: string; + /** Language collection. */ + languages?: Language[]; + } + interface LastModifiedInfo { + /** Timestamp of the last change in milliseconds since epoch. */ + time?: string; + } + interface ListPopulationClause { + /** Terms of this list population clause. Each clause is made up of list population terms representing constraints and are joined by ORs. */ + terms?: ListPopulationTerm[]; + } + interface ListPopulationRule { + /** Floodlight activity ID associated with this rule. This field can be left blank. */ + floodlightActivityId?: string; + /** Name of floodlight activity associated with this rule. This is a read-only, auto-generated field. */ + floodlightActivityName?: string; + /** + * Clauses that make up this list population rule. Clauses are joined by ANDs, and the clauses themselves are made up of list population terms which are + * joined by ORs. + */ + listPopulationClauses?: ListPopulationClause[]; + } + interface ListPopulationTerm { + /** + * Will be true if the term should check if the user is in the list and false if the term should check if the user is not in the list. This field is only + * relevant when type is set to LIST_MEMBERSHIP_TERM. False by default. + */ + contains?: boolean; + /** + * Whether to negate the comparison result of this term during rule evaluation. This field is only relevant when type is left unset or set to + * CUSTOM_VARIABLE_TERM or REFERRER_TERM. + */ + negation?: boolean; + /** Comparison operator of this term. This field is only relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM. */ + operator?: string; + /** ID of the list in question. This field is only relevant when type is set to LIST_MEMBERSHIP_TERM. */ + remarketingListId?: string; + /** + * List population term type determines the applicable fields in this object. If left unset or set to CUSTOM_VARIABLE_TERM, then variableName, + * variableFriendlyName, operator, value, and negation are applicable. If set to LIST_MEMBERSHIP_TERM then remarketingListId and contains are applicable. + * If set to REFERRER_TERM then operator, value, and negation are applicable. + */ + type?: string; + /** Literal to compare the variable to. This field is only relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM. */ + value?: string; + /** + * Friendly name of this term's variable. This is a read-only, auto-generated field. This field is only relevant when type is left unset or set to + * CUSTOM_VARIABLE_TERM. + */ + variableFriendlyName?: string; + /** + * Name of the variable (U1, U2, etc.) being compared in this term. This field is only relevant when type is set to null, CUSTOM_VARIABLE_TERM or + * REFERRER_TERM. + */ + variableName?: string; + } + interface ListTargetingExpression { + /** Expression describing which lists are being targeted by the ad. */ + expression?: string; + } + interface LookbackConfiguration { + /** + * Lookback window, in days, from the last time a given user clicked on one of your ads. If you enter 0, clicks will not be considered as triggering + * events for floodlight tracking. If you leave this field blank, the default value for your account will be used. Acceptable values are 0 to 90, + * inclusive. + */ + clickDuration?: number; + /** + * Lookback window, in days, from the last time a given user viewed one of your ads. If you enter 0, impressions will not be considered as triggering + * events for floodlight tracking. If you leave this field blank, the default value for your account will be used. Acceptable values are 0 to 90, + * inclusive. + */ + postImpressionActivitiesDuration?: number; + } + interface Metric { + /** The kind of resource this is, in this case dfareporting#metric. */ + kind?: string; + /** The metric name, e.g. dfa:impressions */ + name?: string; + } + interface Metro { + /** Country code of the country to which this metro region belongs. */ + countryCode?: string; + /** DART ID of the country to which this metro region belongs. */ + countryDartId?: string; + /** DART ID of this metro region. */ + dartId?: string; + /** DMA ID of this metro region. This is the ID used for targeting and generating reports, and is equivalent to metro_code. */ + dmaId?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#metro". */ + kind?: string; + /** Metro code of this metro region. This is equivalent to dma_id. */ + metroCode?: string; + /** Name of this metro region. */ + name?: string; + } + interface MetrosListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#metrosListResponse". */ + kind?: string; + /** Metro collection. */ + metros?: Metro[]; + } + interface MobileCarrier { + /** Country code of the country to which this mobile carrier belongs. */ + countryCode?: string; + /** DART ID of the country to which this mobile carrier belongs. */ + countryDartId?: string; + /** ID of this mobile carrier. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#mobileCarrier". */ + kind?: string; + /** Name of this mobile carrier. */ + name?: string; + } + interface MobileCarriersListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#mobileCarriersListResponse". */ + kind?: string; + /** Mobile carrier collection. */ + mobileCarriers?: MobileCarrier[]; + } + interface ObjectFilter { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#objectFilter". */ + kind?: string; + /** Applicable when status is ASSIGNED. The user has access to objects with these object IDs. */ + objectIds?: string[]; + /** + * Status of the filter. NONE means the user has access to none of the objects. ALL means the user has access to all objects. ASSIGNED means the user has + * access to the objects with IDs in the objectIds list. + */ + status?: string; + } + interface OffsetPosition { + /** Offset distance from left side of an asset or a window. */ + left?: number; + /** Offset distance from top side of an asset or a window. */ + top?: number; + } + interface OmnitureSettings { + /** Whether placement cost data will be sent to Omniture. This property can be enabled only if omnitureIntegrationEnabled is true. */ + omnitureCostDataEnabled?: boolean; + /** Whether Omniture integration is enabled. This property can be enabled only when the "Advanced Ad Serving" account setting is enabled. */ + omnitureIntegrationEnabled?: boolean; + } + interface OperatingSystem { + /** DART ID of this operating system. This is the ID used for targeting. */ + dartId?: string; + /** Whether this operating system is for desktop. */ + desktop?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#operatingSystem". */ + kind?: string; + /** Whether this operating system is for mobile. */ + mobile?: boolean; + /** Name of this operating system. */ + name?: string; + } + interface OperatingSystemVersion { + /** ID of this operating system version. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#operatingSystemVersion". */ + kind?: string; + /** Major version (leftmost number) of this operating system version. */ + majorVersion?: string; + /** Minor version (number after the first dot) of this operating system version. */ + minorVersion?: string; + /** Name of this operating system version. */ + name?: string; + /** Operating system of this operating system version. */ + operatingSystem?: OperatingSystem; + } + interface OperatingSystemVersionsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#operatingSystemVersionsListResponse". */ + kind?: string; + /** Operating system version collection. */ + operatingSystemVersions?: OperatingSystemVersion[]; + } + interface OperatingSystemsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#operatingSystemsListResponse". */ + kind?: string; + /** Operating system collection. */ + operatingSystems?: OperatingSystem[]; + } + interface OptimizationActivity { + /** Floodlight activity ID of this optimization activity. This is a required field. */ + floodlightActivityId?: string; + /** Dimension value for the ID of the floodlight activity. This is a read-only, auto-generated field. */ + floodlightActivityIdDimensionValue?: DimensionValue; + /** + * Weight associated with this optimization. The weight assigned will be understood in proportion to the weights assigned to the other optimization + * activities. Value must be greater than or equal to 1. + */ + weight?: number; + } + interface Order { + /** Account ID of this order. */ + accountId?: string; + /** Advertiser ID of this order. */ + advertiserId?: string; + /** IDs for users that have to approve documents created for this order. */ + approverUserProfileIds?: string[]; + /** Buyer invoice ID associated with this order. */ + buyerInvoiceId?: string; + /** Name of the buyer organization. */ + buyerOrganizationName?: string; + /** Comments in this order. */ + comments?: string; + /** Contacts for this order. */ + contacts?: OrderContact[]; + /** ID of this order. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#order". */ + kind?: string; + /** Information about the most recent modification of this order. */ + lastModifiedInfo?: LastModifiedInfo; + /** Name of this order. */ + name?: string; + /** Notes of this order. */ + notes?: string; + /** ID of the terms and conditions template used in this order. */ + planningTermId?: string; + /** Project ID of this order. */ + projectId?: string; + /** Seller order ID associated with this order. */ + sellerOrderId?: string; + /** Name of the seller organization. */ + sellerOrganizationName?: string; + /** Site IDs this order is associated with. */ + siteId?: string[]; + /** Free-form site names this order is associated with. */ + siteNames?: string[]; + /** Subaccount ID of this order. */ + subaccountId?: string; + /** Terms and conditions of this order. */ + termsAndConditions?: string; + } + interface OrderContact { + /** + * Free-form information about this contact. It could be any information related to this contact in addition to type, title, name, and signature user + * profile ID. + */ + contactInfo?: string; + /** Name of this contact. */ + contactName?: string; + /** Title of this contact. */ + contactTitle?: string; + /** Type of this contact. */ + contactType?: string; + /** ID of the user profile containing the signature that will be embedded into order documents. */ + signatureUserProfileId?: string; + } + interface OrderDocument { + /** Account ID of this order document. */ + accountId?: string; + /** Advertiser ID of this order document. */ + advertiserId?: string; + /** + * The amended order document ID of this order document. An order document can be created by optionally amending another order document so that the change + * history can be preserved. + */ + amendedOrderDocumentId?: string; + /** IDs of users who have approved this order document. */ + approvedByUserProfileIds?: string[]; + /** Whether this order document is cancelled. */ + cancelled?: boolean; + /** Information about the creation of this order document. */ + createdInfo?: LastModifiedInfo; + /** Effective date of this order document. */ + effectiveDate?: string; + /** ID of this order document. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#orderDocument". */ + kind?: string; + /** List of email addresses that received the last sent document. */ + lastSentRecipients?: string[]; + /** Timestamp of the last email sent with this order document. */ + lastSentTime?: string; + /** ID of the order from which this order document is created. */ + orderId?: string; + /** Project ID of this order document. */ + projectId?: string; + /** Whether this order document has been signed. */ + signed?: boolean; + /** Subaccount ID of this order document. */ + subaccountId?: string; + /** Title of this order document. */ + title?: string; + /** Type of this order document */ + type?: string; + } + interface OrderDocumentsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#orderDocumentsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + /** Order document collection */ + orderDocuments?: OrderDocument[]; + } + interface OrdersListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#ordersListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + /** Order collection. */ + orders?: Order[]; + } + interface PathToConversionReportCompatibleFields { + /** Conversion dimensions which are compatible to be selected in the "conversionDimensions" section of the report. */ + conversionDimensions?: Dimension[]; + /** Custom floodlight variables which are compatible to be selected in the "customFloodlightVariables" section of the report. */ + customFloodlightVariables?: Dimension[]; + /** The kind of resource this is, in this case dfareporting#pathToConversionReportCompatibleFields. */ + kind?: string; + /** Metrics which are compatible to be selected in the "metricNames" section of the report. */ + metrics?: Metric[]; + /** Per-interaction dimensions which are compatible to be selected in the "perInteractionDimensions" section of the report. */ + perInteractionDimensions?: Dimension[]; + } + interface Placement { + /** Account ID of this placement. This field can be left blank. */ + accountId?: string; + /** + * Whether this placement opts out of ad blocking. When true, ad blocking is disabled for this placement. When false, the campaign and site settings take + * effect. + */ + adBlockingOptOut?: boolean; + /** Advertiser ID of this placement. This field can be left blank. */ + advertiserId?: string; + /** Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. */ + advertiserIdDimensionValue?: DimensionValue; + /** Whether this placement is archived. */ + archived?: boolean; + /** Campaign ID of this placement. This field is a required field on insertion. */ + campaignId?: string; + /** Dimension value for the ID of the campaign. This is a read-only, auto-generated field. */ + campaignIdDimensionValue?: DimensionValue; + /** Comments for this placement. */ + comment?: string; + /** + * Placement compatibility. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering on desktop, on mobile devices or in mobile apps for regular or + * interstitial ads respectively. APP and APP_INTERSTITIAL are no longer allowed for new placement insertions. Instead, use DISPLAY or + * DISPLAY_INTERSTITIAL. IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard. This field is required on insertion. + */ + compatibility?: string; + /** ID of the content category assigned to this placement. */ + contentCategoryId?: string; + /** Information about the creation of this placement. This is a read-only field. */ + createInfo?: LastModifiedInfo; + /** + * Directory site ID of this placement. On insert, you must set either this field or the siteId field to specify the site associated with this placement. + * This is a required field that is read-only after insertion. + */ + directorySiteId?: string; + /** Dimension value for the ID of the directory site. This is a read-only, auto-generated field. */ + directorySiteIdDimensionValue?: DimensionValue; + /** External ID for this placement. */ + externalId?: string; + /** ID of this placement. This is a read-only, auto-generated field. */ + id?: string; + /** Dimension value for the ID of this placement. This is a read-only, auto-generated field. */ + idDimensionValue?: DimensionValue; + /** Key name of this placement. This is a read-only, auto-generated field. */ + keyName?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#placement". */ + kind?: string; + /** Information about the most recent modification of this placement. This is a read-only field. */ + lastModifiedInfo?: LastModifiedInfo; + /** Lookback window settings for this placement. */ + lookbackConfiguration?: LookbackConfiguration; + /** Name of this placement.This is a required field and must be less than 256 characters long. */ + name?: string; + /** Whether payment was approved for this placement. This is a read-only field relevant only to publisher-paid placements. */ + paymentApproved?: boolean; + /** Payment source for this placement. This is a required field that is read-only after insertion. */ + paymentSource?: string; + /** ID of this placement's group, if applicable. */ + placementGroupId?: string; + /** Dimension value for the ID of the placement group. This is a read-only, auto-generated field. */ + placementGroupIdDimensionValue?: DimensionValue; + /** ID of the placement strategy assigned to this placement. */ + placementStrategyId?: string; + /** Pricing schedule of this placement. This field is required on insertion, specifically subfields startDate, endDate and pricingType. */ + pricingSchedule?: PricingSchedule; + /** + * Whether this placement is the primary placement of a roadblock (placement group). You cannot change this field from true to false. Setting this field + * to true will automatically set the primary field on the original primary placement of the roadblock to false, and it will automatically set the + * roadblock's primaryPlacementId field to the ID of this placement. + */ + primary?: boolean; + /** Information about the last publisher update. This is a read-only field. */ + publisherUpdateInfo?: LastModifiedInfo; + /** + * Site ID associated with this placement. On insert, you must set either this field or the directorySiteId field to specify the site associated with this + * placement. This is a required field that is read-only after insertion. + */ + siteId?: string; + /** Dimension value for the ID of the site. This is a read-only, auto-generated field. */ + siteIdDimensionValue?: DimensionValue; + /** Size associated with this placement. When inserting or updating a placement, only the size ID field is used. This field is required on insertion. */ + size?: Size; + /** Whether creatives assigned to this placement must be SSL-compliant. */ + sslRequired?: boolean; + /** Third-party placement status. */ + status?: string; + /** Subaccount ID of this placement. This field can be left blank. */ + subaccountId?: string; + /** + * Tag formats to generate for this placement. This field is required on insertion. + * Acceptable values are: + * - "PLACEMENT_TAG_STANDARD" + * - "PLACEMENT_TAG_IFRAME_JAVASCRIPT" + * - "PLACEMENT_TAG_IFRAME_ILAYER" + * - "PLACEMENT_TAG_INTERNAL_REDIRECT" + * - "PLACEMENT_TAG_JAVASCRIPT" + * - "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT" + * - "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT" + * - "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT" + * - "PLACEMENT_TAG_CLICK_COMMANDS" + * - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH" + * - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3" + * - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4" + * - "PLACEMENT_TAG_TRACKING" + * - "PLACEMENT_TAG_TRACKING_IFRAME" + * - "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + */ + tagFormats?: string[]; + /** Tag settings for this placement. */ + tagSetting?: TagSetting; + /** + * Whether Verification and ActiveView are disabled for in-stream video creatives for this placement. The same setting videoActiveViewOptOut exists on the + * site level -- the opt out occurs if either of these settings are true. These settings are distinct from DirectorySites.settings.activeViewOptOut or + * Sites.siteSettings.activeViewOptOut which only apply to display ads. However, Accounts.activeViewOptOut opts out both video traffic, as well as display + * ads, from Verification and ActiveView. + */ + videoActiveViewOptOut?: boolean; + /** A collection of settings which affect video creatives served through this placement. Applicable to placements with IN_STREAM_VIDEO compatibility. */ + videoSettings?: VideoSettings; + /** + * VPAID adapter setting for this placement. Controls which VPAID format the measurement adapter will use for in-stream video creatives assigned to this + * placement. + * + * Note: Flash is no longer supported. This field now defaults to HTML5 when the following values are provided: FLASH, BOTH. + */ + vpaidAdapterChoice?: string; + } + interface PlacementAssignment { + /** Whether this placement assignment is active. When true, the placement will be included in the ad's rotation. */ + active?: boolean; + /** ID of the placement to be assigned. This is a required field. */ + placementId?: string; + /** Dimension value for the ID of the placement. This is a read-only, auto-generated field. */ + placementIdDimensionValue?: DimensionValue; + /** Whether the placement to be assigned requires SSL. This is a read-only field that is auto-generated when the ad is inserted or updated. */ + sslRequired?: boolean; + } + interface PlacementGroup { + /** Account ID of this placement group. This is a read-only field that can be left blank. */ + accountId?: string; + /** Advertiser ID of this placement group. This is a required field on insertion. */ + advertiserId?: string; + /** Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. */ + advertiserIdDimensionValue?: DimensionValue; + /** Whether this placement group is archived. */ + archived?: boolean; + /** Campaign ID of this placement group. This field is required on insertion. */ + campaignId?: string; + /** Dimension value for the ID of the campaign. This is a read-only, auto-generated field. */ + campaignIdDimensionValue?: DimensionValue; + /** IDs of placements which are assigned to this placement group. This is a read-only, auto-generated field. */ + childPlacementIds?: string[]; + /** Comments for this placement group. */ + comment?: string; + /** ID of the content category assigned to this placement group. */ + contentCategoryId?: string; + /** Information about the creation of this placement group. This is a read-only field. */ + createInfo?: LastModifiedInfo; + /** + * Directory site ID associated with this placement group. On insert, you must set either this field or the site_id field to specify the site associated + * with this placement group. This is a required field that is read-only after insertion. + */ + directorySiteId?: string; + /** Dimension value for the ID of the directory site. This is a read-only, auto-generated field. */ + directorySiteIdDimensionValue?: DimensionValue; + /** External ID for this placement. */ + externalId?: string; + /** ID of this placement group. This is a read-only, auto-generated field. */ + id?: string; + /** Dimension value for the ID of this placement group. This is a read-only, auto-generated field. */ + idDimensionValue?: DimensionValue; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#placementGroup". */ + kind?: string; + /** Information about the most recent modification of this placement group. This is a read-only field. */ + lastModifiedInfo?: LastModifiedInfo; + /** Name of this placement group. This is a required field and must be less than 256 characters long. */ + name?: string; + /** + * Type of this placement group. A package is a simple group of placements that acts as a single pricing point for a group of tags. A roadblock is a group + * of placements that not only acts as a single pricing point, but also assumes that all the tags in it will be served at the same time. A roadblock + * requires one of its assigned placements to be marked as primary for reporting. This field is required on insertion. + */ + placementGroupType?: string; + /** ID of the placement strategy assigned to this placement group. */ + placementStrategyId?: string; + /** Pricing schedule of this placement group. This field is required on insertion. */ + pricingSchedule?: PricingSchedule; + /** + * ID of the primary placement, used to calculate the media cost of a roadblock (placement group). Modifying this field will automatically modify the + * primary field on all affected roadblock child placements. + */ + primaryPlacementId?: string; + /** Dimension value for the ID of the primary placement. This is a read-only, auto-generated field. */ + primaryPlacementIdDimensionValue?: DimensionValue; + /** + * Site ID associated with this placement group. On insert, you must set either this field or the directorySiteId field to specify the site associated + * with this placement group. This is a required field that is read-only after insertion. + */ + siteId?: string; + /** Dimension value for the ID of the site. This is a read-only, auto-generated field. */ + siteIdDimensionValue?: DimensionValue; + /** Subaccount ID of this placement group. This is a read-only field that can be left blank. */ + subaccountId?: string; + } + interface PlacementGroupsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#placementGroupsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + /** Placement group collection. */ + placementGroups?: PlacementGroup[]; + } + interface PlacementStrategiesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#placementStrategiesListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + /** Placement strategy collection. */ + placementStrategies?: PlacementStrategy[]; + } + interface PlacementStrategy { + /** Account ID of this placement strategy.This is a read-only field that can be left blank. */ + accountId?: string; + /** ID of this placement strategy. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#placementStrategy". */ + kind?: string; + /** + * Name of this placement strategy. This is a required field. It must be less than 256 characters long and unique among placement strategies of the same + * account. + */ + name?: string; + } + interface PlacementTag { + /** Placement ID */ + placementId?: string; + /** Tags generated for this placement. */ + tagDatas?: TagData[]; + } + interface PlacementsGenerateTagsResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#placementsGenerateTagsResponse". */ + kind?: string; + /** Set of generated tags for the specified placements. */ + placementTags?: PlacementTag[]; + } + interface PlacementsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#placementsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + /** Placement collection. */ + placements?: Placement[]; + } + interface PlatformType { + /** ID of this platform type. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#platformType". */ + kind?: string; + /** Name of this platform type. */ + name?: string; + } + interface PlatformTypesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#platformTypesListResponse". */ + kind?: string; + /** Platform type collection. */ + platformTypes?: PlatformType[]; + } + interface PopupWindowProperties { + /** Popup dimension for a creative. This is a read-only field. Applicable to the following creative types: all RICH_MEDIA and all VPAID */ + dimension?: Size; + /** Upper-left corner coordinates of the popup window. Applicable if positionType is COORDINATES. */ + offset?: OffsetPosition; + /** Popup window position either centered or at specific coordinate. */ + positionType?: string; + /** Whether to display the browser address bar. */ + showAddressBar?: boolean; + /** Whether to display the browser menu bar. */ + showMenuBar?: boolean; + /** Whether to display the browser scroll bar. */ + showScrollBar?: boolean; + /** Whether to display the browser status bar. */ + showStatusBar?: boolean; + /** Whether to display the browser tool bar. */ + showToolBar?: boolean; + /** Title of popup window. */ + title?: string; + } + interface PostalCode { + /** Postal code. This is equivalent to the id field. */ + code?: string; + /** Country code of the country to which this postal code belongs. */ + countryCode?: string; + /** DART ID of the country to which this postal code belongs. */ + countryDartId?: string; + /** ID of this postal code. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#postalCode". */ + kind?: string; + } + interface PostalCodesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#postalCodesListResponse". */ + kind?: string; + /** Postal code collection. */ + postalCodes?: PostalCode[]; + } + interface Pricing { + /** Cap cost type of this inventory item. */ + capCostType?: string; + /** End date of this inventory item. */ + endDate?: string; + /** Flights of this inventory item. A flight (a.k.a. pricing period) represents the inventory item pricing information for a specific period of time. */ + flights?: Flight[]; + /** + * Group type of this inventory item if it represents a placement group. Is null otherwise. There are two type of placement groups: + * PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE is a simple group of inventory items that acts as a single pricing point for a group of tags. + * PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK is a group of inventory items that not only acts as a single pricing point, but also assumes that all the tags + * in it will be served at the same time. A roadblock requires one of its assigned inventory items to be marked as primary. + */ + groupType?: string; + /** Pricing type of this inventory item. */ + pricingType?: string; + /** Start date of this inventory item. */ + startDate?: string; + } + interface PricingSchedule { + /** Placement cap cost option. */ + capCostOption?: string; + /** Whether cap costs are ignored by ad serving. */ + disregardOverdelivery?: boolean; + /** + * Placement end date. This date must be later than, or the same day as, the placement start date, but not later than the campaign end date. If, for + * example, you set 6/25/2015 as both the start and end dates, the effective placement date is just that day only, 6/25/2015. The hours, minutes, and + * seconds of the end date should not be set, as doing so will result in an error. This field is required on insertion. + */ + endDate?: string; + /** Whether this placement is flighted. If true, pricing periods will be computed automatically. */ + flighted?: boolean; + /** Floodlight activity ID associated with this placement. This field should be set when placement pricing type is set to PRICING_TYPE_CPA. */ + floodlightActivityId?: string; + /** Pricing periods for this placement. */ + pricingPeriods?: PricingSchedulePricingPeriod[]; + /** Placement pricing type. This field is required on insertion. */ + pricingType?: string; + /** + * Placement start date. This date must be later than, or the same day as, the campaign start date. The hours, minutes, and seconds of the start date + * should not be set, as doing so will result in an error. This field is required on insertion. + */ + startDate?: string; + /** Testing start date of this placement. The hours, minutes, and seconds of the start date should not be set, as doing so will result in an error. */ + testingStartDate?: string; + } + interface PricingSchedulePricingPeriod { + /** + * Pricing period end date. This date must be later than, or the same day as, the pricing period start date, but not later than the placement end date. + * The period end date can be the same date as the period start date. If, for example, you set 6/25/2015 as both the start and end dates, the effective + * pricing period date is just that day only, 6/25/2015. The hours, minutes, and seconds of the end date should not be set, as doing so will result in an + * error. + */ + endDate?: string; + /** Comments for this pricing period. */ + pricingComment?: string; + /** Rate or cost of this pricing period in nanos (i.e., multipled by 1000000000). Acceptable values are 0 to 1000000000000000000, inclusive. */ + rateOrCostNanos?: string; + /** + * Pricing period start date. This date must be later than, or the same day as, the placement start date. The hours, minutes, and seconds of the start + * date should not be set, as doing so will result in an error. + */ + startDate?: string; + /** Units of this pricing period. Acceptable values are 0 to 10000000000, inclusive. */ + units?: string; + } + interface Project { + /** Account ID of this project. */ + accountId?: string; + /** Advertiser ID of this project. */ + advertiserId?: string; + /** Audience age group of this project. */ + audienceAgeGroup?: string; + /** Audience gender of this project. */ + audienceGender?: string; + /** + * Budget of this project in the currency specified by the current account. The value stored in this field represents only the non-fractional amount. For + * example, for USD, the smallest value that can be represented by this field is 1 US dollar. + */ + budget?: string; + /** Client billing code of this project. */ + clientBillingCode?: string; + /** Name of the project client. */ + clientName?: string; + /** End date of the project. */ + endDate?: string; + /** ID of this project. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#project". */ + kind?: string; + /** Information about the most recent modification of this project. */ + lastModifiedInfo?: LastModifiedInfo; + /** Name of this project. */ + name?: string; + /** Overview of this project. */ + overview?: string; + /** Start date of the project. */ + startDate?: string; + /** Subaccount ID of this project. */ + subaccountId?: string; + /** Number of clicks that the advertiser is targeting. */ + targetClicks?: string; + /** Number of conversions that the advertiser is targeting. */ + targetConversions?: string; + /** CPA that the advertiser is targeting. */ + targetCpaNanos?: string; + /** CPC that the advertiser is targeting. */ + targetCpcNanos?: string; + /** vCPM from Active View that the advertiser is targeting. */ + targetCpmActiveViewNanos?: string; + /** CPM that the advertiser is targeting. */ + targetCpmNanos?: string; + /** Number of impressions that the advertiser is targeting. */ + targetImpressions?: string; + } + interface ProjectsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#projectsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + /** Project collection. */ + projects?: Project[]; + } + interface ReachReportCompatibleFields { + /** Dimensions which are compatible to be selected in the "dimensionFilters" section of the report. */ + dimensionFilters?: Dimension[]; + /** Dimensions which are compatible to be selected in the "dimensions" section of the report. */ + dimensions?: Dimension[]; + /** The kind of resource this is, in this case dfareporting#reachReportCompatibleFields. */ + kind?: string; + /** Metrics which are compatible to be selected in the "metricNames" section of the report. */ + metrics?: Metric[]; + /** Metrics which are compatible to be selected as activity metrics to pivot on in the "activities" section of the report. */ + pivotedActivityMetrics?: Metric[]; + /** Metrics which are compatible to be selected in the "reachByFrequencyMetricNames" section of the report. */ + reachByFrequencyMetrics?: Metric[]; + } + interface Recipient { + /** The delivery type for the recipient. */ + deliveryType?: string; + /** The email address of the recipient. */ + email?: string; + /** The kind of resource this is, in this case dfareporting#recipient. */ + kind?: string; + } + interface Region { + /** Country code of the country to which this region belongs. */ + countryCode?: string; + /** DART ID of the country to which this region belongs. */ + countryDartId?: string; + /** DART ID of this region. */ + dartId?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#region". */ + kind?: string; + /** Name of this region. */ + name?: string; + /** Region code. */ + regionCode?: string; + } + interface RegionsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#regionsListResponse". */ + kind?: string; + /** Region collection. */ + regions?: Region[]; + } + interface RemarketingList { + /** Account ID of this remarketing list. This is a read-only, auto-generated field that is only returned in GET requests. */ + accountId?: string; + /** Whether this remarketing list is active. */ + active?: boolean; + /** Dimension value for the advertiser ID that owns this remarketing list. This is a required field. */ + advertiserId?: string; + /** Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. */ + advertiserIdDimensionValue?: DimensionValue; + /** Remarketing list description. */ + description?: string; + /** Remarketing list ID. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#remarketingList". */ + kind?: string; + /** Number of days that a user should remain in the remarketing list without an impression. Acceptable values are 1 to 540, inclusive. */ + lifeSpan?: string; + /** Rule used to populate the remarketing list with users. */ + listPopulationRule?: ListPopulationRule; + /** Number of users currently in the list. This is a read-only field. */ + listSize?: string; + /** Product from which this remarketing list was originated. */ + listSource?: string; + /** Name of the remarketing list. This is a required field. Must be no greater than 128 characters long. */ + name?: string; + /** Subaccount ID of this remarketing list. This is a read-only, auto-generated field that is only returned in GET requests. */ + subaccountId?: string; + } + interface RemarketingListShare { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#remarketingListShare". */ + kind?: string; + /** Remarketing list ID. This is a read-only, auto-generated field. */ + remarketingListId?: string; + /** Accounts that the remarketing list is shared with. */ + sharedAccountIds?: string[]; + /** Advertisers that the remarketing list is shared with. */ + sharedAdvertiserIds?: string[]; + } + interface RemarketingListsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#remarketingListsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + /** Remarketing list collection. */ + remarketingLists?: RemarketingList[]; + } + interface Report { + /** The account ID to which this report belongs. */ + accountId?: string; + /** The report criteria for a report of type "STANDARD". */ + criteria?: { + /** Activity group. */ + activities?: Activities; + /** Custom Rich Media Events group. */ + customRichMediaEvents?: CustomRichMediaEvents; + /** The date range for which this report should be run. */ + dateRange?: DateRange; + /** + * The list of filters on which dimensions are filtered. + * Filters for different dimensions are ANDed, filters for the same dimension are grouped together and ORed. + */ + dimensionFilters?: DimensionValue[]; + /** The list of standard dimensions the report should include. */ + dimensions?: SortedDimension[]; + /** The list of names of metrics the report should include. */ + metricNames?: string[]; + }; + /** The report criteria for a report of type "CROSS_DIMENSION_REACH". */ + crossDimensionReachCriteria?: { + /** The list of dimensions the report should include. */ + breakdown?: SortedDimension[]; + /** The date range this report should be run for. */ + dateRange?: DateRange; + /** The dimension option. */ + dimension?: string; + /** The list of filters on which dimensions are filtered. */ + dimensionFilters?: DimensionValue[]; + /** The list of names of metrics the report should include. */ + metricNames?: string[]; + /** The list of names of overlap metrics the report should include. */ + overlapMetricNames?: string[]; + /** Whether the report is pivoted or not. Defaults to true. */ + pivoted?: boolean; + }; + /** The report's email delivery settings. */ + delivery?: { + /** Whether the report should be emailed to the report owner. */ + emailOwner?: boolean; + /** The type of delivery for the owner to receive, if enabled. */ + emailOwnerDeliveryType?: string; + /** The message to be sent with each email. */ + message?: string; + /** The list of recipients to which to email the report. */ + recipients?: Recipient[]; + }; + /** The eTag of this response for caching purposes. */ + etag?: string; + /** The filename used when generating report files for this report. */ + fileName?: string; + /** The report criteria for a report of type "FLOODLIGHT". */ + floodlightCriteria?: { + /** The list of custom rich media events to include. */ + customRichMediaEvents?: DimensionValue[]; + /** The date range this report should be run for. */ + dateRange?: DateRange; + /** + * The list of filters on which dimensions are filtered. + * Filters for different dimensions are ANDed, filters for the same dimension are grouped together and ORed. + */ + dimensionFilters?: DimensionValue[]; + /** The list of dimensions the report should include. */ + dimensions?: SortedDimension[]; + /** + * The floodlight ID for which to show data in this report. All advertisers associated with that ID will automatically be added. The dimension of the + * value needs to be 'dfa:floodlightConfigId'. + */ + floodlightConfigId?: DimensionValue; + /** The list of names of metrics the report should include. */ + metricNames?: string[]; + /** The properties of the report. */ + reportProperties?: { + /** Include conversions that have no cookie, but do have an exposure path. */ + includeAttributedIPConversions?: boolean; + /** + * Include conversions of users with a DoubleClick cookie but without an exposure. That means the user did not click or see an ad from the advertiser + * within the Floodlight group, or that the interaction happened outside the lookback window. + */ + includeUnattributedCookieConversions?: boolean; + /** + * Include conversions that have no associated cookies and no exposures. It’s therefore impossible to know how the user was exposed to your ads during the + * lookback window prior to a conversion. + */ + includeUnattributedIPConversions?: boolean; + }; + }; + /** + * The output format of the report. If not specified, default format is "CSV". Note that the actual format in the completed report file might differ if + * for instance the report's size exceeds the format's capabilities. "CSV" will then be the fallback format. + */ + format?: string; + /** The unique ID identifying this report resource. */ + id?: string; + /** The kind of resource this is, in this case dfareporting#report. */ + kind?: string; + /** The timestamp (in milliseconds since epoch) of when this report was last modified. */ + lastModifiedTime?: string; + /** The name of the report. */ + name?: string; + /** The user profile id of the owner of this report. */ + ownerProfileId?: string; + /** The report criteria for a report of type "PATH_TO_CONVERSION". */ + pathToConversionCriteria?: { + /** The list of 'dfa:activity' values to filter on. */ + activityFilters?: DimensionValue[]; + /** The list of conversion dimensions the report should include. */ + conversionDimensions?: SortedDimension[]; + /** The list of custom floodlight variables the report should include. */ + customFloodlightVariables?: SortedDimension[]; + /** The list of custom rich media events to include. */ + customRichMediaEvents?: DimensionValue[]; + /** The date range this report should be run for. */ + dateRange?: DateRange; + /** + * The floodlight ID for which to show data in this report. All advertisers associated with that ID will automatically be added. The dimension of the + * value needs to be 'dfa:floodlightConfigId'. + */ + floodlightConfigId?: DimensionValue; + /** The list of names of metrics the report should include. */ + metricNames?: string[]; + /** The list of per interaction dimensions the report should include. */ + perInteractionDimensions?: SortedDimension[]; + /** The properties of the report. */ + reportProperties?: { + /** + * DFA checks to see if a click interaction occurred within the specified period of time before a conversion. By default the value is pulled from + * Floodlight or you can manually enter a custom value. Valid values: 1-90. + */ + clicksLookbackWindow?: number; + /** + * DFA checks to see if an impression interaction occurred within the specified period of time before a conversion. By default the value is pulled from + * Floodlight or you can manually enter a custom value. Valid values: 1-90. + */ + impressionsLookbackWindow?: number; + /** Deprecated: has no effect. */ + includeAttributedIPConversions?: boolean; + /** + * Include conversions of users with a DoubleClick cookie but without an exposure. That means the user did not click or see an ad from the advertiser + * within the Floodlight group, or that the interaction happened outside the lookback window. + */ + includeUnattributedCookieConversions?: boolean; + /** + * Include conversions that have no associated cookies and no exposures. It’s therefore impossible to know how the user was exposed to your ads during the + * lookback window prior to a conversion. + */ + includeUnattributedIPConversions?: boolean; + /** + * The maximum number of click interactions to include in the report. Advertisers currently paying for E2C reports get up to 200 (100 clicks, 100 + * impressions). If another advertiser in your network is paying for E2C, you can have up to 5 total exposures per report. + */ + maximumClickInteractions?: number; + /** + * The maximum number of click interactions to include in the report. Advertisers currently paying for E2C reports get up to 200 (100 clicks, 100 + * impressions). If another advertiser in your network is paying for E2C, you can have up to 5 total exposures per report. + */ + maximumImpressionInteractions?: number; + /** The maximum amount of time that can take place between interactions (clicks or impressions) by the same user. Valid values: 1-90. */ + maximumInteractionGap?: number; + /** Enable pivoting on interaction path. */ + pivotOnInteractionPath?: boolean; + }; + }; + /** The report criteria for a report of type "REACH". */ + reachCriteria?: { + /** Activity group. */ + activities?: Activities; + /** Custom Rich Media Events group. */ + customRichMediaEvents?: CustomRichMediaEvents; + /** The date range this report should be run for. */ + dateRange?: DateRange; + /** + * The list of filters on which dimensions are filtered. + * Filters for different dimensions are ANDed, filters for the same dimension are grouped together and ORed. + */ + dimensionFilters?: DimensionValue[]; + /** The list of dimensions the report should include. */ + dimensions?: SortedDimension[]; + /** + * Whether to enable all reach dimension combinations in the report. Defaults to false. If enabled, the date range of the report should be within the last + * three months. + */ + enableAllDimensionCombinations?: boolean; + /** The list of names of metrics the report should include. */ + metricNames?: string[]; + /** The list of names of Reach By Frequency metrics the report should include. */ + reachByFrequencyMetricNames?: string[]; + }; + /** The report's schedule. Can only be set if the report's 'dateRange' is a relative date range and the relative date range is not "TODAY". */ + schedule?: { + /** Whether the schedule is active or not. Must be set to either true or false. */ + active?: boolean; + /** Defines every how many days, weeks or months the report should be run. Needs to be set when "repeats" is either "DAILY", "WEEKLY" or "MONTHLY". */ + every?: number; + /** The expiration date when the scheduled report stops running. */ + expirationDate?: string; + /** + * The interval for which the report is repeated. Note: + * - "DAILY" also requires field "every" to be set. + * - "WEEKLY" also requires fields "every" and "repeatsOnWeekDays" to be set. + * - "MONTHLY" also requires fields "every" and "runsOnDayOfMonth" to be set. + */ + repeats?: string; + /** List of week days "WEEKLY" on which scheduled reports should run. */ + repeatsOnWeekDays?: string[]; + /** + * Enum to define for "MONTHLY" scheduled reports whether reports should be repeated on the same day of the month as "startDate" or the same day of the + * week of the month. + * Example: If 'startDate' is Monday, April 2nd 2012 (2012-04-02), "DAY_OF_MONTH" would run subsequent reports on the 2nd of every Month, and + * "WEEK_OF_MONTH" would run subsequent reports on the first Monday of the month. + */ + runsOnDayOfMonth?: string; + /** Start date of date range for which scheduled reports should be run. */ + startDate?: string; + }; + /** The subaccount ID to which this report belongs if applicable. */ + subAccountId?: string; + /** The type of the report. */ + type?: string; + } + interface ReportCompatibleFields { + /** Dimensions which are compatible to be selected in the "dimensionFilters" section of the report. */ + dimensionFilters?: Dimension[]; + /** Dimensions which are compatible to be selected in the "dimensions" section of the report. */ + dimensions?: Dimension[]; + /** The kind of resource this is, in this case dfareporting#reportCompatibleFields. */ + kind?: string; + /** Metrics which are compatible to be selected in the "metricNames" section of the report. */ + metrics?: Metric[]; + /** Metrics which are compatible to be selected as activity metrics to pivot on in the "activities" section of the report. */ + pivotedActivityMetrics?: Metric[]; + } + interface ReportList { + /** The eTag of this response for caching purposes. */ + etag?: string; + /** The reports returned in this response. */ + items?: Report[]; + /** The kind of list this is, in this case dfareporting#reportList. */ + kind?: string; + /** + * Continuation token used to page through reports. To retrieve the next page of results, set the next request's "pageToken" to the value of this field. + * The page token is only valid for a limited amount of time and should not be persisted. + */ + nextPageToken?: string; + } + interface ReportsConfiguration { + /** + * Whether the exposure to conversion report is enabled. This report shows detailed pathway information on up to 10 of the most recent ad exposures seen + * by a user before converting. + */ + exposureToConversionEnabled?: boolean; + /** Default lookback windows for new advertisers in this account. */ + lookbackConfiguration?: LookbackConfiguration; + /** + * Report generation time zone ID of this account. This is a required field that can only be changed by a superuser. + * Acceptable values are: + * + * - "1" for "America/New_York" + * - "2" for "Europe/London" + * - "3" for "Europe/Paris" + * - "4" for "Africa/Johannesburg" + * - "5" for "Asia/Jerusalem" + * - "6" for "Asia/Shanghai" + * - "7" for "Asia/Hong_Kong" + * - "8" for "Asia/Tokyo" + * - "9" for "Australia/Sydney" + * - "10" for "Asia/Dubai" + * - "11" for "America/Los_Angeles" + * - "12" for "Pacific/Auckland" + * - "13" for "America/Sao_Paulo" + */ + reportGenerationTimeZoneId?: string; + } + interface RichMediaExitOverride { + /** Click-through URL of this rich media exit override. Applicable if the enabled field is set to true. */ + clickThroughUrl?: ClickThroughUrl; + /** Whether to use the clickThroughUrl. If false, the creative-level exit will be used. */ + enabled?: boolean; + /** ID for the override to refer to a specific exit in the creative. */ + exitId?: string; + } + interface Rule { + /** A creativeAssets[].id. This should refer to one of the parent assets in this creative. This is a required field. */ + assetId?: string; + /** A user-friendly name for this rule. This is a required field. */ + name?: string; + /** + * A targeting template ID. The targeting from the targeting template will be used to determine whether this asset should be served. This is a required + * field. + */ + targetingTemplateId?: string; + } + interface Site { + /** Account ID of this site. This is a read-only field that can be left blank. */ + accountId?: string; + /** Whether this site is approved. */ + approved?: boolean; + /** Directory site associated with this site. This is a required field that is read-only after insertion. */ + directorySiteId?: string; + /** Dimension value for the ID of the directory site. This is a read-only, auto-generated field. */ + directorySiteIdDimensionValue?: DimensionValue; + /** ID of this site. This is a read-only, auto-generated field. */ + id?: string; + /** Dimension value for the ID of this site. This is a read-only, auto-generated field. */ + idDimensionValue?: DimensionValue; + /** Key name of this site. This is a read-only, auto-generated field. */ + keyName?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#site". */ + kind?: string; + /** + * Name of this site.This is a required field. Must be less than 128 characters long. If this site is under a subaccount, the name must be unique among + * sites of the same subaccount. Otherwise, this site is a top-level site, and the name must be unique among top-level sites of the same account. + */ + name?: string; + /** Site contacts. */ + siteContacts?: SiteContact[]; + /** Site-wide settings. */ + siteSettings?: SiteSettings; + /** Subaccount ID of this site. This is a read-only field that can be left blank. */ + subaccountId?: string; + } + interface SiteContact { + /** Address of this site contact. */ + address?: string; + /** Site contact type. */ + contactType?: string; + /** Email address of this site contact. This is a required field. */ + email?: string; + /** First name of this site contact. */ + firstName?: string; + /** ID of this site contact. This is a read-only, auto-generated field. */ + id?: string; + /** Last name of this site contact. */ + lastName?: string; + /** Primary phone number of this site contact. */ + phone?: string; + /** Title or designation of this site contact. */ + title?: string; + } + interface SiteSettings { + /** Whether active view creatives are disabled for this site. */ + activeViewOptOut?: boolean; + /** + * Whether this site opts out of ad blocking. When true, ad blocking is disabled for all placements under the site, regardless of the individual placement + * settings. When false, the campaign and placement settings take effect. + */ + adBlockingOptOut?: boolean; + /** Site-wide creative settings. */ + creativeSettings?: CreativeSettings; + /** Whether new cookies are disabled for this site. */ + disableNewCookie?: boolean; + /** Lookback window settings for this site. */ + lookbackConfiguration?: LookbackConfiguration; + /** Configuration settings for dynamic and image floodlight tags. */ + tagSetting?: TagSetting; + /** + * Whether Verification and ActiveView for in-stream video creatives are disabled by default for new placements created under this site. This value will + * be used to populate the placement.videoActiveViewOptOut field, when no value is specified for the new placement. + */ + videoActiveViewOptOutTemplate?: boolean; + /** + * Default VPAID adapter setting for new placements created under this site. This value will be used to populate the placements.vpaidAdapterChoice field, + * when no value is specified for the new placement. Controls which VPAID format the measurement adapter will use for in-stream video creatives assigned + * to the placement. The publisher's specifications will typically determine this setting. For VPAID creatives, the adapter format will match the VPAID + * format (HTML5 VPAID creatives use the HTML5 adapter). + * + * Note: Flash is no longer supported. This field now defaults to HTML5 when the following values are provided: FLASH, BOTH. + */ + vpaidAdapterChoiceTemplate?: string; + } + interface SitesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#sitesListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + /** Site collection. */ + sites?: Site[]; + } + interface Size { + /** Height of this size. Acceptable values are 0 to 32767, inclusive. */ + height?: number; + /** IAB standard size. This is a read-only, auto-generated field. */ + iab?: boolean; + /** ID of this size. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#size". */ + kind?: string; + /** Width of this size. Acceptable values are 0 to 32767, inclusive. */ + width?: number; + } + interface SizesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#sizesListResponse". */ + kind?: string; + /** Size collection. */ + sizes?: Size[]; + } + interface SkippableSetting { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#skippableSetting". */ + kind?: string; + /** Amount of time to play videos served to this placement before counting a view. Applicable when skippable is true. */ + progressOffset?: VideoOffset; + /** Amount of time to play videos served to this placement before the skip button should appear. Applicable when skippable is true. */ + skipOffset?: VideoOffset; + /** Whether the user can skip creatives served to this placement. */ + skippable?: boolean; + } + interface SortedDimension { + /** The kind of resource this is, in this case dfareporting#sortedDimension. */ + kind?: string; + /** The name of the dimension. */ + name?: string; + /** An optional sort order for the dimension column. */ + sortOrder?: string; + } + interface Subaccount { + /** ID of the account that contains this subaccount. This is a read-only field that can be left blank. */ + accountId?: string; + /** IDs of the available user role permissions for this subaccount. */ + availablePermissionIds?: string[]; + /** ID of this subaccount. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#subaccount". */ + kind?: string; + /** Name of this subaccount. This is a required field. Must be less than 128 characters long and be unique among subaccounts of the same account. */ + name?: string; + } + interface SubaccountsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#subaccountsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + /** Subaccount collection. */ + subaccounts?: Subaccount[]; + } + interface TagData { + /** Ad associated with this placement tag. Applicable only when format is PLACEMENT_TAG_TRACKING. */ + adId?: string; + /** Tag string to record a click. */ + clickTag?: string; + /** Creative associated with this placement tag. Applicable only when format is PLACEMENT_TAG_TRACKING. */ + creativeId?: string; + /** TagData tag format of this tag. */ + format?: string; + /** Tag string for serving an ad. */ + impressionTag?: string; + } + interface TagSetting { + /** + * Additional key-values to be included in tags. Each key-value pair must be of the form key=value, and pairs must be separated by a semicolon (;). Keys + * and values must not contain commas. For example, id=2;color=red is a valid value for this field. + */ + additionalKeyValues?: string; + /** Whether static landing page URLs should be included in the tags. This setting applies only to placements. */ + includeClickThroughUrls?: boolean; + /** Whether click-tracking string should be included in the tags. */ + includeClickTracking?: boolean; + /** + * Option specifying how keywords are embedded in ad tags. This setting can be used to specify whether keyword placeholders are inserted in placement tags + * for this site. Publishers can then add keywords to those placeholders. + */ + keywordOption?: string; + } + interface TagSettings { + /** Whether dynamic floodlight tags are enabled. */ + dynamicTagEnabled?: boolean; + /** Whether image tags are enabled. */ + imageTagEnabled?: boolean; + } + interface TargetWindow { + /** User-entered value. */ + customHtml?: string; + /** Type of browser window for which the backup image of the flash creative can be displayed. */ + targetWindowOption?: string; + } + interface TargetableRemarketingList { + /** Account ID of this remarketing list. This is a read-only, auto-generated field that is only returned in GET requests. */ + accountId?: string; + /** Whether this targetable remarketing list is active. */ + active?: boolean; + /** Dimension value for the advertiser ID that owns this targetable remarketing list. */ + advertiserId?: string; + /** Dimension value for the ID of the advertiser. */ + advertiserIdDimensionValue?: DimensionValue; + /** Targetable remarketing list description. */ + description?: string; + /** Targetable remarketing list ID. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#targetableRemarketingList". */ + kind?: string; + /** Number of days that a user should remain in the targetable remarketing list without an impression. */ + lifeSpan?: string; + /** Number of users currently in the list. This is a read-only field. */ + listSize?: string; + /** Product from which this targetable remarketing list was originated. */ + listSource?: string; + /** Name of the targetable remarketing list. Is no greater than 128 characters long. */ + name?: string; + /** Subaccount ID of this remarketing list. This is a read-only, auto-generated field that is only returned in GET requests. */ + subaccountId?: string; + } + interface TargetableRemarketingListsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#targetableRemarketingListsListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + /** Targetable remarketing list collection. */ + targetableRemarketingLists?: TargetableRemarketingList[]; + } + interface TargetingTemplate { + /** Account ID of this targeting template. This field, if left unset, will be auto-generated on insert and is read-only after insert. */ + accountId?: string; + /** Advertiser ID of this targeting template. This is a required field on insert and is read-only after insert. */ + advertiserId?: string; + /** Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. */ + advertiserIdDimensionValue?: DimensionValue; + /** Time and day targeting criteria. */ + dayPartTargeting?: DayPartTargeting; + /** Geographical targeting criteria. */ + geoTargeting?: GeoTargeting; + /** ID of this targeting template. This is a read-only, auto-generated field. */ + id?: string; + /** Key-value targeting criteria. */ + keyValueTargetingExpression?: KeyValueTargetingExpression; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#targetingTemplate". */ + kind?: string; + /** Language targeting criteria. */ + languageTargeting?: LanguageTargeting; + /** Remarketing list targeting criteria. */ + listTargetingExpression?: ListTargetingExpression; + /** Name of this targeting template. This field is required. It must be less than 256 characters long and unique within an advertiser. */ + name?: string; + /** Subaccount ID of this targeting template. This field, if left unset, will be auto-generated on insert and is read-only after insert. */ + subaccountId?: string; + /** Technology platform targeting criteria. */ + technologyTargeting?: TechnologyTargeting; + } + interface TargetingTemplatesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#targetingTemplatesListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + /** Targeting template collection. */ + targetingTemplates?: TargetingTemplate[]; + } + interface TechnologyTargeting { + /** + * Browsers that this ad targets. For each browser either set browserVersionId or dartId along with the version numbers. If both are specified, only + * browserVersionId will be used. The other fields are populated automatically when the ad is inserted or updated. + */ + browsers?: Browser[]; + /** + * Connection types that this ad targets. For each connection type only id is required. The other fields are populated automatically when the ad is + * inserted or updated. + */ + connectionTypes?: ConnectionType[]; + /** + * Mobile carriers that this ad targets. For each mobile carrier only id is required, and the other fields are populated automatically when the ad is + * inserted or updated. If targeting a mobile carrier, do not set targeting for any zip codes. + */ + mobileCarriers?: MobileCarrier[]; + /** + * Operating system versions that this ad targets. To target all versions, use operatingSystems. For each operating system version, only id is required. + * The other fields are populated automatically when the ad is inserted or updated. If targeting an operating system version, do not set targeting for the + * corresponding operating system in operatingSystems. + */ + operatingSystemVersions?: OperatingSystemVersion[]; + /** + * Operating systems that this ad targets. To target specific versions, use operatingSystemVersions. For each operating system only dartId is required. + * The other fields are populated automatically when the ad is inserted or updated. If targeting an operating system, do not set targeting for operating + * system versions for the same operating system. + */ + operatingSystems?: OperatingSystem[]; + /** + * Platform types that this ad targets. For example, desktop, mobile, or tablet. For each platform type, only id is required, and the other fields are + * populated automatically when the ad is inserted or updated. + */ + platformTypes?: PlatformType[]; + } + interface ThirdPartyAuthenticationToken { + /** Name of the third-party authentication token. */ + name?: string; + /** Value of the third-party authentication token. This is a read-only, auto-generated field. */ + value?: string; + } + interface ThirdPartyTrackingUrl { + /** Third-party URL type for in-stream video creatives. */ + thirdPartyUrlType?: string; + /** URL for the specified third-party URL type. */ + url?: string; + } + interface TranscodeSetting { + /** Whitelist of video formats to be served to this placement. Set this list to null or empty to serve all video formats. */ + enabledVideoFormats?: number[]; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#transcodeSetting". */ + kind?: string; + } + interface UniversalAdId { + /** Registry used for the Ad ID value. */ + registry?: string; + /** + * ID value for this creative. Only alphanumeric characters and the following symbols are valid: "_/\-". Maximum length is 64 characters. Read only when + * registry is DCM. + */ + value?: string; + } + interface UserDefinedVariableConfiguration { + /** Data type for the variable. This is a required field. */ + dataType?: string; + /** + * User-friendly name for the variable which will appear in reports. This is a required field, must be less than 64 characters long, and cannot contain + * the following characters: ""<>". + */ + reportName?: string; + /** Variable name in the tag. This is a required field. */ + variableType?: string; + } + interface UserProfile { + /** The account ID to which this profile belongs. */ + accountId?: string; + /** The account name this profile belongs to. */ + accountName?: string; + /** The eTag of this response for caching purposes. */ + etag?: string; + /** The kind of resource this is, in this case dfareporting#userProfile. */ + kind?: string; + /** The unique ID of the user profile. */ + profileId?: string; + /** The sub account ID this profile belongs to if applicable. */ + subAccountId?: string; + /** The sub account name this profile belongs to if applicable. */ + subAccountName?: string; + /** The user name. */ + userName?: string; + } + interface UserProfileList { + /** The eTag of this response for caching purposes. */ + etag?: string; + /** The user profiles returned in this response. */ + items?: UserProfile[]; + /** The kind of list this is, in this case dfareporting#userProfileList. */ + kind?: string; + } + interface UserRole { + /** Account ID of this user role. This is a read-only field that can be left blank. */ + accountId?: string; + /** + * Whether this is a default user role. Default user roles are created by the system for the account/subaccount and cannot be modified or deleted. Each + * default user role comes with a basic set of preassigned permissions. + */ + defaultUserRole?: boolean; + /** ID of this user role. This is a read-only, auto-generated field. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#userRole". */ + kind?: string; + /** + * Name of this user role. This is a required field. Must be less than 256 characters long. If this user role is under a subaccount, the name must be + * unique among sites of the same subaccount. Otherwise, this user role is a top-level user role, and the name must be unique among top-level user roles + * of the same account. + */ + name?: string; + /** ID of the user role that this user role is based on or copied from. This is a required field. */ + parentUserRoleId?: string; + /** List of permissions associated with this user role. */ + permissions?: UserRolePermission[]; + /** Subaccount ID of this user role. This is a read-only field that can be left blank. */ + subaccountId?: string; + } + interface UserRolePermission { + /** Levels of availability for a user role permission. */ + availability?: string; + /** ID of this user role permission. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#userRolePermission". */ + kind?: string; + /** Name of this user role permission. */ + name?: string; + /** ID of the permission group that this user role permission belongs to. */ + permissionGroupId?: string; + } + interface UserRolePermissionGroup { + /** ID of this user role permission. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#userRolePermissionGroup". */ + kind?: string; + /** Name of this user role permission group. */ + name?: string; + } + interface UserRolePermissionGroupsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#userRolePermissionGroupsListResponse". */ + kind?: string; + /** User role permission group collection. */ + userRolePermissionGroups?: UserRolePermissionGroup[]; + } + interface UserRolePermissionsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#userRolePermissionsListResponse". */ + kind?: string; + /** User role permission collection. */ + userRolePermissions?: UserRolePermission[]; + } + interface UserRolesListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#userRolesListResponse". */ + kind?: string; + /** Pagination token to be used for the next list operation. */ + nextPageToken?: string; + /** User role collection. */ + userRoles?: UserRole[]; + } + interface VideoFormat { + /** File type of the video format. */ + fileType?: string; + /** ID of the video format. */ + id?: number; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#videoFormat". */ + kind?: string; + /** The resolution of this video format. */ + resolution?: Size; + /** The target bit rate of this video format. */ + targetBitRate?: number; + } + interface VideoFormatsListResponse { + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#videoFormatsListResponse". */ + kind?: string; + /** Video format collection. */ + videoFormats?: VideoFormat[]; + } + interface VideoOffset { + /** Duration, as a percentage of video duration. Do not set when offsetSeconds is set. Acceptable values are 0 to 100, inclusive. */ + offsetPercentage?: number; + /** Duration, in seconds. Do not set when offsetPercentage is set. Acceptable values are 0 to 86399, inclusive. */ + offsetSeconds?: number; + } + interface VideoSettings { + /** Settings for the companion creatives of video creatives served to this placement. */ + companionSettings?: CompanionSetting; + /** Identifies what kind of resource this is. Value: the fixed string "dfareporting#videoSettings". */ + kind?: string; + /** + * Settings for the skippability of video creatives served to this placement. If this object is provided, the creative-level skippable settings will be + * overridden. + */ + skippableSettings?: SkippableSetting; + /** + * Settings for the transcodes of video creatives served to this placement. If this object is provided, the creative-level transcode settings will be + * overridden. + */ + transcodeSettings?: TranscodeSetting; + } + interface AccountActiveAdSummariesResource { + /** Gets the account's active ad summary by account ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Account ID. */ + summaryAccountId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AccountPermissionGroupsResource { + /** Gets one account permission group by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Account permission group ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of account permission groups. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AccountPermissionsResource { + /** Gets one account permission by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Account permission ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of account permissions. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AccountUserProfilesResource { + /** Gets one account user profile by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** User profile ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new account user profile. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of account user profiles, possibly filtered. This method supports paging. */ + list(request: { + /** Select only active user profiles. */ + active?: boolean; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only user profiles with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, "user profile*2015" will return objects with names like + * "user profile June 2015", "user profile April 2015", or simply "user profile 2015". Most of the searches also add wildcards implicitly at the start and + * the end of the search string. For example, a search string of "user profile" will match objects with name "my user profile", "user profile 2015", or + * simply "user profile". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** Select only user profiles with the specified subaccount ID. */ + subaccountId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Select only user profiles with the specified user role ID. */ + userRoleId?: string; + }): Request; + /** Updates an existing account user profile. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** User profile ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing account user profile. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AccountsResource { + /** Gets one account by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Account ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of accounts, possibly filtered. This method supports paging. */ + list(request: { + /** Select only active accounts. Don't set this field to select both active and non-active accounts. */ + active?: boolean; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only accounts with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "account*2015" will return objects with names like "account June + * 2015", "account April 2015", or simply "account 2015". Most of the searches also add wildcards implicitly at the start and the end of the search + * string. For example, a search string of "account" will match objects with name "my account", "account 2015", or simply "account". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing account. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Account ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing account. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AdsResource { + /** Gets one ad by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Ad ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new ad. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of ads, possibly filtered. This method supports paging. */ + list(request: { + /** Select only active ads. */ + active?: boolean; + /** Select only ads with this advertiser ID. */ + advertiserId?: string; + /** Data format for the response. */ + alt?: string; + /** Select only archived ads. */ + archived?: boolean; + /** Select only ads with these audience segment IDs. */ + audienceSegmentIds?: string; + /** Select only ads with these campaign IDs. */ + campaignIds?: string; + /** + * Select default ads with the specified compatibility. Applicable when type is AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering + * either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. + * IN_STREAM_VIDEO refers to rendering an in-stream video ads developed with the VAST standard. + */ + compatibility?: string; + /** Select only ads with these creative IDs assigned. */ + creativeIds?: string; + /** Select only ads with these creative optimization configuration IDs. */ + creativeOptimizationConfigurationIds?: string; + /** + * Select only dynamic click trackers. Applicable when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click trackers. If false, select static + * click trackers. Leave unset to select both. + */ + dynamicClickTracker?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only ads with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Select only ads with these landing page IDs. */ + landingPageIds?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Select only ads with this event tag override ID. */ + overriddenEventTagId?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Select only ads with these placement IDs assigned. */ + placementIds?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Select only ads whose list targeting expression use these remarketing list IDs. */ + remarketingListIds?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "ad*2015" will return objects with names like "ad June 2015", "ad + * April 2015", or simply "ad 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a + * search string of "ad" will match objects with name "my ad", "ad 2015", or simply "ad". + */ + searchString?: string; + /** Select only ads with these size IDs. */ + sizeIds?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** Select only ads that are SSL-compliant. */ + sslCompliant?: boolean; + /** Select only ads that require SSL. */ + sslRequired?: boolean; + /** Select only ads with these types. */ + type?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing ad. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Ad ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing ad. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AdvertiserGroupsResource { + /** Deletes an existing advertiser group. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Advertiser group ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets one advertiser group by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Advertiser group ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new advertiser group. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of advertiser groups, possibly filtered. This method supports paging. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only advertiser groups with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "advertiser*2015" will return objects with names like "advertiser + * group June 2015", "advertiser group April 2015", or simply "advertiser group 2015". Most of the searches also add wildcards implicitly at the start and + * the end of the search string. For example, a search string of "advertisergroup" will match objects with name "my advertisergroup", "advertisergroup + * 2015", or simply "advertisergroup". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing advertiser group. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Advertiser group ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing advertiser group. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface AdvertisersResource { + /** Gets one advertiser by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Advertiser ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new advertiser. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of advertisers, possibly filtered. This method supports paging. */ + list(request: { + /** Select only advertisers with these advertiser group IDs. */ + advertiserGroupIds?: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only advertisers with these floodlight configuration IDs. */ + floodlightConfigurationIds?: string; + /** Select only advertisers with these IDs. */ + ids?: string; + /** Select only advertisers which do not belong to any advertiser group. */ + includeAdvertisersWithoutGroupsOnly?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Select only advertisers which use another advertiser's floodlight configuration. */ + onlyParent?: boolean; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "advertiser*2015" will return objects with names like "advertiser + * June 2015", "advertiser April 2015", or simply "advertiser 2015". Most of the searches also add wildcards implicitly at the start and the end of the + * search string. For example, a search string of "advertiser" will match objects with name "my advertiser", "advertiser 2015", or simply "advertiser". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** Select only advertisers with the specified status. */ + status?: string; + /** Select only advertisers with these subaccount IDs. */ + subaccountId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing advertiser. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Advertiser ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing advertiser. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface BrowsersResource { + /** Retrieves a list of browsers. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CampaignCreativeAssociationsResource { + /** + * Associates a creative with the specified campaign. This method creates a default ad with dimensions matching the creative in the campaign if such a + * default ad does not exist already. + */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Campaign ID in this association. */ + campaignId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of creative IDs associated with the specified campaign. This method supports paging. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Campaign ID in this association. */ + campaignId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CampaignsResource { + /** Gets one campaign by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Campaign ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new campaign. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Default landing page name for this new campaign. Must be less than 256 characters long. */ + defaultLandingPageName: string; + /** Default landing page URL for this new campaign. */ + defaultLandingPageUrl: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of campaigns, possibly filtered. This method supports paging. */ + list(request: { + /** Select only campaigns whose advertisers belong to these advertiser groups. */ + advertiserGroupIds?: string; + /** Select only campaigns that belong to these advertisers. */ + advertiserIds?: string; + /** Data format for the response. */ + alt?: string; + /** Select only archived campaigns. Don't set this field to select both archived and non-archived campaigns. */ + archived?: boolean; + /** Select only campaigns that have at least one optimization activity. */ + atLeastOneOptimizationActivity?: boolean; + /** Exclude campaigns with these IDs. */ + excludedIds?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only campaigns with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Select only campaigns that have overridden this event tag ID. */ + overriddenEventTagId?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for campaigns by name or ID. Wildcards (*) are allowed. For example, "campaign*2015" will return campaigns with names like "campaign + * June 2015", "campaign April 2015", or simply "campaign 2015". Most of the searches also add wildcards implicitly at the start and the end of the search + * string. For example, a search string of "campaign" will match campaigns with name "my campaign", "campaign 2015", or simply "campaign". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** Select only campaigns that belong to this subaccount. */ + subaccountId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing campaign. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Campaign ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing campaign. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ChangeLogsResource { + /** Gets one change log by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Change log ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of change logs. This method supports paging. */ + list(request: { + /** Select only change logs with the specified action. */ + action?: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only change logs with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Select only change logs whose change time is before the specified maxChangeTime.The time should be formatted as an RFC3339 date/time string. For + * example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is "2015-07-18T22:54:00-04:00". In other words, the year, + * month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset. + */ + maxChangeTime?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** + * Select only change logs whose change time is before the specified minChangeTime.The time should be formatted as an RFC3339 date/time string. For + * example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is "2015-07-18T22:54:00-04:00". In other words, the year, + * month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset. + */ + minChangeTime?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Select only change logs with these object IDs. */ + objectIds?: string; + /** Select only change logs with the specified object type. */ + objectType?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Select only change logs whose object ID, user name, old or new values match the search string. */ + searchString?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Select only change logs with these user profile IDs. */ + userProfileIds?: string; + }): Request; + } + interface CitiesResource { + /** Retrieves a list of cities, possibly filtered. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Select only cities from these countries. */ + countryDartIds?: string; + /** Select only cities with these DART IDs. */ + dartIds?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Select only cities with names starting with this prefix. */ + namePrefix?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Select only cities from these regions. */ + regionDartIds?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ConnectionTypesResource { + /** Gets one connection type by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Connection type ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of connection types. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ContentCategoriesResource { + /** Deletes an existing content category. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Content category ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets one content category by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Content category ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new content category. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of content categories, possibly filtered. This method supports paging. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only content categories with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "contentcategory*2015" will return objects with names like + * "contentcategory June 2015", "contentcategory April 2015", or simply "contentcategory 2015". Most of the searches also add wildcards implicitly at the + * start and the end of the search string. For example, a search string of "contentcategory" will match objects with name "my contentcategory", + * "contentcategory 2015", or simply "contentcategory". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing content category. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Content category ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing content category. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ConversionsResource { + /** Inserts conversions. */ + batchinsert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates existing conversions. */ + batchupdate(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CountriesResource { + /** Gets one country by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Country DART ID. */ + dartId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of countries. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CreativeAssetsResource { + /** Inserts a new creative asset. */ + insert(request: { + /** Advertiser ID of this creative. This is a required field. */ + advertiserId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CreativeFieldValuesResource { + /** Deletes an existing creative field value. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Creative field ID for this creative field value. */ + creativeFieldId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Creative Field Value ID */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets one creative field value by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Creative field ID for this creative field value. */ + creativeFieldId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Creative Field Value ID */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new creative field value. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Creative field ID for this creative field value. */ + creativeFieldId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of creative field values, possibly filtered. This method supports paging. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Creative field ID for this creative field value. */ + creativeFieldId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only creative field values with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Allows searching for creative field values by their values. Wildcards (e.g. *) are not allowed. */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing creative field value. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Creative field ID for this creative field value. */ + creativeFieldId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Creative Field Value ID */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing creative field value. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Creative field ID for this creative field value. */ + creativeFieldId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CreativeFieldsResource { + /** Deletes an existing creative field. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Creative Field ID */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets one creative field by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Creative Field ID */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new creative field. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of creative fields, possibly filtered. This method supports paging. */ + list(request: { + /** Select only creative fields that belong to these advertisers. */ + advertiserIds?: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only creative fields with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for creative fields by name or ID. Wildcards (*) are allowed. For example, "creativefield*2015" will return creative fields with names + * like "creativefield June 2015", "creativefield April 2015", or simply "creativefield 2015". Most of the searches also add wild-cards implicitly at the + * start and the end of the search string. For example, a search string of "creativefield" will match creative fields with the name "my creativefield", + * "creativefield 2015", or simply "creativefield". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing creative field. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Creative Field ID */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing creative field. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CreativeGroupsResource { + /** Gets one creative group by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Creative group ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new creative group. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of creative groups, possibly filtered. This method supports paging. */ + list(request: { + /** Select only creative groups that belong to these advertisers. */ + advertiserIds?: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only creative groups that belong to this subgroup. */ + groupNumber?: number; + /** Select only creative groups with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for creative groups by name or ID. Wildcards (*) are allowed. For example, "creativegroup*2015" will return creative groups with names + * like "creativegroup June 2015", "creativegroup April 2015", or simply "creativegroup 2015". Most of the searches also add wild-cards implicitly at the + * start and the end of the search string. For example, a search string of "creativegroup" will match creative groups with the name "my creativegroup", + * "creativegroup 2015", or simply "creativegroup". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing creative group. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Creative group ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing creative group. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CreativesResource { + /** Gets one creative by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Creative ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new creative. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of creatives, possibly filtered. This method supports paging. */ + list(request: { + /** Select only active creatives. Leave blank to select active and inactive creatives. */ + active?: boolean; + /** Select only creatives with this advertiser ID. */ + advertiserId?: string; + /** Data format for the response. */ + alt?: string; + /** Select only archived creatives. Leave blank to select archived and unarchived creatives. */ + archived?: boolean; + /** Select only creatives with this campaign ID. */ + campaignId?: string; + /** Select only in-stream video creatives with these companion IDs. */ + companionCreativeIds?: string; + /** Select only creatives with these creative field IDs. */ + creativeFieldIds?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only creatives with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Select only creatives with these rendering IDs. */ + renderingIds?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "creative*2015" will return objects with names like "creative June + * 2015", "creative April 2015", or simply "creative 2015". Most of the searches also add wildcards implicitly at the start and the end of the search + * string. For example, a search string of "creative" will match objects with name "my creative", "creative 2015", or simply "creative". + */ + searchString?: string; + /** Select only creatives with these size IDs. */ + sizeIds?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** Select only creatives corresponding to this Studio creative ID. */ + studioCreativeId?: string; + /** Select only creatives with these creative types. */ + types?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing creative. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Creative ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing creative. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DimensionValuesResource { + /** Retrieves list of report dimension values for a list of filters. */ + query(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The value of the nextToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The DFA user profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DirectorySiteContactsResource { + /** Gets one directory site contact by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Directory site contact ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of directory site contacts, possibly filtered. This method supports paging. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Select only directory site contacts with these directory site IDs. This is a required field. */ + directorySiteIds?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only directory site contacts with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, "directory site contact*2015" will return objects with names + * like "directory site contact June 2015", "directory site contact April 2015", or simply "directory site contact 2015". Most of the searches also add + * wildcards implicitly at the start and the end of the search string. For example, a search string of "directory site contact" will match objects with + * name "my directory site contact", "directory site contact 2015", or simply "directory site contact". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DirectorySitesResource { + /** Gets one directory site by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Directory site ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new directory site. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of directory sites, possibly filtered. This method supports paging. */ + list(request: { + /** This search filter is no longer supported and will have no effect on the results returned. */ + acceptsInStreamVideoPlacements?: boolean; + /** This search filter is no longer supported and will have no effect on the results returned. */ + acceptsInterstitialPlacements?: boolean; + /** Select only directory sites that accept publisher paid placements. This field can be left blank. */ + acceptsPublisherPaidPlacements?: boolean; + /** Select only active directory sites. Leave blank to retrieve both active and inactive directory sites. */ + active?: boolean; + /** Data format for the response. */ + alt?: string; + /** Select only directory sites with this country ID. */ + countryId?: string; + /** Select only directory sites with this DFP network code. */ + dfpNetworkCode?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only directory sites with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Select only directory sites with this parent ID. */ + parentId?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name, ID or URL. Wildcards (*) are allowed. For example, "directory site*2015" will return objects with names like + * "directory site June 2015", "directory site April 2015", or simply "directory site 2015". Most of the searches also add wildcards implicitly at the + * start and the end of the search string. For example, a search string of "directory site" will match objects with name "my directory site", "directory + * site 2015" or simply, "directory site". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DynamicTargetingKeysResource { + /** Deletes an existing dynamic targeting key. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Name of this dynamic targeting key. This is a required field. Must be less than 256 characters long and cannot contain commas. All characters are + * converted to lowercase. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** ID of the object of this dynamic targeting key. This is a required field. */ + objectId: string; + /** Type of the object of this dynamic targeting key. This is a required field. */ + objectType: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Inserts a new dynamic targeting key. Keys must be created at the advertiser level before being assigned to the advertiser's ads, creatives, or + * placements. There is a maximum of 1000 keys per advertiser, out of which a maximum of 20 keys can be assigned per ad, creative, or placement. + */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of dynamic targeting keys. */ + list(request: { + /** Select only dynamic targeting keys whose object has this advertiser ID. */ + advertiserId?: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Select only dynamic targeting keys exactly matching these names. */ + names?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Select only dynamic targeting keys with this object ID. */ + objectId?: string; + /** Select only dynamic targeting keys with this object type. */ + objectType?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface EventTagsResource { + /** Deletes an existing event tag. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Event tag ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets one event tag by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Event tag ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new event tag. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of event tags, possibly filtered. */ + list(request: { + /** Select only event tags that belong to this ad. */ + adId?: string; + /** Select only event tags that belong to this advertiser. */ + advertiserId?: string; + /** Data format for the response. */ + alt?: string; + /** Select only event tags that belong to this campaign. */ + campaignId?: string; + /** + * Examine only the specified campaign or advertiser's event tags for matching selector criteria. When set to false, the parent advertiser and parent + * campaign of the specified ad or campaign is examined as well. In addition, when set to false, the status field is examined as well, along with the + * enabledByDefault field. This parameter can not be set to true when adId is specified as ads do not define their own even tags. + */ + definitionsOnly?: boolean; + /** + * Select only enabled event tags. What is considered enabled or disabled depends on the definitionsOnly parameter. When definitionsOnly is set to true, + * only the specified advertiser or campaign's event tags' enabledByDefault field is examined. When definitionsOnly is set to false, the specified ad or + * specified campaign's parent advertiser's or parent campaign's event tags' enabledByDefault and status fields are examined as well. + */ + enabled?: boolean; + /** + * Select only event tags with the specified event tag types. Event tag types can be used to specify whether to use a third-party pixel, a third-party + * JavaScript URL, or a third-party click-through URL for either impression or click tracking. + */ + eventTagTypes?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only event tags with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "eventtag*2015" will return objects with names like "eventtag June + * 2015", "eventtag April 2015", or simply "eventtag 2015". Most of the searches also add wildcards implicitly at the start and the end of the search + * string. For example, a search string of "eventtag" will match objects with name "my eventtag", "eventtag 2015", or simply "eventtag". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing event tag. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Event tag ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing event tag. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface FilesResource { + /** Retrieves a report file by its report ID and file ID. This method supports media download. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the report file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the report. */ + reportId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists files for a user profile. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The value of the nextToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The DFA profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The scope that defines which results are returned. */ + scope?: string; + /** The field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface FloodlightActivitiesResource { + /** Deletes an existing floodlight activity. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Floodlight activity ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Generates a tag for a floodlight activity. */ + generatetag(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Floodlight activity ID for which we want to generate a tag. */ + floodlightActivityId?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets one floodlight activity by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Floodlight activity ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new floodlight activity. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of floodlight activities, possibly filtered. This method supports paging. */ + list(request: { + /** + * Select only floodlight activities for the specified advertiser ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty + * result. + */ + advertiserId?: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only floodlight activities with the specified floodlight activity group IDs. */ + floodlightActivityGroupIds?: string; + /** Select only floodlight activities with the specified floodlight activity group name. */ + floodlightActivityGroupName?: string; + /** Select only floodlight activities with the specified floodlight activity group tag string. */ + floodlightActivityGroupTagString?: string; + /** Select only floodlight activities with the specified floodlight activity group type. */ + floodlightActivityGroupType?: string; + /** + * Select only floodlight activities for the specified floodlight configuration ID. Must specify either ids, advertiserId, or floodlightConfigurationId + * for a non-empty result. + */ + floodlightConfigurationId?: string; + /** Select only floodlight activities with the specified IDs. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "floodlightactivity*2015" will return objects with names like + * "floodlightactivity June 2015", "floodlightactivity April 2015", or simply "floodlightactivity 2015". Most of the searches also add wildcards + * implicitly at the start and the end of the search string. For example, a search string of "floodlightactivity" will match objects with name "my + * floodlightactivity activity", "floodlightactivity 2015", or simply "floodlightactivity". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** Select only floodlight activities with the specified tag string. */ + tagString?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing floodlight activity. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Floodlight activity ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing floodlight activity. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface FloodlightActivityGroupsResource { + /** Gets one floodlight activity group by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Floodlight activity Group ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new floodlight activity group. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of floodlight activity groups, possibly filtered. This method supports paging. */ + list(request: { + /** + * Select only floodlight activity groups with the specified advertiser ID. Must specify either advertiserId or floodlightConfigurationId for a non-empty + * result. + */ + advertiserId?: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Select only floodlight activity groups with the specified floodlight configuration ID. Must specify either advertiserId, or floodlightConfigurationId + * for a non-empty result. + */ + floodlightConfigurationId?: string; + /** Select only floodlight activity groups with the specified IDs. Must specify either advertiserId or floodlightConfigurationId for a non-empty result. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "floodlightactivitygroup*2015" will return objects with names like + * "floodlightactivitygroup June 2015", "floodlightactivitygroup April 2015", or simply "floodlightactivitygroup 2015". Most of the searches also add + * wildcards implicitly at the start and the end of the search string. For example, a search string of "floodlightactivitygroup" will match objects with + * name "my floodlightactivitygroup activity", "floodlightactivitygroup 2015", or simply "floodlightactivitygroup". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** Select only floodlight activity groups with the specified floodlight activity group type. */ + type?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing floodlight activity group. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Floodlight activity Group ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing floodlight activity group. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface FloodlightConfigurationsResource { + /** Gets one floodlight configuration by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Floodlight configuration ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of floodlight configurations, possibly filtered. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Set of IDs of floodlight configurations to retrieve. Required field; otherwise an empty list will be returned. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing floodlight configuration. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Floodlight configuration ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing floodlight configuration. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface InventoryItemsResource { + /** Gets one inventory item by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Inventory item ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** Project ID for order documents. */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of inventory items, possibly filtered. This method supports paging. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only inventory items with these IDs. */ + ids?: string; + /** Select only inventory items that are in plan. */ + inPlan?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Select only inventory items that belong to specified orders. */ + orderId?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** Project ID for order documents. */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Select only inventory items that are associated with these sites. */ + siteId?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** Select only inventory items with this type. */ + type?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface LandingPagesResource { + /** Deletes an existing campaign landing page. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Landing page campaign ID. */ + campaignId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Landing page ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets one campaign landing page by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Landing page campaign ID. */ + campaignId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Landing page ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new landing page for the specified campaign. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Landing page campaign ID. */ + campaignId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves the list of landing pages for the specified campaign. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Landing page campaign ID. */ + campaignId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing campaign landing page. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Landing page campaign ID. */ + campaignId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Landing page ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing campaign landing page. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Landing page campaign ID. */ + campaignId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface LanguagesResource { + /** Retrieves a list of languages. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface MetrosResource { + /** Retrieves a list of metros. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface MobileCarriersResource { + /** Gets one mobile carrier by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Mobile carrier ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of mobile carriers. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface OperatingSystemVersionsResource { + /** Gets one operating system version by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Operating system version ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of operating system versions. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface OperatingSystemsResource { + /** Gets one operating system by DART ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Operating system DART ID. */ + dartId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of operating systems. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface OrderDocumentsResource { + /** Gets one order document by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Order document ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** Project ID for order documents. */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of order documents, possibly filtered. This method supports paging. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Select only order documents that have been approved by at least one user. */ + approved?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only order documents with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Select only order documents for specified orders. */ + orderId?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** Project ID for order documents. */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for order documents by name or ID. Wildcards (*) are allowed. For example, "orderdocument*2015" will return order documents with names + * like "orderdocument June 2015", "orderdocument April 2015", or simply "orderdocument 2015". Most of the searches also add wildcards implicitly at the + * start and the end of the search string. For example, a search string of "orderdocument" will match order documents with name "my orderdocument", + * "orderdocument 2015", or simply "orderdocument". + */ + searchString?: string; + /** Select only order documents that are associated with these sites. */ + siteId?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface OrdersResource { + /** Gets one order by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Order ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** Project ID for orders. */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of orders, possibly filtered. This method supports paging. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only orders with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** Project ID for orders. */ + projectId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for orders by name or ID. Wildcards (*) are allowed. For example, "order*2015" will return orders with names like "order June 2015", + * "order April 2015", or simply "order 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For + * example, a search string of "order" will match orders with name "my order", "order 2015", or simply "order". + */ + searchString?: string; + /** Select only orders that are associated with these site IDs. */ + siteId?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PlacementGroupsResource { + /** Gets one placement group by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Placement group ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new placement group. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of placement groups, possibly filtered. This method supports paging. */ + list(request: { + /** Select only placement groups that belong to these advertisers. */ + advertiserIds?: string; + /** Data format for the response. */ + alt?: string; + /** Select only archived placements. Don't set this field to select both archived and non-archived placements. */ + archived?: boolean; + /** Select only placement groups that belong to these campaigns. */ + campaignIds?: string; + /** Select only placement groups that are associated with these content categories. */ + contentCategoryIds?: string; + /** Select only placement groups that are associated with these directory sites. */ + directorySiteIds?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only placement groups with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as "yyyy-MM-dd". */ + maxEndDate?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as "yyyy-MM-dd". */ + maxStartDate?: string; + /** Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as "yyyy-MM-dd". */ + minEndDate?: string; + /** Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as "yyyy-MM-dd". */ + minStartDate?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** + * Select only placement groups belonging with this group type. A package is a simple group of placements that acts as a single pricing point for a group + * of tags. A roadblock is a group of placements that not only acts as a single pricing point but also assumes that all the tags in it will be served at + * the same time. A roadblock requires one of its assigned placements to be marked as primary for reporting. + */ + placementGroupType?: string; + /** Select only placement groups that are associated with these placement strategies. */ + placementStrategyIds?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Select only placement groups with these pricing types. */ + pricingTypes?: string; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for placement groups by name or ID. Wildcards (*) are allowed. For example, "placement*2015" will return placement groups with names + * like "placement group June 2015", "placement group May 2015", or simply "placements 2015". Most of the searches also add wildcards implicitly at the + * start and the end of the search string. For example, a search string of "placementgroup" will match placement groups with name "my placementgroup", + * "placementgroup 2015", or simply "placementgroup". + */ + searchString?: string; + /** Select only placement groups that are associated with these sites. */ + siteIds?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing placement group. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Placement group ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing placement group. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PlacementStrategiesResource { + /** Deletes an existing placement strategy. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Placement strategy ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets one placement strategy by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Placement strategy ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new placement strategy. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of placement strategies, possibly filtered. This method supports paging. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only placement strategies with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "placementstrategy*2015" will return objects with names like + * "placementstrategy June 2015", "placementstrategy April 2015", or simply "placementstrategy 2015". Most of the searches also add wildcards implicitly + * at the start and the end of the search string. For example, a search string of "placementstrategy" will match objects with name "my placementstrategy", + * "placementstrategy 2015", or simply "placementstrategy". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing placement strategy. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Placement strategy ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing placement strategy. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PlacementsResource { + /** Generates tags for a placement. */ + generatetags(request: { + /** Data format for the response. */ + alt?: string; + /** Generate placements belonging to this campaign. This is a required field. */ + campaignId?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Generate tags for these placements. */ + placementIds?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Tag formats to generate for these placements. + * + * Note: PLACEMENT_TAG_STANDARD can only be generated for 1x1 placements. + */ + tagFormats?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets one placement by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Placement ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new placement. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of placements, possibly filtered. This method supports paging. */ + list(request: { + /** Select only placements that belong to these advertisers. */ + advertiserIds?: string; + /** Data format for the response. */ + alt?: string; + /** Select only archived placements. Don't set this field to select both archived and non-archived placements. */ + archived?: boolean; + /** Select only placements that belong to these campaigns. */ + campaignIds?: string; + /** + * Select only placements that are associated with these compatibilities. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on + * mobile devices for regular or interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to + * rendering in in-stream video ads developed with the VAST standard. + */ + compatibilities?: string; + /** Select only placements that are associated with these content categories. */ + contentCategoryIds?: string; + /** Select only placements that are associated with these directory sites. */ + directorySiteIds?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only placements that belong to these placement groups. */ + groupIds?: string; + /** Select only placements with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as "yyyy-MM-dd". */ + maxEndDate?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as "yyyy-MM-dd". */ + maxStartDate?: string; + /** Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as "yyyy-MM-dd". */ + minEndDate?: string; + /** Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as "yyyy-MM-dd". */ + minStartDate?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Select only placements with this payment source. */ + paymentSource?: string; + /** Select only placements that are associated with these placement strategies. */ + placementStrategyIds?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Select only placements with these pricing types. */ + pricingTypes?: string; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for placements by name or ID. Wildcards (*) are allowed. For example, "placement*2015" will return placements with names like + * "placement June 2015", "placement May 2015", or simply "placements 2015". Most of the searches also add wildcards implicitly at the start and the end + * of the search string. For example, a search string of "placement" will match placements with name "my placement", "placement 2015", or simply + * "placement". + */ + searchString?: string; + /** Select only placements that are associated with these sites. */ + siteIds?: string; + /** Select only placements that are associated with these sizes. */ + sizeIds?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing placement. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Placement ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing placement. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PlatformTypesResource { + /** Gets one platform type by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Platform type ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of platform types. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PostalCodesResource { + /** Gets one postal code by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Postal code ID. */ + code: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of postal codes. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ProjectsResource { + /** Gets one project by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Project ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of projects, possibly filtered. This method supports paging. */ + list(request: { + /** Select only projects with these advertiser IDs. */ + advertiserIds?: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only projects with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for projects by name or ID. Wildcards (*) are allowed. For example, "project*2015" will return projects with names like "project June + * 2015", "project April 2015", or simply "project 2015". Most of the searches also add wildcards implicitly at the start and the end of the search + * string. For example, a search string of "project" will match projects with name "my project", "project 2015", or simply "project". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RegionsResource { + /** Retrieves a list of regions. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RemarketingListSharesResource { + /** Gets one remarketing list share by remarketing list ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Remarketing list ID. */ + remarketingListId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing remarketing list share. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Remarketing list ID. */ + remarketingListId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing remarketing list share. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RemarketingListsResource { + /** Gets one remarketing list by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Remarketing list ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new remarketing list. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of remarketing lists, possibly filtered. This method supports paging. */ + list(request: { + /** Select only active or only inactive remarketing lists. */ + active?: boolean; + /** Select only remarketing lists owned by this advertiser. */ + advertiserId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only remarketing lists that have this floodlight activity ID. */ + floodlightActivityId?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "remarketing list*2015" will return objects with names like + * "remarketing list June 2015", "remarketing list April 2015", or simply "remarketing list 2015". Most of the searches also add wildcards implicitly at + * the start and the end of the search string. For example, a search string of "remarketing list" will match objects with name "my remarketing list", + * "remarketing list 2015", or simply "remarketing list". + */ + name?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing remarketing list. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Remarketing list ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing remarketing list. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CompatibleFieldsResource { + /** + * Returns the fields that are compatible to be selected in the respective sections of a report criteria, given the fields already selected in the input + * report and user permissions. + */ + query(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The DFA user profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface FilesResource { + /** Retrieves a report file. This method supports media download. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the report file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The DFA profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the report. */ + reportId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists files for a report. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The value of the nextToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The DFA profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the parent report. */ + reportId: string; + /** The field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ReportsResource { + /** Deletes a report by its ID. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The DFA user profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the report. */ + reportId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a report by its ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The DFA user profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the report. */ + reportId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a report. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The DFA user profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves list of reports. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The value of the nextToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The DFA user profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The scope that defines which results are returned. */ + scope?: string; + /** The field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a report. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The DFA user profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the report. */ + reportId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Runs a report. */ + run(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The DFA profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the report. */ + reportId: string; + /** If set and true, tries to run the report synchronously. */ + synchronous?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a report. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The DFA user profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the report. */ + reportId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + compatibleFields: CompatibleFieldsResource; + files: FilesResource; + } + interface SitesResource { + /** Gets one site by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Site ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new site. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of sites, possibly filtered. This method supports paging. */ + list(request: { + /** This search filter is no longer supported and will have no effect on the results returned. */ + acceptsInStreamVideoPlacements?: boolean; + /** This search filter is no longer supported and will have no effect on the results returned. */ + acceptsInterstitialPlacements?: boolean; + /** Select only sites that accept publisher paid placements. */ + acceptsPublisherPaidPlacements?: boolean; + /** Select only AdWords sites. */ + adWordsSite?: boolean; + /** Data format for the response. */ + alt?: string; + /** Select only approved sites. */ + approved?: boolean; + /** Select only sites with these campaign IDs. */ + campaignIds?: string; + /** Select only sites with these directory site IDs. */ + directorySiteIds?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only sites with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name, ID or keyName. Wildcards (*) are allowed. For example, "site*2015" will return objects with names like "site June + * 2015", "site April 2015", or simply "site 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For + * example, a search string of "site" will match objects with name "my site", "site 2015", or simply "site". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** Select only sites with this subaccount ID. */ + subaccountId?: string; + /** Select only sites that have not been mapped to a directory site. */ + unmappedSite?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing site. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Site ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing site. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SizesResource { + /** Gets one size by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Size ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new size. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of sizes, possibly filtered. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only sizes with this height. */ + height?: number; + /** Select only IAB standard sizes. */ + iabStandard?: boolean; + /** Select only sizes with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** Select only sizes with this width. */ + width?: number; + }): Request; + } + interface SubaccountsResource { + /** Gets one subaccount by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Subaccount ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new subaccount. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets a list of subaccounts, possibly filtered. This method supports paging. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only subaccounts with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "subaccount*2015" will return objects with names like "subaccount + * June 2015", "subaccount April 2015", or simply "subaccount 2015". Most of the searches also add wildcards implicitly at the start and the end of the + * search string. For example, a search string of "subaccount" will match objects with name "my subaccount", "subaccount 2015", or simply "subaccount". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing subaccount. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Subaccount ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing subaccount. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TargetableRemarketingListsResource { + /** Gets one remarketing list by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Remarketing list ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of targetable remarketing lists, possibly filtered. This method supports paging. */ + list(request: { + /** Select only active or only inactive targetable remarketing lists. */ + active?: boolean; + /** Select only targetable remarketing lists targetable by these advertisers. */ + advertiserId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "remarketing list*2015" will return objects with names like + * "remarketing list June 2015", "remarketing list April 2015", or simply "remarketing list 2015". Most of the searches also add wildcards implicitly at + * the start and the end of the search string. For example, a search string of "remarketing list" will match objects with name "my remarketing list", + * "remarketing list 2015", or simply "remarketing list". + */ + name?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TargetingTemplatesResource { + /** Gets one targeting template by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Targeting template ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new targeting template. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of targeting templates, optionally filtered. This method supports paging. */ + list(request: { + /** Select only targeting templates with this advertiser ID. */ + advertiserId?: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only targeting templates with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "template*2015" will return objects with names like "template June + * 2015", "template April 2015", or simply "template 2015". Most of the searches also add wildcards implicitly at the start and the end of the search + * string. For example, a search string of "template" will match objects with name "my template", "template 2015", or simply "template". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing targeting template. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Targeting template ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing targeting template. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UserProfilesResource { + /** Gets one user profile by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** The user profile ID. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves list of user profiles for a user. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UserRolePermissionGroupsResource { + /** Gets one user role permission group by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** User role permission group ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets a list of all supported user role permission groups. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UserRolePermissionsResource { + /** Gets one user role permission by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** User role permission ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets a list of user role permissions, possibly filtered. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only user role permissions with these IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UserRolesResource { + /** Deletes an existing user role. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** User role ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets one user role by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** User role ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a new user role. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of user roles, possibly filtered. This method supports paging. */ + list(request: { + /** Select only account level user roles not associated with any specific subaccount. */ + accountUserRoleOnly?: boolean; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Select only user roles with the specified IDs. */ + ids?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Value of the nextPageToken from the previous result page. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "userrole*2015" will return objects with names like "userrole June + * 2015", "userrole April 2015", or simply "userrole 2015". Most of the searches also add wildcards implicitly at the start and the end of the search + * string. For example, a search string of "userrole" will match objects with name "my userrole", "userrole 2015", or simply "userrole". + */ + searchString?: string; + /** Field by which to sort the list. */ + sortField?: string; + /** Order of sorted results. */ + sortOrder?: string; + /** Select only user roles that belong to this subaccount. */ + subaccountId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing user role. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** User role ID. */ + id: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing user role. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface VideoFormatsResource { + /** Gets one video format by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Video format ID. */ + id: number; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists available video formats. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** User profile ID associated with this request. */ + profileId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.dfareporting/readme.md b/types/gapi.client.dfareporting/readme.md new file mode 100644 index 0000000000..2a210805c5 --- /dev/null +++ b/types/gapi.client.dfareporting/readme.md @@ -0,0 +1,1070 @@ +# TypeScript typings for DCM/DFA Reporting And Trafficking API v2.8 +Manages your DoubleClick Campaign Manager ad campaigns and reports. +For detailed description please check [documentation](https://developers.google.com/doubleclick-advertisers/). + +## Installing + +Install typings for DCM/DFA Reporting And Trafficking API: +``` +npm install @types/gapi.client.dfareporting@v2.8 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('dfareporting', 'v2.8', () => { + // now we can use gapi.client.dfareporting + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // Manage DoubleClick Digital Marketing conversions + 'https://www.googleapis.com/auth/ddmconversions', + + // View and manage DoubleClick for Advertisers reports + 'https://www.googleapis.com/auth/dfareporting', + + // View and manage your DoubleClick Campaign Manager's (DCM) display ad campaigns + 'https://www.googleapis.com/auth/dfatrafficking', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use DCM/DFA Reporting And Trafficking API resources: + +```typescript + +/* +Gets the account's active ad summary by account ID. +*/ +await gapi.client.accountActiveAdSummaries.get({ profileId: "profileId", summaryAccountId: "summaryAccountId", }); + +/* +Gets one account permission group by ID. +*/ +await gapi.client.accountPermissionGroups.get({ id: "id", profileId: "profileId", }); + +/* +Retrieves the list of account permission groups. +*/ +await gapi.client.accountPermissionGroups.list({ profileId: "profileId", }); + +/* +Gets one account permission by ID. +*/ +await gapi.client.accountPermissions.get({ id: "id", profileId: "profileId", }); + +/* +Retrieves the list of account permissions. +*/ +await gapi.client.accountPermissions.list({ profileId: "profileId", }); + +/* +Gets one account user profile by ID. +*/ +await gapi.client.accountUserProfiles.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new account user profile. +*/ +await gapi.client.accountUserProfiles.insert({ profileId: "profileId", }); + +/* +Retrieves a list of account user profiles, possibly filtered. This method supports paging. +*/ +await gapi.client.accountUserProfiles.list({ profileId: "profileId", }); + +/* +Updates an existing account user profile. This method supports patch semantics. +*/ +await gapi.client.accountUserProfiles.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing account user profile. +*/ +await gapi.client.accountUserProfiles.update({ profileId: "profileId", }); + +/* +Gets one account by ID. +*/ +await gapi.client.accounts.get({ id: "id", profileId: "profileId", }); + +/* +Retrieves the list of accounts, possibly filtered. This method supports paging. +*/ +await gapi.client.accounts.list({ profileId: "profileId", }); + +/* +Updates an existing account. This method supports patch semantics. +*/ +await gapi.client.accounts.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing account. +*/ +await gapi.client.accounts.update({ profileId: "profileId", }); + +/* +Gets one ad by ID. +*/ +await gapi.client.ads.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new ad. +*/ +await gapi.client.ads.insert({ profileId: "profileId", }); + +/* +Retrieves a list of ads, possibly filtered. This method supports paging. +*/ +await gapi.client.ads.list({ profileId: "profileId", }); + +/* +Updates an existing ad. This method supports patch semantics. +*/ +await gapi.client.ads.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing ad. +*/ +await gapi.client.ads.update({ profileId: "profileId", }); + +/* +Deletes an existing advertiser group. +*/ +await gapi.client.advertiserGroups.delete({ id: "id", profileId: "profileId", }); + +/* +Gets one advertiser group by ID. +*/ +await gapi.client.advertiserGroups.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new advertiser group. +*/ +await gapi.client.advertiserGroups.insert({ profileId: "profileId", }); + +/* +Retrieves a list of advertiser groups, possibly filtered. This method supports paging. +*/ +await gapi.client.advertiserGroups.list({ profileId: "profileId", }); + +/* +Updates an existing advertiser group. This method supports patch semantics. +*/ +await gapi.client.advertiserGroups.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing advertiser group. +*/ +await gapi.client.advertiserGroups.update({ profileId: "profileId", }); + +/* +Gets one advertiser by ID. +*/ +await gapi.client.advertisers.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new advertiser. +*/ +await gapi.client.advertisers.insert({ profileId: "profileId", }); + +/* +Retrieves a list of advertisers, possibly filtered. This method supports paging. +*/ +await gapi.client.advertisers.list({ profileId: "profileId", }); + +/* +Updates an existing advertiser. This method supports patch semantics. +*/ +await gapi.client.advertisers.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing advertiser. +*/ +await gapi.client.advertisers.update({ profileId: "profileId", }); + +/* +Retrieves a list of browsers. +*/ +await gapi.client.browsers.list({ profileId: "profileId", }); + +/* +Associates a creative with the specified campaign. This method creates a default ad with dimensions matching the creative in the campaign if such a default ad does not exist already. +*/ +await gapi.client.campaignCreativeAssociations.insert({ campaignId: "campaignId", profileId: "profileId", }); + +/* +Retrieves the list of creative IDs associated with the specified campaign. This method supports paging. +*/ +await gapi.client.campaignCreativeAssociations.list({ campaignId: "campaignId", profileId: "profileId", }); + +/* +Gets one campaign by ID. +*/ +await gapi.client.campaigns.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new campaign. +*/ +await gapi.client.campaigns.insert({ defaultLandingPageName: "defaultLandingPageName", defaultLandingPageUrl: "defaultLandingPageUrl", profileId: "profileId", }); + +/* +Retrieves a list of campaigns, possibly filtered. This method supports paging. +*/ +await gapi.client.campaigns.list({ profileId: "profileId", }); + +/* +Updates an existing campaign. This method supports patch semantics. +*/ +await gapi.client.campaigns.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing campaign. +*/ +await gapi.client.campaigns.update({ profileId: "profileId", }); + +/* +Gets one change log by ID. +*/ +await gapi.client.changeLogs.get({ id: "id", profileId: "profileId", }); + +/* +Retrieves a list of change logs. This method supports paging. +*/ +await gapi.client.changeLogs.list({ profileId: "profileId", }); + +/* +Retrieves a list of cities, possibly filtered. +*/ +await gapi.client.cities.list({ profileId: "profileId", }); + +/* +Gets one connection type by ID. +*/ +await gapi.client.connectionTypes.get({ id: "id", profileId: "profileId", }); + +/* +Retrieves a list of connection types. +*/ +await gapi.client.connectionTypes.list({ profileId: "profileId", }); + +/* +Deletes an existing content category. +*/ +await gapi.client.contentCategories.delete({ id: "id", profileId: "profileId", }); + +/* +Gets one content category by ID. +*/ +await gapi.client.contentCategories.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new content category. +*/ +await gapi.client.contentCategories.insert({ profileId: "profileId", }); + +/* +Retrieves a list of content categories, possibly filtered. This method supports paging. +*/ +await gapi.client.contentCategories.list({ profileId: "profileId", }); + +/* +Updates an existing content category. This method supports patch semantics. +*/ +await gapi.client.contentCategories.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing content category. +*/ +await gapi.client.contentCategories.update({ profileId: "profileId", }); + +/* +Inserts conversions. +*/ +await gapi.client.conversions.batchinsert({ profileId: "profileId", }); + +/* +Updates existing conversions. +*/ +await gapi.client.conversions.batchupdate({ profileId: "profileId", }); + +/* +Gets one country by ID. +*/ +await gapi.client.countries.get({ dartId: "dartId", profileId: "profileId", }); + +/* +Retrieves a list of countries. +*/ +await gapi.client.countries.list({ profileId: "profileId", }); + +/* +Inserts a new creative asset. +*/ +await gapi.client.creativeAssets.insert({ advertiserId: "advertiserId", profileId: "profileId", }); + +/* +Deletes an existing creative field value. +*/ +await gapi.client.creativeFieldValues.delete({ creativeFieldId: "creativeFieldId", id: "id", profileId: "profileId", }); + +/* +Gets one creative field value by ID. +*/ +await gapi.client.creativeFieldValues.get({ creativeFieldId: "creativeFieldId", id: "id", profileId: "profileId", }); + +/* +Inserts a new creative field value. +*/ +await gapi.client.creativeFieldValues.insert({ creativeFieldId: "creativeFieldId", profileId: "profileId", }); + +/* +Retrieves a list of creative field values, possibly filtered. This method supports paging. +*/ +await gapi.client.creativeFieldValues.list({ creativeFieldId: "creativeFieldId", profileId: "profileId", }); + +/* +Updates an existing creative field value. This method supports patch semantics. +*/ +await gapi.client.creativeFieldValues.patch({ creativeFieldId: "creativeFieldId", id: "id", profileId: "profileId", }); + +/* +Updates an existing creative field value. +*/ +await gapi.client.creativeFieldValues.update({ creativeFieldId: "creativeFieldId", profileId: "profileId", }); + +/* +Deletes an existing creative field. +*/ +await gapi.client.creativeFields.delete({ id: "id", profileId: "profileId", }); + +/* +Gets one creative field by ID. +*/ +await gapi.client.creativeFields.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new creative field. +*/ +await gapi.client.creativeFields.insert({ profileId: "profileId", }); + +/* +Retrieves a list of creative fields, possibly filtered. This method supports paging. +*/ +await gapi.client.creativeFields.list({ profileId: "profileId", }); + +/* +Updates an existing creative field. This method supports patch semantics. +*/ +await gapi.client.creativeFields.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing creative field. +*/ +await gapi.client.creativeFields.update({ profileId: "profileId", }); + +/* +Gets one creative group by ID. +*/ +await gapi.client.creativeGroups.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new creative group. +*/ +await gapi.client.creativeGroups.insert({ profileId: "profileId", }); + +/* +Retrieves a list of creative groups, possibly filtered. This method supports paging. +*/ +await gapi.client.creativeGroups.list({ profileId: "profileId", }); + +/* +Updates an existing creative group. This method supports patch semantics. +*/ +await gapi.client.creativeGroups.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing creative group. +*/ +await gapi.client.creativeGroups.update({ profileId: "profileId", }); + +/* +Gets one creative by ID. +*/ +await gapi.client.creatives.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new creative. +*/ +await gapi.client.creatives.insert({ profileId: "profileId", }); + +/* +Retrieves a list of creatives, possibly filtered. This method supports paging. +*/ +await gapi.client.creatives.list({ profileId: "profileId", }); + +/* +Updates an existing creative. This method supports patch semantics. +*/ +await gapi.client.creatives.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing creative. +*/ +await gapi.client.creatives.update({ profileId: "profileId", }); + +/* +Retrieves list of report dimension values for a list of filters. +*/ +await gapi.client.dimensionValues.query({ profileId: "profileId", }); + +/* +Gets one directory site contact by ID. +*/ +await gapi.client.directorySiteContacts.get({ id: "id", profileId: "profileId", }); + +/* +Retrieves a list of directory site contacts, possibly filtered. This method supports paging. +*/ +await gapi.client.directorySiteContacts.list({ profileId: "profileId", }); + +/* +Gets one directory site by ID. +*/ +await gapi.client.directorySites.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new directory site. +*/ +await gapi.client.directorySites.insert({ profileId: "profileId", }); + +/* +Retrieves a list of directory sites, possibly filtered. This method supports paging. +*/ +await gapi.client.directorySites.list({ profileId: "profileId", }); + +/* +Deletes an existing dynamic targeting key. +*/ +await gapi.client.dynamicTargetingKeys.delete({ name: "name", objectId: "objectId", objectType: "objectType", profileId: "profileId", }); + +/* +Inserts a new dynamic targeting key. Keys must be created at the advertiser level before being assigned to the advertiser's ads, creatives, or placements. There is a maximum of 1000 keys per advertiser, out of which a maximum of 20 keys can be assigned per ad, creative, or placement. +*/ +await gapi.client.dynamicTargetingKeys.insert({ profileId: "profileId", }); + +/* +Retrieves a list of dynamic targeting keys. +*/ +await gapi.client.dynamicTargetingKeys.list({ profileId: "profileId", }); + +/* +Deletes an existing event tag. +*/ +await gapi.client.eventTags.delete({ id: "id", profileId: "profileId", }); + +/* +Gets one event tag by ID. +*/ +await gapi.client.eventTags.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new event tag. +*/ +await gapi.client.eventTags.insert({ profileId: "profileId", }); + +/* +Retrieves a list of event tags, possibly filtered. +*/ +await gapi.client.eventTags.list({ profileId: "profileId", }); + +/* +Updates an existing event tag. This method supports patch semantics. +*/ +await gapi.client.eventTags.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing event tag. +*/ +await gapi.client.eventTags.update({ profileId: "profileId", }); + +/* +Retrieves a report file by its report ID and file ID. This method supports media download. +*/ +await gapi.client.files.get({ fileId: "fileId", reportId: "reportId", }); + +/* +Lists files for a user profile. +*/ +await gapi.client.files.list({ profileId: "profileId", }); + +/* +Deletes an existing floodlight activity. +*/ +await gapi.client.floodlightActivities.delete({ id: "id", profileId: "profileId", }); + +/* +Generates a tag for a floodlight activity. +*/ +await gapi.client.floodlightActivities.generatetag({ profileId: "profileId", }); + +/* +Gets one floodlight activity by ID. +*/ +await gapi.client.floodlightActivities.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new floodlight activity. +*/ +await gapi.client.floodlightActivities.insert({ profileId: "profileId", }); + +/* +Retrieves a list of floodlight activities, possibly filtered. This method supports paging. +*/ +await gapi.client.floodlightActivities.list({ profileId: "profileId", }); + +/* +Updates an existing floodlight activity. This method supports patch semantics. +*/ +await gapi.client.floodlightActivities.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing floodlight activity. +*/ +await gapi.client.floodlightActivities.update({ profileId: "profileId", }); + +/* +Gets one floodlight activity group by ID. +*/ +await gapi.client.floodlightActivityGroups.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new floodlight activity group. +*/ +await gapi.client.floodlightActivityGroups.insert({ profileId: "profileId", }); + +/* +Retrieves a list of floodlight activity groups, possibly filtered. This method supports paging. +*/ +await gapi.client.floodlightActivityGroups.list({ profileId: "profileId", }); + +/* +Updates an existing floodlight activity group. This method supports patch semantics. +*/ +await gapi.client.floodlightActivityGroups.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing floodlight activity group. +*/ +await gapi.client.floodlightActivityGroups.update({ profileId: "profileId", }); + +/* +Gets one floodlight configuration by ID. +*/ +await gapi.client.floodlightConfigurations.get({ id: "id", profileId: "profileId", }); + +/* +Retrieves a list of floodlight configurations, possibly filtered. +*/ +await gapi.client.floodlightConfigurations.list({ profileId: "profileId", }); + +/* +Updates an existing floodlight configuration. This method supports patch semantics. +*/ +await gapi.client.floodlightConfigurations.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing floodlight configuration. +*/ +await gapi.client.floodlightConfigurations.update({ profileId: "profileId", }); + +/* +Gets one inventory item by ID. +*/ +await gapi.client.inventoryItems.get({ id: "id", profileId: "profileId", projectId: "projectId", }); + +/* +Retrieves a list of inventory items, possibly filtered. This method supports paging. +*/ +await gapi.client.inventoryItems.list({ profileId: "profileId", projectId: "projectId", }); + +/* +Deletes an existing campaign landing page. +*/ +await gapi.client.landingPages.delete({ campaignId: "campaignId", id: "id", profileId: "profileId", }); + +/* +Gets one campaign landing page by ID. +*/ +await gapi.client.landingPages.get({ campaignId: "campaignId", id: "id", profileId: "profileId", }); + +/* +Inserts a new landing page for the specified campaign. +*/ +await gapi.client.landingPages.insert({ campaignId: "campaignId", profileId: "profileId", }); + +/* +Retrieves the list of landing pages for the specified campaign. +*/ +await gapi.client.landingPages.list({ campaignId: "campaignId", profileId: "profileId", }); + +/* +Updates an existing campaign landing page. This method supports patch semantics. +*/ +await gapi.client.landingPages.patch({ campaignId: "campaignId", id: "id", profileId: "profileId", }); + +/* +Updates an existing campaign landing page. +*/ +await gapi.client.landingPages.update({ campaignId: "campaignId", profileId: "profileId", }); + +/* +Retrieves a list of languages. +*/ +await gapi.client.languages.list({ profileId: "profileId", }); + +/* +Retrieves a list of metros. +*/ +await gapi.client.metros.list({ profileId: "profileId", }); + +/* +Gets one mobile carrier by ID. +*/ +await gapi.client.mobileCarriers.get({ id: "id", profileId: "profileId", }); + +/* +Retrieves a list of mobile carriers. +*/ +await gapi.client.mobileCarriers.list({ profileId: "profileId", }); + +/* +Gets one operating system version by ID. +*/ +await gapi.client.operatingSystemVersions.get({ id: "id", profileId: "profileId", }); + +/* +Retrieves a list of operating system versions. +*/ +await gapi.client.operatingSystemVersions.list({ profileId: "profileId", }); + +/* +Gets one operating system by DART ID. +*/ +await gapi.client.operatingSystems.get({ dartId: "dartId", profileId: "profileId", }); + +/* +Retrieves a list of operating systems. +*/ +await gapi.client.operatingSystems.list({ profileId: "profileId", }); + +/* +Gets one order document by ID. +*/ +await gapi.client.orderDocuments.get({ id: "id", profileId: "profileId", projectId: "projectId", }); + +/* +Retrieves a list of order documents, possibly filtered. This method supports paging. +*/ +await gapi.client.orderDocuments.list({ profileId: "profileId", projectId: "projectId", }); + +/* +Gets one order by ID. +*/ +await gapi.client.orders.get({ id: "id", profileId: "profileId", projectId: "projectId", }); + +/* +Retrieves a list of orders, possibly filtered. This method supports paging. +*/ +await gapi.client.orders.list({ profileId: "profileId", projectId: "projectId", }); + +/* +Gets one placement group by ID. +*/ +await gapi.client.placementGroups.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new placement group. +*/ +await gapi.client.placementGroups.insert({ profileId: "profileId", }); + +/* +Retrieves a list of placement groups, possibly filtered. This method supports paging. +*/ +await gapi.client.placementGroups.list({ profileId: "profileId", }); + +/* +Updates an existing placement group. This method supports patch semantics. +*/ +await gapi.client.placementGroups.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing placement group. +*/ +await gapi.client.placementGroups.update({ profileId: "profileId", }); + +/* +Deletes an existing placement strategy. +*/ +await gapi.client.placementStrategies.delete({ id: "id", profileId: "profileId", }); + +/* +Gets one placement strategy by ID. +*/ +await gapi.client.placementStrategies.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new placement strategy. +*/ +await gapi.client.placementStrategies.insert({ profileId: "profileId", }); + +/* +Retrieves a list of placement strategies, possibly filtered. This method supports paging. +*/ +await gapi.client.placementStrategies.list({ profileId: "profileId", }); + +/* +Updates an existing placement strategy. This method supports patch semantics. +*/ +await gapi.client.placementStrategies.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing placement strategy. +*/ +await gapi.client.placementStrategies.update({ profileId: "profileId", }); + +/* +Generates tags for a placement. +*/ +await gapi.client.placements.generatetags({ profileId: "profileId", }); + +/* +Gets one placement by ID. +*/ +await gapi.client.placements.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new placement. +*/ +await gapi.client.placements.insert({ profileId: "profileId", }); + +/* +Retrieves a list of placements, possibly filtered. This method supports paging. +*/ +await gapi.client.placements.list({ profileId: "profileId", }); + +/* +Updates an existing placement. This method supports patch semantics. +*/ +await gapi.client.placements.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing placement. +*/ +await gapi.client.placements.update({ profileId: "profileId", }); + +/* +Gets one platform type by ID. +*/ +await gapi.client.platformTypes.get({ id: "id", profileId: "profileId", }); + +/* +Retrieves a list of platform types. +*/ +await gapi.client.platformTypes.list({ profileId: "profileId", }); + +/* +Gets one postal code by ID. +*/ +await gapi.client.postalCodes.get({ code: "code", profileId: "profileId", }); + +/* +Retrieves a list of postal codes. +*/ +await gapi.client.postalCodes.list({ profileId: "profileId", }); + +/* +Gets one project by ID. +*/ +await gapi.client.projects.get({ id: "id", profileId: "profileId", }); + +/* +Retrieves a list of projects, possibly filtered. This method supports paging. +*/ +await gapi.client.projects.list({ profileId: "profileId", }); + +/* +Retrieves a list of regions. +*/ +await gapi.client.regions.list({ profileId: "profileId", }); + +/* +Gets one remarketing list share by remarketing list ID. +*/ +await gapi.client.remarketingListShares.get({ profileId: "profileId", remarketingListId: "remarketingListId", }); + +/* +Updates an existing remarketing list share. This method supports patch semantics. +*/ +await gapi.client.remarketingListShares.patch({ profileId: "profileId", remarketingListId: "remarketingListId", }); + +/* +Updates an existing remarketing list share. +*/ +await gapi.client.remarketingListShares.update({ profileId: "profileId", }); + +/* +Gets one remarketing list by ID. +*/ +await gapi.client.remarketingLists.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new remarketing list. +*/ +await gapi.client.remarketingLists.insert({ profileId: "profileId", }); + +/* +Retrieves a list of remarketing lists, possibly filtered. This method supports paging. +*/ +await gapi.client.remarketingLists.list({ advertiserId: "advertiserId", profileId: "profileId", }); + +/* +Updates an existing remarketing list. This method supports patch semantics. +*/ +await gapi.client.remarketingLists.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing remarketing list. +*/ +await gapi.client.remarketingLists.update({ profileId: "profileId", }); + +/* +Deletes a report by its ID. +*/ +await gapi.client.reports.delete({ profileId: "profileId", reportId: "reportId", }); + +/* +Retrieves a report by its ID. +*/ +await gapi.client.reports.get({ profileId: "profileId", reportId: "reportId", }); + +/* +Creates a report. +*/ +await gapi.client.reports.insert({ profileId: "profileId", }); + +/* +Retrieves list of reports. +*/ +await gapi.client.reports.list({ profileId: "profileId", }); + +/* +Updates a report. This method supports patch semantics. +*/ +await gapi.client.reports.patch({ profileId: "profileId", reportId: "reportId", }); + +/* +Runs a report. +*/ +await gapi.client.reports.run({ profileId: "profileId", reportId: "reportId", }); + +/* +Updates a report. +*/ +await gapi.client.reports.update({ profileId: "profileId", reportId: "reportId", }); + +/* +Gets one site by ID. +*/ +await gapi.client.sites.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new site. +*/ +await gapi.client.sites.insert({ profileId: "profileId", }); + +/* +Retrieves a list of sites, possibly filtered. This method supports paging. +*/ +await gapi.client.sites.list({ profileId: "profileId", }); + +/* +Updates an existing site. This method supports patch semantics. +*/ +await gapi.client.sites.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing site. +*/ +await gapi.client.sites.update({ profileId: "profileId", }); + +/* +Gets one size by ID. +*/ +await gapi.client.sizes.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new size. +*/ +await gapi.client.sizes.insert({ profileId: "profileId", }); + +/* +Retrieves a list of sizes, possibly filtered. +*/ +await gapi.client.sizes.list({ profileId: "profileId", }); + +/* +Gets one subaccount by ID. +*/ +await gapi.client.subaccounts.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new subaccount. +*/ +await gapi.client.subaccounts.insert({ profileId: "profileId", }); + +/* +Gets a list of subaccounts, possibly filtered. This method supports paging. +*/ +await gapi.client.subaccounts.list({ profileId: "profileId", }); + +/* +Updates an existing subaccount. This method supports patch semantics. +*/ +await gapi.client.subaccounts.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing subaccount. +*/ +await gapi.client.subaccounts.update({ profileId: "profileId", }); + +/* +Gets one remarketing list by ID. +*/ +await gapi.client.targetableRemarketingLists.get({ id: "id", profileId: "profileId", }); + +/* +Retrieves a list of targetable remarketing lists, possibly filtered. This method supports paging. +*/ +await gapi.client.targetableRemarketingLists.list({ advertiserId: "advertiserId", profileId: "profileId", }); + +/* +Gets one targeting template by ID. +*/ +await gapi.client.targetingTemplates.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new targeting template. +*/ +await gapi.client.targetingTemplates.insert({ profileId: "profileId", }); + +/* +Retrieves a list of targeting templates, optionally filtered. This method supports paging. +*/ +await gapi.client.targetingTemplates.list({ profileId: "profileId", }); + +/* +Updates an existing targeting template. This method supports patch semantics. +*/ +await gapi.client.targetingTemplates.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing targeting template. +*/ +await gapi.client.targetingTemplates.update({ profileId: "profileId", }); + +/* +Gets one user profile by ID. +*/ +await gapi.client.userProfiles.get({ profileId: "profileId", }); + +/* +Retrieves list of user profiles for a user. +*/ +await gapi.client.userProfiles.list({ }); + +/* +Gets one user role permission group by ID. +*/ +await gapi.client.userRolePermissionGroups.get({ id: "id", profileId: "profileId", }); + +/* +Gets a list of all supported user role permission groups. +*/ +await gapi.client.userRolePermissionGroups.list({ profileId: "profileId", }); + +/* +Gets one user role permission by ID. +*/ +await gapi.client.userRolePermissions.get({ id: "id", profileId: "profileId", }); + +/* +Gets a list of user role permissions, possibly filtered. +*/ +await gapi.client.userRolePermissions.list({ profileId: "profileId", }); + +/* +Deletes an existing user role. +*/ +await gapi.client.userRoles.delete({ id: "id", profileId: "profileId", }); + +/* +Gets one user role by ID. +*/ +await gapi.client.userRoles.get({ id: "id", profileId: "profileId", }); + +/* +Inserts a new user role. +*/ +await gapi.client.userRoles.insert({ profileId: "profileId", }); + +/* +Retrieves a list of user roles, possibly filtered. This method supports paging. +*/ +await gapi.client.userRoles.list({ profileId: "profileId", }); + +/* +Updates an existing user role. This method supports patch semantics. +*/ +await gapi.client.userRoles.patch({ id: "id", profileId: "profileId", }); + +/* +Updates an existing user role. +*/ +await gapi.client.userRoles.update({ profileId: "profileId", }); + +/* +Gets one video format by ID. +*/ +await gapi.client.videoFormats.get({ id: 1, profileId: "profileId", }); + +/* +Lists available video formats. +*/ +await gapi.client.videoFormats.list({ profileId: "profileId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.dfareporting/tsconfig.json b/types/gapi.client.dfareporting/tsconfig.json new file mode 100644 index 0000000000..78bcd11678 --- /dev/null +++ b/types/gapi.client.dfareporting/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.dfareporting-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.dfareporting/tslint.json b/types/gapi.client.dfareporting/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.dfareporting/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.discovery/gapi.client.discovery-tests.ts b/types/gapi.client.discovery/gapi.client.discovery-tests.ts new file mode 100644 index 0000000000..c1dab1700b --- /dev/null +++ b/types/gapi.client.discovery/gapi.client.discovery-tests.ts @@ -0,0 +1,26 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('discovery', 'v1', () => { + /** now we can use gapi.client.discovery */ + + run(); + }); + + async function run() { + /** Retrieve the description of a particular version of an api. */ + await gapi.client.apis.getRest({ + api: "api", + version: "version", + }); + /** Retrieve the list of APIs supported at this endpoint. */ + await gapi.client.apis.list({ + name: "name", + preferred: true, + }); + } +}); diff --git a/types/gapi.client.discovery/index.d.ts b/types/gapi.client.discovery/index.d.ts new file mode 100644 index 0000000000..570928f44f --- /dev/null +++ b/types/gapi.client.discovery/index.d.ts @@ -0,0 +1,322 @@ +// Type definitions for Google APIs Discovery Service v1 1.0 +// Project: https://developers.google.com/discovery/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/discovery/v1/rest + +/// + +declare namespace gapi.client { + /** Load APIs Discovery Service v1 */ + function load(name: "discovery", version: "v1"): PromiseLike; + function load(name: "discovery", version: "v1", callback: () => any): void; + + const apis: discovery.ApisResource; + + namespace discovery { + interface DirectoryList { + /** Indicate the version of the Discovery API used to generate this doc. */ + discoveryVersion?: string; + /** The individual directory entries. One entry per api/version pair. */ + items?: Array<{ + /** The description of this API. */ + description?: string; + /** A link to the discovery document. */ + discoveryLink?: string; + /** The URL for the discovery REST document. */ + discoveryRestUrl?: string; + /** A link to human readable documentation for the API. */ + documentationLink?: string; + /** Links to 16x16 and 32x32 icons representing the API. */ + icons?: { + /** The URL of the 16x16 icon. */ + x16?: string; + /** The URL of the 32x32 icon. */ + x32?: string; + }; + /** The id of this API. */ + id?: string; + /** The kind for this response. */ + kind?: string; + /** Labels for the status of this API, such as labs or deprecated. */ + labels?: string[]; + /** The name of the API. */ + name?: string; + /** True if this version is the preferred version to use. */ + preferred?: boolean; + /** The title of this API. */ + title?: string; + /** The version of the API. */ + version?: string; + }>; + /** The kind for this response. */ + kind?: string; + } + interface JsonSchema { + /** A reference to another schema. The value of this property is the "id" of another schema. */ + $ref?: string; + /** If this is a schema for an object, this property is the schema for any additional properties with dynamic keys on this object. */ + additionalProperties?: JsonSchema; + /** Additional information about this property. */ + annotations?: { + /** A list of methods for which this property is required on requests. */ + required?: string[]; + }; + /** The default value of this property (if one exists). */ + default?: string; + /** A description of this object. */ + description?: string; + /** Values this parameter may take (if it is an enum). */ + enum?: string[]; + /** The descriptions for the enums. Each position maps to the corresponding value in the "enum" array. */ + enumDescriptions?: string[]; + /** + * An additional regular expression or key that helps constrain the value. For more details see: + * http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.23 + */ + format?: string; + /** Unique identifier for this schema. */ + id?: string; + /** If this is a schema for an array, this property is the schema for each element in the array. */ + items?: JsonSchema; + /** Whether this parameter goes in the query or the path for REST requests. */ + location?: string; + /** The maximum value of this parameter. */ + maximum?: string; + /** The minimum value of this parameter. */ + minimum?: string; + /** The regular expression this parameter must conform to. Uses Java 6 regex format: http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html */ + pattern?: string; + /** If this is a schema for an object, list the schema for each property of this object. */ + properties?: Record; + /** + * The value is read-only, generated by the service. The value cannot be modified by the client. If the value is included in a POST, PUT, or PATCH + * request, it is ignored by the service. + */ + readOnly?: boolean; + /** Whether this parameter may appear multiple times. */ + repeated?: boolean; + /** Whether the parameter is required. */ + required?: boolean; + /** The value type for this schema. A list of values can be found here: http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1 */ + type?: string; + /** + * In a variant data type, the value of one property is used to determine how to interpret the entire entity. Its value must exist in a map of + * descriminant values to schema names. + */ + variant?: { + /** The name of the type discriminant property. */ + discriminant?: string; + /** The map of discriminant value to schema to use for parsing.. */ + map?: Array<{ + $ref?: string; + type_value?: string; + }>; + }; + } + interface RestDescription { + /** Authentication information. */ + auth?: { + /** OAuth 2.0 authentication information. */ + oauth2?: { + /** Available OAuth 2.0 scopes. */ + scopes?: Record; + }; + }; + /** [DEPRECATED] The base path for REST requests. */ + basePath?: string; + /** [DEPRECATED] The base URL for REST requests. */ + baseUrl?: string; + /** The path for REST batch requests. */ + batchPath?: string; + /** Indicates how the API name should be capitalized and split into various parts. Useful for generating pretty class names. */ + canonicalName?: string; + /** The description of this API. */ + description?: string; + /** Indicate the version of the Discovery API used to generate this doc. */ + discoveryVersion?: string; + /** A link to human readable documentation for the API. */ + documentationLink?: string; + /** The ETag for this response. */ + etag?: string; + /** Enable exponential backoff for suitable methods in the generated clients. */ + exponentialBackoffDefault?: boolean; + /** A list of supported features for this API. */ + features?: string[]; + /** Links to 16x16 and 32x32 icons representing the API. */ + icons?: { + /** The URL of the 16x16 icon. */ + x16?: string; + /** The URL of the 32x32 icon. */ + x32?: string; + }; + /** The ID of this API. */ + id?: string; + /** The kind for this response. */ + kind?: string; + /** Labels for the status of this API, such as labs or deprecated. */ + labels?: string[]; + /** API-level methods for this API. */ + methods?: Record; + /** The name of this API. */ + name?: string; + /** + * The domain of the owner of this API. Together with the ownerName and a packagePath values, this can be used to generate a library for this API which + * would have a unique fully qualified name. + */ + ownerDomain?: string; + /** The name of the owner of this API. See ownerDomain. */ + ownerName?: string; + /** The package of the owner of this API. See ownerDomain. */ + packagePath?: string; + /** Common parameters that apply across all apis. */ + parameters?: Record; + /** The protocol described by this document. */ + protocol?: string; + /** The resources in this API. */ + resources?: Record; + /** The version of this API. */ + revision?: string; + /** The root URL under which all API services live. */ + rootUrl?: string; + /** The schemas for this API. */ + schemas?: Record; + /** The base path for all REST requests. */ + servicePath?: string; + /** The title of this API. */ + title?: string; + /** The version of this API. */ + version?: string; + version_module?: boolean; + } + interface RestMethod { + /** Description of this method. */ + description?: string; + /** Whether this method requires an ETag to be specified. The ETag is sent as an HTTP If-Match or If-None-Match header. */ + etagRequired?: boolean; + /** HTTP method used by this method. */ + httpMethod?: string; + /** A unique ID for this method. This property can be used to match methods between different versions of Discovery. */ + id?: string; + /** Media upload parameters. */ + mediaUpload?: { + /** MIME Media Ranges for acceptable media uploads to this method. */ + accept?: string[]; + /** Maximum size of a media upload, such as "1MB", "2GB" or "3TB". */ + maxSize?: string; + /** Supported upload protocols. */ + protocols?: { + /** Supports the Resumable Media Upload protocol. */ + resumable?: { + /** True if this endpoint supports uploading multipart media. */ + multipart?: boolean; + /** The URI path to be used for upload. Should be used in conjunction with the basePath property at the api-level. */ + path?: string; + }; + /** Supports uploading as a single HTTP request. */ + simple?: { + /** True if this endpoint supports upload multipart media. */ + multipart?: boolean; + /** The URI path to be used for upload. Should be used in conjunction with the basePath property at the api-level. */ + path?: string; + }; + }; + }; + /** + * Ordered list of required parameters, serves as a hint to clients on how to structure their method signatures. The array is ordered such that the + * "most-significant" parameter appears first. + */ + parameterOrder?: string[]; + /** Details for all parameters in this method. */ + parameters?: Record; + /** The URI path of this REST method. Should be used in conjunction with the basePath property at the api-level. */ + path?: string; + /** The schema for the request. */ + request?: { + /** Schema ID for the request schema. */ + $ref?: string; + /** parameter name. */ + parameterName?: string; + }; + /** The schema for the response. */ + response?: { + /** Schema ID for the response schema. */ + $ref?: string; + }; + /** OAuth 2.0 scopes applicable to this method. */ + scopes?: string[]; + /** Whether this method supports media downloads. */ + supportsMediaDownload?: boolean; + /** Whether this method supports media uploads. */ + supportsMediaUpload?: boolean; + /** Whether this method supports subscriptions. */ + supportsSubscription?: boolean; + /** Indicates that downloads from this method should use the download service URL (i.e. "/download"). Only applies if the method supports media download. */ + useMediaDownloadService?: boolean; + } + interface RestResource { + /** Methods on this resource. */ + methods?: Record; + /** Sub-resources on this resource. */ + resources?: Record; + } + interface ApisResource { + /** Retrieve the description of a particular version of an api. */ + getRest(request: { + /** Data format for the response. */ + alt?: string; + /** The name of the API. */ + api: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + /** The version of the API. */ + version: string; + }): Request; + /** Retrieve the list of APIs supported at this endpoint. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Only include APIs with the given name. */ + name?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Return only the preferred version of an API. */ + preferred?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.discovery/readme.md b/types/gapi.client.discovery/readme.md new file mode 100644 index 0000000000..6ac616bdea --- /dev/null +++ b/types/gapi.client.discovery/readme.md @@ -0,0 +1,45 @@ +# TypeScript typings for APIs Discovery Service v1 +Provides information about other Google APIs, such as what APIs are available, the resource, and method details for each API. +For detailed description please check [documentation](https://developers.google.com/discovery/). + +## Installing + +Install typings for APIs Discovery Service: +``` +npm install @types/gapi.client.discovery@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('discovery', 'v1', () => { + // now we can use gapi.client.discovery + // ... +}); +``` + + + +After that you can use APIs Discovery Service resources: + +```typescript + +/* +Retrieve the description of a particular version of an api. +*/ +await gapi.client.apis.getRest({ api: "api", version: "version", }); + +/* +Retrieve the list of APIs supported at this endpoint. +*/ +await gapi.client.apis.list({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.discovery/tsconfig.json b/types/gapi.client.discovery/tsconfig.json new file mode 100644 index 0000000000..b597d1b278 --- /dev/null +++ b/types/gapi.client.discovery/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.discovery-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.discovery/tslint.json b/types/gapi.client.discovery/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.discovery/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.dlp/gapi.client.dlp-tests.ts b/types/gapi.client.dlp/gapi.client.dlp-tests.ts new file mode 100644 index 0000000000..87fe123a67 --- /dev/null +++ b/types/gapi.client.dlp/gapi.client.dlp-tests.ts @@ -0,0 +1,60 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('dlp', 'v2beta1', () => { + /** now we can use gapi.client.dlp */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** + * De-identifies potentially sensitive info from a list of strings. + * This method has limits on input size and output size. + */ + await gapi.client.content.deidentify({ + }); + /** + * Finds potentially sensitive info in a list of strings. + * This method has limits on input size, processing time, and output size. + */ + await gapi.client.content.inspect({ + }); + /** + * Redacts potentially sensitive info from a list of strings. + * This method has limits on input size, processing time, and output size. + */ + await gapi.client.content.redact({ + }); + /** + * Schedules a job to compute risk analysis metrics over content in a Google + * Cloud Platform repository. + */ + await gapi.client.dataSource.analyze({ + }); + /** Returns the list of root categories of sensitive information. */ + await gapi.client.rootCategories.list({ + languageCode: "languageCode", + }); + } +}); diff --git a/types/gapi.client.dlp/index.d.ts b/types/gapi.client.dlp/index.d.ts new file mode 100644 index 0000000000..29839bac80 --- /dev/null +++ b/types/gapi.client.dlp/index.d.ts @@ -0,0 +1,1612 @@ +// Type definitions for Google DLP API v2beta1 2.0 +// Project: https://cloud.google.com/dlp/docs/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://dlp.googleapis.com/$discovery/rest?version=v2beta1 + +/// + +declare namespace gapi.client { + /** Load DLP API v2beta1 */ + function load(name: "dlp", version: "v2beta1"): PromiseLike; + function load(name: "dlp", version: "v2beta1", callback: () => any): void; + + const content: dlp.ContentResource; + + const dataSource: dlp.DataSourceResource; + + const inspect: dlp.InspectResource; + + const riskAnalysis: dlp.RiskAnalysisResource; + + const rootCategories: dlp.RootCategoriesResource; + + namespace dlp { + interface GoogleLongrunningListOperationsResponse { + /** The standard List next-page token. */ + nextPageToken?: string; + /** A list of operations that matches the specified filter in the request. */ + operations?: GoogleLongrunningOperation[]; + } + interface GoogleLongrunningOperation { + /** + * If the value is `false`, it means the operation is still in progress. + * If `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done?: boolean; + /** The error result of the operation in case of failure or cancellation. */ + error?: GoogleRpcStatus; + /** + * This field will contain an InspectOperationMetadata object for `inspect.operations.create` or a RiskAnalysisOperationMetadata object for + * `dataSource.analyze`. This will always be returned with the Operation. + */ + metadata?: Record; + /** The server-assigned name. The `name` should have the format of `inspect/operations/`. */ + name?: string; + /** + * This field will contain an InspectOperationResult object for `inspect.operations.create` or a RiskAnalysisOperationResult object for + * `dataSource.analyze`. + */ + response?: Record; + } + interface GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest { + /** Privacy metric to compute. */ + privacyMetric?: GooglePrivacyDlpV2beta1PrivacyMetric; + /** Input dataset to compute metrics over. */ + sourceTable?: GooglePrivacyDlpV2beta1BigQueryTable; + } + interface GooglePrivacyDlpV2beta1BigQueryOptions { + /** + * References to fields uniquely identifying rows within the table. + * Nested fields in the format, like `person.birthdate.year`, are allowed. + */ + identifyingFields?: GooglePrivacyDlpV2beta1FieldId[]; + /** Complete BigQuery table reference. */ + tableReference?: GooglePrivacyDlpV2beta1BigQueryTable; + } + interface GooglePrivacyDlpV2beta1BigQueryTable { + /** Dataset ID of the table. */ + datasetId?: string; + /** + * The Google Cloud Platform project ID of the project containing the table. + * If omitted, project ID is inferred from the API call. + */ + projectId?: string; + /** Name of the table. */ + tableId?: string; + } + interface GooglePrivacyDlpV2beta1Bucket { + /** Upper bound of the range, exclusive; type must match min. */ + max?: GooglePrivacyDlpV2beta1Value; + /** + * Lower bound of the range, inclusive. Type should be the same as max if + * used. + */ + min?: GooglePrivacyDlpV2beta1Value; + /** + * Replacement value for this bucket. If not provided + * the default behavior will be to hyphenate the min-max range. + */ + replacementValue?: GooglePrivacyDlpV2beta1Value; + } + interface GooglePrivacyDlpV2beta1BucketingConfig { + buckets?: GooglePrivacyDlpV2beta1Bucket[]; + } + interface GooglePrivacyDlpV2beta1CategoricalStatsConfig { + /** + * Field to compute categorical stats on. All column types are + * supported except for arrays and structs. However, it may be more + * informative to use NumericalStats when the field type is supported, + * depending on the data. + */ + field?: GooglePrivacyDlpV2beta1FieldId; + } + interface GooglePrivacyDlpV2beta1CategoricalStatsHistogramBucket { + /** Total number of records in this bucket. */ + bucketSize?: string; + /** + * Sample of value frequencies in this bucket. The total number of + * values returned per bucket is capped at 20. + */ + bucketValues?: GooglePrivacyDlpV2beta1ValueFrequency[]; + /** Lower bound on the value frequency of the values in this bucket. */ + valueFrequencyLowerBound?: string; + /** Upper bound on the value frequency of the values in this bucket. */ + valueFrequencyUpperBound?: string; + } + interface GooglePrivacyDlpV2beta1CategoricalStatsResult { + /** Histogram of value frequencies in the column. */ + valueFrequencyHistogramBuckets?: GooglePrivacyDlpV2beta1CategoricalStatsHistogramBucket[]; + } + interface GooglePrivacyDlpV2beta1CategoryDescription { + /** Human readable form of the category name. */ + displayName?: string; + /** Internal name of the category. */ + name?: string; + } + interface GooglePrivacyDlpV2beta1CharacterMaskConfig { + /** + * When masking a string, items in this list will be skipped when replacing. + * For example, if your string is 555-555-5555 and you ask us to skip `-` and + * mask 5 chars with * we would produce ***-*55-5555. + */ + charactersToIgnore?: GooglePrivacyDlpV2beta1CharsToIgnore[]; + /** + * Character to mask the sensitive values—for example, "*" for an + * alphabetic string such as name, or "0" for a numeric string such as ZIP + * code or credit card number. String must have length 1. If not supplied, we + * will default to "*" for strings, 0 for digits. + */ + maskingCharacter?: string; + /** + * Number of characters to mask. If not set, all matching chars will be + * masked. Skipped characters do not count towards this tally. + */ + numberToMask?: number; + /** + * Mask characters in reverse order. For example, if `masking_character` is + * '0', number_to_mask is 14, and `reverse_order` is false, then + * 1234-5678-9012-3456 -> 00000000000000-3456 + * If `masking_character` is '*', `number_to_mask` is 3, and `reverse_order` + * is true, then 12345 -> 12*** + */ + reverseOrder?: boolean; + } + interface GooglePrivacyDlpV2beta1CharsToIgnore { + charactersToSkip?: string; + commonCharactersToIgnore?: string; + } + interface GooglePrivacyDlpV2beta1CloudStorageKey { + /** Path to the file. */ + filePath?: string; + /** Byte offset of the referenced data in the file. */ + startOffset?: string; + } + interface GooglePrivacyDlpV2beta1CloudStorageOptions { + fileSet?: GooglePrivacyDlpV2beta1FileSet; + } + interface GooglePrivacyDlpV2beta1CloudStoragePath { + /** The url, in the format of `gs://bucket/`. */ + path?: string; + } + interface GooglePrivacyDlpV2beta1Color { + /** The amount of blue in the color as a value in the interval [0, 1]. */ + blue?: number; + /** The amount of green in the color as a value in the interval [0, 1]. */ + green?: number; + /** The amount of red in the color as a value in the interval [0, 1]. */ + red?: number; + } + interface GooglePrivacyDlpV2beta1Condition { + /** Field within the record this condition is evaluated against. [required] */ + field?: GooglePrivacyDlpV2beta1FieldId; + /** Operator used to compare the field or info type to the value. [required] */ + operator?: string; + /** Value to compare against. [Required, except for `EXISTS` tests.] */ + value?: GooglePrivacyDlpV2beta1Value; + } + interface GooglePrivacyDlpV2beta1Conditions { + conditions?: GooglePrivacyDlpV2beta1Condition[]; + } + interface GooglePrivacyDlpV2beta1ContentItem { + /** Content data to inspect or redact. */ + data?: string; + /** Structured content for inspection. */ + table?: GooglePrivacyDlpV2beta1Table; + /** + * Type of the content, as defined in Content-Type HTTP header. + * Supported types are: all "text" types, octet streams, PNG images, + * JPEG images. + */ + type?: string; + /** String data to inspect or redact. */ + value?: string; + } + interface GooglePrivacyDlpV2beta1CreateInspectOperationRequest { + /** Configuration for the inspector. */ + inspectConfig?: GooglePrivacyDlpV2beta1InspectConfig; + /** Additional configuration settings for long running operations. */ + operationConfig?: GooglePrivacyDlpV2beta1OperationConfig; + /** Optional location to store findings. */ + outputConfig?: GooglePrivacyDlpV2beta1OutputStorageConfig; + /** Specification of the data set to process. */ + storageConfig?: GooglePrivacyDlpV2beta1StorageConfig; + } + interface GooglePrivacyDlpV2beta1CryptoHashConfig { + /** The key used by the hash function. */ + cryptoKey?: GooglePrivacyDlpV2beta1CryptoKey; + } + interface GooglePrivacyDlpV2beta1CryptoKey { + kmsWrapped?: GooglePrivacyDlpV2beta1KmsWrappedCryptoKey; + transient?: GooglePrivacyDlpV2beta1TransientCryptoKey; + unwrapped?: GooglePrivacyDlpV2beta1UnwrappedCryptoKey; + } + interface GooglePrivacyDlpV2beta1CryptoReplaceFfxFpeConfig { + commonAlphabet?: string; + /** + * A context may be used for higher security since the same + * identifier in two different contexts likely will be given a distinct + * surrogate. The principle is that the likeliness is inversely related + * to the ratio of the number of distinct identifiers per context over the + * number of possible surrogates: As long as this ratio is small, the + * likehood is large. + * + * If the context is not set, a default tweak will be used. + * If the context is set but: + * + * 1. there is no record present when transforming a given value or + * 1. the field is not present when transforming a given value, + * + * a default tweak will be used. + * + * Note that case (1) is expected when an `InfoTypeTransformation` is + * applied to both structured and non-structured `ContentItem`s. + * Currently, the referenced field may be of value type integer or string. + * + * The tweak is constructed as a sequence of bytes in big endian byte order + * such that: + * + * - a 64 bit integer is encoded followed by a single byte of value 1 + * - a string is encoded in UTF-8 format followed by a single byte of value 2 + * + * This is also known as the 'tweak', as in tweakable encryption. + */ + context?: GooglePrivacyDlpV2beta1FieldId; + /** The key used by the encryption algorithm. [required] */ + cryptoKey?: GooglePrivacyDlpV2beta1CryptoKey; + /** + * This is supported by mapping these to the alphanumeric characters + * that the FFX mode natively supports. This happens before/after + * encryption/decryption. + * Each character listed must appear only once. + * Number of characters must be in the range [2, 62]. + * This must be encoded as ASCII. + * The order of characters does not matter. + */ + customAlphabet?: string; + /** The native way to select the alphabet. Must be in the range [2, 62]. */ + radix?: number; + } + interface GooglePrivacyDlpV2beta1DatastoreKey { + /** Datastore entity key. */ + entityKey?: GooglePrivacyDlpV2beta1Key; + } + interface GooglePrivacyDlpV2beta1DatastoreOptions { + /** The kind to process. */ + kind?: GooglePrivacyDlpV2beta1KindExpression; + /** + * A partition ID identifies a grouping of entities. The grouping is always + * by project and namespace, however the namespace ID may be empty. + */ + partitionId?: GooglePrivacyDlpV2beta1PartitionId; + /** + * Properties to scan. If none are specified, all properties will be scanned + * by default. + */ + projection?: GooglePrivacyDlpV2beta1Projection[]; + } + interface GooglePrivacyDlpV2beta1DeidentificationSummary { + /** Transformations applied to the dataset. */ + transformationSummaries?: GooglePrivacyDlpV2beta1TransformationSummary[]; + /** Total size in bytes that were transformed in some way. */ + transformedBytes?: string; + } + interface GooglePrivacyDlpV2beta1DeidentifyConfig { + /** + * Treat the dataset as free-form text and apply the same free text + * transformation everywhere. + */ + infoTypeTransformations?: GooglePrivacyDlpV2beta1InfoTypeTransformations; + /** + * Treat the dataset as structured. Transformations can be applied to + * specific locations within structured datasets, such as transforming + * a column within a table. + */ + recordTransformations?: GooglePrivacyDlpV2beta1RecordTransformations; + } + interface GooglePrivacyDlpV2beta1DeidentifyContentRequest { + /** Configuration for the de-identification of the list of content items. */ + deidentifyConfig?: GooglePrivacyDlpV2beta1DeidentifyConfig; + /** Configuration for the inspector. */ + inspectConfig?: GooglePrivacyDlpV2beta1InspectConfig; + /** + * The list of items to inspect. Up to 100 are allowed per request. + * All items will be treated as text/*. + */ + items?: GooglePrivacyDlpV2beta1ContentItem[]; + } + interface GooglePrivacyDlpV2beta1DeidentifyContentResponse { + items?: GooglePrivacyDlpV2beta1ContentItem[]; + /** A review of the transformations that took place for each item. */ + summaries?: GooglePrivacyDlpV2beta1DeidentificationSummary[]; + } + interface GooglePrivacyDlpV2beta1EntityId { + /** Composite key indicating which field contains the entity identifier. */ + field?: GooglePrivacyDlpV2beta1FieldId; + } + interface GooglePrivacyDlpV2beta1Expressions { + conditions?: GooglePrivacyDlpV2beta1Conditions; + /** + * The operator to apply to the result of conditions. Default and currently + * only supported value is `AND`. + */ + logicalOperator?: string; + } + interface GooglePrivacyDlpV2beta1FieldId { + /** Name describing the field. */ + columnName?: string; + } + interface GooglePrivacyDlpV2beta1FieldTransformation { + /** + * Only apply the transformation if the condition evaluates to true for the + * given `RecordCondition`. The conditions are allowed to reference fields + * that are not used in the actual transformation. [optional] + * + * Example Use Cases: + * + * - Apply a different bucket transformation to an age column if the zip code + * column for the same record is within a specific range. + * - Redact a field if the date of birth field is greater than 85. + */ + condition?: GooglePrivacyDlpV2beta1RecordCondition; + /** Input field(s) to apply the transformation to. [required] */ + fields?: GooglePrivacyDlpV2beta1FieldId[]; + /** + * Treat the contents of the field as free text, and selectively + * transform content that matches an `InfoType`. + */ + infoTypeTransformations?: GooglePrivacyDlpV2beta1InfoTypeTransformations; + /** Apply the transformation to the entire field. */ + primitiveTransformation?: GooglePrivacyDlpV2beta1PrimitiveTransformation; + } + interface GooglePrivacyDlpV2beta1FileSet { + /** + * The url, in the format `gs:///`. Trailing wildcard in the + * path is allowed. + */ + url?: string; + } + interface GooglePrivacyDlpV2beta1Finding { + /** Timestamp when finding was detected. */ + createTime?: string; + /** The specific type of info the string might be. */ + infoType?: GooglePrivacyDlpV2beta1InfoType; + /** Estimate of how likely it is that the info_type is correct. */ + likelihood?: string; + /** Location of the info found. */ + location?: GooglePrivacyDlpV2beta1Location; + /** The specific string that may be potentially sensitive info. */ + quote?: string; + } + interface GooglePrivacyDlpV2beta1FixedSizeBucketingConfig { + /** + * Size of each bucket (except for minimum and maximum buckets). So if + * `lower_bound` = 10, `upper_bound` = 89, and `bucket_size` = 10, then the + * following buckets would be used: -10, 10-20, 20-30, 30-40, 40-50, 50-60, + * 60-70, 70-80, 80-89, 89+. Precision up to 2 decimals works. [Required]. + */ + bucketSize?: number; + /** + * Lower bound value of buckets. All values less than `lower_bound` are + * grouped together into a single bucket; for example if `lower_bound` = 10, + * then all values less than 10 are replaced with the value “-10”. [Required]. + */ + lowerBound?: GooglePrivacyDlpV2beta1Value; + /** + * Upper bound value of buckets. All values greater than upper_bound are + * grouped together into a single bucket; for example if `upper_bound` = 89, + * then all values greater than 89 are replaced with the value “89+”. + * [Required]. + */ + upperBound?: GooglePrivacyDlpV2beta1Value; + } + interface GooglePrivacyDlpV2beta1ImageLocation { + /** Height of the bounding box in pixels. */ + height?: number; + /** Left coordinate of the bounding box. (0,0) is upper left. */ + left?: number; + /** Top coordinate of the bounding box. (0,0) is upper left. */ + top?: number; + /** Width of the bounding box in pixels. */ + width?: number; + } + interface GooglePrivacyDlpV2beta1ImageRedactionConfig { + /** + * Only one per info_type should be provided per request. If not + * specified, and redact_all_text is false, the DLP API will redact all + * text that it matches against all info_types that are found, but not + * specified in another ImageRedactionConfig. + */ + infoType?: GooglePrivacyDlpV2beta1InfoType; + /** + * If true, all text found in the image, regardless whether it matches an + * info_type, is redacted. + */ + redactAllText?: boolean; + /** + * The color to use when redacting content from an image. If not specified, + * the default is black. + */ + redactionColor?: GooglePrivacyDlpV2beta1Color; + } + interface GooglePrivacyDlpV2beta1InfoType { + /** Name of the information type. */ + name?: string; + } + interface GooglePrivacyDlpV2beta1InfoTypeDescription { + /** List of categories this infoType belongs to. */ + categories?: GooglePrivacyDlpV2beta1CategoryDescription[]; + /** Human readable form of the infoType name. */ + displayName?: string; + /** Internal name of the infoType. */ + name?: string; + } + interface GooglePrivacyDlpV2beta1InfoTypeLimit { + /** + * Type of information the findings limit applies to. Only one limit per + * info_type should be provided. If InfoTypeLimit does not have an + * info_type, the DLP API applies the limit against all info_types that are + * found but not specified in another InfoTypeLimit. + */ + infoType?: GooglePrivacyDlpV2beta1InfoType; + /** Max findings limit for the given infoType. */ + maxFindings?: number; + } + interface GooglePrivacyDlpV2beta1InfoTypeStatistics { + /** Number of findings for this info type. */ + count?: string; + /** The type of finding this stat is for. */ + infoType?: GooglePrivacyDlpV2beta1InfoType; + } + interface GooglePrivacyDlpV2beta1InfoTypeTransformation { + /** + * Info types to apply the transformation to. Empty list will match all + * available info types for this transformation. + */ + infoTypes?: GooglePrivacyDlpV2beta1InfoType[]; + /** Primitive transformation to apply to the info type. [required] */ + primitiveTransformation?: GooglePrivacyDlpV2beta1PrimitiveTransformation; + } + interface GooglePrivacyDlpV2beta1InfoTypeTransformations { + /** + * Transformation for each info type. Cannot specify more than one + * for a given info type. [required] + */ + transformations?: GooglePrivacyDlpV2beta1InfoTypeTransformation[]; + } + interface GooglePrivacyDlpV2beta1InspectConfig { + /** When true, excludes type information of the findings. */ + excludeTypes?: boolean; + /** + * When true, a contextual quote from the data that triggered a finding is + * included in the response; see Finding.quote. + */ + includeQuote?: boolean; + /** Configuration of findings limit given for specified info types. */ + infoTypeLimits?: GooglePrivacyDlpV2beta1InfoTypeLimit[]; + /** + * Restricts what info_types to look for. The values must correspond to + * InfoType values returned by ListInfoTypes or found in documentation. + * Empty info_types runs all enabled detectors. + */ + infoTypes?: GooglePrivacyDlpV2beta1InfoType[]; + /** Limits the number of findings per content item or long running operation. */ + maxFindings?: number; + /** Only returns findings equal or above this threshold. */ + minLikelihood?: string; + } + interface GooglePrivacyDlpV2beta1InspectContentRequest { + /** Configuration for the inspector. */ + inspectConfig?: GooglePrivacyDlpV2beta1InspectConfig; + /** + * The list of items to inspect. Items in a single request are + * considered "related" unless inspect_config.independent_inputs is true. + * Up to 100 are allowed per request. + */ + items?: GooglePrivacyDlpV2beta1ContentItem[]; + } + interface GooglePrivacyDlpV2beta1InspectContentResponse { + /** + * Each content_item from the request has a result in this list, in the + * same order as the request. + */ + results?: GooglePrivacyDlpV2beta1InspectResult[]; + } + interface GooglePrivacyDlpV2beta1InspectOperationMetadata { + /** The time which this request was started. */ + createTime?: string; + infoTypeStats?: GooglePrivacyDlpV2beta1InfoTypeStatistics[]; + /** Total size in bytes that were processed. */ + processedBytes?: string; + /** The inspect config used to create the Operation. */ + requestInspectConfig?: GooglePrivacyDlpV2beta1InspectConfig; + /** Optional location to store findings. */ + requestOutputConfig?: GooglePrivacyDlpV2beta1OutputStorageConfig; + /** The storage config used to create the Operation. */ + requestStorageConfig?: GooglePrivacyDlpV2beta1StorageConfig; + /** Estimate of the number of bytes to process. */ + totalEstimatedBytes?: string; + } + interface GooglePrivacyDlpV2beta1InspectOperationResult { + /** + * The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `inspect/results/{id}`. + */ + name?: string; + } + interface GooglePrivacyDlpV2beta1InspectResult { + /** List of findings for an item. */ + findings?: GooglePrivacyDlpV2beta1Finding[]; + /** + * If true, then this item might have more findings than were returned, + * and the findings returned are an arbitrary subset of all findings. + * The findings list might be truncated because the input items were too + * large, or because the server reached the maximum amount of resources + * allowed for a single API call. For best results, divide the input into + * smaller batches. + */ + findingsTruncated?: boolean; + } + interface GooglePrivacyDlpV2beta1KAnonymityConfig { + /** + * Optional message indicating that each distinct `EntityId` should not + * contribute to the k-anonymity count more than once per equivalence class. + */ + entityId?: GooglePrivacyDlpV2beta1EntityId; + /** + * Set of fields to compute k-anonymity over. When multiple fields are + * specified, they are considered a single composite key. Structs and + * repeated data types are not supported; however, nested fields are + * supported so long as they are not structs themselves or nested within + * a repeated field. + */ + quasiIds?: GooglePrivacyDlpV2beta1FieldId[]; + } + interface GooglePrivacyDlpV2beta1KAnonymityEquivalenceClass { + /** + * Size of the equivalence class, for example number of rows with the + * above set of values. + */ + equivalenceClassSize?: string; + /** + * Set of values defining the equivalence class. One value per + * quasi-identifier column in the original KAnonymity metric message. + * The order is always the same as the original request. + */ + quasiIdsValues?: GooglePrivacyDlpV2beta1Value[]; + } + interface GooglePrivacyDlpV2beta1KAnonymityHistogramBucket { + /** Total number of records in this bucket. */ + bucketSize?: string; + /** + * Sample of equivalence classes in this bucket. The total number of + * classes returned per bucket is capped at 20. + */ + bucketValues?: GooglePrivacyDlpV2beta1KAnonymityEquivalenceClass[]; + /** Lower bound on the size of the equivalence classes in this bucket. */ + equivalenceClassSizeLowerBound?: string; + /** Upper bound on the size of the equivalence classes in this bucket. */ + equivalenceClassSizeUpperBound?: string; + } + interface GooglePrivacyDlpV2beta1KAnonymityResult { + /** Histogram of k-anonymity equivalence classes. */ + equivalenceClassHistogramBuckets?: GooglePrivacyDlpV2beta1KAnonymityHistogramBucket[]; + } + interface GooglePrivacyDlpV2beta1Key { + /** + * Entities are partitioned into subsets, currently identified by a project + * ID and namespace ID. + * Queries are scoped to a single partition. + */ + partitionId?: GooglePrivacyDlpV2beta1PartitionId; + /** + * The entity path. + * An entity path consists of one or more elements composed of a kind and a + * string or numerical identifier, which identify entities. The first + * element identifies a _root entity_, the second element identifies + * a _child_ of the root entity, the third element identifies a child of the + * second entity, and so forth. The entities identified by all prefixes of + * the path are called the element's _ancestors_. + * + * A path can never be empty, and a path can have at most 100 elements. + */ + path?: GooglePrivacyDlpV2beta1PathElement[]; + } + interface GooglePrivacyDlpV2beta1KindExpression { + /** The name of the kind. */ + name?: string; + } + interface GooglePrivacyDlpV2beta1KmsWrappedCryptoKey { + /** The resource name of the KMS CryptoKey to use for unwrapping. [required] */ + cryptoKeyName?: string; + /** The wrapped data crypto key. [required] */ + wrappedKey?: string; + } + interface GooglePrivacyDlpV2beta1LDiversityConfig { + /** + * Set of quasi-identifiers indicating how equivalence classes are + * defined for the l-diversity computation. When multiple fields are + * specified, they are considered a single composite key. + */ + quasiIds?: GooglePrivacyDlpV2beta1FieldId[]; + /** Sensitive field for computing the l-value. */ + sensitiveAttribute?: GooglePrivacyDlpV2beta1FieldId; + } + interface GooglePrivacyDlpV2beta1LDiversityEquivalenceClass { + /** Size of the k-anonymity equivalence class. */ + equivalenceClassSize?: string; + /** Number of distinct sensitive values in this equivalence class. */ + numDistinctSensitiveValues?: string; + /** + * Quasi-identifier values defining the k-anonymity equivalence + * class. The order is always the same as the original request. + */ + quasiIdsValues?: GooglePrivacyDlpV2beta1Value[]; + /** Estimated frequencies of top sensitive values. */ + topSensitiveValues?: GooglePrivacyDlpV2beta1ValueFrequency[]; + } + interface GooglePrivacyDlpV2beta1LDiversityHistogramBucket { + /** Total number of records in this bucket. */ + bucketSize?: string; + /** + * Sample of equivalence classes in this bucket. The total number of + * classes returned per bucket is capped at 20. + */ + bucketValues?: GooglePrivacyDlpV2beta1LDiversityEquivalenceClass[]; + /** + * Lower bound on the sensitive value frequencies of the equivalence + * classes in this bucket. + */ + sensitiveValueFrequencyLowerBound?: string; + /** + * Upper bound on the sensitive value frequencies of the equivalence + * classes in this bucket. + */ + sensitiveValueFrequencyUpperBound?: string; + } + interface GooglePrivacyDlpV2beta1LDiversityResult { + /** Histogram of l-diversity equivalence class sensitive value frequencies. */ + sensitiveValueFrequencyHistogramBuckets?: GooglePrivacyDlpV2beta1LDiversityHistogramBucket[]; + } + interface GooglePrivacyDlpV2beta1ListInfoTypesResponse { + /** Set of sensitive info types belonging to a category. */ + infoTypes?: GooglePrivacyDlpV2beta1InfoTypeDescription[]; + } + interface GooglePrivacyDlpV2beta1ListInspectFindingsResponse { + /** + * If not empty, indicates that there may be more results that match the + * request; this value should be passed in a new `ListInspectFindingsRequest`. + */ + nextPageToken?: string; + /** The results. */ + result?: GooglePrivacyDlpV2beta1InspectResult; + } + interface GooglePrivacyDlpV2beta1ListRootCategoriesResponse { + /** List of all into type categories supported by the API. */ + categories?: GooglePrivacyDlpV2beta1CategoryDescription[]; + } + interface GooglePrivacyDlpV2beta1Location { + /** Zero-based byte offsets within a content item. */ + byteRange?: GooglePrivacyDlpV2beta1Range; + /** + * Character offsets within a content item, included when content type + * is a text. Default charset assumed to be UTF-8. + */ + codepointRange?: GooglePrivacyDlpV2beta1Range; + /** Field id of the field containing the finding. */ + fieldId?: GooglePrivacyDlpV2beta1FieldId; + /** Location within an image's pixels. */ + imageBoxes?: GooglePrivacyDlpV2beta1ImageLocation[]; + /** Key of the finding. */ + recordKey?: GooglePrivacyDlpV2beta1RecordKey; + /** Location within a `ContentItem.Table`. */ + tableLocation?: GooglePrivacyDlpV2beta1TableLocation; + } + interface GooglePrivacyDlpV2beta1NumericalStatsConfig { + /** + * Field to compute numerical stats on. Supported types are + * integer, float, date, datetime, timestamp, time. + */ + field?: GooglePrivacyDlpV2beta1FieldId; + } + interface GooglePrivacyDlpV2beta1NumericalStatsResult { + /** Maximum value appearing in the column. */ + maxValue?: GooglePrivacyDlpV2beta1Value; + /** Minimum value appearing in the column. */ + minValue?: GooglePrivacyDlpV2beta1Value; + /** + * List of 99 values that partition the set of field values into 100 equal + * sized buckets. + */ + quantileValues?: GooglePrivacyDlpV2beta1Value[]; + } + interface GooglePrivacyDlpV2beta1OperationConfig { + /** Max number of findings per file, Datastore entity, or database row. */ + maxItemFindings?: string; + } + interface GooglePrivacyDlpV2beta1OutputStorageConfig { + /** + * The path to a Google Cloud Storage location to store output. + * The bucket must already exist and + * the Google APIs service account for DLP must have write permission to + * write to the given bucket. + * Results are split over multiple csv files with each file name matching + * the pattern "[operation_id]_[count].csv", for example + * `3094877188788974909_1.csv`. The `operation_id` matches the + * identifier for the Operation, and the `count` is a counter used for + * tracking the number of files written. + * + * The CSV file(s) contain the following columns regardless of storage type + * scanned: + * - id + * - info_type + * - likelihood + * - byte size of finding + * - quote + * - timestamp + * + * For Cloud Storage the next columns are: + * + * - file_path + * - start_offset + * + * For Cloud Datastore the next columns are: + * + * - project_id + * - namespace_id + * - path + * - column_name + * - offset + * + * For BigQuery the next columns are: + * + * - row_number + * - project_id + * - dataset_id + * - table_id + */ + storagePath?: GooglePrivacyDlpV2beta1CloudStoragePath; + /** Store findings in a new table in the dataset. */ + table?: GooglePrivacyDlpV2beta1BigQueryTable; + } + interface GooglePrivacyDlpV2beta1PartitionId { + /** If not empty, the ID of the namespace to which the entities belong. */ + namespaceId?: string; + /** The ID of the project to which the entities belong. */ + projectId?: string; + } + interface GooglePrivacyDlpV2beta1PathElement { + /** + * The auto-allocated ID of the entity. + * Never equal to zero. Values less than zero are discouraged and may not + * be supported in the future. + */ + id?: string; + /** + * The kind of the entity. + * A kind matching regex `__.*__` is reserved/read-only. + * A kind must not contain more than 1500 bytes when UTF-8 encoded. + * Cannot be `""`. + */ + kind?: string; + /** + * The name of the entity. + * A name matching regex `__.*__` is reserved/read-only. + * A name must not be more than 1500 bytes when UTF-8 encoded. + * Cannot be `""`. + */ + name?: string; + } + interface GooglePrivacyDlpV2beta1PrimitiveTransformation { + bucketingConfig?: GooglePrivacyDlpV2beta1BucketingConfig; + characterMaskConfig?: GooglePrivacyDlpV2beta1CharacterMaskConfig; + cryptoHashConfig?: GooglePrivacyDlpV2beta1CryptoHashConfig; + cryptoReplaceFfxFpeConfig?: GooglePrivacyDlpV2beta1CryptoReplaceFfxFpeConfig; + fixedSizeBucketingConfig?: GooglePrivacyDlpV2beta1FixedSizeBucketingConfig; + redactConfig?: any; + replaceConfig?: GooglePrivacyDlpV2beta1ReplaceValueConfig; + replaceWithInfoTypeConfig?: any; + timePartConfig?: GooglePrivacyDlpV2beta1TimePartConfig; + } + interface GooglePrivacyDlpV2beta1PrivacyMetric { + categoricalStatsConfig?: GooglePrivacyDlpV2beta1CategoricalStatsConfig; + kAnonymityConfig?: GooglePrivacyDlpV2beta1KAnonymityConfig; + lDiversityConfig?: GooglePrivacyDlpV2beta1LDiversityConfig; + numericalStatsConfig?: GooglePrivacyDlpV2beta1NumericalStatsConfig; + } + interface GooglePrivacyDlpV2beta1Projection { + /** The property to project. */ + property?: GooglePrivacyDlpV2beta1PropertyReference; + } + interface GooglePrivacyDlpV2beta1PropertyReference { + /** + * The name of the property. + * If name includes "."s, it may be interpreted as a property name path. + */ + name?: string; + } + interface GooglePrivacyDlpV2beta1Range { + /** Index of the last character of the range (exclusive). */ + end?: string; + /** Index of the first character of the range (inclusive). */ + start?: string; + } + interface GooglePrivacyDlpV2beta1RecordCondition { + expressions?: GooglePrivacyDlpV2beta1Expressions; + } + interface GooglePrivacyDlpV2beta1RecordKey { + cloudStorageKey?: GooglePrivacyDlpV2beta1CloudStorageKey; + datastoreKey?: GooglePrivacyDlpV2beta1DatastoreKey; + } + interface GooglePrivacyDlpV2beta1RecordSuppression { + condition?: GooglePrivacyDlpV2beta1RecordCondition; + } + interface GooglePrivacyDlpV2beta1RecordTransformations { + /** Transform the record by applying various field transformations. */ + fieldTransformations?: GooglePrivacyDlpV2beta1FieldTransformation[]; + /** + * Configuration defining which records get suppressed entirely. Records that + * match any suppression rule are omitted from the output [optional]. + */ + recordSuppressions?: GooglePrivacyDlpV2beta1RecordSuppression[]; + } + interface GooglePrivacyDlpV2beta1RedactContentRequest { + /** The configuration for specifying what content to redact from images. */ + imageRedactionConfigs?: GooglePrivacyDlpV2beta1ImageRedactionConfig[]; + /** Configuration for the inspector. */ + inspectConfig?: GooglePrivacyDlpV2beta1InspectConfig; + /** The list of items to inspect. Up to 100 are allowed per request. */ + items?: GooglePrivacyDlpV2beta1ContentItem[]; + /** + * The strings to replace findings text findings with. Must specify at least + * one of these or one ImageRedactionConfig if redacting images. + */ + replaceConfigs?: GooglePrivacyDlpV2beta1ReplaceConfig[]; + } + interface GooglePrivacyDlpV2beta1RedactContentResponse { + /** The redacted content. */ + items?: GooglePrivacyDlpV2beta1ContentItem[]; + } + interface GooglePrivacyDlpV2beta1ReplaceConfig { + /** + * Type of information to replace. Only one ReplaceConfig per info_type + * should be provided. If ReplaceConfig does not have an info_type, the DLP + * API matches it against all info_types that are found but not specified in + * another ReplaceConfig. + */ + infoType?: GooglePrivacyDlpV2beta1InfoType; + /** Content replacing sensitive information of given type. Max 256 chars. */ + replaceWith?: string; + } + interface GooglePrivacyDlpV2beta1ReplaceValueConfig { + /** Value to replace it with. */ + newValue?: GooglePrivacyDlpV2beta1Value; + } + interface GooglePrivacyDlpV2beta1RiskAnalysisOperationMetadata { + /** The time which this request was started. */ + createTime?: string; + /** Privacy metric to compute. */ + requestedPrivacyMetric?: GooglePrivacyDlpV2beta1PrivacyMetric; + /** Input dataset to compute metrics over. */ + requestedSourceTable?: GooglePrivacyDlpV2beta1BigQueryTable; + } + interface GooglePrivacyDlpV2beta1RiskAnalysisOperationResult { + categoricalStatsResult?: GooglePrivacyDlpV2beta1CategoricalStatsResult; + kAnonymityResult?: GooglePrivacyDlpV2beta1KAnonymityResult; + lDiversityResult?: GooglePrivacyDlpV2beta1LDiversityResult; + numericalStatsResult?: GooglePrivacyDlpV2beta1NumericalStatsResult; + } + interface GooglePrivacyDlpV2beta1Row { + values?: GooglePrivacyDlpV2beta1Value[]; + } + interface GooglePrivacyDlpV2beta1StorageConfig { + /** BigQuery options specification. */ + bigQueryOptions?: GooglePrivacyDlpV2beta1BigQueryOptions; + /** Google Cloud Storage options specification. */ + cloudStorageOptions?: GooglePrivacyDlpV2beta1CloudStorageOptions; + /** Google Cloud Datastore options specification. */ + datastoreOptions?: GooglePrivacyDlpV2beta1DatastoreOptions; + } + interface GooglePrivacyDlpV2beta1SummaryResult { + code?: string; + count?: string; + /** + * A place for warnings or errors to show up if a transformation didn't + * work as expected. + */ + details?: string; + } + interface GooglePrivacyDlpV2beta1Table { + headers?: GooglePrivacyDlpV2beta1FieldId[]; + rows?: GooglePrivacyDlpV2beta1Row[]; + } + interface GooglePrivacyDlpV2beta1TableLocation { + /** The zero-based index of the row where the finding is located. */ + rowIndex?: string; + } + interface GooglePrivacyDlpV2beta1TimePartConfig { + partToExtract?: string; + } + interface GooglePrivacyDlpV2beta1TransformationSummary { + /** Set if the transformation was limited to a specific FieldId. */ + field?: GooglePrivacyDlpV2beta1FieldId; + /** + * The field transformation that was applied. This list will contain + * multiple only in the case of errors. + */ + fieldTransformations?: GooglePrivacyDlpV2beta1FieldTransformation[]; + /** Set if the transformation was limited to a specific info_type. */ + infoType?: GooglePrivacyDlpV2beta1InfoType; + /** The specific suppression option these stats apply to. */ + recordSuppress?: GooglePrivacyDlpV2beta1RecordSuppression; + results?: GooglePrivacyDlpV2beta1SummaryResult[]; + /** The specific transformation these stats apply to. */ + transformation?: GooglePrivacyDlpV2beta1PrimitiveTransformation; + } + interface GooglePrivacyDlpV2beta1TransientCryptoKey { + /** + * Name of the key. [required] + * This is an arbitrary string used to differentiate different keys. + * A unique key is generated per name: two separate `TransientCryptoKey` + * protos share the same generated key if their names are the same. + * When the data crypto key is generated, this name is not used in any way + * (repeating the api call will result in a different key being generated). + */ + name?: string; + } + interface GooglePrivacyDlpV2beta1UnwrappedCryptoKey { + /** The AES 128/192/256 bit key. [required] */ + key?: string; + } + interface GooglePrivacyDlpV2beta1Value { + booleanValue?: boolean; + dateValue?: GoogleTypeDate; + floatValue?: number; + integerValue?: string; + stringValue?: string; + timeValue?: GoogleTypeTimeOfDay; + timestampValue?: string; + } + interface GooglePrivacyDlpV2beta1ValueFrequency { + /** How many times the value is contained in the field. */ + count?: string; + /** A value contained in the field in question. */ + value?: GooglePrivacyDlpV2beta1Value; + } + interface GoogleRpcStatus { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface GoogleTypeDate { + /** + * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 + * if specifying a year/month where the day is not significant. + */ + day?: number; + /** Month of year. Must be from 1 to 12. */ + month?: number; + /** + * Year of date. Must be from 1 to 9999, or 0 if specifying a date without + * a year. + */ + year?: number; + } + interface GoogleTypeTimeOfDay { + /** + * Hours of day in 24 hour format. Should be from 0 to 23. An API may choose + * to allow the value "24:00:00" for scenarios like business closing time. + */ + hours?: number; + /** Minutes of hour of day. Must be from 0 to 59. */ + minutes?: number; + /** Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. */ + nanos?: number; + /** + * Seconds of minutes of the time. Must normally be from 0 to 59. An API may + * allow the value 60 if it allows leap-seconds. + */ + seconds?: number; + } + interface ContentResource { + /** + * De-identifies potentially sensitive info from a list of strings. + * This method has limits on input size and output size. + */ + deidentify(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Finds potentially sensitive info in a list of strings. + * This method has limits on input size, processing time, and output size. + */ + inspect(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Redacts potentially sensitive info from a list of strings. + * This method has limits on input size, processing time, and output size. + */ + redact(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface DataSourceResource { + /** + * Schedules a job to compute risk analysis metrics over content in a Google + * Cloud Platform repository. + */ + analyze(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface OperationsResource { + /** Cancels an operation. Use the `inspect.operations.get` to check whether the cancellation succeeded or the operation completed despite cancellation. */ + cancel(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource to be cancelled. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Schedules a job scanning content in a Google Cloud Platform data + * repository. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** This method is not supported and the server returns `UNIMPLEMENTED`. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource to be deleted. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Fetches the list of long running operations. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Filters by `done`. That is, `done=true` or `done=false`. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation's parent resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The list page size. The maximum allowed value is 256 and the default is 100. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface FindingsResource { + /** Returns list of results for given inspect operation result set id. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Restricts findings to items that match. Supports info_type and likelihood. + * + * Examples: + * + * - info_type=EMAIL_ADDRESS + * - info_type=PHONE_NUMBER,EMAIL_ADDRESS + * - likelihood=VERY_LIKELY + * - likelihood=VERY_LIKELY,LIKELY + * - info_type=EMAIL_ADDRESS,likelihood=VERY_LIKELY,LIKELY + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Identifier of the results set returned as metadata of + * the longrunning operation created by a call to InspectDataSource. + * Should be in the format of `inspect/results/{id}`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Maximum number of results to return. + * If 0, the implementation selects a reasonable value. + */ + pageSize?: number; + /** + * The value returned by the last `ListInspectFindingsResponse`; indicates + * that this is a continuation of a prior `ListInspectFindings` call, and that + * the system should return the next page of data. + */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface ResultsResource { + findings: FindingsResource; + } + interface InspectResource { + operations: OperationsResource; + results: ResultsResource; + } + interface OperationsResource { + /** Cancels an operation. Use the `inspect.operations.get` to check whether the cancellation succeeded or the operation completed despite cancellation. */ + cancel(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource to be cancelled. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** This method is not supported and the server returns `UNIMPLEMENTED`. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource to be deleted. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Fetches the list of long running operations. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Filters by `done`. That is, `done=true` or `done=false`. */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name of the operation's parent resource. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The list page size. The maximum allowed value is 256 and the default is 100. */ + pageSize?: number; + /** The standard list page token. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface RiskAnalysisResource { + operations: OperationsResource; + } + interface InfoTypesResource { + /** Returns sensitive information types for given category. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Category name as returned by ListRootCategories. */ + category: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Optional BCP-47 language code for localized info type friendly + * names. If omitted, or if localized strings are not available, + * en-US strings will be returned. + */ + languageCode?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface RootCategoriesResource { + /** Returns the list of root categories of sensitive information. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Optional language code for localized friendly category names. + * If omitted or if localized strings are not available, + * en-US strings will be returned. + */ + languageCode?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + infoTypes: InfoTypesResource; + } + } +} diff --git a/types/gapi.client.dlp/readme.md b/types/gapi.client.dlp/readme.md new file mode 100644 index 0000000000..8a9a52d069 --- /dev/null +++ b/types/gapi.client.dlp/readme.md @@ -0,0 +1,83 @@ +# TypeScript typings for DLP API v2beta1 +The Google Data Loss Prevention API provides methods for detection of privacy-sensitive fragments in text, images, and Google Cloud Platform storage repositories. +For detailed description please check [documentation](https://cloud.google.com/dlp/docs/). + +## Installing + +Install typings for DLP API: +``` +npm install @types/gapi.client.dlp@v2beta1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('dlp', 'v2beta1', () => { + // now we can use gapi.client.dlp + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use DLP API resources: + +```typescript + +/* +De-identifies potentially sensitive info from a list of strings. +This method has limits on input size and output size. +*/ +await gapi.client.content.deidentify({ }); + +/* +Finds potentially sensitive info in a list of strings. +This method has limits on input size, processing time, and output size. +*/ +await gapi.client.content.inspect({ }); + +/* +Redacts potentially sensitive info from a list of strings. +This method has limits on input size, processing time, and output size. +*/ +await gapi.client.content.redact({ }); + +/* +Schedules a job to compute risk analysis metrics over content in a Google +Cloud Platform repository. +*/ +await gapi.client.dataSource.analyze({ }); + +/* +Returns the list of root categories of sensitive information. +*/ +await gapi.client.rootCategories.list({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.dlp/tsconfig.json b/types/gapi.client.dlp/tsconfig.json new file mode 100644 index 0000000000..b7ab822674 --- /dev/null +++ b/types/gapi.client.dlp/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.dlp-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.dlp/tslint.json b/types/gapi.client.dlp/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.dlp/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.dns/gapi.client.dns-tests.ts b/types/gapi.client.dns/gapi.client.dns-tests.ts new file mode 100644 index 0000000000..16164e4e41 --- /dev/null +++ b/types/gapi.client.dns/gapi.client.dns-tests.ts @@ -0,0 +1,92 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('dns', 'v1', () => { + /** now we can use gapi.client.dns */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform.read-only', + /** View your DNS records hosted by Google Cloud DNS */ + 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + /** View and manage your DNS records hosted by Google Cloud DNS */ + 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Atomically update the ResourceRecordSet collection. */ + await gapi.client.changes.create({ + managedZone: "managedZone", + project: "project", + }); + /** Fetch the representation of an existing Change. */ + await gapi.client.changes.get({ + changeId: "changeId", + managedZone: "managedZone", + project: "project", + }); + /** Enumerate Changes to a ResourceRecordSet collection. */ + await gapi.client.changes.list({ + managedZone: "managedZone", + maxResults: 2, + pageToken: "pageToken", + project: "project", + sortBy: "sortBy", + sortOrder: "sortOrder", + }); + /** Create a new ManagedZone. */ + await gapi.client.managedZones.create({ + project: "project", + }); + /** Delete a previously created ManagedZone. */ + await gapi.client.managedZones.delete({ + managedZone: "managedZone", + project: "project", + }); + /** Fetch the representation of an existing ManagedZone. */ + await gapi.client.managedZones.get({ + managedZone: "managedZone", + project: "project", + }); + /** Enumerate ManagedZones that have been created but not yet deleted. */ + await gapi.client.managedZones.list({ + dnsName: "dnsName", + maxResults: 2, + pageToken: "pageToken", + project: "project", + }); + /** Fetch the representation of an existing Project. */ + await gapi.client.projects.get({ + project: "project", + }); + /** Enumerate ResourceRecordSets that have been created but not yet deleted. */ + await gapi.client.resourceRecordSets.list({ + managedZone: "managedZone", + maxResults: 2, + name: "name", + pageToken: "pageToken", + project: "project", + type: "type", + }); + } +}); diff --git a/types/gapi.client.dns/index.d.ts b/types/gapi.client.dns/index.d.ts new file mode 100644 index 0000000000..c97f2c0240 --- /dev/null +++ b/types/gapi.client.dns/index.d.ts @@ -0,0 +1,392 @@ +// Type definitions for Google Google Cloud DNS API v1 1.0 +// Project: https://developers.google.com/cloud-dns +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/dns/v1/rest + +/// + +declare namespace gapi.client { + /** Load Google Cloud DNS API v1 */ + function load(name: "dns", version: "v1"): PromiseLike; + function load(name: "dns", version: "v1", callback: () => any): void; + + const changes: dns.ChangesResource; + + const managedZones: dns.ManagedZonesResource; + + const projects: dns.ProjectsResource; + + const resourceRecordSets: dns.ResourceRecordSetsResource; + + namespace dns { + interface Change { + /** Which ResourceRecordSets to add? */ + additions?: ResourceRecordSet[]; + /** Which ResourceRecordSets to remove? Must match existing data exactly. */ + deletions?: ResourceRecordSet[]; + /** Unique identifier for the resource; defined by the server (output only). */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dns#change". */ + kind?: string; + /** The time that this operation was started by the server (output only). This is in RFC3339 text format. */ + startTime?: string; + /** Status of the operation (output only). */ + status?: string; + } + interface ChangesListResponse { + /** The requested changes. */ + changes?: Change[]; + /** Type of resource. */ + kind?: string; + /** + * The presence of this field indicates that there exist more results following your last page of results in pagination order. To fetch them, make another + * list request using this value as your pagination token. + * + * In this way you can retrieve the complete contents of even very large collections one page at a time. However, if the contents of the collection change + * between the first and last paginated list request, the set of all elements returned will be an inconsistent view of the collection. There is no way to + * retrieve a "snapshot" of collections larger than the maximum page size. + */ + nextPageToken?: string; + } + interface ManagedZone { + /** The time that this resource was created on the server. This is in RFC3339 text format. Output only. */ + creationTime?: string; + /** A mutable string of at most 1024 characters associated with this resource for the user's convenience. Has no effect on the managed zone's function. */ + description?: string; + /** The DNS name of this managed zone, for instance "example.com.". */ + dnsName?: string; + /** Unique identifier for the resource; defined by the server (output only) */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dns#managedZone". */ + kind?: string; + /** + * User assigned name for this resource. Must be unique within the project. The name must be 1-63 characters long, must begin with a letter, end with a + * letter or digit, and only contain lowercase letters, digits or dashes. + */ + name?: string; + /** + * Optionally specifies the NameServerSet for this ManagedZone. A NameServerSet is a set of DNS name servers that all host the same ManagedZones. Most + * users will leave this field unset. + */ + nameServerSet?: string; + /** Delegate your managed_zone to these virtual name servers; defined by the server (output only) */ + nameServers?: string[]; + } + interface ManagedZonesListResponse { + /** Type of resource. */ + kind?: string; + /** The managed zone resources. */ + managedZones?: ManagedZone[]; + /** + * The presence of this field indicates that there exist more results following your last page of results in pagination order. To fetch them, make another + * list request using this value as your page token. + * + * In this way you can retrieve the complete contents of even very large collections one page at a time. However, if the contents of the collection change + * between the first and last paginated list request, the set of all elements returned will be an inconsistent view of the collection. There is no way to + * retrieve a consistent snapshot of a collection larger than the maximum page size. + */ + nextPageToken?: string; + } + interface Project { + /** User assigned unique identifier for the resource (output only). */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "dns#project". */ + kind?: string; + /** Unique numeric identifier for the resource; defined by the server (output only). */ + number?: string; + /** Quotas assigned to this project (output only). */ + quota?: Quota; + } + interface Quota { + /** Identifies what kind of resource this is. Value: the fixed string "dns#quota". */ + kind?: string; + /** Maximum allowed number of managed zones in the project. */ + managedZones?: number; + /** Maximum allowed number of ResourceRecords per ResourceRecordSet. */ + resourceRecordsPerRrset?: number; + /** Maximum allowed number of ResourceRecordSets to add per ChangesCreateRequest. */ + rrsetAdditionsPerChange?: number; + /** Maximum allowed number of ResourceRecordSets to delete per ChangesCreateRequest. */ + rrsetDeletionsPerChange?: number; + /** Maximum allowed number of ResourceRecordSets per zone in the project. */ + rrsetsPerManagedZone?: number; + /** Maximum allowed size for total rrdata in one ChangesCreateRequest in bytes. */ + totalRrdataSizePerChange?: number; + } + interface ResourceRecordSet { + /** Identifies what kind of resource this is. Value: the fixed string "dns#resourceRecordSet". */ + kind?: string; + /** For example, www.example.com. */ + name?: string; + /** As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1). */ + rrdatas?: string[]; + /** Number of seconds that this ResourceRecordSet can be cached by resolvers. */ + ttl?: number; + /** The identifier of a supported record type, for example, A, AAAA, MX, TXT, and so on. */ + type?: string; + } + interface ResourceRecordSetsListResponse { + /** Type of resource. */ + kind?: string; + /** + * The presence of this field indicates that there exist more results following your last page of results in pagination order. To fetch them, make another + * list request using this value as your pagination token. + * + * In this way you can retrieve the complete contents of even very large collections one page at a time. However, if the contents of the collection change + * between the first and last paginated list request, the set of all elements returned will be an inconsistent view of the collection. There is no way to + * retrieve a consistent snapshot of a collection larger than the maximum page size. + */ + nextPageToken?: string; + /** The resource record set resources. */ + rrsets?: ResourceRecordSet[]; + } + interface ChangesResource { + /** Atomically update the ResourceRecordSet collection. */ + create(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Identifies the managed zone addressed by this request. Can be the managed zone name or id. */ + managedZone: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Identifies the project addressed by this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Fetch the representation of an existing Change. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The identifier of the requested change, from a previous ResourceRecordSetsChangeResponse. */ + changeId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Identifies the managed zone addressed by this request. Can be the managed zone name or id. */ + managedZone: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Identifies the project addressed by this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Enumerate Changes to a ResourceRecordSet collection. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Identifies the managed zone addressed by this request. Can be the managed zone name or id. */ + managedZone: string; + /** Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Identifies the project addressed by this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Sorting criterion. The only supported value is change sequence. */ + sortBy?: string; + /** Sorting order direction: 'ascending' or 'descending'. */ + sortOrder?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ManagedZonesResource { + /** Create a new ManagedZone. */ + create(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Identifies the project addressed by this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Delete a previously created ManagedZone. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Identifies the managed zone addressed by this request. Can be the managed zone name or id. */ + managedZone: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Identifies the project addressed by this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Fetch the representation of an existing ManagedZone. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Identifies the managed zone addressed by this request. Can be the managed zone name or id. */ + managedZone: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Identifies the project addressed by this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Enumerate ManagedZones that have been created but not yet deleted. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Restricts the list to return only zones with this domain name. */ + dnsName?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Identifies the project addressed by this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ProjectsResource { + /** Fetch the representation of an existing Project. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Identifies the project addressed by this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ResourceRecordSetsResource { + /** Enumerate ResourceRecordSets that have been created but not yet deleted. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Identifies the managed zone addressed by this request. Can be the managed zone name or id. */ + managedZone: string; + /** Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. */ + maxResults?: number; + /** Restricts the list to return only records with this fully qualified domain name. */ + name?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Identifies the project addressed by this request. */ + project: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Restricts the list to return only records of this type. If present, the "name" parameter must also be present. */ + type?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.dns/readme.md b/types/gapi.client.dns/readme.md new file mode 100644 index 0000000000..2f7171937e --- /dev/null +++ b/types/gapi.client.dns/readme.md @@ -0,0 +1,108 @@ +# TypeScript typings for Google Cloud DNS API v1 +Configures and serves authoritative DNS records. +For detailed description please check [documentation](https://developers.google.com/cloud-dns). + +## Installing + +Install typings for Google Cloud DNS API: +``` +npm install @types/gapi.client.dns@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('dns', 'v1', () => { + // now we can use gapi.client.dns + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform.read-only', + + // View your DNS records hosted by Google Cloud DNS + 'https://www.googleapis.com/auth/ndev.clouddns.readonly', + + // View and manage your DNS records hosted by Google Cloud DNS + 'https://www.googleapis.com/auth/ndev.clouddns.readwrite', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Cloud DNS API resources: + +```typescript + +/* +Atomically update the ResourceRecordSet collection. +*/ +await gapi.client.changes.create({ managedZone: "managedZone", project: "project", }); + +/* +Fetch the representation of an existing Change. +*/ +await gapi.client.changes.get({ changeId: "changeId", managedZone: "managedZone", project: "project", }); + +/* +Enumerate Changes to a ResourceRecordSet collection. +*/ +await gapi.client.changes.list({ managedZone: "managedZone", project: "project", }); + +/* +Create a new ManagedZone. +*/ +await gapi.client.managedZones.create({ project: "project", }); + +/* +Delete a previously created ManagedZone. +*/ +await gapi.client.managedZones.delete({ managedZone: "managedZone", project: "project", }); + +/* +Fetch the representation of an existing ManagedZone. +*/ +await gapi.client.managedZones.get({ managedZone: "managedZone", project: "project", }); + +/* +Enumerate ManagedZones that have been created but not yet deleted. +*/ +await gapi.client.managedZones.list({ project: "project", }); + +/* +Fetch the representation of an existing Project. +*/ +await gapi.client.projects.get({ project: "project", }); + +/* +Enumerate ResourceRecordSets that have been created but not yet deleted. +*/ +await gapi.client.resourceRecordSets.list({ managedZone: "managedZone", project: "project", }); +``` \ No newline at end of file diff --git a/types/gapi.client.dns/tsconfig.json b/types/gapi.client.dns/tsconfig.json new file mode 100644 index 0000000000..93f3858c6c --- /dev/null +++ b/types/gapi.client.dns/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.dns-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.dns/tslint.json b/types/gapi.client.dns/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.dns/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.doubleclickbidmanager/gapi.client.doubleclickbidmanager-tests.ts b/types/gapi.client.doubleclickbidmanager/gapi.client.doubleclickbidmanager-tests.ts new file mode 100644 index 0000000000..85dbaea986 --- /dev/null +++ b/types/gapi.client.doubleclickbidmanager/gapi.client.doubleclickbidmanager-tests.ts @@ -0,0 +1,63 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('doubleclickbidmanager', 'v1', () => { + /** now we can use gapi.client.doubleclickbidmanager */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your reports in DoubleClick Bid Manager */ + 'https://www.googleapis.com/auth/doubleclickbidmanager', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Retrieves line items in CSV format. */ + await gapi.client.lineitems.downloadlineitems({ + }); + /** Uploads line items in CSV format. */ + await gapi.client.lineitems.uploadlineitems({ + }); + /** Creates a query. */ + await gapi.client.queries.createquery({ + }); + /** Deletes a stored query as well as the associated stored reports. */ + await gapi.client.queries.deletequery({ + queryId: "queryId", + }); + /** Retrieves a stored query. */ + await gapi.client.queries.getquery({ + queryId: "queryId", + }); + /** Retrieves stored queries. */ + await gapi.client.queries.listqueries({ + }); + /** Runs a stored query to generate a report. */ + await gapi.client.queries.runquery({ + queryId: "queryId", + }); + /** Retrieves stored reports. */ + await gapi.client.reports.listreports({ + queryId: "queryId", + }); + /** Retrieves entities in SDF format. */ + await gapi.client.sdf.download({ + }); + } +}); diff --git a/types/gapi.client.doubleclickbidmanager/index.d.ts b/types/gapi.client.doubleclickbidmanager/index.d.ts new file mode 100644 index 0000000000..13274ff247 --- /dev/null +++ b/types/gapi.client.doubleclickbidmanager/index.d.ts @@ -0,0 +1,435 @@ +// Type definitions for Google DoubleClick Bid Manager API v1 1.0 +// Project: https://developers.google.com/bid-manager/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/doubleclickbidmanager/v1/rest + +/// + +declare namespace gapi.client { + /** Load DoubleClick Bid Manager API v1 */ + function load(name: "doubleclickbidmanager", version: "v1"): PromiseLike; + function load(name: "doubleclickbidmanager", version: "v1", callback: () => any): void; + + const lineitems: doubleclickbidmanager.LineitemsResource; + + const queries: doubleclickbidmanager.QueriesResource; + + const reports: doubleclickbidmanager.ReportsResource; + + const sdf: doubleclickbidmanager.SdfResource; + + namespace doubleclickbidmanager { + interface DownloadLineItemsRequest { + /** File specification (column names, types, order) in which the line items will be returned. Default to EWF. */ + fileSpec?: string; + /** Ids of the specified filter type used to filter line items to fetch. If omitted, all the line items will be returned. */ + filterIds?: string[]; + /** Filter type used to filter line items to fetch. */ + filterType?: string; + /** Format in which the line items will be returned. Default to CSV. */ + format?: string; + } + interface DownloadLineItemsResponse { + /** Retrieved line items in CSV format. For more information about file formats, see Entity Write File Format. */ + lineItems?: string; + } + interface DownloadRequest { + /** File types that will be returned. */ + fileTypes?: string[]; + /** + * The IDs of the specified filter type. This is used to filter entities to fetch. At least one ID must be specified. Only one ID is allowed for the + * ADVERTISER_ID filter type. For INSERTION_ORDER_ID or LINE_ITEM_ID filter types, all IDs must be from the same Advertiser. + */ + filterIds?: string[]; + /** Filter type used to filter line items to fetch. */ + filterType?: string; + /** SDF Version (column names, types, order) in which the entities will be returned. Default to 3. */ + version?: string; + } + interface DownloadResponse { + /** Retrieved ad groups in SDF format. */ + adGroups?: string; + /** Retrieved ads in SDF format. */ + ads?: string; + /** Retrieved insertion orders in SDF format. */ + insertionOrders?: string; + /** Retrieved line items in SDF format. */ + lineItems?: string; + } + interface FilterPair { + /** Filter type. */ + type?: string; + /** Filter value. */ + value?: string; + } + interface ListQueriesResponse { + /** Identifies what kind of resource this is. Value: the fixed string "doubleclickbidmanager#listQueriesResponse". */ + kind?: string; + /** Retrieved queries. */ + queries?: Query[]; + } + interface ListReportsResponse { + /** Identifies what kind of resource this is. Value: the fixed string "doubleclickbidmanager#listReportsResponse". */ + kind?: string; + /** Retrieved reports. */ + reports?: Report[]; + } + interface Parameters { + /** Filters used to match traffic data in your report. */ + filters?: FilterPair[]; + /** Data is grouped by the filters listed in this field. */ + groupBys?: string[]; + /** Whether to include data from Invite Media. */ + includeInviteData?: boolean; + /** Metrics to include as columns in your report. */ + metrics?: string[]; + /** Report type. */ + type?: string; + } + interface Query { + /** Identifies what kind of resource this is. Value: the fixed string "doubleclickbidmanager#query". */ + kind?: string; + /** Query metadata. */ + metadata?: QueryMetadata; + /** Query parameters. */ + params?: Parameters; + /** Query ID. */ + queryId?: string; + /** + * The ending time for the data that is shown in the report. Note, reportDataEndTimeMs is required if metadata.dataRange is CUSTOM_DATES and ignored + * otherwise. + */ + reportDataEndTimeMs?: string; + /** + * The starting time for the data that is shown in the report. Note, reportDataStartTimeMs is required if metadata.dataRange is CUSTOM_DATES and ignored + * otherwise. + */ + reportDataStartTimeMs?: string; + /** Information on how often and when to run a query. */ + schedule?: QuerySchedule; + /** Canonical timezone code for report data time. Defaults to America/New_York. */ + timezoneCode?: string; + } + interface QueryMetadata { + /** Range of report data. */ + dataRange?: string; + /** Format of the generated report. */ + format?: string; + /** The path to the location in Google Cloud Storage where the latest report is stored. */ + googleCloudStoragePathForLatestReport?: string; + /** The path in Google Drive for the latest report. */ + googleDrivePathForLatestReport?: string; + /** The time when the latest report started to run. */ + latestReportRunTimeMs?: string; + /** + * Locale of the generated reports. Valid values are cs CZECH de GERMAN en ENGLISH es SPANISH fr FRENCH it ITALIAN ja JAPANESE ko KOREAN pl POLISH pt-BR + * BRAZILIAN_PORTUGUESE ru RUSSIAN tr TURKISH uk UKRAINIAN zh-CN CHINA_CHINESE zh-TW TAIWAN_CHINESE + * + * An locale string not in the list above will generate reports in English. + */ + locale?: string; + /** Number of reports that have been generated for the query. */ + reportCount?: number; + /** Whether the latest report is currently running. */ + running?: boolean; + /** Whether to send an email notification when a report is ready. Default to false. */ + sendNotification?: boolean; + /** List of email addresses which are sent email notifications when the report is finished. Separate from sendNotification. */ + shareEmailAddress?: string[]; + /** Query title. It is used to name the reports generated from this query. */ + title?: string; + } + interface QuerySchedule { + /** Datetime to periodically run the query until. */ + endTimeMs?: string; + /** How often the query is run. */ + frequency?: string; + /** Time of day at which a new report will be generated, represented as minutes past midnight. Range is 0 to 1439. Only applies to scheduled reports. */ + nextRunMinuteOfDay?: number; + /** Canonical timezone code for report generation time. Defaults to America/New_York. */ + nextRunTimezoneCode?: string; + } + interface Report { + /** Key used to identify a report. */ + key?: ReportKey; + /** Report metadata. */ + metadata?: ReportMetadata; + /** Report parameters. */ + params?: Parameters; + } + interface ReportFailure { + /** Error code that shows why the report was not created. */ + errorCode?: string; + } + interface ReportKey { + /** Query ID. */ + queryId?: string; + /** Report ID. */ + reportId?: string; + } + interface ReportMetadata { + /** The path to the location in Google Cloud Storage where the report is stored. */ + googleCloudStoragePath?: string; + /** The ending time for the data that is shown in the report. */ + reportDataEndTimeMs?: string; + /** The starting time for the data that is shown in the report. */ + reportDataStartTimeMs?: string; + /** Report status. */ + status?: ReportStatus; + } + interface ReportStatus { + /** If the report failed, this records the cause. */ + failure?: ReportFailure; + /** The time when this report either completed successfully or failed. */ + finishTimeMs?: string; + /** The file type of the report. */ + format?: string; + /** The state of the report. */ + state?: string; + } + interface RowStatus { + /** Whether the stored entity is changed as a result of upload. */ + changed?: boolean; + /** Entity Id. */ + entityId?: string; + /** Entity name. */ + entityName?: string; + /** Reasons why the entity can't be uploaded. */ + errors?: string[]; + /** Whether the entity is persisted. */ + persisted?: boolean; + /** Row number. */ + rowNumber?: number; + } + interface RunQueryRequest { + /** Report data range used to generate the report. */ + dataRange?: string; + /** The ending time for the data that is shown in the report. Note, reportDataEndTimeMs is required if dataRange is CUSTOM_DATES and ignored otherwise. */ + reportDataEndTimeMs?: string; + /** The starting time for the data that is shown in the report. Note, reportDataStartTimeMs is required if dataRange is CUSTOM_DATES and ignored otherwise. */ + reportDataStartTimeMs?: string; + /** Canonical timezone code for report data time. Defaults to America/New_York. */ + timezoneCode?: string; + } + interface UploadLineItemsRequest { + /** Set to true to get upload status without actually persisting the line items. */ + dryRun?: boolean; + /** Format the line items are in. Default to CSV. */ + format?: string; + /** Line items in CSV to upload. Refer to Entity Write File Format for more information on file format. */ + lineItems?: string; + } + interface UploadLineItemsResponse { + /** Status of upload. */ + uploadStatus?: UploadStatus; + } + interface UploadStatus { + /** Reasons why upload can't be completed. */ + errors?: string[]; + /** Per-row upload status. */ + rowStatus?: RowStatus[]; + } + interface LineitemsResource { + /** Retrieves line items in CSV format. */ + downloadlineitems(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Uploads line items in CSV format. */ + uploadlineitems(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface QueriesResource { + /** Creates a query. */ + createquery(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes a stored query as well as the associated stored reports. */ + deletequery(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Query ID to delete. */ + queryId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a stored query. */ + getquery(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Query ID to retrieve. */ + queryId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves stored queries. */ + listqueries(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Runs a stored query to generate a report. */ + runquery(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Query ID to run. */ + queryId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ReportsResource { + /** Retrieves stored reports. */ + listreports(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Query ID with which the reports are associated. */ + queryId: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SdfResource { + /** Retrieves entities in SDF format. */ + download(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.doubleclickbidmanager/readme.md b/types/gapi.client.doubleclickbidmanager/readme.md new file mode 100644 index 0000000000..cdb82d9f8f --- /dev/null +++ b/types/gapi.client.doubleclickbidmanager/readme.md @@ -0,0 +1,99 @@ +# TypeScript typings for DoubleClick Bid Manager API v1 +API for viewing and managing your reports in DoubleClick Bid Manager. +For detailed description please check [documentation](https://developers.google.com/bid-manager/). + +## Installing + +Install typings for DoubleClick Bid Manager API: +``` +npm install @types/gapi.client.doubleclickbidmanager@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('doubleclickbidmanager', 'v1', () => { + // now we can use gapi.client.doubleclickbidmanager + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your reports in DoubleClick Bid Manager + 'https://www.googleapis.com/auth/doubleclickbidmanager', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use DoubleClick Bid Manager API resources: + +```typescript + +/* +Retrieves line items in CSV format. +*/ +await gapi.client.lineitems.downloadlineitems({ }); + +/* +Uploads line items in CSV format. +*/ +await gapi.client.lineitems.uploadlineitems({ }); + +/* +Creates a query. +*/ +await gapi.client.queries.createquery({ }); + +/* +Deletes a stored query as well as the associated stored reports. +*/ +await gapi.client.queries.deletequery({ queryId: "queryId", }); + +/* +Retrieves a stored query. +*/ +await gapi.client.queries.getquery({ queryId: "queryId", }); + +/* +Retrieves stored queries. +*/ +await gapi.client.queries.listqueries({ }); + +/* +Runs a stored query to generate a report. +*/ +await gapi.client.queries.runquery({ queryId: "queryId", }); + +/* +Retrieves stored reports. +*/ +await gapi.client.reports.listreports({ queryId: "queryId", }); + +/* +Retrieves entities in SDF format. +*/ +await gapi.client.sdf.download({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.doubleclickbidmanager/tsconfig.json b/types/gapi.client.doubleclickbidmanager/tsconfig.json new file mode 100644 index 0000000000..1e00b8c904 --- /dev/null +++ b/types/gapi.client.doubleclickbidmanager/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.doubleclickbidmanager-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.doubleclickbidmanager/tslint.json b/types/gapi.client.doubleclickbidmanager/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.doubleclickbidmanager/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.doubleclicksearch/gapi.client.doubleclicksearch-tests.ts b/types/gapi.client.doubleclicksearch/gapi.client.doubleclicksearch-tests.ts new file mode 100644 index 0000000000..14dc6b1fb6 --- /dev/null +++ b/types/gapi.client.doubleclicksearch/gapi.client.doubleclicksearch-tests.ts @@ -0,0 +1,85 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('doubleclicksearch', 'v2', () => { + /** now we can use gapi.client.doubleclicksearch */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your advertising data in DoubleClick Search */ + 'https://www.googleapis.com/auth/doubleclicksearch', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Retrieves a list of conversions from a DoubleClick Search engine account. */ + await gapi.client.conversion.get({ + adGroupId: "adGroupId", + adId: "adId", + advertiserId: "advertiserId", + agencyId: "agencyId", + campaignId: "campaignId", + criterionId: "criterionId", + endDate: 7, + engineAccountId: "engineAccountId", + rowCount: 9, + startDate: 10, + startRow: 11, + }); + /** Inserts a batch of new conversions into DoubleClick Search. */ + await gapi.client.conversion.insert({ + }); + /** Updates a batch of conversions in DoubleClick Search. This method supports patch semantics. */ + await gapi.client.conversion.patch({ + advertiserId: "advertiserId", + agencyId: "agencyId", + endDate: 3, + engineAccountId: "engineAccountId", + rowCount: 5, + startDate: 6, + startRow: 7, + }); + /** Updates a batch of conversions in DoubleClick Search. */ + await gapi.client.conversion.update({ + }); + /** Updates the availabilities of a batch of floodlight activities in DoubleClick Search. */ + await gapi.client.conversion.updateAvailability({ + }); + /** Generates and returns a report immediately. */ + await gapi.client.reports.generate({ + }); + /** Polls for the status of a report request. */ + await gapi.client.reports.get({ + reportId: "reportId", + }); + /** Downloads a report file encoded in UTF-8. */ + await gapi.client.reports.getFile({ + reportFragment: 1, + reportId: "reportId", + }); + /** Inserts a report request into the reporting system. */ + await gapi.client.reports.request({ + }); + /** Retrieve the list of saved columns for a specified advertiser. */ + await gapi.client.savedColumns.list({ + advertiserId: "advertiserId", + agencyId: "agencyId", + }); + } +}); diff --git a/types/gapi.client.doubleclicksearch/index.d.ts b/types/gapi.client.doubleclicksearch/index.d.ts new file mode 100644 index 0000000000..f1e0a69436 --- /dev/null +++ b/types/gapi.client.doubleclicksearch/index.d.ts @@ -0,0 +1,578 @@ +// Type definitions for Google DoubleClick Search API v2 2.0 +// Project: https://developers.google.com/doubleclick-search/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/doubleclicksearch/v2/rest + +/// + +declare namespace gapi.client { + /** Load DoubleClick Search API v2 */ + function load(name: "doubleclicksearch", version: "v2"): PromiseLike; + function load(name: "doubleclicksearch", version: "v2", callback: () => any): void; + + const conversion: doubleclicksearch.ConversionResource; + + const reports: doubleclicksearch.ReportsResource; + + const savedColumns: doubleclicksearch.SavedColumnsResource; + + namespace doubleclicksearch { + interface Availability { + /** DS advertiser ID. */ + advertiserId?: string; + /** DS agency ID. */ + agencyId?: string; + /** The time by which all conversions have been uploaded, in epoch millis UTC. */ + availabilityTimestamp?: string; + /** The numeric segmentation identifier (for example, DoubleClick Search Floodlight activity ID). */ + segmentationId?: string; + /** The friendly segmentation identifier (for example, DoubleClick Search Floodlight activity name). */ + segmentationName?: string; + /** The segmentation type that this availability is for (its default value is FLOODLIGHT). */ + segmentationType?: string; + } + interface Conversion { + /** DS ad group ID. */ + adGroupId?: string; + /** DS ad ID. */ + adId?: string; + /** DS advertiser ID. */ + advertiserId?: string; + /** DS agency ID. */ + agencyId?: string; + /** Available to advertisers only after contacting DoubleClick Search customer support. */ + attributionModel?: string; + /** DS campaign ID. */ + campaignId?: string; + /** + * Sales channel for the product. Acceptable values are: + * - "local": a physical store + * - "online": an online store + */ + channel?: string; + /** DS click ID for the conversion. */ + clickId?: string; + /** + * For offline conversions, advertisers provide this ID. Advertisers can specify any ID that is meaningful to them. Each conversion in a request must + * specify a unique ID, and the combination of ID and timestamp must be unique amongst all conversions within the advertiser. + * For online conversions, DS copies the dsConversionId or floodlightOrderId into this property depending on the advertiser's Floodlight instructions. + */ + conversionId?: string; + /** The time at which the conversion was last modified, in epoch millis UTC. */ + conversionModifiedTimestamp?: string; + /** The time at which the conversion took place, in epoch millis UTC. */ + conversionTimestamp?: string; + /** Available to advertisers only after contacting DoubleClick Search customer support. */ + countMillis?: string; + /** DS criterion (keyword) ID. */ + criterionId?: string; + /** The currency code for the conversion's revenue. Should be in ISO 4217 alphabetic (3-char) format. */ + currencyCode?: string; + /** Custom dimensions for the conversion, which can be used to filter data in a report. */ + customDimension?: CustomDimension[]; + /** Custom metrics for the conversion. */ + customMetric?: CustomMetric[]; + /** The type of device on which the conversion occurred. */ + deviceType?: string; + /** ID that DoubleClick Search generates for each conversion. */ + dsConversionId?: string; + /** DS engine account ID. */ + engineAccountId?: string; + /** The Floodlight order ID provided by the advertiser for the conversion. */ + floodlightOrderId?: string; + /** ID that DS generates and uses to uniquely identify the inventory account that contains the product. */ + inventoryAccountId?: string; + /** The country registered for the Merchant Center feed that contains the product. Use an ISO 3166 code to specify a country. */ + productCountry?: string; + /** DS product group ID. */ + productGroupId?: string; + /** The product ID (SKU). */ + productId?: string; + /** The language registered for the Merchant Center feed that contains the product. Use an ISO 639 code to specify a language. */ + productLanguage?: string; + /** The quantity of this conversion, in millis. */ + quantityMillis?: string; + /** + * The revenue amount of this TRANSACTION conversion, in micros (value multiplied by 1000000, no decimal). For example, to specify a revenue value of "10" + * enter "10000000" (10 million) in your request. + */ + revenueMicros?: string; + /** The numeric segmentation identifier (for example, DoubleClick Search Floodlight activity ID). */ + segmentationId?: string; + /** The friendly segmentation identifier (for example, DoubleClick Search Floodlight activity name). */ + segmentationName?: string; + /** The segmentation type of this conversion (for example, FLOODLIGHT). */ + segmentationType?: string; + /** The state of the conversion, that is, either ACTIVE or REMOVED. Note: state DELETED is deprecated. */ + state?: string; + /** The ID of the local store for which the product was advertised. Applicable only when the channel is "local". */ + storeId?: string; + /** + * The type of the conversion, that is, either ACTION or TRANSACTION. An ACTION conversion is an action by the user that has no monetarily quantifiable + * value, while a TRANSACTION conversion is an action that does have a monetarily quantifiable value. Examples are email list signups (ACTION) versus + * ecommerce purchases (TRANSACTION). + */ + type?: string; + } + interface ConversionList { + /** The conversions being requested. */ + conversion?: Conversion[]; + /** Identifies this as a ConversionList resource. Value: the fixed string doubleclicksearch#conversionList. */ + kind?: string; + } + interface CustomDimension { + /** Custom dimension name. */ + name?: string; + /** Custom dimension value. */ + value?: string; + } + interface CustomMetric { + /** Custom metric name. */ + name?: string; + /** Custom metric numeric value. */ + value?: number; + } + interface Report { + /** Asynchronous report only. Contains a list of generated report files once the report has succesfully completed. */ + files?: Array<{ + /** The size of this report file in bytes. */ + byteCount?: string; + /** Use this url to download the report file. */ + url?: string; + }>; + /** Asynchronous report only. Id of the report. */ + id?: string; + /** Asynchronous report only. True if and only if the report has completed successfully and the report files are ready to be downloaded. */ + isReportReady?: boolean; + /** Identifies this as a Report resource. Value: the fixed string doubleclicksearch#report. */ + kind?: string; + /** The request that created the report. Optional fields not specified in the original request are filled with default values. */ + request?: ReportRequest; + /** The number of report rows generated by the report, not including headers. */ + rowCount?: number; + /** Synchronous report only. Generated report rows. */ + rows?: ReportRow[]; + /** + * The currency code of all monetary values produced in the report, including values that are set by users (e.g., keyword bid settings) and metrics (e.g., + * cost and revenue). The currency code of a report is determined by the statisticsCurrency field of the report request. + */ + statisticsCurrencyCode?: string; + /** If all statistics of the report are sourced from the same time zone, this would be it. Otherwise the field is unset. */ + statisticsTimeZone?: string; + } + interface ReportApiColumnSpec { + /** Name of a DoubleClick Search column to include in the report. */ + columnName?: string; + /** + * Segments a report by a custom dimension. The report must be scoped to an advertiser or lower, and the custom dimension must already be set up in + * DoubleClick Search. The custom dimension name, which appears in DoubleClick Search, is case sensitive. + * If used in a conversion report, returns the value of the specified custom dimension for the given conversion, if set. This column does not segment the + * conversion report. + */ + customDimensionName?: string; + /** + * Name of a custom metric to include in the report. The report must be scoped to an advertiser or lower, and the custom metric must already be set up in + * DoubleClick Search. The custom metric name, which appears in DoubleClick Search, is case sensitive. + */ + customMetricName?: string; + /** + * Inclusive day in YYYY-MM-DD format. When provided, this overrides the overall time range of the report for this column only. Must be provided together + * with startDate. + */ + endDate?: string; + /** Synchronous report only. Set to true to group by this column. Defaults to false. */ + groupByColumn?: boolean; + /** + * Text used to identify this column in the report output; defaults to columnName or savedColumnName when not specified. This can be used to prevent + * collisions between DoubleClick Search columns and saved columns with the same name. + */ + headerText?: string; + /** The platform that is used to provide data for the custom dimension. Acceptable values are "floodlight". */ + platformSource?: string; + /** + * Returns metrics only for a specific type of product activity. Accepted values are: + * - "sold": returns metrics only for products that were sold + * - "advertised": returns metrics only for products that were advertised in a Shopping campaign, and that might or might not have been sold + */ + productReportPerspective?: string; + /** + * Name of a saved column to include in the report. The report must be scoped at advertiser or lower, and this saved column must already be created in the + * DoubleClick Search UI. + */ + savedColumnName?: string; + /** + * Inclusive date in YYYY-MM-DD format. When provided, this overrides the overall time range of the report for this column only. Must be provided together + * with endDate. + */ + startDate?: string; + } + interface ReportRequest { + /** + * The columns to include in the report. This includes both DoubleClick Search columns and saved columns. For DoubleClick Search columns, only the + * columnName parameter is required. For saved columns only the savedColumnName parameter is required. Both columnName and savedColumnName cannot be set + * in the same stanza. + */ + columns?: ReportApiColumnSpec[]; + /** Format that the report should be returned in. Currently csv or tsv is supported. */ + downloadFormat?: string; + /** A list of filters to be applied to the report. */ + filters?: Array<{ + /** Column to perform the filter on. This can be a DoubleClick Search column or a saved column. */ + column?: ReportApiColumnSpec; + /** Operator to use in the filter. See the filter reference for a list of available operators. */ + operator?: string; + /** A list of values to filter the column value against. */ + values?: any[]; + }>; + /** Determines if removed entities should be included in the report. Defaults to false. Deprecated, please use includeRemovedEntities instead. */ + includeDeletedEntities?: boolean; + /** Determines if removed entities should be included in the report. Defaults to false. */ + includeRemovedEntities?: boolean; + /** + * Asynchronous report only. The maximum number of rows per report file. A large report is split into many files based on this field. Acceptable values + * are 1000000 to 100000000, inclusive. + */ + maxRowsPerFile?: number; + /** Synchronous report only. A list of columns and directions defining sorting to be performed on the report rows. */ + orderBy?: Array<{ + /** Column to perform the sort on. This can be a DoubleClick Search-defined column or a saved column. */ + column?: ReportApiColumnSpec; + /** The sort direction, which is either ascending or descending. */ + sortOrder?: string; + }>; + /** + * The reportScope is a set of IDs that are used to determine which subset of entities will be returned in the report. The full lineage of IDs from the + * lowest scoped level desired up through agency is required. + */ + reportScope?: { + /** DS ad group ID. */ + adGroupId?: string; + /** DS ad ID. */ + adId?: string; + /** DS advertiser ID. */ + advertiserId?: string; + /** DS agency ID. */ + agencyId?: string; + /** DS campaign ID. */ + campaignId?: string; + /** DS engine account ID. */ + engineAccountId?: string; + /** DS keyword ID. */ + keywordId?: string; + }; + /** + * Determines the type of rows that are returned in the report. For example, if you specify reportType: keyword, each row in the report will contain data + * about a keyword. See the Types of Reports reference for the columns that are available for each type. + */ + reportType?: string; + /** + * Synchronous report only. The maxinum number of rows to return; additional rows are dropped. Acceptable values are 0 to 10000, inclusive. Defaults to + * 10000. + */ + rowCount?: number; + /** Synchronous report only. Zero-based index of the first row to return. Acceptable values are 0 to 50000, inclusive. Defaults to 0. */ + startRow?: number; + /** + * Specifies the currency in which monetary will be returned. Possible values are: usd, agency (valid if the report is scoped to agency or lower), + * advertiser (valid if the report is scoped to * advertiser or lower), or account (valid if the report is scoped to engine account or lower). + */ + statisticsCurrency?: string; + /** If metrics are requested in a report, this argument will be used to restrict the metrics to a specific time range. */ + timeRange?: { + /** Inclusive UTC timestamp in RFC format, e.g., 2013-07-16T10:16:23.555Z. See additional references on how changed attribute reports work. */ + changedAttributesSinceTimestamp?: string; + /** Inclusive UTC timestamp in RFC format, e.g., 2013-07-16T10:16:23.555Z. See additional references on how changed metrics reports work. */ + changedMetricsSinceTimestamp?: string; + /** Inclusive date in YYYY-MM-DD format. */ + endDate?: string; + /** Inclusive date in YYYY-MM-DD format. */ + startDate?: string; + }; + /** If true, the report would only be created if all the requested stat data are sourced from a single timezone. Defaults to false. */ + verifySingleTimeZone?: boolean; + } + interface ReportRow { + [key: string]: any; + } + interface SavedColumn { + /** Identifies this as a SavedColumn resource. Value: the fixed string doubleclicksearch#savedColumn. */ + kind?: string; + /** The name of the saved column. */ + savedColumnName?: string; + /** The type of data this saved column will produce. */ + type?: string; + } + interface SavedColumnList { + /** The saved columns being requested. */ + items?: SavedColumn[]; + /** Identifies this as a SavedColumnList resource. Value: the fixed string doubleclicksearch#savedColumnList. */ + kind?: string; + } + interface UpdateAvailabilityRequest { + /** The availabilities being requested. */ + availabilities?: Availability[]; + } + interface UpdateAvailabilityResponse { + /** The availabilities being returned. */ + availabilities?: Availability[]; + } + interface ConversionResource { + /** Retrieves a list of conversions from a DoubleClick Search engine account. */ + get(request: { + /** Numeric ID of the ad group. */ + adGroupId?: string; + /** Numeric ID of the ad. */ + adId?: string; + /** Numeric ID of the advertiser. */ + advertiserId: string; + /** Numeric ID of the agency. */ + agencyId: string; + /** Data format for the response. */ + alt?: string; + /** Numeric ID of the campaign. */ + campaignId?: string; + /** Numeric ID of the criterion. */ + criterionId?: string; + /** Last date (inclusive) on which to retrieve conversions. Format is yyyymmdd. */ + endDate: number; + /** Numeric ID of the engine account. */ + engineAccountId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The number of conversions to return per call. */ + rowCount: number; + /** First date (inclusive) on which to retrieve conversions. Format is yyyymmdd. */ + startDate: number; + /** The 0-based starting index for retrieving conversions results. */ + startRow: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a batch of new conversions into DoubleClick Search. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a batch of conversions in DoubleClick Search. This method supports patch semantics. */ + patch(request: { + /** Numeric ID of the advertiser. */ + advertiserId: string; + /** Numeric ID of the agency. */ + agencyId: string; + /** Data format for the response. */ + alt?: string; + /** Last date (inclusive) on which to retrieve conversions. Format is yyyymmdd. */ + endDate: number; + /** Numeric ID of the engine account. */ + engineAccountId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The number of conversions to return per call. */ + rowCount: number; + /** First date (inclusive) on which to retrieve conversions. Format is yyyymmdd. */ + startDate: number; + /** The 0-based starting index for retrieving conversions results. */ + startRow: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a batch of conversions in DoubleClick Search. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the availabilities of a batch of floodlight activities in DoubleClick Search. */ + updateAvailability(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ReportsResource { + /** Generates and returns a report immediately. */ + generate(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Polls for the status of a report request. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ID of the report request being polled. */ + reportId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Downloads a report file encoded in UTF-8. */ + getFile(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The index of the report fragment to download. */ + reportFragment: number; + /** ID of the report. */ + reportId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Inserts a report request into the reporting system. */ + request(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SavedColumnsResource { + /** Retrieve the list of saved columns for a specified advertiser. */ + list(request: { + /** DS ID of the advertiser. */ + advertiserId: string; + /** DS ID of the agency. */ + agencyId: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.doubleclicksearch/readme.md b/types/gapi.client.doubleclicksearch/readme.md new file mode 100644 index 0000000000..5889f83d22 --- /dev/null +++ b/types/gapi.client.doubleclicksearch/readme.md @@ -0,0 +1,104 @@ +# TypeScript typings for DoubleClick Search API v2 +Reports and modifies your advertising data in DoubleClick Search (for example, campaigns, ad groups, keywords, and conversions). +For detailed description please check [documentation](https://developers.google.com/doubleclick-search/). + +## Installing + +Install typings for DoubleClick Search API: +``` +npm install @types/gapi.client.doubleclicksearch@v2 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('doubleclicksearch', 'v2', () => { + // now we can use gapi.client.doubleclicksearch + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your advertising data in DoubleClick Search + 'https://www.googleapis.com/auth/doubleclicksearch', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use DoubleClick Search API resources: + +```typescript + +/* +Retrieves a list of conversions from a DoubleClick Search engine account. +*/ +await gapi.client.conversion.get({ advertiserId: "advertiserId", agencyId: "agencyId", endDate: 1, engineAccountId: "engineAccountId", rowCount: 1, startDate: 1, startRow: 1, }); + +/* +Inserts a batch of new conversions into DoubleClick Search. +*/ +await gapi.client.conversion.insert({ }); + +/* +Updates a batch of conversions in DoubleClick Search. This method supports patch semantics. +*/ +await gapi.client.conversion.patch({ advertiserId: "advertiserId", agencyId: "agencyId", endDate: 1, engineAccountId: "engineAccountId", rowCount: 1, startDate: 1, startRow: 1, }); + +/* +Updates a batch of conversions in DoubleClick Search. +*/ +await gapi.client.conversion.update({ }); + +/* +Updates the availabilities of a batch of floodlight activities in DoubleClick Search. +*/ +await gapi.client.conversion.updateAvailability({ }); + +/* +Generates and returns a report immediately. +*/ +await gapi.client.reports.generate({ }); + +/* +Polls for the status of a report request. +*/ +await gapi.client.reports.get({ reportId: "reportId", }); + +/* +Downloads a report file encoded in UTF-8. +*/ +await gapi.client.reports.getFile({ reportFragment: 1, reportId: "reportId", }); + +/* +Inserts a report request into the reporting system. +*/ +await gapi.client.reports.request({ }); + +/* +Retrieve the list of saved columns for a specified advertiser. +*/ +await gapi.client.savedColumns.list({ advertiserId: "advertiserId", agencyId: "agencyId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.doubleclicksearch/tsconfig.json b/types/gapi.client.doubleclicksearch/tsconfig.json new file mode 100644 index 0000000000..fb0d0a44bd --- /dev/null +++ b/types/gapi.client.doubleclicksearch/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.doubleclicksearch-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.doubleclicksearch/tslint.json b/types/gapi.client.doubleclicksearch/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.doubleclicksearch/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.drive/gapi.client.drive-tests.ts b/types/gapi.client.drive/gapi.client.drive-tests.ts new file mode 100644 index 0000000000..f9fa0ce332 --- /dev/null +++ b/types/gapi.client.drive/gapi.client.drive-tests.ts @@ -0,0 +1,291 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('drive', 'v3', () => { + /** now we can use gapi.client.drive */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage the files in your Google Drive */ + 'https://www.googleapis.com/auth/drive', + /** View and manage its own configuration data in your Google Drive */ + 'https://www.googleapis.com/auth/drive.appdata', + /** View and manage Google Drive files and folders that you have opened or created with this app */ + 'https://www.googleapis.com/auth/drive.file', + /** View and manage metadata of files in your Google Drive */ + 'https://www.googleapis.com/auth/drive.metadata', + /** View metadata for files in your Google Drive */ + 'https://www.googleapis.com/auth/drive.metadata.readonly', + /** View the photos, videos and albums in your Google Photos */ + 'https://www.googleapis.com/auth/drive.photos.readonly', + /** View the files in your Google Drive */ + 'https://www.googleapis.com/auth/drive.readonly', + /** Modify your Google Apps Script scripts' behavior */ + 'https://www.googleapis.com/auth/drive.scripts', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Gets information about the user, the user's Drive, and system capabilities. */ + await gapi.client.about.get({ + }); + /** Gets the starting pageToken for listing future changes. */ + await gapi.client.changes.getStartPageToken({ + supportsTeamDrives: true, + teamDriveId: "teamDriveId", + }); + /** Lists the changes for a user or Team Drive. */ + await gapi.client.changes.list({ + includeCorpusRemovals: true, + includeRemoved: true, + includeTeamDriveItems: true, + pageSize: 4, + pageToken: "pageToken", + restrictToMyDrive: true, + spaces: "spaces", + supportsTeamDrives: true, + teamDriveId: "teamDriveId", + }); + /** Subscribes to changes for a user. */ + await gapi.client.changes.watch({ + includeCorpusRemovals: true, + includeRemoved: true, + includeTeamDriveItems: true, + pageSize: 4, + pageToken: "pageToken", + restrictToMyDrive: true, + spaces: "spaces", + supportsTeamDrives: true, + teamDriveId: "teamDriveId", + }); + /** Stop watching resources through this channel */ + await gapi.client.channels.stop({ + }); + /** Creates a new comment on a file. */ + await gapi.client.comments.create({ + fileId: "fileId", + }); + /** Deletes a comment. */ + await gapi.client.comments.delete({ + commentId: "commentId", + fileId: "fileId", + }); + /** Gets a comment by ID. */ + await gapi.client.comments.get({ + commentId: "commentId", + fileId: "fileId", + includeDeleted: true, + }); + /** Lists a file's comments. */ + await gapi.client.comments.list({ + fileId: "fileId", + includeDeleted: true, + pageSize: 3, + pageToken: "pageToken", + startModifiedTime: "startModifiedTime", + }); + /** Updates a comment with patch semantics. */ + await gapi.client.comments.update({ + commentId: "commentId", + fileId: "fileId", + }); + /** Creates a copy of a file and applies any requested updates with patch semantics. */ + await gapi.client.files.copy({ + fileId: "fileId", + ignoreDefaultVisibility: true, + keepRevisionForever: true, + ocrLanguage: "ocrLanguage", + supportsTeamDrives: true, + }); + /** Creates a new file. */ + await gapi.client.files.create({ + ignoreDefaultVisibility: true, + keepRevisionForever: true, + ocrLanguage: "ocrLanguage", + supportsTeamDrives: true, + useContentAsIndexableText: true, + }); + /** + * Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a Team Drive the user must be an organizer on the + * parent. If the target is a folder, all descendants owned by the user are also deleted. + */ + await gapi.client.files.delete({ + fileId: "fileId", + supportsTeamDrives: true, + }); + /** Permanently deletes all of the user's trashed files. */ + await gapi.client.files.emptyTrash({ + }); + /** Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB. */ + await gapi.client.files.export({ + fileId: "fileId", + mimeType: "mimeType", + }); + /** Generates a set of file IDs which can be provided in create requests. */ + await gapi.client.files.generateIds({ + count: 1, + space: "space", + }); + /** Gets a file's metadata or content by ID. */ + await gapi.client.files.get({ + acknowledgeAbuse: true, + fileId: "fileId", + supportsTeamDrives: true, + }); + /** Lists or searches files. */ + await gapi.client.files.list({ + corpora: "corpora", + corpus: "corpus", + includeTeamDriveItems: true, + orderBy: "orderBy", + pageSize: 5, + pageToken: "pageToken", + q: "q", + spaces: "spaces", + supportsTeamDrives: true, + teamDriveId: "teamDriveId", + }); + /** Updates a file's metadata and/or content with patch semantics. */ + await gapi.client.files.update({ + addParents: "addParents", + fileId: "fileId", + keepRevisionForever: true, + ocrLanguage: "ocrLanguage", + removeParents: "removeParents", + supportsTeamDrives: true, + useContentAsIndexableText: true, + }); + /** Subscribes to changes to a file */ + await gapi.client.files.watch({ + acknowledgeAbuse: true, + fileId: "fileId", + supportsTeamDrives: true, + }); + /** Creates a permission for a file or Team Drive. */ + await gapi.client.permissions.create({ + emailMessage: "emailMessage", + fileId: "fileId", + sendNotificationEmail: true, + supportsTeamDrives: true, + transferOwnership: true, + }); + /** Deletes a permission. */ + await gapi.client.permissions.delete({ + fileId: "fileId", + permissionId: "permissionId", + supportsTeamDrives: true, + }); + /** Gets a permission by ID. */ + await gapi.client.permissions.get({ + fileId: "fileId", + permissionId: "permissionId", + supportsTeamDrives: true, + }); + /** Lists a file's or Team Drive's permissions. */ + await gapi.client.permissions.list({ + fileId: "fileId", + pageSize: 2, + pageToken: "pageToken", + supportsTeamDrives: true, + }); + /** Updates a permission with patch semantics. */ + await gapi.client.permissions.update({ + fileId: "fileId", + permissionId: "permissionId", + removeExpiration: true, + supportsTeamDrives: true, + transferOwnership: true, + }); + /** Creates a new reply to a comment. */ + await gapi.client.replies.create({ + commentId: "commentId", + fileId: "fileId", + }); + /** Deletes a reply. */ + await gapi.client.replies.delete({ + commentId: "commentId", + fileId: "fileId", + replyId: "replyId", + }); + /** Gets a reply by ID. */ + await gapi.client.replies.get({ + commentId: "commentId", + fileId: "fileId", + includeDeleted: true, + replyId: "replyId", + }); + /** Lists a comment's replies. */ + await gapi.client.replies.list({ + commentId: "commentId", + fileId: "fileId", + includeDeleted: true, + pageSize: 4, + pageToken: "pageToken", + }); + /** Updates a reply with patch semantics. */ + await gapi.client.replies.update({ + commentId: "commentId", + fileId: "fileId", + replyId: "replyId", + }); + /** Permanently deletes a revision. This method is only applicable to files with binary content in Drive. */ + await gapi.client.revisions.delete({ + fileId: "fileId", + revisionId: "revisionId", + }); + /** Gets a revision's metadata or content by ID. */ + await gapi.client.revisions.get({ + acknowledgeAbuse: true, + fileId: "fileId", + revisionId: "revisionId", + }); + /** Lists a file's revisions. */ + await gapi.client.revisions.list({ + fileId: "fileId", + pageSize: 2, + pageToken: "pageToken", + }); + /** Updates a revision with patch semantics. */ + await gapi.client.revisions.update({ + fileId: "fileId", + revisionId: "revisionId", + }); + /** Creates a new Team Drive. */ + await gapi.client.teamdrives.create({ + requestId: "requestId", + }); + /** Permanently deletes a Team Drive for which the user is an organizer. The Team Drive cannot contain any untrashed items. */ + await gapi.client.teamdrives.delete({ + teamDriveId: "teamDriveId", + }); + /** Gets a Team Drive's metadata by ID. */ + await gapi.client.teamdrives.get({ + teamDriveId: "teamDriveId", + }); + /** Lists the user's Team Drives. */ + await gapi.client.teamdrives.list({ + pageSize: 1, + pageToken: "pageToken", + }); + /** Updates a Team Drive's metadata */ + await gapi.client.teamdrives.update({ + teamDriveId: "teamDriveId", + }); + } +}); diff --git a/types/gapi.client.drive/index.d.ts b/types/gapi.client.drive/index.d.ts new file mode 100644 index 0000000000..7004e2c0bb --- /dev/null +++ b/types/gapi.client.drive/index.d.ts @@ -0,0 +1,1831 @@ +// Type definitions for Google Drive API v3 3.0 +// Project: https://developers.google.com/drive/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/drive/v3/rest + +/// + +declare namespace gapi.client { + /** Load Drive API v3 */ + function load(name: "drive", version: "v3"): PromiseLike; + function load(name: "drive", version: "v3", callback: () => any): void; + + const about: drive.AboutResource; + + const changes: drive.ChangesResource; + + const channels: drive.ChannelsResource; + + const comments: drive.CommentsResource; + + const files: drive.FilesResource; + + const permissions: drive.PermissionsResource; + + const replies: drive.RepliesResource; + + const revisions: drive.RevisionsResource; + + const teamdrives: drive.TeamdrivesResource; + + namespace drive { + interface About { + /** Whether the user has installed the requesting app. */ + appInstalled?: boolean; + /** A map of source MIME type to possible targets for all supported exports. */ + exportFormats?: Record; + /** The currently supported folder colors as RGB hex strings. */ + folderColorPalette?: string[]; + /** A map of source MIME type to possible targets for all supported imports. */ + importFormats?: Record; + /** Identifies what kind of resource this is. Value: the fixed string "drive#about". */ + kind?: string; + /** A map of maximum import sizes by MIME type, in bytes. */ + maxImportSizes?: Record; + /** The maximum upload size in bytes. */ + maxUploadSize?: string; + /** The user's storage quota limits and usage. All fields are measured in bytes. */ + storageQuota?: { + /** The usage limit, if applicable. This will not be present if the user has unlimited storage. */ + limit?: string; + /** The total usage across all services. */ + usage?: string; + /** The usage by all files in Google Drive. */ + usageInDrive?: string; + /** The usage by trashed files in Google Drive. */ + usageInDriveTrash?: string; + }; + /** A list of themes that are supported for Team Drives. */ + teamDriveThemes?: Array<{ + /** A link to this Team Drive theme's background image. */ + backgroundImageLink?: string; + /** The color of this Team Drive theme as an RGB hex string. */ + colorRgb?: string; + /** The ID of the theme. */ + id?: string; + }>; + /** The authenticated user. */ + user?: User; + } + interface Change { + /** The updated state of the file. Present if the type is file and the file has not been removed from this list of changes. */ + file?: File; + /** The ID of the file which has changed. */ + fileId?: string; + /** Identifies what kind of resource this is. Value: the fixed string "drive#change". */ + kind?: string; + /** Whether the file or Team Drive has been removed from this list of changes, for example by deletion or loss of access. */ + removed?: boolean; + /** + * The updated state of the Team Drive. Present if the type is teamDrive, the user is still a member of the Team Drive, and the Team Drive has not been + * removed. + */ + teamDrive?: TeamDrive; + /** The ID of the Team Drive associated with this change. */ + teamDriveId?: string; + /** The time of this change (RFC 3339 date-time). */ + time?: string; + /** The type of the change. Possible values are file and teamDrive. */ + type?: string; + } + interface ChangeList { + /** The list of changes. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. */ + changes?: Change[]; + /** Identifies what kind of resource this is. Value: the fixed string "drive#changeList". */ + kind?: string; + /** The starting page token for future changes. This will be present only if the end of the current changes list has been reached. */ + newStartPageToken?: string; + /** + * The page token for the next page of changes. This will be absent if the end of the changes list has been reached. If the token is rejected for any + * reason, it should be discarded, and pagination should be restarted from the first page of results. + */ + nextPageToken?: string; + } + interface Channel { + /** The address where notifications are delivered for this channel. */ + address?: string; + /** Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. */ + expiration?: string; + /** A UUID or similar unique string that identifies this channel. */ + id?: string; + /** Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel". */ + kind?: string; + /** Additional parameters controlling delivery channel behavior. Optional. */ + params?: Record; + /** A Boolean value to indicate whether payload is wanted. Optional. */ + payload?: boolean; + /** An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. */ + resourceId?: string; + /** A version-specific identifier for the watched resource. */ + resourceUri?: string; + /** An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. */ + token?: string; + /** The type of delivery mechanism used for this channel. */ + type?: string; + } + interface Comment { + /** A region of the document represented as a JSON string. See anchor documentation for details on how to define and interpret anchor properties. */ + anchor?: string; + /** The user who created the comment. */ + author?: User; + /** The plain text content of the comment. This field is used for setting the content, while htmlContent should be displayed. */ + content?: string; + /** The time at which the comment was created (RFC 3339 date-time). */ + createdTime?: string; + /** Whether the comment has been deleted. A deleted comment has no content. */ + deleted?: boolean; + /** The content of the comment with HTML formatting. */ + htmlContent?: string; + /** The ID of the comment. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "drive#comment". */ + kind?: string; + /** The last time the comment or any of its replies was modified (RFC 3339 date-time). */ + modifiedTime?: string; + /** + * The file content to which the comment refers, typically within the anchor region. For a text file, for example, this would be the text at the location + * of the comment. + */ + quotedFileContent?: { + /** The MIME type of the quoted content. */ + mimeType?: string; + /** The quoted content itself. This is interpreted as plain text if set through the API. */ + value?: string; + }; + /** The full list of replies to the comment in chronological order. */ + replies?: Reply[]; + /** Whether the comment has been resolved by one of its replies. */ + resolved?: boolean; + } + interface CommentList { + /** The list of comments. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. */ + comments?: Comment[]; + /** Identifies what kind of resource this is. Value: the fixed string "drive#commentList". */ + kind?: string; + /** + * The page token for the next page of comments. This will be absent if the end of the comments list has been reached. If the token is rejected for any + * reason, it should be discarded, and pagination should be restarted from the first page of results. + */ + nextPageToken?: string; + } + interface File { + /** + * A collection of arbitrary key-value pairs which are private to the requesting app. + * Entries with null values are cleared in update and copy requests. + */ + appProperties?: Record; + /** Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. */ + capabilities?: { + /** Whether the current user can add children to this folder. This is always false when the item is not a folder. */ + canAddChildren?: boolean; + /** Whether the current user can change whether viewers can copy the contents of this file. */ + canChangeViewersCanCopyContent?: boolean; + /** Whether the current user can comment on this file. */ + canComment?: boolean; + /** + * Whether the current user can copy this file. For a Team Drive item, whether the current user can copy non-folder descendants of this item, or this item + * itself if it is not a folder. + */ + canCopy?: boolean; + /** Whether the current user can delete this file. */ + canDelete?: boolean; + /** Whether the current user can download this file. */ + canDownload?: boolean; + /** Whether the current user can edit this file. */ + canEdit?: boolean; + /** Whether the current user can list the children of this folder. This is always false when the item is not a folder. */ + canListChildren?: boolean; + /** Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem. */ + canMoveItemIntoTeamDrive?: boolean; + /** + * Whether the current user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail + * depending on the new parent that is being added. Only populated for Team Drive files. + */ + canMoveTeamDriveItem?: boolean; + /** + * Whether the current user can read the revisions resource of this file. For a Team Drive item, whether revisions of non-folder descendants of this item, + * or this item itself if it is not a folder, can be read. + */ + canReadRevisions?: boolean; + /** Whether the current user can read the Team Drive to which this file belongs. Only populated for Team Drive files. */ + canReadTeamDrive?: boolean; + /** Whether the current user can remove children from this folder. This is always false when the item is not a folder. */ + canRemoveChildren?: boolean; + /** Whether the current user can rename this file. */ + canRename?: boolean; + /** Whether the current user can modify the sharing settings for this file. */ + canShare?: boolean; + /** Whether the current user can move this file to trash. */ + canTrash?: boolean; + /** Whether the current user can restore this file from trash. */ + canUntrash?: boolean; + }; + /** Additional information about the content of the file. These fields are never populated in responses. */ + contentHints?: { + /** Text to be indexed for the file to improve fullText queries. This is limited to 128KB in length and may contain HTML elements. */ + indexableText?: string; + /** A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail. */ + thumbnail?: { + /** The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5). */ + image?: string; + /** The MIME type of the thumbnail. */ + mimeType?: string; + }; + }; + /** The time at which the file was created (RFC 3339 date-time). */ + createdTime?: string; + /** A short description of the file. */ + description?: string; + /** Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder. */ + explicitlyTrashed?: boolean; + /** The final component of fullFileExtension. This is only available for files with binary content in Drive. */ + fileExtension?: string; + /** + * The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource. + * If an unsupported color is specified, the closest color in the palette will be used instead. + */ + folderColorRgb?: string; + /** + * The full file extension extracted from the name field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files + * with binary content in Drive. + * This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension. + */ + fullFileExtension?: string; + /** Whether any users are granted file access directly on this file. This field is only populated for Team Drive files. */ + hasAugmentedPermissions?: boolean; + /** + * Whether this file has a thumbnail. This does not indicate whether the requesting app has access to the thumbnail. To check access, look for the + * presence of the thumbnailLink field. + */ + hasThumbnail?: boolean; + /** The ID of the file's head revision. This is currently only available for files with binary content in Drive. */ + headRevisionId?: string; + /** A static, unauthenticated link to the file's icon. */ + iconLink?: string; + /** The ID of the file. */ + id?: string; + /** Additional metadata about image media, if available. */ + imageMediaMetadata?: { + /** The aperture used to create the photo (f-number). */ + aperture?: number; + /** The make of the camera used to create the photo. */ + cameraMake?: string; + /** The model of the camera used to create the photo. */ + cameraModel?: string; + /** The color space of the photo. */ + colorSpace?: string; + /** The exposure bias of the photo (APEX value). */ + exposureBias?: number; + /** The exposure mode used to create the photo. */ + exposureMode?: string; + /** The length of the exposure, in seconds. */ + exposureTime?: number; + /** Whether a flash was used to create the photo. */ + flashUsed?: boolean; + /** The focal length used to create the photo, in millimeters. */ + focalLength?: number; + /** The height of the image in pixels. */ + height?: number; + /** The ISO speed used to create the photo. */ + isoSpeed?: number; + /** The lens used to create the photo. */ + lens?: string; + /** Geographic location information stored in the image. */ + location?: { + /** The altitude stored in the image. */ + altitude?: number; + /** The latitude stored in the image. */ + latitude?: number; + /** The longitude stored in the image. */ + longitude?: number; + }; + /** The smallest f-number of the lens at the focal length used to create the photo (APEX value). */ + maxApertureValue?: number; + /** The metering mode used to create the photo. */ + meteringMode?: string; + /** The rotation in clockwise degrees from the image's original orientation. */ + rotation?: number; + /** The type of sensor used to create the photo. */ + sensor?: string; + /** The distance to the subject of the photo, in meters. */ + subjectDistance?: number; + /** The date and time the photo was taken (EXIF DateTime). */ + time?: string; + /** The white balance mode used to create the photo. */ + whiteBalance?: string; + /** The width of the image in pixels. */ + width?: number; + }; + /** Whether the file was created or opened by the requesting app. */ + isAppAuthorized?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "drive#file". */ + kind?: string; + /** The last user to modify the file. */ + lastModifyingUser?: User; + /** The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive. */ + md5Checksum?: string; + /** + * The MIME type of the file. + * Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new + * revision is uploaded. + * If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the + * About resource. + */ + mimeType?: string; + /** Whether the file has been modified by this user. */ + modifiedByMe?: boolean; + /** The last time the file was modified by the user (RFC 3339 date-time). */ + modifiedByMeTime?: string; + /** + * The last time the file was modified by anyone (RFC 3339 date-time). + * Note that setting modifiedTime will also update modifiedByMeTime for the user. + */ + modifiedTime?: string; + /** + * The name of the file. This is not necessarily unique within a folder. Note that for immutable items such as the top level folders of Team Drives, My + * Drive root folder, and Application Data folder the name is constant. + */ + name?: string; + /** + * The original filename of the uploaded content if available, or else the original value of the name field. This is only available for files with binary + * content in Drive. + */ + originalFilename?: string; + /** Whether the user owns the file. Not populated for Team Drive files. */ + ownedByMe?: boolean; + /** The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for Team Drive files. */ + owners?: User[]; + /** + * The IDs of the parent folders which contain the file. + * If not specified as part of a create request, the file will be placed directly in the My Drive folder. Update requests must use the addParents and + * removeParents parameters to modify the values. + */ + parents?: string[]; + /** List of permission IDs for users with access to this file. */ + permissionIds?: string[]; + /** The full list of permissions for the file. This is only available if the requesting user can share the file. Not populated for Team Drive files. */ + permissions?: Permission[]; + /** + * A collection of arbitrary key-value pairs which are visible to all apps. + * Entries with null values are cleared in update and copy requests. + */ + properties?: Record; + /** The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled. */ + quotaBytesUsed?: string; + /** Whether the file has been shared. Not populated for Team Drive files. */ + shared?: boolean; + /** The time at which the file was shared with the user, if applicable (RFC 3339 date-time). */ + sharedWithMeTime?: string; + /** The user who shared the file with the requesting user, if applicable. */ + sharingUser?: User; + /** The size of the file's content in bytes. This is only applicable to files with binary content in Drive. */ + size?: string; + /** The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'. */ + spaces?: string[]; + /** Whether the user has starred the file. */ + starred?: boolean; + /** ID of the Team Drive the file resides in. */ + teamDriveId?: string; + /** + * A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the + * file's content. + */ + thumbnailLink?: string; + /** The thumbnail version for use in thumbnail cache invalidation. */ + thumbnailVersion?: string; + /** + * Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files + * in the owner's trash. + */ + trashed?: boolean; + /** The time that the item was trashed (RFC 3339 date-time). Only populated for Team Drive files. */ + trashedTime?: string; + /** If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files. */ + trashingUser?: User; + /** A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the user. */ + version?: string; + /** Additional metadata about video media. This may not be available immediately upon upload. */ + videoMediaMetadata?: { + /** The duration of the video in milliseconds. */ + durationMillis?: string; + /** The height of the video in pixels. */ + height?: number; + /** The width of the video in pixels. */ + width?: number; + }; + /** Whether the file has been viewed by this user. */ + viewedByMe?: boolean; + /** The last time the file was viewed by the user (RFC 3339 date-time). */ + viewedByMeTime?: string; + /** Whether users with only reader or commenter permission can copy the file's content. This affects copy, download, and print operations. */ + viewersCanCopyContent?: boolean; + /** A link for downloading the content of the file in a browser. This is only available for files with binary content in Drive. */ + webContentLink?: string; + /** A link for opening the file in a relevant Google editor or viewer in a browser. */ + webViewLink?: string; + /** Whether users with only writer permission can modify the file's permissions. Not populated for Team Drive files. */ + writersCanShare?: boolean; + } + interface FileList { + /** The list of files. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. */ + files?: File[]; + /** + * Whether the search process was incomplete. If true, then some search results may be missing, since all documents were not searched. This may occur when + * searching multiple Team Drives with the "user,allTeamDrives" corpora, but all corpora could not be searched. When this happens, it is suggested that + * clients narrow their query by choosing a different corpus such as "user" or "teamDrive". + */ + incompleteSearch?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "drive#fileList". */ + kind?: string; + /** + * The page token for the next page of files. This will be absent if the end of the files list has been reached. If the token is rejected for any reason, + * it should be discarded, and pagination should be restarted from the first page of results. + */ + nextPageToken?: string; + } + interface GeneratedIds { + /** The IDs generated for the requesting user in the specified space. */ + ids?: string[]; + /** Identifies what kind of resource this is. Value: the fixed string "drive#generatedIds". */ + kind?: string; + /** The type of file that can be created with these IDs. */ + space?: string; + } + interface Permission { + /** Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone. */ + allowFileDiscovery?: boolean; + /** Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. */ + deleted?: boolean; + /** A displayable name for users, groups or domains. */ + displayName?: string; + /** The domain to which this permission refers. */ + domain?: string; + /** The email address of the user or group to which this permission refers. */ + emailAddress?: string; + /** + * The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions: + * - They can only be set on user and group permissions + * - The time must be in the future + * - The time cannot be more than a year in the future + */ + expirationTime?: string; + /** The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "drive#permission". */ + kind?: string; + /** A link to the user's profile photo, if available. */ + photoLink?: string; + /** + * The role granted by this permission. While new values may be supported in the future, the following are currently allowed: + * - organizer + * - owner + * - writer + * - commenter + * - reader + */ + role?: string; + /** + * Details of whether the permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only + * for Team Drive items. + */ + teamDrivePermissionDetails?: Array<{ + /** Whether this permission is inherited. This field is always populated. This is an output-only field. */ + inherited?: boolean; + /** The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive. */ + inheritedFrom?: string; + /** + * The primary role for this user. While new values may be added in the future, the following are currently possible: + * - organizer + * - writer + * - commenter + * - reader + */ + role?: string; + /** + * The Team Drive permission type for this user. While new values may be added in future, the following are currently possible: + * - file + * - member + */ + teamDrivePermissionType?: string; + }>; + /** + * The type of the grantee. Valid values are: + * - user + * - group + * - domain + * - anyone + */ + type?: string; + } + interface PermissionList { + /** Identifies what kind of resource this is. Value: the fixed string "drive#permissionList". */ + kind?: string; + /** + * The page token for the next page of permissions. This field will be absent if the end of the permissions list has been reached. If the token is + * rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results. + */ + nextPageToken?: string; + /** The list of permissions. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. */ + permissions?: Permission[]; + } + interface Reply { + /** + * The action the reply performed to the parent comment. Valid values are: + * - resolve + * - reopen + */ + action?: string; + /** The user who created the reply. */ + author?: User; + /** + * The plain text content of the reply. This field is used for setting the content, while htmlContent should be displayed. This is required on creates if + * no action is specified. + */ + content?: string; + /** The time at which the reply was created (RFC 3339 date-time). */ + createdTime?: string; + /** Whether the reply has been deleted. A deleted reply has no content. */ + deleted?: boolean; + /** The content of the reply with HTML formatting. */ + htmlContent?: string; + /** The ID of the reply. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "drive#reply". */ + kind?: string; + /** The last time the reply was modified (RFC 3339 date-time). */ + modifiedTime?: string; + } + interface ReplyList { + /** Identifies what kind of resource this is. Value: the fixed string "drive#replyList". */ + kind?: string; + /** + * The page token for the next page of replies. This will be absent if the end of the replies list has been reached. If the token is rejected for any + * reason, it should be discarded, and pagination should be restarted from the first page of results. + */ + nextPageToken?: string; + /** The list of replies. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. */ + replies?: Reply[]; + } + interface Revision { + /** The ID of the revision. */ + id?: string; + /** + * Whether to keep this revision forever, even if it is no longer the head revision. If not set, the revision will be automatically purged 30 days after + * newer content is uploaded. This can be set on a maximum of 200 revisions for a file. + * This field is only applicable to files with binary content in Drive. + */ + keepForever?: boolean; + /** Identifies what kind of resource this is. Value: the fixed string "drive#revision". */ + kind?: string; + /** The last user to modify this revision. */ + lastModifyingUser?: User; + /** The MD5 checksum of the revision's content. This is only applicable to files with binary content in Drive. */ + md5Checksum?: string; + /** The MIME type of the revision. */ + mimeType?: string; + /** The last time the revision was modified (RFC 3339 date-time). */ + modifiedTime?: string; + /** The original filename used to create this revision. This is only applicable to files with binary content in Drive. */ + originalFilename?: string; + /** Whether subsequent revisions will be automatically republished. This is only applicable to Google Docs. */ + publishAuto?: boolean; + /** Whether this revision is published. This is only applicable to Google Docs. */ + published?: boolean; + /** Whether this revision is published outside the domain. This is only applicable to Google Docs. */ + publishedOutsideDomain?: boolean; + /** The size of the revision's content in bytes. This is only applicable to files with binary content in Drive. */ + size?: string; + } + interface RevisionList { + /** Identifies what kind of resource this is. Value: the fixed string "drive#revisionList". */ + kind?: string; + /** + * The page token for the next page of revisions. This will be absent if the end of the revisions list has been reached. If the token is rejected for any + * reason, it should be discarded, and pagination should be restarted from the first page of results. + */ + nextPageToken?: string; + /** The list of revisions. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. */ + revisions?: Revision[]; + } + interface StartPageToken { + /** Identifies what kind of resource this is. Value: the fixed string "drive#startPageToken". */ + kind?: string; + /** The starting page token for listing changes. */ + startPageToken?: string; + } + interface TeamDrive { + /** + * An image file and cropping parameters from which a background image for this Team Drive is set. This is a write only field; it can only be set on + * drive.teamdrives.update requests that don't set themeId. When specified, all fields of the backgroundImageFile must be set. + */ + backgroundImageFile?: { + /** The ID of an image file in Drive to use for the background image. */ + id?: string; + /** + * The width of the cropped image in the closed range of 0 to 1. This value represents the width of the cropped image divided by the width of the entire + * image. The height is computed by applying a width to height aspect ratio of 80 to 9. The resulting image must be at least 1280 pixels wide and 144 + * pixels high. + */ + width?: number; + /** + * The X coordinate of the upper left corner of the cropping area in the background image. This is a value in the closed range of 0 to 1. This value + * represents the horizontal distance from the left side of the entire image to the left side of the cropping area divided by the width of the entire + * image. + */ + xCoordinate?: number; + /** + * The Y coordinate of the upper left corner of the cropping area in the background image. This is a value in the closed range of 0 to 1. This value + * represents the vertical distance from the top side of the entire image to the top side of the cropping area divided by the height of the entire image. + */ + yCoordinate?: number; + }; + /** A short-lived link to this Team Drive's background image. */ + backgroundImageLink?: string; + /** Capabilities the current user has on this Team Drive. */ + capabilities?: { + /** Whether the current user can add children to folders in this Team Drive. */ + canAddChildren?: boolean; + /** Whether the current user can change the background of this Team Drive. */ + canChangeTeamDriveBackground?: boolean; + /** Whether the current user can comment on files in this Team Drive. */ + canComment?: boolean; + /** Whether the current user can copy files in this Team Drive. */ + canCopy?: boolean; + /** + * Whether the current user can delete this Team Drive. Attempting to delete the Team Drive may still fail if there are untrashed items inside the Team + * Drive. + */ + canDeleteTeamDrive?: boolean; + /** Whether the current user can download files in this Team Drive. */ + canDownload?: boolean; + /** Whether the current user can edit files in this Team Drive */ + canEdit?: boolean; + /** Whether the current user can list the children of folders in this Team Drive. */ + canListChildren?: boolean; + /** Whether the current user can add members to this Team Drive or remove them or change their role. */ + canManageMembers?: boolean; + /** Whether the current user can read the revisions resource of files in this Team Drive. */ + canReadRevisions?: boolean; + /** Whether the current user can remove children from folders in this Team Drive. */ + canRemoveChildren?: boolean; + /** Whether the current user can rename files or folders in this Team Drive. */ + canRename?: boolean; + /** Whether the current user can rename this Team Drive. */ + canRenameTeamDrive?: boolean; + /** Whether the current user can share files or folders in this Team Drive. */ + canShare?: boolean; + }; + /** The color of this Team Drive as an RGB hex string. It can only be set on a drive.teamdrives.update request that does not set themeId. */ + colorRgb?: string; + /** The ID of this Team Drive which is also the ID of the top level folder for this Team Drive. */ + id?: string; + /** Identifies what kind of resource this is. Value: the fixed string "drive#teamDrive". */ + kind?: string; + /** The name of this Team Drive. */ + name?: string; + /** + * The ID of the theme from which the background image and color will be set. The set of possible teamDriveThemes can be retrieved from a drive.about.get + * response. When not specified on a drive.teamdrives.create request, a random theme is chosen from which the background image and color are set. This is + * a write-only field; it can only be set on requests that don't set colorRgb or backgroundImageFile. + */ + themeId?: string; + } + interface TeamDriveList { + /** Identifies what kind of resource this is. Value: the fixed string "drive#teamDriveList". */ + kind?: string; + /** + * The page token for the next page of Team Drives. This will be absent if the end of the Team Drives list has been reached. If the token is rejected for + * any reason, it should be discarded, and pagination should be restarted from the first page of results. + */ + nextPageToken?: string; + /** The list of Team Drives. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. */ + teamDrives?: TeamDrive[]; + } + interface User { + /** A plain text displayable name for this user. */ + displayName?: string; + /** The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. */ + emailAddress?: string; + /** Identifies what kind of resource this is. Value: the fixed string "drive#user". */ + kind?: string; + /** Whether this user is the requesting user. */ + me?: boolean; + /** The user's ID as visible in Permission resources. */ + permissionId?: string; + /** A link to the user's profile photo, if available. */ + photoLink?: string; + } + interface AboutResource { + /** Gets information about the user, the user's Drive, and system capabilities. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ChangesResource { + /** Gets the starting pageToken for listing future changes. */ + getStartPageToken(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** The ID of the Team Drive for which the starting pageToken for listing future changes from that Team Drive will be returned. */ + teamDriveId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the changes for a user or Team Drive. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed + * from the list of changes and there will be no further change entries for this file. + */ + includeCorpusRemovals?: boolean; + /** Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access. */ + includeRemoved?: boolean; + /** Whether Team Drive files or changes should be included in results. */ + includeTeamDriveItems?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The maximum number of changes to return per page. */ + pageSize?: number; + /** + * The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to + * the response from the getStartPageToken method. + */ + pageToken: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Whether to restrict the results to changes inside the My Drive hierarchy. This omits changes to files such as those in the Application Data folder or + * shared files which have not been added to My Drive. + */ + restrictToMyDrive?: boolean; + /** A comma-separated list of spaces to query within the user corpus. Supported values are 'drive', 'appDataFolder' and 'photos'. */ + spaces?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** + * The Team Drive from which changes will be returned. If specified the change IDs will be reflective of the Team Drive; use the combined Team Drive ID + * and change ID as an identifier. + */ + teamDriveId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Subscribes to changes for a user. */ + watch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed + * from the list of changes and there will be no further change entries for this file. + */ + includeCorpusRemovals?: boolean; + /** Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access. */ + includeRemoved?: boolean; + /** Whether Team Drive files or changes should be included in results. */ + includeTeamDriveItems?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The maximum number of changes to return per page. */ + pageSize?: number; + /** + * The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to + * the response from the getStartPageToken method. + */ + pageToken: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Whether to restrict the results to changes inside the My Drive hierarchy. This omits changes to files such as those in the Application Data folder or + * shared files which have not been added to My Drive. + */ + restrictToMyDrive?: boolean; + /** A comma-separated list of spaces to query within the user corpus. Supported values are 'drive', 'appDataFolder' and 'photos'. */ + spaces?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** + * The Team Drive from which changes will be returned. If specified the change IDs will be reflective of the Team Drive; use the combined Team Drive ID + * and change ID as an identifier. + */ + teamDriveId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface ChannelsResource { + /** Stop watching resources through this channel */ + stop(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface CommentsResource { + /** Creates a new comment on a file. */ + create(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes a comment. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the comment. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets a comment by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the comment. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** Whether to return deleted comments. Deleted comments will not include their original content. */ + includeDeleted?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists a file's comments. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** Whether to include deleted comments. Deleted comments will not include their original content. */ + includeDeleted?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The maximum number of comments to return per page. */ + pageSize?: number; + /** The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The minimum value of 'modifiedTime' for the result comments (RFC 3339 date-time). */ + startModifiedTime?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a comment with patch semantics. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the comment. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface FilesResource { + /** Creates a copy of a file and applies any requested updates with patch semantics. */ + copy(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** + * Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to + * the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders. + */ + ignoreDefaultVisibility?: boolean; + /** Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive. */ + keepRevisionForever?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** A language hint for OCR processing during image import (ISO 639-1 code). */ + ocrLanguage?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Creates a new file. */ + create(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to + * the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders. + */ + ignoreDefaultVisibility?: boolean; + /** Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive. */ + keepRevisionForever?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** A language hint for OCR processing during image import (ISO 639-1 code). */ + ocrLanguage?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** Whether to use the uploaded content as indexable text. */ + useContentAsIndexableText?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a Team Drive the user must be an organizer on the + * parent. If the target is a folder, all descendants owned by the user are also deleted. + */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Permanently deletes all of the user's trashed files. */ + emptyTrash(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB. */ + export(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The MIME type of the format requested for this export. */ + mimeType: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Generates a set of file IDs which can be provided in create requests. */ + generateIds(request: { + /** Data format for the response. */ + alt?: string; + /** The number of IDs to return. */ + count?: number; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'. */ + space?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets a file's metadata or content by ID. */ + get(request: { + /** Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. */ + acknowledgeAbuse?: boolean; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists or searches files. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** + * Comma-separated list of bodies of items (files/documents) to which the query applies. Supported bodies are 'user', 'domain', 'teamDrive' and + * 'allTeamDrives'. 'allTeamDrives' must be combined with 'user'; all other values must be used in isolation. Prefer 'user' or 'teamDrive' to + * 'allTeamDrives' for efficiency. + */ + corpora?: string; + /** The source of files to list. Deprecated: use 'corpora' instead. */ + corpus?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Whether Team Drive items should be included in results. */ + includeTeamDriveItems?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * A comma-separated list of sort keys. Valid keys are 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime', 'name', 'name_natural', + * 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and 'viewedByMeTime'. Each key sorts ascending by default, but may be reversed with the + * 'desc' modifier. Example usage: ?orderBy=folder,modifiedTime desc,name. Please note that there is a current limitation for users with approximately one + * million files in which the requested sort order is ignored. + */ + orderBy?: string; + /** The maximum number of files to return per page. Partial or empty result pages are possible even before the end of the files list has been reached. */ + pageSize?: number; + /** The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** A query for filtering the file results. See the "Search for Files" guide for supported syntax. */ + q?: string; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** A comma-separated list of spaces to query within the corpus. Supported values are 'drive', 'appDataFolder' and 'photos'. */ + spaces?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** ID of Team Drive to search. */ + teamDriveId?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a file's metadata and/or content with patch semantics. */ + update(request: { + /** A comma-separated list of parent IDs to add. */ + addParents?: string; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive. */ + keepRevisionForever?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** A language hint for OCR processing during image import (ISO 639-1 code). */ + ocrLanguage?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** A comma-separated list of parent IDs to remove. */ + removeParents?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** Whether to use the uploaded content as indexable text. */ + useContentAsIndexableText?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Subscribes to changes to a file */ + watch(request: { + /** Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. */ + acknowledgeAbuse?: boolean; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface PermissionsResource { + /** Creates a permission for a file or Team Drive. */ + create(request: { + /** Data format for the response. */ + alt?: string; + /** A custom message to include in the notification email. */ + emailMessage?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file or Team Drive. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * Whether to send a notification email when sharing to users or groups. This defaults to true for users and groups, and is not allowed for other + * requests. It must not be disabled for ownership transfers. + */ + sendNotificationEmail?: boolean; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** + * Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of + * the side effect. + */ + transferOwnership?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes a permission. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file or Team Drive. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the permission. */ + permissionId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets a permission by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the permission. */ + permissionId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists a file's or Team Drive's permissions. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file or Team Drive. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The maximum number of permissions to return per page. When not set for files in a Team Drive, at most 100 results will be returned. When not set for + * files that are not in a Team Drive, the entire list will be returned. + */ + pageSize?: number; + /** The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a permission with patch semantics. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file or Team Drive. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The ID of the permission. */ + permissionId: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether to remove the expiration date. */ + removeExpiration?: boolean; + /** Whether the requesting application supports Team Drives. */ + supportsTeamDrives?: boolean; + /** + * Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of + * the side effect. + */ + transferOwnership?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RepliesResource { + /** Creates a new reply to a comment. */ + create(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the comment. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes a reply. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the comment. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the reply. */ + replyId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets a reply by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the comment. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** Whether to return deleted replies. Deleted replies will not include their original content. */ + includeDeleted?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the reply. */ + replyId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists a comment's replies. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the comment. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** Whether to include deleted replies. Deleted replies will not include their original content. */ + includeDeleted?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The maximum number of replies to return per page. */ + pageSize?: number; + /** The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a reply with patch semantics. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The ID of the comment. */ + commentId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the reply. */ + replyId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface RevisionsResource { + /** Permanently deletes a revision. This method is only applicable to files with binary content in Drive. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the revision. */ + revisionId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets a revision's metadata or content by ID. */ + get(request: { + /** Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. */ + acknowledgeAbuse?: boolean; + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the revision. */ + revisionId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists a file's revisions. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The maximum number of revisions to return per page. */ + pageSize?: number; + /** The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a revision with patch semantics. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** The ID of the file. */ + fileId: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the revision. */ + revisionId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TeamdrivesResource { + /** Creates a new Team Drive. */ + create(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a Team Drive. A repeated request by the same + * user and with the same request ID will avoid creating duplicates by attempting to create the same Team Drive. If the Team Drive already exists a 409 + * error will be returned. + */ + requestId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Permanently deletes a Team Drive for which the user is an organizer. The Team Drive cannot contain any untrashed items. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the Team Drive */ + teamDriveId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets a Team Drive's metadata by ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the Team Drive */ + teamDriveId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists the user's Team Drives. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Maximum number of Team Drives to return. */ + pageSize?: number; + /** Page token for Team Drives. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates a Team Drive's metadata */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the Team Drive */ + teamDriveId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.drive/readme.md b/types/gapi.client.drive/readme.md new file mode 100644 index 0000000000..da5a3fb6e5 --- /dev/null +++ b/types/gapi.client.drive/readme.md @@ -0,0 +1,270 @@ +# TypeScript typings for Drive API v3 +Manages files in Drive including uploading, downloading, searching, detecting changes, and updating sharing permissions. +For detailed description please check [documentation](https://developers.google.com/drive/). + +## Installing + +Install typings for Drive API: +``` +npm install @types/gapi.client.drive@v3 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('drive', 'v3', () => { + // now we can use gapi.client.drive + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage the files in your Google Drive + 'https://www.googleapis.com/auth/drive', + + // View and manage its own configuration data in your Google Drive + 'https://www.googleapis.com/auth/drive.appdata', + + // View and manage Google Drive files and folders that you have opened or created with this app + 'https://www.googleapis.com/auth/drive.file', + + // View and manage metadata of files in your Google Drive + 'https://www.googleapis.com/auth/drive.metadata', + + // View metadata for files in your Google Drive + 'https://www.googleapis.com/auth/drive.metadata.readonly', + + // View the photos, videos and albums in your Google Photos + 'https://www.googleapis.com/auth/drive.photos.readonly', + + // View the files in your Google Drive + 'https://www.googleapis.com/auth/drive.readonly', + + // Modify your Google Apps Script scripts' behavior + 'https://www.googleapis.com/auth/drive.scripts', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Drive API resources: + +```typescript + +/* +Gets information about the user, the user's Drive, and system capabilities. +*/ +await gapi.client.about.get({ }); + +/* +Gets the starting pageToken for listing future changes. +*/ +await gapi.client.changes.getStartPageToken({ }); + +/* +Lists the changes for a user or Team Drive. +*/ +await gapi.client.changes.list({ pageToken: "pageToken", }); + +/* +Subscribes to changes for a user. +*/ +await gapi.client.changes.watch({ pageToken: "pageToken", }); + +/* +Stop watching resources through this channel +*/ +await gapi.client.channels.stop({ }); + +/* +Creates a new comment on a file. +*/ +await gapi.client.comments.create({ fileId: "fileId", }); + +/* +Deletes a comment. +*/ +await gapi.client.comments.delete({ commentId: "commentId", fileId: "fileId", }); + +/* +Gets a comment by ID. +*/ +await gapi.client.comments.get({ commentId: "commentId", fileId: "fileId", }); + +/* +Lists a file's comments. +*/ +await gapi.client.comments.list({ fileId: "fileId", }); + +/* +Updates a comment with patch semantics. +*/ +await gapi.client.comments.update({ commentId: "commentId", fileId: "fileId", }); + +/* +Creates a copy of a file and applies any requested updates with patch semantics. +*/ +await gapi.client.files.copy({ fileId: "fileId", }); + +/* +Creates a new file. +*/ +await gapi.client.files.create({ }); + +/* +Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a Team Drive the user must be an organizer on the parent. If the target is a folder, all descendants owned by the user are also deleted. +*/ +await gapi.client.files.delete({ fileId: "fileId", }); + +/* +Permanently deletes all of the user's trashed files. +*/ +await gapi.client.files.emptyTrash({ }); + +/* +Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB. +*/ +await gapi.client.files.export({ fileId: "fileId", mimeType: "mimeType", }); + +/* +Generates a set of file IDs which can be provided in create requests. +*/ +await gapi.client.files.generateIds({ }); + +/* +Gets a file's metadata or content by ID. +*/ +await gapi.client.files.get({ fileId: "fileId", }); + +/* +Lists or searches files. +*/ +await gapi.client.files.list({ }); + +/* +Updates a file's metadata and/or content with patch semantics. +*/ +await gapi.client.files.update({ fileId: "fileId", }); + +/* +Subscribes to changes to a file +*/ +await gapi.client.files.watch({ fileId: "fileId", }); + +/* +Creates a permission for a file or Team Drive. +*/ +await gapi.client.permissions.create({ fileId: "fileId", }); + +/* +Deletes a permission. +*/ +await gapi.client.permissions.delete({ fileId: "fileId", permissionId: "permissionId", }); + +/* +Gets a permission by ID. +*/ +await gapi.client.permissions.get({ fileId: "fileId", permissionId: "permissionId", }); + +/* +Lists a file's or Team Drive's permissions. +*/ +await gapi.client.permissions.list({ fileId: "fileId", }); + +/* +Updates a permission with patch semantics. +*/ +await gapi.client.permissions.update({ fileId: "fileId", permissionId: "permissionId", }); + +/* +Creates a new reply to a comment. +*/ +await gapi.client.replies.create({ commentId: "commentId", fileId: "fileId", }); + +/* +Deletes a reply. +*/ +await gapi.client.replies.delete({ commentId: "commentId", fileId: "fileId", replyId: "replyId", }); + +/* +Gets a reply by ID. +*/ +await gapi.client.replies.get({ commentId: "commentId", fileId: "fileId", replyId: "replyId", }); + +/* +Lists a comment's replies. +*/ +await gapi.client.replies.list({ commentId: "commentId", fileId: "fileId", }); + +/* +Updates a reply with patch semantics. +*/ +await gapi.client.replies.update({ commentId: "commentId", fileId: "fileId", replyId: "replyId", }); + +/* +Permanently deletes a revision. This method is only applicable to files with binary content in Drive. +*/ +await gapi.client.revisions.delete({ fileId: "fileId", revisionId: "revisionId", }); + +/* +Gets a revision's metadata or content by ID. +*/ +await gapi.client.revisions.get({ fileId: "fileId", revisionId: "revisionId", }); + +/* +Lists a file's revisions. +*/ +await gapi.client.revisions.list({ fileId: "fileId", }); + +/* +Updates a revision with patch semantics. +*/ +await gapi.client.revisions.update({ fileId: "fileId", revisionId: "revisionId", }); + +/* +Creates a new Team Drive. +*/ +await gapi.client.teamdrives.create({ requestId: "requestId", }); + +/* +Permanently deletes a Team Drive for which the user is an organizer. The Team Drive cannot contain any untrashed items. +*/ +await gapi.client.teamdrives.delete({ teamDriveId: "teamDriveId", }); + +/* +Gets a Team Drive's metadata by ID. +*/ +await gapi.client.teamdrives.get({ teamDriveId: "teamDriveId", }); + +/* +Lists the user's Team Drives. +*/ +await gapi.client.teamdrives.list({ }); + +/* +Updates a Team Drive's metadata +*/ +await gapi.client.teamdrives.update({ teamDriveId: "teamDriveId", }); +``` \ No newline at end of file diff --git a/types/gapi.client.drive/tsconfig.json b/types/gapi.client.drive/tsconfig.json new file mode 100644 index 0000000000..6d5901b410 --- /dev/null +++ b/types/gapi.client.drive/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.drive-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.drive/tslint.json b/types/gapi.client.drive/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.drive/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.firebasedynamiclinks/gapi.client.firebasedynamiclinks-tests.ts b/types/gapi.client.firebasedynamiclinks/gapi.client.firebasedynamiclinks-tests.ts new file mode 100644 index 0000000000..4ef78ca6ba --- /dev/null +++ b/types/gapi.client.firebasedynamiclinks/gapi.client.firebasedynamiclinks-tests.ts @@ -0,0 +1,57 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('firebasedynamiclinks', 'v1', () => { + /** now we can use gapi.client.firebasedynamiclinks */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and administer all your Firebase data and settings */ + 'https://www.googleapis.com/auth/firebase', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** + * Creates a short Dynamic Link given either a valid long Dynamic Link or + * details such as Dynamic Link domain, Android and iOS app information. + * The created short Dynamic Link will not expire. + * + * Repeated calls with the same long Dynamic Link or Dynamic Link information + * will produce the same short Dynamic Link. + * + * The Dynamic Link domain in the request must be owned by requester's + * Firebase project. + */ + await gapi.client.shortLinks.create({ + }); + /** + * Fetches analytics stats of a short Dynamic Link for a given + * duration. Metrics include number of clicks, redirects, installs, + * app first opens, and app reopens. + */ + await gapi.client.v1.getLinkStats({ + durationDays: "durationDays", + dynamicLink: "dynamicLink", + }); + /** Get iOS strong/weak-match info for post-install attribution. */ + await gapi.client.v1.installAttribution({ + }); + } +}); diff --git a/types/gapi.client.firebasedynamiclinks/index.d.ts b/types/gapi.client.firebasedynamiclinks/index.d.ts new file mode 100644 index 0000000000..618a8845a6 --- /dev/null +++ b/types/gapi.client.firebasedynamiclinks/index.d.ts @@ -0,0 +1,430 @@ +// Type definitions for Google Firebase Dynamic Links API v1 1.0 +// Project: https://firebase.google.com/docs/dynamic-links/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://firebasedynamiclinks.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Firebase Dynamic Links API v1 */ + function load(name: "firebasedynamiclinks", version: "v1"): PromiseLike; + function load(name: "firebasedynamiclinks", version: "v1", callback: () => any): void; + + const shortLinks: firebasedynamiclinks.ShortLinksResource; + + const v1: firebasedynamiclinks.V1Resource; + + namespace firebasedynamiclinks { + interface AnalyticsInfo { + /** Google Play Campaign Measurements. */ + googlePlayAnalytics?: GooglePlayAnalytics; + /** iTunes Connect App Analytics. */ + itunesConnectAnalytics?: ITunesConnectAnalytics; + } + interface AndroidInfo { + /** Link to open on Android if the app is not installed. */ + androidFallbackLink?: string; + /** If specified, this overrides the ‘link’ parameter on Android. */ + androidLink?: string; + /** + * Minimum version code for the Android app. If the installed app’s version + * code is lower, then the user is taken to the Play Store. + */ + androidMinPackageVersionCode?: string; + /** Android package name of the app. */ + androidPackageName?: string; + } + interface CreateShortDynamicLinkRequest { + /** + * Information about the Dynamic Link to be shortened. + * [Learn more](https://firebase.google.com/docs/dynamic-links/android#create-a-dynamic-link-programmatically). + */ + dynamicLinkInfo?: DynamicLinkInfo; + /** + * Full long Dynamic Link URL with desired query parameters specified. + * For example, + * "https://sample.app.goo.gl/?link=http://www.google.com&apn=com.sample", + * [Learn more](https://firebase.google.com/docs/dynamic-links/android#create-a-dynamic-link-programmatically). + */ + longDynamicLink?: string; + /** Short Dynamic Link suffix. Optional. */ + suffix?: Suffix; + } + interface CreateShortDynamicLinkResponse { + /** Preivew link to show the link flow chart. */ + previewLink?: string; + /** Short Dynamic Link value. e.g. https://abcd.app.goo.gl/wxyz */ + shortLink?: string; + /** Information about potential warnings on link creation. */ + warning?: DynamicLinkWarning[]; + } + interface DeviceInfo { + /** Device model name. */ + deviceModelName?: string; + /** Device language code setting. */ + languageCode?: string; + /** Device display resolution height. */ + screenResolutionHeight?: string; + /** Device display resolution width. */ + screenResolutionWidth?: string; + /** Device timezone setting. */ + timezone?: string; + } + interface DynamicLinkEventStat { + /** The number of times this event occurred. */ + count?: string; + /** Link event. */ + event?: string; + /** Requested platform. */ + platform?: string; + } + interface DynamicLinkInfo { + /** + * Parameters used for tracking. See all tracking parameters in the + * [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). + */ + analyticsInfo?: AnalyticsInfo; + /** + * Android related information. See Android related parameters in the + * [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). + */ + androidInfo?: AndroidInfo; + /** + * Dynamic Links domain that the project owns, e.g. abcd.app.goo.gl + * [Learn more](https://firebase.google.com/docs/dynamic-links/android/receive) + * on how to set up Dynamic Link domain associated with your Firebase project. + * + * Required. + */ + dynamicLinkDomain?: string; + /** + * iOS related information. See iOS related parameters in the + * [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). + */ + iosInfo?: IosInfo; + /** + * The link your app will open, You can specify any URL your app can handle. + * This link must be a well-formatted URL, be properly URL-encoded, and use + * the HTTP or HTTPS scheme. See 'link' parameters in the + * [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). + * + * Required. + */ + link?: string; + /** Information of navigation behavior of a Firebase Dynamic Links. */ + navigationInfo?: NavigationInfo; + /** + * Parameters for social meta tag params. + * Used to set meta tag data for link previews on social sites. + */ + socialMetaTagInfo?: SocialMetaTagInfo; + } + interface DynamicLinkStats { + /** Dynamic Link event stats. */ + linkEventStats?: DynamicLinkEventStat[]; + } + interface DynamicLinkWarning { + /** The warning code. */ + warningCode?: string; + /** The document describing the warning, and helps resolve. */ + warningDocumentLink?: string; + /** The warning message to help developers improve their requests. */ + warningMessage?: string; + } + interface GetIosPostInstallAttributionRequest { + /** + * App installation epoch time (https://en.wikipedia.org/wiki/Unix_time). + * This is a client signal for a more accurate weak match. + */ + appInstallationTime?: string; + /** APP bundle ID. */ + bundleId?: string; + /** Device information. */ + device?: DeviceInfo; + /** + * iOS version, ie: 9.3.5. + * Consider adding "build". + */ + iosVersion?: string; + /** + * App post install attribution retrieval information. Disambiguates + * mechanism (iSDK or developer invoked) to retrieve payload from + * clicked link. + */ + retrievalMethod?: string; + /** Google SDK version. */ + sdkVersion?: string; + /** + * Possible unique matched link that server need to check before performing + * fingerprint match. If passed link is short server need to expand the link. + * If link is long server need to vslidate the link. + */ + uniqueMatchLinkToCheck?: string; + /** + * Strong match page information. Disambiguates between default UI and + * custom page to present when strong match succeeds/fails to find cookie. + */ + visualStyle?: string; + } + interface GetIosPostInstallAttributionResponse { + /** + * The minimum version for app, specified by dev through ?imv= parameter. + * Return to iSDK to allow app to evaluate if current version meets this. + */ + appMinimumVersion?: string; + /** The confidence of the returned attribution. */ + attributionConfidence?: string; + /** + * The deep-link attributed post-install via one of several techniques + * (fingerprint, copy unique). + */ + deepLink?: string; + /** + * User-agent specific custom-scheme URIs for iSDK to open. This will be set + * according to the user-agent tha the click was originally made in. There is + * no Safari-equivalent custom-scheme open URLs. + * ie: googlechrome://www.example.com + * ie: firefox://open-url?url=http://www.example.com + * ie: opera-http://example.com + */ + externalBrowserDestinationLink?: string; + /** + * The link to navigate to update the app if min version is not met. + * This is either (in order): 1) fallback link (from ?ifl= parameter, if + * specified by developer) or 2) AppStore URL (from ?isi= parameter, if + * specified), or 3) the payload link (from required link= parameter). + */ + fallbackLink?: string; + /** + * Invitation ID attributed post-install via one of several techniques + * (fingerprint, copy unique). + */ + invitationId?: string; + /** + * Instruction for iSDK to attemmpt to perform strong match. For instance, + * if browser does not support/allow cookie or outside of support browsers, + * this will be false. + */ + isStrongMatchExecutable?: boolean; + /** + * Describes why match failed, ie: "discarded due to low confidence". + * This message will be publicly visible. + */ + matchMessage?: string; + /** + * Entire FDL (short or long) attributed post-install via one of several + * techniques (fingerprint, copy unique). + */ + requestedLink?: string; + /** + * The entire FDL, expanded from a short link. It is the same as the + * requested_link, if it is long. Parameters from this should not be + * used directly (ie: server can default utm_[campaign|medium|source] + * to a value when requested_link lack them, server determine the best + * fallback_link when requested_link specifies >1 fallback links). + */ + resolvedLink?: string; + /** Scion campaign value to be propagated by iSDK to Scion at post-install. */ + utmCampaign?: string; + /** Scion medium value to be propagated by iSDK to Scion at post-install. */ + utmMedium?: string; + /** Scion source value to be propagated by iSDK to Scion at post-install. */ + utmSource?: string; + } + interface GooglePlayAnalytics { + /** + * [AdWords autotagging parameter](https://support.google.com/analytics/answer/1033981?hl=en); + * used to measure Google AdWords ads. This value is generated dynamically + * and should never be modified. + */ + gclid?: string; + /** + * Campaign name; used for keyword analysis to identify a specific product + * promotion or strategic campaign. + */ + utmCampaign?: string; + /** + * Campaign content; used for A/B testing and content-targeted ads to + * differentiate ads or links that point to the same URL. + */ + utmContent?: string; + /** Campaign medium; used to identify a medium such as email or cost-per-click. */ + utmMedium?: string; + /** + * Campaign source; used to identify a search engine, newsletter, or other + * source. + */ + utmSource?: string; + /** Campaign term; used with paid search to supply the keywords for ads. */ + utmTerm?: string; + } + interface ITunesConnectAnalytics { + /** Affiliate token used to create affiliate-coded links. */ + at?: string; + /** + * Campaign text that developers can optionally add to any link in order to + * track sales from a specific marketing campaign. + */ + ct?: string; + /** iTune media types, including music, podcasts, audiobooks and so on. */ + mt?: string; + /** + * Provider token that enables analytics for Dynamic Links from within iTunes + * Connect. + */ + pt?: string; + } + interface IosInfo { + /** iOS App Store ID. */ + iosAppStoreId?: string; + /** iOS bundle ID of the app. */ + iosBundleId?: string; + /** + * Custom (destination) scheme to use for iOS. By default, we’ll use the + * bundle ID as the custom scheme. Developer can override this behavior using + * this param. + */ + iosCustomScheme?: string; + /** Link to open on iOS if the app is not installed. */ + iosFallbackLink?: string; + /** iPad bundle ID of the app. */ + iosIpadBundleId?: string; + /** If specified, this overrides the ios_fallback_link value on iPads. */ + iosIpadFallbackLink?: string; + } + interface NavigationInfo { + /** + * If this option is on, FDL click will be forced to redirect rather than + * show an interstitial page. + */ + enableForcedRedirect?: boolean; + } + interface SocialMetaTagInfo { + /** A short description of the link. Optional. */ + socialDescription?: string; + /** An image url string. Optional. */ + socialImageLink?: string; + /** Title to be displayed. Optional. */ + socialTitle?: string; + } + interface Suffix { + /** Suffix option. */ + option?: string; + } + interface ShortLinksResource { + /** + * Creates a short Dynamic Link given either a valid long Dynamic Link or + * details such as Dynamic Link domain, Android and iOS app information. + * The created short Dynamic Link will not expire. + * + * Repeated calls with the same long Dynamic Link or Dynamic Link information + * will produce the same short Dynamic Link. + * + * The Dynamic Link domain in the request must be owned by requester's + * Firebase project. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface V1Resource { + /** + * Fetches analytics stats of a short Dynamic Link for a given + * duration. Metrics include number of clicks, redirects, installs, + * app first opens, and app reopens. + */ + getLinkStats(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The span of time requested in days. */ + durationDays?: string; + /** Dynamic Link URL. e.g. https://abcd.app.goo.gl/wxyz */ + dynamicLink: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Get iOS strong/weak-match info for post-install attribution. */ + installAttribution(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + } +} diff --git a/types/gapi.client.firebasedynamiclinks/readme.md b/types/gapi.client.firebasedynamiclinks/readme.md new file mode 100644 index 0000000000..ec49c972a7 --- /dev/null +++ b/types/gapi.client.firebasedynamiclinks/readme.md @@ -0,0 +1,79 @@ +# TypeScript typings for Firebase Dynamic Links API v1 +Programmatically creates and manages Firebase Dynamic Links. +For detailed description please check [documentation](https://firebase.google.com/docs/dynamic-links/). + +## Installing + +Install typings for Firebase Dynamic Links API: +``` +npm install @types/gapi.client.firebasedynamiclinks@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('firebasedynamiclinks', 'v1', () => { + // now we can use gapi.client.firebasedynamiclinks + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and administer all your Firebase data and settings + 'https://www.googleapis.com/auth/firebase', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Firebase Dynamic Links API resources: + +```typescript + +/* +Creates a short Dynamic Link given either a valid long Dynamic Link or +details such as Dynamic Link domain, Android and iOS app information. +The created short Dynamic Link will not expire. + +Repeated calls with the same long Dynamic Link or Dynamic Link information +will produce the same short Dynamic Link. + +The Dynamic Link domain in the request must be owned by requester's +Firebase project. +*/ +await gapi.client.shortLinks.create({ }); + +/* +Fetches analytics stats of a short Dynamic Link for a given +duration. Metrics include number of clicks, redirects, installs, +app first opens, and app reopens. +*/ +await gapi.client.v1.getLinkStats({ dynamicLink: "dynamicLink", }); + +/* +Get iOS strong/weak-match info for post-install attribution. +*/ +await gapi.client.v1.installAttribution({ }); +``` \ No newline at end of file diff --git a/types/gapi.client.firebasedynamiclinks/tsconfig.json b/types/gapi.client.firebasedynamiclinks/tsconfig.json new file mode 100644 index 0000000000..e43d9944a4 --- /dev/null +++ b/types/gapi.client.firebasedynamiclinks/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.firebasedynamiclinks-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.firebasedynamiclinks/tslint.json b/types/gapi.client.firebasedynamiclinks/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.firebasedynamiclinks/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.firebaseremoteconfig/gapi.client.firebaseremoteconfig-tests.ts b/types/gapi.client.firebaseremoteconfig/gapi.client.firebaseremoteconfig-tests.ts new file mode 100644 index 0000000000..60c5cec59c --- /dev/null +++ b/types/gapi.client.firebaseremoteconfig/gapi.client.firebaseremoteconfig-tests.ts @@ -0,0 +1,48 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('firebaseremoteconfig', 'v1', () => { + /** now we can use gapi.client.firebaseremoteconfig */ + + run(); + }); + + async function run() { + /** + * Get the latest version Remote Configuration for a project. + * Returns the RemoteConfig as the payload, and also the eTag as a + * response header. + */ + await gapi.client.projects.getRemoteConfig({ + project: "project", + }); + /** + * Update a RemoteConfig. We treat this as an always-existing + * resource (when it is not found in our data store, we treat it as version + * 0, a template with zero conditions and zero parameters). Hence there are + * no Create or Delete operations. Returns the updated template when + * successful (and the updated eTag as a response header), or an error if + * things go wrong. + * Possible error messages: + * * VALIDATION_ERROR (HTTP status 400) with additional details if the + * template being passed in can not be validated. + * * AUTHENTICATION_ERROR (HTTP status 401) if the request can not be + * authenticate (e.g. no access token, or invalid access token). + * * AUTHORIZATION_ERROR (HTTP status 403) if the request can not be + * authorized (e.g. the user has no access to the specified project id). + * * VERSION_MISMATCH (HTTP status 412) when trying to update when the + * expected eTag (passed in via the "If-match" header) is not specified, or + * is specified but does does not match the current eTag. + * * Internal error (HTTP status 500) for Database problems or other internal + * errors. + */ + await gapi.client.projects.updateRemoteConfig({ + project: "project", + validateOnly: true, + }); + } +}); diff --git a/types/gapi.client.firebaseremoteconfig/index.d.ts b/types/gapi.client.firebaseremoteconfig/index.d.ts new file mode 100644 index 0000000000..22c96e59c8 --- /dev/null +++ b/types/gapi.client.firebaseremoteconfig/index.d.ts @@ -0,0 +1,197 @@ +// Type definitions for Google Firebase Remote Config API v1 1.0 +// Project: https://firebase.google.com/docs/remote-config/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://firebaseremoteconfig.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Firebase Remote Config API v1 */ + function load(name: "firebaseremoteconfig", version: "v1"): PromiseLike; + function load(name: "firebaseremoteconfig", version: "v1", callback: () => any): void; + + const projects: firebaseremoteconfig.ProjectsResource; + + namespace firebaseremoteconfig { + interface RemoteConfig { + /** + * The list of named conditions. The order *does* affect the semantics. + * The condition_name values of these entries must be unique. + * + * The resolved value of a config parameter P is determined as follow: + * * Let Y be the set of values from the submap of P that refer to conditions + * that evaluate to true. + * * If Y is non empty, the value is taken from the specific submap in Y whose + * condition_name is the earliest in this condition list. + * * Else, if P has a default value option (condition_name is empty) then + * the value is taken from that option. + * * Else, parameter P has no value and is omitted from the config result. + * + * Example: parameter key "p1", default value "v1", submap specified as + * {"c1": v2, "c2": v3} where "c1" and "c2" are names of conditions in the + * condition list (where "c1" in this example appears before "c2"). The + * value of p1 would be v2 as long as c1 is true. Otherwise, if c2 is true, + * p1 would evaluate to v3, and if c1 and c2 are both false, p1 would evaluate + * to v1. If no default value was specified, and c1 and c2 were both false, + * no value for p1 would be generated. + */ + conditions?: RemoteConfigCondition[]; + /** + * Map of parameter keys to their optional default values and optional submap + * of (condition name : value). Order doesn't affect semantics, and so is + * sorted by the server. The 'key' values of the params must be unique. + */ + parameters?: Record; + } + interface RemoteConfigCondition { + /** Required. */ + expression?: string; + /** + * Required. + * A non empty and unique name of this condition. + */ + name?: string; + /** + * Optional. + * The display (tag) color of this condition. This serves as part of a tag + * (in the future, we may add tag text as well as tag color, but that is not + * yet implemented in the UI). + * This value has no affect on the semantics of the delivered config and it + * is ignored by the backend, except for passing it through write/read + * requests. + * Not having this value or having the "CONDITION_DISPLAY_COLOR_UNSPECIFIED" + * value (0) have the same meaning: Let the UI choose any valid color when + * displaying the condition. + */ + tagColor?: string; + } + interface RemoteConfigParameter { + /** + * Optional - a map of (condition_name, value). The condition_name of the + * highest priority (the one listed first in the conditions array) determines + * the value of this parameter. + */ + conditionalValues?: Record; + /** + * Optional - value to set the parameter to, when none of the named conditions + * evaluate to true. + */ + defaultValue?: RemoteConfigParameterValue; + } + interface RemoteConfigParameterValue { + /** if true, omit the parameter from the map of fetched parameter values */ + useInAppDefault?: boolean; + /** the string to set the parameter to */ + value?: string; + } + interface ProjectsResource { + /** + * Get the latest version Remote Configuration for a project. + * Returns the RemoteConfig as the payload, and also the eTag as a + * response header. + */ + getRemoteConfig(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The GMP project identifier. Required. + * See note at the beginning of this file regarding project ids. + */ + project: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Update a RemoteConfig. We treat this as an always-existing + * resource (when it is not found in our data store, we treat it as version + * 0, a template with zero conditions and zero parameters). Hence there are + * no Create or Delete operations. Returns the updated template when + * successful (and the updated eTag as a response header), or an error if + * things go wrong. + * Possible error messages: + * * VALIDATION_ERROR (HTTP status 400) with additional details if the + * template being passed in can not be validated. + * * AUTHENTICATION_ERROR (HTTP status 401) if the request can not be + * authenticate (e.g. no access token, or invalid access token). + * * AUTHORIZATION_ERROR (HTTP status 403) if the request can not be + * authorized (e.g. the user has no access to the specified project id). + * * VERSION_MISMATCH (HTTP status 412) when trying to update when the + * expected eTag (passed in via the "If-match" header) is not specified, or + * is specified but does does not match the current eTag. + * * Internal error (HTTP status 500) for Database problems or other internal + * errors. + */ + updateRemoteConfig(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * The GMP project identifier. Required. + * See note at the beginning of this file regarding project ids. + */ + project: string; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + /** + * Optional. Defaults to false (UpdateRemoteConfig call should + * update the backend if there are no validation/interal errors). May be set + * to true to indicate that, should no validation errors occur, + * the call should return a "200 OK" instead of performing the update. Note + * that other error messages (500 Internal Error, 412 Version Mismatch, etc) + * may still result after flipping to false, even if getting a + * "200 OK" when calling with true. + */ + validateOnly?: boolean; + }): Request; + } + } +} diff --git a/types/gapi.client.firebaseremoteconfig/readme.md b/types/gapi.client.firebaseremoteconfig/readme.md new file mode 100644 index 0000000000..eb99d22d5f --- /dev/null +++ b/types/gapi.client.firebaseremoteconfig/readme.md @@ -0,0 +1,64 @@ +# TypeScript typings for Firebase Remote Config API v1 +Firebase Remote Config API allows the 3P clients to manage Remote Config conditions and parameters for Firebase applications. +For detailed description please check [documentation](https://firebase.google.com/docs/remote-config/). + +## Installing + +Install typings for Firebase Remote Config API: +``` +npm install @types/gapi.client.firebaseremoteconfig@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('firebaseremoteconfig', 'v1', () => { + // now we can use gapi.client.firebaseremoteconfig + // ... +}); +``` + + + +After that you can use Firebase Remote Config API resources: + +```typescript + +/* +Get the latest version Remote Configuration for a project. +Returns the RemoteConfig as the payload, and also the eTag as a +response header. +*/ +await gapi.client.projects.getRemoteConfig({ project: "project", }); + +/* +Update a RemoteConfig. We treat this as an always-existing +resource (when it is not found in our data store, we treat it as version +0, a template with zero conditions and zero parameters). Hence there are +no Create or Delete operations. Returns the updated template when +successful (and the updated eTag as a response header), or an error if +things go wrong. +Possible error messages: +* VALIDATION_ERROR (HTTP status 400) with additional details if the +template being passed in can not be validated. +* AUTHENTICATION_ERROR (HTTP status 401) if the request can not be +authenticate (e.g. no access token, or invalid access token). +* AUTHORIZATION_ERROR (HTTP status 403) if the request can not be +authorized (e.g. the user has no access to the specified project id). +* VERSION_MISMATCH (HTTP status 412) when trying to update when the +expected eTag (passed in via the "If-match" header) is not specified, or +is specified but does does not match the current eTag. +* Internal error (HTTP status 500) for Database problems or other internal +errors. +*/ +await gapi.client.projects.updateRemoteConfig({ project: "project", }); +``` \ No newline at end of file diff --git a/types/gapi.client.firebaseremoteconfig/tsconfig.json b/types/gapi.client.firebaseremoteconfig/tsconfig.json new file mode 100644 index 0000000000..9366ffa276 --- /dev/null +++ b/types/gapi.client.firebaseremoteconfig/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.firebaseremoteconfig-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.firebaseremoteconfig/tslint.json b/types/gapi.client.firebaseremoteconfig/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.firebaseremoteconfig/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.firebaserules/gapi.client.firebaserules-tests.ts b/types/gapi.client.firebaserules/gapi.client.firebaserules-tests.ts new file mode 100644 index 0000000000..28ca08a8d8 --- /dev/null +++ b/types/gapi.client.firebaserules/gapi.client.firebaserules-tests.ts @@ -0,0 +1,63 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('firebaserules', 'v1', () => { + /** now we can use gapi.client.firebaserules */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View and administer all your Firebase data and settings */ + 'https://www.googleapis.com/auth/firebase', + /** View all your Firebase data and settings */ + 'https://www.googleapis.com/auth/firebase.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** + * Test `Source` for syntactic and semantic correctness. Issues present, if + * any, will be returned to the caller with a description, severity, and + * source location. + * + * The test method may be executed with `Source` or a `Ruleset` name. + * Passing `Source` is useful for unit testing new rules. Passing a `Ruleset` + * name is useful for regression testing an existing rule. + * + * The following is an example of `Source` that permits users to upload images + * to a bucket bearing their user id and matching the correct metadata: + * + * _*Example*_ + * + * // Users are allowed to subscribe and unsubscribe to the blog. + * service firebase.storage { + * match /users/{userId}/images/{imageName} { + * allow write: if userId == request.auth.uid + * && (imageName.matches('*.png$') + * || imageName.matches('*.jpg$')) + * && resource.mimeType.matches('^image/') + * } + * } + */ + await gapi.client.projects.test({ + name: "name", + }); + } +}); diff --git a/types/gapi.client.firebaserules/index.d.ts b/types/gapi.client.firebaserules/index.d.ts new file mode 100644 index 0000000000..fbe2fb4da7 --- /dev/null +++ b/types/gapi.client.firebaserules/index.d.ts @@ -0,0 +1,828 @@ +// Type definitions for Google Firebase Rules API v1 1.0 +// Project: https://firebase.google.com/docs/storage/security +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://firebaserules.googleapis.com/$discovery/rest?version=v1 + +/// + +declare namespace gapi.client { + /** Load Firebase Rules API v1 */ + function load(name: "firebaserules", version: "v1"): PromiseLike; + function load(name: "firebaserules", version: "v1", callback: () => any): void; + + const projects: firebaserules.ProjectsResource; + + namespace firebaserules { + interface Arg { + /** Argument matches any value provided. */ + anyValue?: any; + /** Argument exactly matches value provided. */ + exactValue?: any; + } + interface File { + /** Textual Content. */ + content?: string; + /** Fingerprint (e.g. github sha) associated with the `File`. */ + fingerprint?: string; + /** File name. */ + name?: string; + } + interface FunctionCall { + /** The arguments that were provided to the function. */ + args?: any[]; + /** Name of the function invoked. */ + function?: string; + } + interface FunctionMock { + /** + * The list of `Arg` values to match. The order in which the arguments are + * provided is the order in which they must appear in the function + * invocation. + */ + args?: Arg[]; + /** + * The name of the function. + * + * The function name must match one provided by a service declaration. + */ + function?: string; + /** The mock result of the function call. */ + result?: Result; + } + interface GetReleaseExecutableResponse { + /** Executable view of the `Ruleset` referenced by the `Release`. */ + executable?: string; + /** The Rules runtime version of the executable. */ + executableVersion?: string; + /** `Language` used to generate the executable bytes. */ + language?: string; + /** `Ruleset` name associated with the `Release` executable. */ + rulesetName?: string; + /** Timestamp for the most recent `Release.update_time`. */ + updateTime?: string; + } + interface Issue { + /** Short error description. */ + description?: string; + /** The severity of the issue. */ + severity?: string; + /** Position of the issue in the `Source`. */ + sourcePosition?: SourcePosition; + } + interface ListReleasesResponse { + /** + * The pagination token to retrieve the next page of results. If the value is + * empty, no further results remain. + */ + nextPageToken?: string; + /** List of `Release` instances. */ + releases?: Release[]; + } + interface ListRulesetsResponse { + /** + * The pagination token to retrieve the next page of results. If the value is + * empty, no further results remain. + */ + nextPageToken?: string; + /** List of `Ruleset` instances. */ + rulesets?: Ruleset[]; + } + interface Release { + /** + * Time the release was created. + * Output only. + */ + createTime?: string; + /** + * Resource name for the `Release`. + * + * `Release` names may be structured `app1/prod/v2` or flat `app1_prod_v2` + * which affords developers a great deal of flexibility in mapping the name + * to the style that best fits their existing development practices. For + * example, a name could refer to an environment, an app, a version, or some + * combination of three. + * + * In the table below, for the project name `projects/foo`, the following + * relative release paths show how flat and structured names might be chosen + * to match a desired development / deployment strategy. + * + * Use Case | Flat Name | Structured Name + * -------------|---------------------|---------------- + * Environments | releases/qa | releases/qa + * Apps | releases/app1_qa | releases/app1/qa + * Versions | releases/app1_v2_qa | releases/app1/v2/qa + * + * The delimiter between the release name path elements can be almost anything + * and it should work equally well with the release name list filter, but in + * many ways the structured paths provide a clearer picture of the + * relationship between `Release` instances. + * + * Format: `projects/{project_id}/releases/{release_id}` + */ + name?: string; + /** + * Name of the `Ruleset` referred to by this `Release`. The `Ruleset` must + * exist the `Release` to be created. + */ + rulesetName?: string; + /** + * Time the release was updated. + * Output only. + */ + updateTime?: string; + } + interface Result { + /** The result is undefined, meaning the result could not be computed. */ + undefined?: any; + /** + * The result is an actual value. The type of the value must match that + * of the type declared by the service. + */ + value?: any; + } + interface Ruleset { + /** + * Time the `Ruleset` was created. + * Output only. + */ + createTime?: string; + /** + * Name of the `Ruleset`. The ruleset_id is auto generated by the service. + * Format: `projects/{project_id}/rulesets/{ruleset_id}` + * Output only. + */ + name?: string; + /** `Source` for the `Ruleset`. */ + source?: Source; + } + interface Source { + /** `File` set constituting the `Source` bundle. */ + files?: File[]; + } + interface SourcePosition { + /** First column on the source line associated with the source fragment. */ + column?: number; + /** Name of the `File`. */ + fileName?: string; + /** Line number of the source fragment. 1-based. */ + line?: number; + } + interface TestCase { + /** Test expectation. */ + expectation?: string; + /** + * Optional function mocks for service-defined functions. If not set, any + * service defined function is expected to return an error, which may or may + * not influence the test outcome. + */ + functionMocks?: FunctionMock[]; + /** + * Request context. + * + * The exact format of the request context is service-dependent. See the + * appropriate service documentation for information about the supported + * fields and types on the request. Minimally, all services support the + * following fields and types: + * + * Request field | Type + * ---------------|----------------- + * auth.uid | `string` + * auth.token | `map` + * headers | `map` + * method | `string` + * params | `map` + * path | `string` + * time | `google.protobuf.Timestamp` + * + * If the request value is not well-formed for the service, the request will + * be rejected as an invalid argument. + */ + request?: any; + /** + * Optional resource value as it appears in persistent storage before the + * request is fulfilled. + * + * The resource type depends on the `request.path` value. + */ + resource?: any; + } + interface TestResult { + /** + * Debug messages related to test execution issues encountered during + * evaluation. + * + * Debug messages may be related to too many or too few invocations of + * function mocks or to runtime errors that occur during evaluation. + * + * For example: ```Unable to read variable [name: "resource"]``` + */ + debugMessages?: string[]; + /** + * Position in the `Source` or `Ruleset` where the principle runtime error + * occurs. + * + * Evaluation of an expression may result in an error. Rules are deny by + * default, so a `DENY` expectation when an error is generated is valid. + * When there is a `DENY` with an error, the `SourcePosition` is returned. + * + * E.g. `error_position { line: 19 column: 37 }` + */ + errorPosition?: SourcePosition; + /** + * The set of function calls made to service-defined methods. + * + * Function calls are included in the order in which they are encountered + * during evaluation, are provided for both mocked and unmocked functions, + * and included on the response regardless of the test `state`. + */ + functionCalls?: FunctionCall[]; + /** State of the test. */ + state?: string; + } + interface TestRulesetRequest { + /** + * Optional `Source` to be checked for correctness. + * + * This field must not be set when the resource name refers to a `Ruleset`. + */ + source?: Source; + /** Inline `TestSuite` to run. */ + testSuite?: TestSuite; + } + interface TestRulesetResponse { + /** + * Syntactic and semantic `Source` issues of varying severity. Issues of + * `ERROR` severity will prevent tests from executing. + */ + issues?: Issue[]; + /** + * The set of test results given the test cases in the `TestSuite`. + * The results will appear in the same order as the test cases appear in the + * `TestSuite`. + */ + testResults?: TestResult[]; + } + interface TestSuite { + /** Collection of test cases associated with the `TestSuite`. */ + testCases?: TestCase[]; + } + interface ReleasesResource { + /** + * Create a `Release`. + * + * Release names should reflect the developer's deployment practices. For + * example, the release name may include the environment name, application + * name, application version, or any other name meaningful to the developer. + * Once a `Release` refers to a `Ruleset`, the rules can be enforced by + * Firebase Rules-enabled services. + * + * More than one `Release` may be 'live' concurrently. Consider the following + * three `Release` names for `projects/foo` and the `Ruleset` to which they + * refer. + * + * Release Name | Ruleset Name + * --------------------------------|------------- + * projects/foo/releases/prod | projects/foo/rulesets/uuid123 + * projects/foo/releases/prod/beta | projects/foo/rulesets/uuid123 + * projects/foo/releases/prod/v23 | projects/foo/rulesets/uuid456 + * + * The table reflects the `Ruleset` rollout in progress. The `prod` and + * `prod/beta` releases refer to the same `Ruleset`. However, `prod/v23` + * refers to a new `Ruleset`. The `Ruleset` reference for a `Release` may be + * updated using the UpdateRelease method. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Resource name for the project which owns this `Release`. + * + * Format: `projects/{project_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Delete a `Release` by resource name. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Resource name for the `Release` to delete. + * + * Format: `projects/{project_id}/releases/{release_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Get a `Release` by name. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Resource name of the `Release`. + * + * Format: `projects/{project_id}/releases/{release_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Get the `Release` executable to use when enforcing rules. */ + getExecutable(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The requested runtime executable version. + * Defaults to FIREBASE_RULES_EXECUTABLE_V1 + */ + executableVersion?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Resource name of the `Release`. + * + * Format: `projects/{project_id}/releases/{release_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * List the `Release` values for a project. This list may optionally be + * filtered by `Release` name, `Ruleset` name, `TestSuite` name, or any + * combination thereof. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * `Release` filter. The list method supports filters with restrictions on the + * `Release.name`, `Release.ruleset_name`, and `Release.test_suite_name`. + * + * Example 1: A filter of 'name=prod*' might return `Release`s with names + * within 'projects/foo' prefixed with 'prod': + * + * Name | Ruleset Name + * ------------------------------|------------- + * projects/foo/releases/prod | projects/foo/rulesets/uuid1234 + * projects/foo/releases/prod/v1 | projects/foo/rulesets/uuid1234 + * projects/foo/releases/prod/v2 | projects/foo/rulesets/uuid8888 + * + * Example 2: A filter of `name=prod* ruleset_name=uuid1234` would return only + * `Release` instances for 'projects/foo' with names prefixed with 'prod' + * referring to the same `Ruleset` name of 'uuid1234': + * + * Name | Ruleset Name + * ------------------------------|------------- + * projects/foo/releases/prod | projects/foo/rulesets/1234 + * projects/foo/releases/prod/v1 | projects/foo/rulesets/1234 + * + * In the examples, the filter parameters refer to the search filters are + * relative to the project. Fully qualified prefixed may also be used. e.g. + * `test_suite_name=projects/foo/testsuites/uuid1` + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Resource name for the project. + * + * Format: `projects/{project_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Page size to load. Maximum of 100. Defaults to 10. + * Note: `page_size` is just a hint and the service may choose to load fewer + * than `page_size` results due to the size of the output. To traverse all of + * the releases, the caller should iterate until the `page_token` on the + * response is empty. + */ + pageSize?: number; + /** Next page token for the next batch of `Release` instances. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Update a `Release`. + * + * Only updates to the `ruleset_name` and `test_suite_name` fields will be + * honored. `Release` rename is not supported. To create a `Release` use the + * CreateRelease method. + */ + update(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Resource name for the `Release`. + * + * `Release` names may be structured `app1/prod/v2` or flat `app1_prod_v2` + * which affords developers a great deal of flexibility in mapping the name + * to the style that best fits their existing development practices. For + * example, a name could refer to an environment, an app, a version, or some + * combination of three. + * + * In the table below, for the project name `projects/foo`, the following + * relative release paths show how flat and structured names might be chosen + * to match a desired development / deployment strategy. + * + * Use Case | Flat Name | Structured Name + * -------------|---------------------|---------------- + * Environments | releases/qa | releases/qa + * Apps | releases/app1_qa | releases/app1/qa + * Versions | releases/app1_v2_qa | releases/app1/v2/qa + * + * The delimiter between the release name path elements can be almost anything + * and it should work equally well with the release name list filter, but in + * many ways the structured paths provide a clearer picture of the + * relationship between `Release` instances. + * + * Format: `projects/{project_id}/releases/{release_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface RulesetsResource { + /** + * Create a `Ruleset` from `Source`. + * + * The `Ruleset` is given a unique generated name which is returned to the + * caller. `Source` containing syntactic or semantics errors will result in an + * error response indicating the first error encountered. For a detailed view + * of `Source` issues, use TestRuleset. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Resource name for Project which owns this `Ruleset`. + * + * Format: `projects/{project_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * Delete a `Ruleset` by resource name. + * + * If the `Ruleset` is referenced by a `Release` the operation will fail. + */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Resource name for the ruleset to delete. + * + * Format: `projects/{project_id}/rulesets/{ruleset_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Get a `Ruleset` by name including the full `Source` contents. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Resource name for the ruleset to get. + * + * Format: `projects/{project_id}/rulesets/{ruleset_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** + * List `Ruleset` metadata only and optionally filter the results by `Ruleset` + * name. + * + * The full `Source` contents of a `Ruleset` may be retrieved with + * GetRuleset. + */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * `Ruleset` filter. The list method supports filters with restrictions on + * `Ruleset.name`. + * + * Filters on `Ruleset.create_time` should use the `date` function which + * parses strings that conform to the RFC 3339 date/time specifications. + * + * Example: `create_time > date("2017-01-01") AND name=UUID-*` + */ + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Resource name for the project. + * + * Format: `projects/{project_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * Page size to load. Maximum of 100. Defaults to 10. + * Note: `page_size` is just a hint and the service may choose to load less + * than `page_size` due to the size of the output. To traverse all of the + * releases, caller should iterate until the `page_token` is empty. + */ + pageSize?: number; + /** Next page token for loading the next batch of `Ruleset` instances. */ + pageToken?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface ProjectsResource { + /** + * Test `Source` for syntactic and semantic correctness. Issues present, if + * any, will be returned to the caller with a description, severity, and + * source location. + * + * The test method may be executed with `Source` or a `Ruleset` name. + * Passing `Source` is useful for unit testing new rules. Passing a `Ruleset` + * name is useful for regression testing an existing rule. + * + * The following is an example of `Source` that permits users to upload images + * to a bucket bearing their user id and matching the correct metadata: + * + * _*Example*_ + * + * // Users are allowed to subscribe and unsubscribe to the blog. + * service firebase.storage { + * match /users/{userId}/images/{imageName} { + * allow write: if userId == request.auth.uid + * && (imageName.matches('*.png$') + * || imageName.matches('*.jpg$')) + * && resource.mimeType.matches('^image/') + * } + * } + */ + test(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * Tests may either provide `source` or a `Ruleset` resource name. + * + * For tests against `source`, the resource name must refer to the project: + * Format: `projects/{project_id}` + * + * For tests against a `Ruleset`, this must be the `Ruleset` resource name: + * Format: `projects/{project_id}/rulesets/{ruleset_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + releases: ReleasesResource; + rulesets: RulesetsResource; + } + } +} diff --git a/types/gapi.client.firebaserules/readme.md b/types/gapi.client.firebaserules/readme.md new file mode 100644 index 0000000000..992701be26 --- /dev/null +++ b/types/gapi.client.firebaserules/readme.md @@ -0,0 +1,87 @@ +# TypeScript typings for Firebase Rules API v1 +Creates and manages rules that determine when a Firebase Rules-enabled service should permit a request. + +For detailed description please check [documentation](https://firebase.google.com/docs/storage/security). + +## Installing + +Install typings for Firebase Rules API: +``` +npm install @types/gapi.client.firebaserules@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('firebaserules', 'v1', () => { + // now we can use gapi.client.firebaserules + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View and administer all your Firebase data and settings + 'https://www.googleapis.com/auth/firebase', + + // View all your Firebase data and settings + 'https://www.googleapis.com/auth/firebase.readonly', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Firebase Rules API resources: + +```typescript + +/* +Test `Source` for syntactic and semantic correctness. Issues present, if +any, will be returned to the caller with a description, severity, and +source location. + +The test method may be executed with `Source` or a `Ruleset` name. +Passing `Source` is useful for unit testing new rules. Passing a `Ruleset` +name is useful for regression testing an existing rule. + +The following is an example of `Source` that permits users to upload images +to a bucket bearing their user id and matching the correct metadata: + +_*Example*_ + + // Users are allowed to subscribe and unsubscribe to the blog. + service firebase.storage { + match /users/{userId}/images/{imageName} { + allow write: if userId == request.auth.uid + && (imageName.matches('*.png$') + || imageName.matches('*.jpg$')) + && resource.mimeType.matches('^image/') + } + } +*/ +await gapi.client.projects.test({ name: "name", }); +``` \ No newline at end of file diff --git a/types/gapi.client.firebaserules/tsconfig.json b/types/gapi.client.firebaserules/tsconfig.json new file mode 100644 index 0000000000..fe476614b8 --- /dev/null +++ b/types/gapi.client.firebaserules/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.firebaserules-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.firebaserules/tslint.json b/types/gapi.client.firebaserules/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.firebaserules/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.firestore/gapi.client.firestore-tests.ts b/types/gapi.client.firestore/gapi.client.firestore-tests.ts new file mode 100644 index 0000000000..45c7838019 --- /dev/null +++ b/types/gapi.client.firestore/gapi.client.firestore-tests.ts @@ -0,0 +1,34 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('firestore', 'v1beta1', () => { + /** now we can use gapi.client.firestore */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View and manage your data across Google Cloud Platform services */ + 'https://www.googleapis.com/auth/cloud-platform', + /** View and manage your Google Cloud Datastore data */ + 'https://www.googleapis.com/auth/datastore', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + } +}); diff --git a/types/gapi.client.firestore/index.d.ts b/types/gapi.client.firestore/index.d.ts new file mode 100644 index 0000000000..783434a8c7 --- /dev/null +++ b/types/gapi.client.firestore/index.d.ts @@ -0,0 +1,1579 @@ +// Type definitions for Google Google Cloud Firestore API v1beta1 1.0 +// Project: https://cloud.google.com/firestore +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://firestore.googleapis.com/$discovery/rest?version=v1beta1 + +/// + +declare namespace gapi.client { + /** Load Google Cloud Firestore API v1beta1 */ + function load(name: "firestore", version: "v1beta1"): PromiseLike; + function load(name: "firestore", version: "v1beta1", callback: () => any): void; + + const projects: firestore.ProjectsResource; + + namespace firestore { + interface ArrayValue { + /** Values in the array. */ + values?: Value[]; + } + interface BatchGetDocumentsRequest { + /** + * The names of the documents to retrieve. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * The request will fail if any of the document is not a child resource of the + * given `database`. Duplicate names will be elided. + */ + documents?: string[]; + /** + * The fields to return. If not set, returns all fields. + * + * If a document has a field that is not present in this mask, that field will + * not be returned in the response. + */ + mask?: DocumentMask; + /** + * Starts a new transaction and reads the documents. + * Defaults to a read-only transaction. + * The new transaction ID will be returned as the first response in the + * stream. + */ + newTransaction?: TransactionOptions; + /** + * Reads documents as they were at the given time. + * This may not be older than 60 seconds. + */ + readTime?: string; + /** Reads documents in a transaction. */ + transaction?: string; + } + interface BatchGetDocumentsResponse { + /** A document that was requested. */ + found?: Document; + /** + * A document name that was requested but does not exist. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + */ + missing?: string; + /** + * The time at which the document was read. + * This may be monotically increasing, in this case the previous documents in + * the result stream are guaranteed not to have changed between their + * read_time and this one. + */ + readTime?: string; + /** + * The transaction that was started as part of this request. + * Will only be set in the first response, and only if + * BatchGetDocumentsRequest.new_transaction was set in the request. + */ + transaction?: string; + } + interface BeginTransactionRequest { + /** + * The options for the transaction. + * Defaults to a read-write transaction. + */ + options?: TransactionOptions; + } + interface BeginTransactionResponse { + /** The transaction that was started. */ + transaction?: string; + } + interface CollectionSelector { + /** + * When false, selects only collections that are immediate children of + * the `parent` specified in the containing `RunQueryRequest`. + * When true, selects all descendant collections. + */ + allDescendants?: boolean; + /** + * The collection ID. + * When set, selects only collections with this ID. + */ + collectionId?: string; + } + interface CommitRequest { + /** + * If non-empty, applies all writes in this transaction, and commits it. + * Otherwise, applies the writes as if they were in their own transaction. + */ + transaction?: string; + /** + * The writes to apply. + * + * Always executed atomically and in order. + */ + writes?: Write[]; + } + interface CommitResponse { + /** The time at which the commit occurred. */ + commitTime?: string; + /** + * The result of applying the writes. + * + * This i-th write result corresponds to the i-th write in the + * request. + */ + writeResults?: WriteResult[]; + } + interface CompositeFilter { + /** + * The list of filters to combine. + * Must contain at least one filter. + */ + filters?: Filter[]; + /** The operator for combining multiple filters. */ + op?: string; + } + interface Cursor { + /** + * If the position is just before or just after the given values, relative + * to the sort order defined by the query. + */ + before?: boolean; + /** + * The values that represent a position, in the order they appear in + * the order by clause of a query. + * + * Can contain fewer values than specified in the order by clause. + */ + values?: Value[]; + } + interface Document { + /** + * Output only. The time at which the document was created. + * + * This value increases monotonically when a document is deleted then + * recreated. It can also be compared to values from other documents and + * the `read_time` of a query. + */ + createTime?: string; + /** + * The document's fields. + * + * The map keys represent field names. + * + * A simple field name contains only characters `a` to `z`, `A` to `Z`, + * `0` to `9`, or `_`, and must not start with `0` to `9` or `_`. For example, + * `foo_bar_17`. + * + * Field names matching the regular expression `__.*__` are reserved. Reserved + * field names are forbidden except in certain documented contexts. The map + * keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be + * empty. + * + * Field paths may be used in other contexts to refer to structured fields + * defined here. For `map_value`, the field path is represented by the simple + * or quoted field names of the containing fields, delimited by `.`. For + * example, the structured field + * `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be + * represented by the field path `foo.x&y`. + * + * Within a field path, a quoted field name starts and ends with `` ` `` and + * may contain any character. Some characters, including `` ` ``, must be + * escaped using a `\`. For example, `` `x&y` `` represents `x&y` and + * `` `bak\`tik` `` represents `` bak`tik ``. + */ + fields?: Record; + /** + * The resource name of the document, for example + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + */ + name?: string; + /** + * Output only. The time at which the document was last changed. + * + * This value is initally set to the `create_time` then increases + * monotonically with each change to the document. It can also be + * compared to values from other documents and the `read_time` of a query. + */ + updateTime?: string; + } + interface DocumentChange { + /** + * The new state of the Document. + * + * If `mask` is set, contains only fields that were updated or added. + */ + document?: Document; + /** A set of target IDs for targets that no longer match this document. */ + removedTargetIds?: number[]; + /** A set of target IDs of targets that match this document. */ + targetIds?: number[]; + } + interface DocumentDelete { + /** The resource name of the Document that was deleted. */ + document?: string; + /** + * The read timestamp at which the delete was observed. + * + * Greater or equal to the `commit_time` of the delete. + */ + readTime?: string; + /** A set of target IDs for targets that previously matched this entity. */ + removedTargetIds?: number[]; + } + interface DocumentMask { + /** + * The list of field paths in the mask. See Document.fields for a field + * path syntax reference. + */ + fieldPaths?: string[]; + } + interface DocumentRemove { + /** The resource name of the Document that has gone out of view. */ + document?: string; + /** + * The read timestamp at which the remove was observed. + * + * Greater or equal to the `commit_time` of the change/delete/remove. + */ + readTime?: string; + /** A set of target IDs for targets that previously matched this document. */ + removedTargetIds?: number[]; + } + interface DocumentTransform { + /** The name of the document to transform. */ + document?: string; + /** + * The list of transformations to apply to the fields of the document, in + * order. + */ + fieldTransforms?: FieldTransform[]; + } + interface DocumentsTarget { + /** + * The names of the documents to retrieve. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * The request will fail if any of the document is not a child resource of + * the given `database`. Duplicate names will be elided. + */ + documents?: string[]; + } + interface ExistenceFilter { + /** + * The total count of documents that match target_id. + * + * If different from the count of documents in the client that match, the + * client must manually determine which documents no longer match the target. + */ + count?: number; + /** The target ID to which this filter applies. */ + targetId?: number; + } + interface FieldFilter { + /** The field to filter by. */ + field?: FieldReference; + /** The operator to filter by. */ + op?: string; + /** The value to compare to. */ + value?: Value; + } + interface FieldReference { + fieldPath?: string; + } + interface FieldTransform { + /** + * The path of the field. See Document.fields for the field path syntax + * reference. + */ + fieldPath?: string; + /** Sets the field to the given server value. */ + setToServerValue?: string; + } + interface Filter { + /** A composite filter. */ + compositeFilter?: CompositeFilter; + /** A filter on a document field. */ + fieldFilter?: FieldFilter; + /** A filter that takes exactly one argument. */ + unaryFilter?: UnaryFilter; + } + interface Index { + /** The collection ID to which this index applies. Required. */ + collectionId?: string; + /** The fields to index. */ + fields?: IndexField[]; + /** The resource name of the index. */ + name?: string; + /** + * The state of the index. + * The state is read-only. + * @OutputOnly + */ + state?: string; + } + interface IndexField { + /** + * The path of the field. Must match the field path specification described + * by google.firestore.v1beta1.Document.fields. + * Special field path `__name__` may be used by itself or at the end of a + * path. `__type__` may be used only at the end of path. + */ + fieldPath?: string; + /** The field's mode. */ + mode?: string; + } + interface IndexOperationMetadata { + /** + * True if the [google.longrunning.Operation] was cancelled. If the + * cancellation is in progress, cancelled will be true but + * google.longrunning.Operation.done will be false. + */ + cancelled?: boolean; + /** Progress of the existing operation, measured in number of documents. */ + documentProgress?: Progress; + /** + * The time the operation ended, either successfully or otherwise. Unset if + * the operation is still active. + */ + endTime?: string; + /** + * The index resource that this operation is acting on. For example: + * `projects/{project_id}/databases/{database_id}/indexes/{index_id}` + */ + index?: string; + /** The type of index operation. */ + operationType?: string; + /** The time that work began on the operation. */ + startTime?: string; + } + interface LatLng { + /** The latitude in degrees. It must be in the range [-90.0, +90.0]. */ + latitude?: number; + /** The longitude in degrees. It must be in the range [-180.0, +180.0]. */ + longitude?: number; + } + interface ListCollectionIdsResponse { + /** The collection ids. */ + collectionIds?: string[]; + /** A page token that may be used to continue the list. */ + nextPageToken?: string; + } + interface ListDocumentsResponse { + /** The Documents found. */ + documents?: Document[]; + /** The next page token. */ + nextPageToken?: string; + } + interface ListIndexesResponse { + /** The indexes. */ + indexes?: Index[]; + /** The standard List next-page token. */ + nextPageToken?: string; + } + interface ListenRequest { + /** A target to add to this stream. */ + addTarget?: Target; + /** Labels associated with this target change. */ + labels?: Record; + /** The ID of a target to remove from this stream. */ + removeTarget?: number; + } + interface ListenResponse { + /** A Document has changed. */ + documentChange?: DocumentChange; + /** A Document has been deleted. */ + documentDelete?: DocumentDelete; + /** + * A Document has been removed from a target (because it is no longer + * relevant to that target). + */ + documentRemove?: DocumentRemove; + /** + * A filter to apply to the set of documents previously returned for the + * given target. + * + * Returned when documents may have been removed from the given target, but + * the exact documents are unknown. + */ + filter?: ExistenceFilter; + /** Targets have changed. */ + targetChange?: TargetChange; + } + interface MapValue { + /** + * The map's fields. + * + * The map keys represent field names. Field names matching the regular + * expression `__.*__` are reserved. Reserved field names are forbidden except + * in certain documented contexts. The map keys, represented as UTF-8, must + * not exceed 1,500 bytes and cannot be empty. + */ + fields?: Record; + } + interface Operation { + /** + * If the value is `false`, it means the operation is still in progress. + * If `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done?: boolean; + /** The error result of the operation in case of failure or cancellation. */ + error?: Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata?: Record; + /** + * The server-assigned name, which is only unique within the same service that + * originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name?: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` + * is the original method name. For example, if the original method name + * is `TakeSnapshot()`, the inferred response type is + * `TakeSnapshotResponse`. + */ + response?: Record; + } + interface Order { + /** The direction to order by. Defaults to `ASCENDING`. */ + direction?: string; + /** The field to order by. */ + field?: FieldReference; + } + interface Precondition { + /** + * When set to `true`, the target document must exist. + * When set to `false`, the target document must not exist. + */ + exists?: boolean; + /** + * When set, the target document must exist and have been last updated at + * that time. + */ + updateTime?: string; + } + interface Progress { + /** + * An estimate of how much work has been completed. Note that this may be + * greater than `work_estimated`. + */ + workCompleted?: string; + /** + * An estimate of how much work needs to be performed. Zero if the + * work estimate is unavailable. May change as work progresses. + */ + workEstimated?: string; + } + interface Projection { + /** + * The fields to return. + * + * If empty, all fields are returned. To only return the name + * of the document, use `['__name__']`. + */ + fields?: FieldReference[]; + } + interface QueryTarget { + /** + * The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + */ + parent?: string; + /** A structured query. */ + structuredQuery?: StructuredQuery; + } + interface ReadOnly { + /** + * Reads documents at the given time. + * This may not be older than 60 seconds. + */ + readTime?: string; + } + interface ReadWrite { + /** An optional transaction to retry. */ + retryTransaction?: string; + } + interface RollbackRequest { + /** The transaction to roll back. */ + transaction?: string; + } + interface RunQueryRequest { + /** + * Starts a new transaction and reads the documents. + * Defaults to a read-only transaction. + * The new transaction ID will be returned as the first response in the + * stream. + */ + newTransaction?: TransactionOptions; + /** + * Reads documents as they were at the given time. + * This may not be older than 60 seconds. + */ + readTime?: string; + /** A structured query. */ + structuredQuery?: StructuredQuery; + /** Reads documents in a transaction. */ + transaction?: string; + } + interface RunQueryResponse { + /** + * A query result. + * Not set when reporting partial progress. + */ + document?: Document; + /** + * The time at which the document was read. This may be monotonically + * increasing; in this case, the previous documents in the result stream are + * guaranteed not to have changed between their `read_time` and this one. + * + * If the query returns no results, a response with `read_time` and no + * `document` will be sent, and this represents the time at which the query + * was run. + */ + readTime?: string; + /** + * The number of results that have been skipped due to an offset between + * the last response and the current response. + */ + skippedResults?: number; + /** + * The transaction that was started as part of this request. + * Can only be set in the first response, and only if + * RunQueryRequest.new_transaction was set in the request. + * If set, no other fields will be set in this response. + */ + transaction?: string; + } + interface Status { + /** The status code, which should be an enum value of google.rpc.Code. */ + code?: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details?: Array>; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message?: string; + } + interface StructuredQuery { + /** A end point for the query results. */ + endAt?: Cursor; + /** The collections to query. */ + from?: CollectionSelector[]; + /** + * The maximum number of results to return. + * + * Applies after all other constraints. + * Must be >= 0 if specified. + */ + limit?: number; + /** + * The number of results to skip. + * + * Applies before limit, but after all other constraints. Must be >= 0 if + * specified. + */ + offset?: number; + /** + * The order to apply to the query results. + * + * Firestore guarantees a stable ordering through the following rules: + * + * * Any field required to appear in `order_by`, that is not already + * specified in `order_by`, is appended to the order in field name order + * by default. + * * If an order on `__name__` is not specified, it is appended by default. + * + * Fields are appended with the same sort direction as the last order + * specified, or 'ASCENDING' if no order was specified. For example: + * + * * `SELECT * FROM Foo ORDER BY A` becomes + * `SELECT * FROM Foo ORDER BY A, __name__` + * * `SELECT * FROM Foo ORDER BY A DESC` becomes + * `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC` + * * `SELECT * FROM Foo WHERE A > 1` becomes + * `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__` + */ + orderBy?: Order[]; + /** The projection to return. */ + select?: Projection; + /** A starting point for the query results. */ + startAt?: Cursor; + /** The filter to apply. */ + where?: Filter; + } + interface Target { + /** A target specified by a set of document names. */ + documents?: DocumentsTarget; + /** If the target should be removed once it is current and consistent. */ + once?: boolean; + /** A target specified by a query. */ + query?: QueryTarget; + /** + * Start listening after a specific `read_time`. + * + * The client must know the state of matching documents at this time. + */ + readTime?: string; + /** + * A resume token from a prior TargetChange for an identical target. + * + * Using a resume token with a different target is unsupported and may fail. + */ + resumeToken?: string; + /** + * A client provided target ID. + * + * If not set, the server will assign an ID for the target. + * + * Used for resuming a target without changing IDs. The IDs can either be + * client-assigned or be server-assigned in a previous stream. All targets + * with client provided IDs must be added before adding a target that needs + * a server-assigned id. + */ + targetId?: number; + } + interface TargetChange { + /** The error that resulted in this change, if applicable. */ + cause?: Status; + /** + * The consistent `read_time` for the given `target_ids` (omitted when the + * target_ids are not at a consistent snapshot). + * + * The stream is guaranteed to send a `read_time` with `target_ids` empty + * whenever the entire stream reaches a new consistent snapshot. ADD, + * CURRENT, and RESET messages are guaranteed to (eventually) result in a + * new consistent snapshot (while NO_CHANGE and REMOVE messages are not). + * + * For a given stream, `read_time` is guaranteed to be monotonically + * increasing. + */ + readTime?: string; + /** + * A token that can be used to resume the stream for the given `target_ids`, + * or all targets if `target_ids` is empty. + * + * Not set on every target change. + */ + resumeToken?: string; + /** The type of change that occurred. */ + targetChangeType?: string; + /** + * The target IDs of targets that have changed. + * + * If empty, the change applies to all targets. + * + * For `target_change_type=ADD`, the order of the target IDs matches the order + * of the requests to add the targets. This allows clients to unambiguously + * associate server-assigned target IDs with added targets. + * + * For other states, the order of the target IDs is not defined. + */ + targetIds?: number[]; + } + interface TransactionOptions { + /** The transaction can only be used for read operations. */ + readOnly?: ReadOnly; + /** The transaction can be used for both read and write operations. */ + readWrite?: ReadWrite; + } + interface UnaryFilter { + /** The field to which to apply the operator. */ + field?: FieldReference; + /** The unary operator to apply. */ + op?: string; + } + interface Value { + /** + * An array value. + * + * Cannot contain another array value. + */ + arrayValue?: ArrayValue; + /** A boolean value. */ + booleanValue?: boolean; + /** + * A bytes value. + * + * Must not exceed 1 MiB - 89 bytes. + * Only the first 1,500 bytes are considered by queries. + */ + bytesValue?: string; + /** A double value. */ + doubleValue?: number; + /** A geo point value representing a point on the surface of Earth. */ + geoPointValue?: LatLng; + /** An integer value. */ + integerValue?: string; + /** A map value. */ + mapValue?: MapValue; + /** A null value. */ + nullValue?: string; + /** + * A reference to a document. For example: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + */ + referenceValue?: string; + /** + * A string value. + * + * The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. + * Only the first 1,500 bytes of the UTF-8 representation are considered by + * queries. + */ + stringValue?: string; + /** + * A timestamp value. + * + * Precise only to microseconds. When stored, any additional precision is + * rounded down. + */ + timestampValue?: string; + } + interface Write { + /** + * An optional precondition on the document. + * + * The write will fail if this is set and not met by the target document. + */ + currentDocument?: Precondition; + /** + * A document name to delete. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + */ + delete?: string; + /** + * Applies a tranformation to a document. + * At most one `transform` per document is allowed in a given request. + * An `update` cannot follow a `transform` on the same document in a given + * request. + */ + transform?: DocumentTransform; + /** A document to write. */ + update?: Document; + /** + * The fields to update in this write. + * + * This field can be set only when the operation is `update`. + * None of the field paths in the mask may contain a reserved name. + * If the document exists on the server and has fields not referenced in the + * mask, they are left unchanged. + * Fields referenced in the mask, but not present in the input document, are + * deleted from the document on the server. + * The field paths in this mask must not contain a reserved field name. + */ + updateMask?: DocumentMask; + } + interface WriteRequest { + /** Labels associated with this write request. */ + labels?: Record; + /** + * The ID of the write stream to resume. + * This may only be set in the first message. When left empty, a new write + * stream will be created. + */ + streamId?: string; + /** + * A stream token that was previously sent by the server. + * + * The client should set this field to the token from the most recent + * WriteResponse it has received. This acknowledges that the client has + * received responses up to this token. After sending this token, earlier + * tokens may not be used anymore. + * + * The server may close the stream if there are too many unacknowledged + * responses. + * + * Leave this field unset when creating a new stream. To resume a stream at + * a specific point, set this field and the `stream_id` field. + * + * Leave this field unset when creating a new stream. + */ + streamToken?: string; + /** + * The writes to apply. + * + * Always executed atomically and in order. + * This must be empty on the first request. + * This may be empty on the last request. + * This must not be empty on all other requests. + */ + writes?: Write[]; + } + interface WriteResponse { + /** The time at which the commit occurred. */ + commitTime?: string; + /** + * The ID of the stream. + * Only set on the first message, when a new stream was created. + */ + streamId?: string; + /** + * A token that represents the position of this response in the stream. + * This can be used by a client to resume the stream at this point. + * + * This field is always set. + */ + streamToken?: string; + /** + * The result of applying the writes. + * + * This i-th write result corresponds to the i-th write in the + * request. + */ + writeResults?: WriteResult[]; + } + interface WriteResult { + /** + * The results of applying each DocumentTransform.FieldTransform, in the + * same order. + */ + transformResults?: Value[]; + /** + * The last update time of the document after applying the write. Not set + * after a `delete`. + * + * If the write did not actually change the document, this will be the + * previous update_time. + */ + updateTime?: string; + } + interface DocumentsResource { + /** + * Gets multiple documents. + * + * Documents returned by this method are not guaranteed to be returned in the + * same order that they were requested. + */ + batchGet(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + */ + database: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Starts a new transaction. */ + beginTransaction(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + */ + database: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Commits a transaction, while optionally updating documents. */ + commit(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + */ + database: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Creates a new document. */ + createDocument(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** The collection ID, relative to `parent`, to list. For example: `chatrooms`. */ + collectionId: string; + /** + * The client-assigned document ID to use for this document. + * + * Optional. If not specified, an ID will be assigned by the service. + */ + documentId?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The list of field paths in the mask. See Document.fields for a field + * path syntax reference. + */ + "mask.fieldPaths"?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The parent resource. For example: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Deletes a document. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * When set to `true`, the target document must exist. + * When set to `false`, the target document must not exist. + */ + "currentDocument.exists"?: boolean; + /** + * When set, the target document must exist and have been last updated at + * that time. + */ + "currentDocument.updateTime"?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The resource name of the Document to delete. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Gets a single document. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The list of field paths in the mask. See Document.fields for a field + * path syntax reference. + */ + "mask.fieldPaths"?: string; + /** + * The resource name of the Document to get. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Reads the version of the document at the given time. + * This may not be older than 60 seconds. + */ + readTime?: string; + /** Reads the document in a transaction. */ + transaction?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists documents. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The collection ID, relative to `parent`, to list. For example: `chatrooms` + * or `messages`. + */ + collectionId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The list of field paths in the mask. See Document.fields for a field + * path syntax reference. + */ + "mask.fieldPaths"?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The order to sort results by. For example: `priority desc, name`. */ + orderBy?: string; + /** The maximum number of documents to return. */ + pageSize?: number; + /** The `next_page_token` value returned from a previous List request, if any. */ + pageToken?: string; + /** + * The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * Reads documents as they were at the given time. + * This may not be older than 60 seconds. + */ + readTime?: string; + /** + * If the list should show missing documents. A missing document is a + * document that does not exist but has sub-documents. These documents will + * be returned with a key but will not have fields, Document.create_time, + * or Document.update_time set. + * + * Requests with `show_missing` may not specify `where` or + * `order_by`. + */ + showMissing?: boolean; + /** Reads documents in a transaction. */ + transaction?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists all the collection IDs underneath a document. */ + listCollectionIds(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The maximum number of results to return. */ + pageSize?: number; + /** + * A page token. Must be a value from + * ListCollectionIdsResponse. + */ + pageToken?: string; + /** + * The parent document. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Listens to changes. */ + listen(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + */ + database: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Updates or inserts a document. */ + patch(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * When set to `true`, the target document must exist. + * When set to `false`, the target document must not exist. + */ + "currentDocument.exists"?: boolean; + /** + * When set, the target document must exist and have been last updated at + * that time. + */ + "currentDocument.updateTime"?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The list of field paths in the mask. See Document.fields for a field + * path syntax reference. + */ + "mask.fieldPaths"?: string; + /** + * The resource name of the document, for example + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** + * The list of field paths in the mask. See Document.fields for a field + * path syntax reference. + */ + "updateMask.fieldPaths"?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Rolls back a transaction. */ + rollback(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + */ + database: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Runs a query. */ + runQuery(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: + * `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Streams batches of document updates and deletes, in order. */ + write(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** + * The database name. In the format: + * `projects/{project_id}/databases/{database_id}`. + * This is only required in the first message. + */ + database: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface IndexesResource { + /** + * Creates the specified index. + * A newly created index's initial state is `CREATING`. On completion of the + * returned google.longrunning.Operation, the state will be `READY`. + * If the index already exists, the call will return an `ALREADY_EXISTS` + * status. + * + * During creation, the process could result in an error, in which case the + * index will move to the `ERROR` state. The process can be recovered by + * fixing the data that caused the error, removing the index with + * delete, then re-creating the index with + * create. + * + * Indexes with a single field cannot be created. + */ + create(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The name of the database this index will apply to. For example: + * `projects/{project_id}/databases/{database_id}` + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Deletes an index. */ + delete(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The index name. For example: + * `projects/{project_id}/databases/{database_id}/indexes/{index_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request<{}>; + /** Gets an index. */ + get(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * The name of the index. For example: + * `projects/{project_id}/databases/{database_id}/indexes/{index_id}` + */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + /** Lists the indexes that match the specified filters. */ + list(request: { + /** V1 error format. */ + "$.xgafv"?: string; + /** OAuth access token. */ + access_token?: string; + /** Data format for response. */ + alt?: string; + /** OAuth bearer token. */ + bearer_token?: string; + /** JSONP */ + callback?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + filter?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** The standard List page size. */ + pageSize?: number; + /** The standard List page token. */ + pageToken?: string; + /** + * The database name. For example: + * `projects/{project_id}/databases/{database_id}` + */ + parent: string; + /** Pretty-print response. */ + pp?: boolean; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ + quotaUser?: string; + /** Legacy upload protocol for media (e.g. "media", "multipart"). */ + uploadType?: string; + /** Upload protocol for media (e.g. "raw", "multipart"). */ + upload_protocol?: string; + }): Request; + } + interface DatabasesResource { + documents: DocumentsResource; + indexes: IndexesResource; + } + interface ProjectsResource { + databases: DatabasesResource; + } + } +} diff --git a/types/gapi.client.firestore/readme.md b/types/gapi.client.firestore/readme.md new file mode 100644 index 0000000000..8609bf31fb --- /dev/null +++ b/types/gapi.client.firestore/readme.md @@ -0,0 +1,57 @@ +# TypeScript typings for Google Cloud Firestore API v1beta1 + +For detailed description please check [documentation](https://cloud.google.com/firestore). + +## Installing + +Install typings for Google Cloud Firestore API: +``` +npm install @types/gapi.client.firestore@v1beta1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('firestore', 'v1beta1', () => { + // now we can use gapi.client.firestore + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View and manage your data across Google Cloud Platform services + 'https://www.googleapis.com/auth/cloud-platform', + + // View and manage your Google Cloud Datastore data + 'https://www.googleapis.com/auth/datastore', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Google Cloud Firestore API resources: + +```typescript +``` \ No newline at end of file diff --git a/types/gapi.client.firestore/tsconfig.json b/types/gapi.client.firestore/tsconfig.json new file mode 100644 index 0000000000..c15195612c --- /dev/null +++ b/types/gapi.client.firestore/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.firestore-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.firestore/tslint.json b/types/gapi.client.firestore/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.firestore/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.fitness/gapi.client.fitness-tests.ts b/types/gapi.client.fitness/gapi.client.fitness-tests.ts new file mode 100644 index 0000000000..81bcf6a5bf --- /dev/null +++ b/types/gapi.client.fitness/gapi.client.fitness-tests.ts @@ -0,0 +1,66 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('fitness', 'v1', () => { + /** now we can use gapi.client.fitness */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** View your activity information in Google Fit */ + 'https://www.googleapis.com/auth/fitness.activity.read', + /** View and store your activity information in Google Fit */ + 'https://www.googleapis.com/auth/fitness.activity.write', + /** View blood glucose data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.blood_glucose.read', + /** View and store blood glucose data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.blood_glucose.write', + /** View blood pressure data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.blood_pressure.read', + /** View and store blood pressure data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.blood_pressure.write', + /** View body sensor information in Google Fit */ + 'https://www.googleapis.com/auth/fitness.body.read', + /** View and store body sensor data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.body.write', + /** View body temperature data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.body_temperature.read', + /** View and store body temperature data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.body_temperature.write', + /** View your stored location data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.location.read', + /** View and store your location data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.location.write', + /** View nutrition information in Google Fit */ + 'https://www.googleapis.com/auth/fitness.nutrition.read', + /** View and store nutrition information in Google Fit */ + 'https://www.googleapis.com/auth/fitness.nutrition.write', + /** View oxygen saturation data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.oxygen_saturation.read', + /** View and store oxygen saturation data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.oxygen_saturation.write', + /** View reproductive health data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.reproductive_health.read', + /** View and store reproductive health data in Google Fit */ + 'https://www.googleapis.com/auth/fitness.reproductive_health.write', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + } +}); diff --git a/types/gapi.client.fitness/index.d.ts b/types/gapi.client.fitness/index.d.ts new file mode 100644 index 0000000000..a5b2f034d5 --- /dev/null +++ b/types/gapi.client.fitness/index.d.ts @@ -0,0 +1,767 @@ +// Type definitions for Google Fitness v1 1.0 +// Project: https://developers.google.com/fit/rest/ +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/fitness/v1/rest + +/// + +declare namespace gapi.client { + /** Load Fitness v1 */ + function load(name: "fitness", version: "v1"): PromiseLike; + function load(name: "fitness", version: "v1", callback: () => any): void; + + const users: fitness.UsersResource; + + namespace fitness { + interface AggregateBucket { + /** Available for Bucket.Type.ACTIVITY_TYPE, Bucket.Type.ACTIVITY_SEGMENT */ + activity?: number; + /** There will be one dataset per AggregateBy in the request. */ + dataset?: Dataset[]; + /** The end time for the aggregated data, in milliseconds since epoch, inclusive. */ + endTimeMillis?: string; + /** Available for Bucket.Type.SESSION */ + session?: Session; + /** The start time for the aggregated data, in milliseconds since epoch, inclusive. */ + startTimeMillis?: string; + /** The type of a bucket signifies how the data aggregation is performed in the bucket. */ + type?: string; + } + interface AggregateBy { + /** + * A data source ID to aggregate. Mutually exclusive of dataTypeName. Only data from the specified data source ID will be included in the aggregation. The + * dataset in the response will have the same data source ID. + */ + dataSourceId?: string; + /** + * The data type to aggregate. All data sources providing this data type will contribute data to the aggregation. The response will contain a single + * dataset for this data type name. The dataset will have a data source ID of derived:com.google.:com.google.android.gms:aggregated + */ + dataTypeName?: string; + } + interface AggregateRequest { + /** + * The specification of data to be aggregated. At least one aggregateBy spec must be provided. All data that is specified will be aggregated using the + * same bucketing criteria. There will be one dataset in the response for every aggregateBy spec. + */ + aggregateBy?: AggregateBy[]; + /** + * Specifies that data be aggregated each activity segment recored for a user. Similar to bucketByActivitySegment, but bucketing is done for each activity + * segment rather than all segments of the same type. Mutually exclusive of other bucketing specifications. + */ + bucketByActivitySegment?: BucketByActivity; + /** + * Specifies that data be aggregated by the type of activity being performed when the data was recorded. All data that was recorded during a certain + * activity type (for the given time range) will be aggregated into the same bucket. Data that was recorded while the user was not active will not be + * included in the response. Mutually exclusive of other bucketing specifications. + */ + bucketByActivityType?: BucketByActivity; + /** + * Specifies that data be aggregated by user sessions. Data that does not fall within the time range of a session will not be included in the response. + * Mutually exclusive of other bucketing specifications. + */ + bucketBySession?: BucketBySession; + /** Specifies that data be aggregated by a single time interval. Mutually exclusive of other bucketing specifications. */ + bucketByTime?: BucketByTime; + /** The end of a window of time. Data that intersects with this time window will be aggregated. The time is in milliseconds since epoch, inclusive. */ + endTimeMillis?: string; + /** + * A list of acceptable data quality standards. Only data points which conform to at least one of the specified data quality standards will be returned. + * If the list is empty, all data points are returned. + */ + filteredDataQualityStandard?: string[]; + /** The start of a window of time. Data that intersects with this time window will be aggregated. The time is in milliseconds since epoch, inclusive. */ + startTimeMillis?: string; + } + interface AggregateResponse { + /** A list of buckets containing the aggregated data. */ + bucket?: AggregateBucket[]; + } + interface Application { + /** An optional URI that can be used to link back to the application. */ + detailsUrl?: string; + /** + * The name of this application. This is required for REST clients, but we do not enforce uniqueness of this name. It is provided as a matter of + * convenience for other developers who would like to identify which REST created an Application or Data Source. + */ + name?: string; + /** + * Package name for this application. This is used as a unique identifier when created by Android applications, but cannot be specified by REST clients. + * REST clients will have their developer project number reflected into the Data Source data stream IDs, instead of the packageName. + */ + packageName?: string; + /** Version of the application. You should update this field whenever the application changes in a way that affects the computation of the data. */ + version?: string; + } + interface BucketByActivity { + /** The default activity stream will be used if a specific activityDataSourceId is not specified. */ + activityDataSourceId?: string; + /** Specifies that only activity segments of duration longer than minDurationMillis are considered and used as a container for aggregated data. */ + minDurationMillis?: string; + } + interface BucketBySession { + /** Specifies that only sessions of duration longer than minDurationMillis are considered and used as a container for aggregated data. */ + minDurationMillis?: string; + } + interface BucketByTime { + /** + * Specifies that result buckets aggregate data by exactly durationMillis time frames. Time frames that contain no data will be included in the response + * with an empty dataset. + */ + durationMillis?: string; + period?: BucketByTimePeriod; + } + interface BucketByTimePeriod { + /** org.joda.timezone.DateTimeZone */ + timeZoneId?: string; + type?: string; + value?: number; + } + interface DataPoint { + /** Used for version checking during transformation; that is, a datapoint can only replace another datapoint that has an older computation time stamp. */ + computationTimeMillis?: string; + /** The data type defining the format of the values in this data point. */ + dataTypeName?: string; + /** The end time of the interval represented by this data point, in nanoseconds since epoch. */ + endTimeNanos?: string; + /** + * Indicates the last time this data point was modified. Useful only in contexts where we are listing the data changes, rather than representing the + * current state of the data. + */ + modifiedTimeMillis?: string; + /** + * If the data point is contained in a dataset for a derived data source, this field will be populated with the data source stream ID that created the + * data point originally. + */ + originDataSourceId?: string; + /** The raw timestamp from the original SensorEvent. */ + rawTimestampNanos?: string; + /** The start time of the interval represented by this data point, in nanoseconds since epoch. */ + startTimeNanos?: string; + /** + * Values of each data type field for the data point. It is expected that each value corresponding to a data type field will occur in the same order that + * the field is listed with in the data type specified in a data source. + * + * Only one of integer and floating point fields will be populated, depending on the format enum value within data source's type field. + */ + value?: Value[]; + } + interface DataSource { + /** Information about an application which feeds sensor data into the platform. */ + application?: Application; + dataQualityStandard?: string[]; + /** + * A unique identifier for the data stream produced by this data source. The identifier includes: + * + * + * - The physical device's manufacturer, model, and serial number (UID). + * - The application's package name or name. Package name is used when the data source was created by an Android application. The developer project number + * is used when the data source was created by a REST client. + * - The data source's type. + * - The data source's stream name. Note that not all attributes of the data source are used as part of the stream identifier. In particular, the version + * of the hardware/the application isn't used. This allows us to preserve the same stream through version updates. This also means that two DataSource + * objects may represent the same data stream even if they're not equal. + * + * The exact format of the data stream ID created by an Android application is: + * type:dataType.name:application.packageName:device.manufacturer:device.model:device.uid:dataStreamName + * + * The exact format of the data stream ID created by a REST client is: type:dataType.name:developer project + * number:device.manufacturer:device.model:device.uid:dataStreamName + * + * When any of the optional fields that comprise of the data stream ID are blank, they will be omitted from the data stream ID. The minimum viable data + * stream ID would be: type:dataType.name:developer project number + * + * Finally, the developer project number is obfuscated when read by any REST or Android client that did not create the data source. Only the data source + * creator will see the developer project number in clear and normal form. + */ + dataStreamId?: string; + /** + * The stream name uniquely identifies this particular data source among other data sources of the same type from the same underlying producer. Setting + * the stream name is optional, but should be done whenever an application exposes two streams for the same data type, or when a device has two equivalent + * sensors. + */ + dataStreamName?: string; + /** The data type defines the schema for a stream of data being collected by, inserted into, or queried from the Fitness API. */ + dataType?: DataType; + /** Representation of an integrated device (such as a phone or a wearable) that can hold sensors. */ + device?: Device; + /** An end-user visible name for this data source. */ + name?: string; + /** A constant describing the type of this data source. Indicates whether this data source produces raw or derived data. */ + type?: string; + } + interface DataType { + /** A field represents one dimension of a data type. */ + field?: DataTypeField[]; + /** Each data type has a unique, namespaced, name. All data types in the com.google namespace are shared as part of the platform. */ + name?: string; + } + interface DataTypeField { + /** The different supported formats for each field in a data type. */ + format?: string; + /** Defines the name and format of data. Unlike data type names, field names are not namespaced, and only need to be unique within the data type. */ + name?: string; + optional?: boolean; + } + interface Dataset { + /** The data stream ID of the data source that created the points in this dataset. */ + dataSourceId?: string; + /** + * The largest end time of all data points in this possibly partial representation of the dataset. Time is in nanoseconds from epoch. This should also + * match the first part of the dataset identifier. + */ + maxEndTimeNs?: string; + /** + * The smallest start time of all data points in this possibly partial representation of the dataset. Time is in nanoseconds from epoch. This should also + * match the first part of the dataset identifier. + */ + minStartTimeNs?: string; + /** + * This token will be set when a dataset is received in response to a GET request and the dataset is too large to be included in a single response. + * Provide this value in a subsequent GET request to return the next page of data points within this dataset. + */ + nextPageToken?: string; + /** + * A partial list of data points contained in the dataset, ordered by largest endTimeNanos first. This list is considered complete when retrieving a small + * dataset and partial when patching a dataset or retrieving a dataset that is too large to include in a single response. + */ + point?: DataPoint[]; + } + interface Device { + /** Manufacturer of the product/hardware. */ + manufacturer?: string; + /** End-user visible model name for the device. */ + model?: string; + /** A constant representing the type of the device. */ + type?: string; + /** + * The serial number or other unique ID for the hardware. This field is obfuscated when read by any REST or Android client that did not create the data + * source. Only the data source creator will see the uid field in clear and normal form. + */ + uid?: string; + /** Version string for the device hardware/software. */ + version?: string; + } + interface ListDataPointChangesResponse { + /** The data stream ID of the data source with data point changes. */ + dataSourceId?: string; + /** Deleted data points for the user. Note, for modifications this should be parsed before handling insertions. */ + deletedDataPoint?: DataPoint[]; + /** Inserted data points for the user. */ + insertedDataPoint?: DataPoint[]; + /** The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results. */ + nextPageToken?: string; + } + interface ListDataSourcesResponse { + /** A previously created data source. */ + dataSource?: DataSource[]; + } + interface ListSessionsResponse { + /** + * If includeDeleted is set to true in the request, this list will contain sessions deleted with original end times that are within the startTime and + * endTime frame. + */ + deletedSession?: Session[]; + /** Flag to indicate server has more data to transfer */ + hasMoreData?: boolean; + /** The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results. */ + nextPageToken?: string; + /** Sessions with an end time that is between startTime and endTime of the request. */ + session?: Session[]; + } + interface MapValue { + /** Floating point value. */ + fpVal?: number; + } + interface Session { + /** + * Session active time. While start_time_millis and end_time_millis define the full session time, the active time can be shorter and specified by + * active_time_millis. If the inactive time during the session is known, it should also be inserted via a com.google.activity.segment data point with a + * STILL activity value + */ + activeTimeMillis?: string; + /** The type of activity this session represents. */ + activityType?: number; + /** The application that created the session. */ + application?: Application; + /** A description for this session. */ + description?: string; + /** An end time, in milliseconds since epoch, inclusive. */ + endTimeMillis?: string; + /** A client-generated identifier that is unique across all sessions owned by this particular user. */ + id?: string; + /** A timestamp that indicates when the session was last modified. */ + modifiedTimeMillis?: string; + /** A human readable name of the session. */ + name?: string; + /** A start time, in milliseconds since epoch, inclusive. */ + startTimeMillis?: string; + } + interface Value { + /** Floating point value. When this is set, other values must not be set. */ + fpVal?: number; + /** Integer value. When this is set, other values must not be set. */ + intVal?: number; + /** + * Map value. The valid key space and units for the corresponding value of each entry should be documented as part of the data type definition. Keys + * should be kept small whenever possible. Data streams with large keys and high data frequency may be down sampled. + */ + mapVal?: ValueMapValEntry[]; + /** + * String value. When this is set, other values must not be set. Strings should be kept small whenever possible. Data streams with large string values and + * high data frequency may be down sampled. + */ + stringVal?: string; + } + interface ValueMapValEntry { + key?: string; + value?: MapValue; + } + interface DataPointChangesResource { + /** Queries for user's data point changes for a particular data source. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The data stream ID of the data source that created the dataset. */ + dataSourceId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** If specified, no more than this many data point changes will be included in the response. */ + limit?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of + * nextPageToken from the previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** List data points for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DatasetsResource { + /** + * Performs an inclusive delete of all data points whose start and end times have any overlap with the time range specified by the dataset ID. For most + * data types, the entire data point will be deleted. For data types where the time span represents a consistent value (such as + * com.google.activity.segment), and a data point straddles either end point of the dataset, only the overlapping portion of the data point will be + * deleted. + */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The client's current time in milliseconds since epoch. */ + currentTimeMillis?: string; + /** The data stream ID of the data source that created the dataset. */ + dataSourceId: string; + /** + * Dataset identifier that is a composite of the minimum data point start time and maximum data point end time represented as nanoseconds from the epoch. + * The ID is formatted like: "startTime-endTime" where startTime and endTime are 64 bit integers. + */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** When the operation was performed on the client. */ + modifiedTimeMillis?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Delete a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Returns a dataset containing all data points whose start and end times overlap with the specified range of the dataset minimum start time and maximum + * end time. Specifically, any data point whose start time is less than or equal to the dataset end time and whose end time is greater than or equal to + * the dataset start time. + */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The data stream ID of the data source that created the dataset. */ + dataSourceId: string; + /** + * Dataset identifier that is a composite of the minimum data point start time and maximum data point end time represented as nanoseconds from the epoch. + * The ID is formatted like: "startTime-endTime" where startTime and endTime are 64 bit integers. + */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** + * If specified, no more than this many data points will be included in the dataset. If there are more data points in the dataset, nextPageToken will be + * set in the dataset response. + */ + limit?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The continuation token, which is used to page through large datasets. To get the next page of a dataset, set this parameter to the value of + * nextPageToken from the previous response. Each subsequent call will yield a partial dataset with data point end timestamps that are strictly smaller + * than those in the previous partial response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Retrieve a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Adds data points to a dataset. The dataset need not be previously created. All points within the given dataset will be returned with subsquent calls to + * retrieve this dataset. Data points can belong to more than one dataset. This method does not use patch semantics. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** + * The client's current time in milliseconds since epoch. Note that the minStartTimeNs and maxEndTimeNs properties in the request body are in nanoseconds + * instead of milliseconds. + */ + currentTimeMillis?: string; + /** The data stream ID of the data source that created the dataset. */ + dataSourceId: string; + /** + * Dataset identifier that is a composite of the minimum data point start time and maximum data point end time represented as nanoseconds from the epoch. + * The ID is formatted like: "startTime-endTime" where startTime and endTime are 64 bit integers. + */ + datasetId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Patch a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface DataSourcesResource { + /** + * Creates a new data source that is unique across all data sources belonging to this user. The data stream ID field can be omitted and will be generated + * by the server with the correct format. The data stream ID is an ordered combination of some fields from the data source. In addition to the data source + * fields reflected into the data source ID, the developer project number that is authenticated when creating the data source is included. This developer + * project number is obfuscated when read by any other developer reading public data types. + */ + create(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Create the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes the specified data source. The request will fail if the data source contains any data points. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The data stream ID of the data source to delete. */ + dataSourceId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Retrieve a data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Returns the specified data source. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** The data stream ID of the data source to retrieve. */ + dataSourceId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Retrieve a data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Lists all data sources that are visible to the developer, using the OAuth scopes provided. The list is not exhaustive; the user may have private data + * sources that are only visible to other developers, or calls using other scopes. + */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** The names of data types to include in the list. If not specified, all data sources will be returned. */ + dataTypeName?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** List data sources for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the specified data source. The dataStreamId, dataType, type, dataStreamName, and device properties with the exception of version, cannot be + * modified. + * + * Data sources are identified by their dataStreamId. This method supports patch semantics. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** The data stream ID of the data source to update. */ + dataSourceId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Update the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates the specified data source. The dataStreamId, dataType, type, dataStreamName, and device properties with the exception of version, cannot be + * modified. + * + * Data sources are identified by their dataStreamId. + */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The data stream ID of the data source to update. */ + dataSourceId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Update the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + dataPointChanges: DataPointChangesResource; + datasets: DatasetsResource; + } + interface DatasetResource { + /** + * Aggregates data of a certain type or stream into buckets divided by a given type of boundary. Multiple data sets of multiple types and from multiple + * sources can be aggreated into exactly one bucket type per request. + */ + aggregate(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Aggregate data for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface SessionsResource { + /** Deletes a session specified by the given session ID. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** The client's current time in milliseconds since epoch. */ + currentTimeMillis?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the session to be deleted. */ + sessionId: string; + /** Delete a session for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Lists sessions previously created. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** An RFC3339 timestamp. Only sessions ending between the start and end times will be included in the response. */ + endTime?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * If true, deleted sessions will be returned. When set to true, sessions returned in this response will only have an ID and will not have any other + * fields. + */ + includeDeleted?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** + * The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of + * nextPageToken from the previous response. + */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** An RFC3339 timestamp. Only sessions ending between the start and end times will be included in the response. */ + startTime?: string; + /** List sessions for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates or insert a given session. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** The client's current time in milliseconds since epoch. */ + currentTimeMillis?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The ID of the session to be created. */ + sessionId: string; + /** Create sessions for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. */ + userId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface UsersResource { + dataSources: DataSourcesResource; + dataset: DatasetResource; + sessions: SessionsResource; + } + } +} diff --git a/types/gapi.client.fitness/readme.md b/types/gapi.client.fitness/readme.md new file mode 100644 index 0000000000..e8dee74aba --- /dev/null +++ b/types/gapi.client.fitness/readme.md @@ -0,0 +1,105 @@ +# TypeScript typings for Fitness v1 +Stores and accesses user data in the fitness store from apps on any platform. +For detailed description please check [documentation](https://developers.google.com/fit/rest/). + +## Installing + +Install typings for Fitness: +``` +npm install @types/gapi.client.fitness@v1 --save-dev +``` + +## Usage + +You need to initialize Google API client in your code: +```typescript +gapi.load("client", () => { + // now we can use gapi.client + // ... +}); +``` + +Then load api client wrapper: +```typescript +gapi.client.load('fitness', 'v1', () => { + // now we can use gapi.client.fitness + // ... +}); +``` + +Don't forget to authenticate your client before sending any request to resources: +```typescript + +// declare client_id registered in Google Developers Console +var client_id = '', + scope = [ + // View your activity information in Google Fit + 'https://www.googleapis.com/auth/fitness.activity.read', + + // View and store your activity information in Google Fit + 'https://www.googleapis.com/auth/fitness.activity.write', + + // View blood glucose data in Google Fit + 'https://www.googleapis.com/auth/fitness.blood_glucose.read', + + // View and store blood glucose data in Google Fit + 'https://www.googleapis.com/auth/fitness.blood_glucose.write', + + // View blood pressure data in Google Fit + 'https://www.googleapis.com/auth/fitness.blood_pressure.read', + + // View and store blood pressure data in Google Fit + 'https://www.googleapis.com/auth/fitness.blood_pressure.write', + + // View body sensor information in Google Fit + 'https://www.googleapis.com/auth/fitness.body.read', + + // View and store body sensor data in Google Fit + 'https://www.googleapis.com/auth/fitness.body.write', + + // View body temperature data in Google Fit + 'https://www.googleapis.com/auth/fitness.body_temperature.read', + + // View and store body temperature data in Google Fit + 'https://www.googleapis.com/auth/fitness.body_temperature.write', + + // View your stored location data in Google Fit + 'https://www.googleapis.com/auth/fitness.location.read', + + // View and store your location data in Google Fit + 'https://www.googleapis.com/auth/fitness.location.write', + + // View nutrition information in Google Fit + 'https://www.googleapis.com/auth/fitness.nutrition.read', + + // View and store nutrition information in Google Fit + 'https://www.googleapis.com/auth/fitness.nutrition.write', + + // View oxygen saturation data in Google Fit + 'https://www.googleapis.com/auth/fitness.oxygen_saturation.read', + + // View and store oxygen saturation data in Google Fit + 'https://www.googleapis.com/auth/fitness.oxygen_saturation.write', + + // View reproductive health data in Google Fit + 'https://www.googleapis.com/auth/fitness.reproductive_health.read', + + // View and store reproductive health data in Google Fit + 'https://www.googleapis.com/auth/fitness.reproductive_health.write', + ], + immediate = true; +// ... + +gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => { + if (authResult && !authResult.error) { + /* handle succesfull authorization */ + } else { + /* handle authorization error */ + } +}); +``` + +After that you can use Fitness resources: + +```typescript +``` \ No newline at end of file diff --git a/types/gapi.client.fitness/tsconfig.json b/types/gapi.client.fitness/tsconfig.json new file mode 100644 index 0000000000..d165e53085 --- /dev/null +++ b/types/gapi.client.fitness/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "gapi.client.fitness-tests.ts" + ] +} \ No newline at end of file diff --git a/types/gapi.client.fitness/tslint.json b/types/gapi.client.fitness/tslint.json new file mode 100644 index 0000000000..1c5c1ce060 --- /dev/null +++ b/types/gapi.client.fitness/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [false], + "ban-types": [false], + "await-promise": [true, "Request"] + } +} diff --git a/types/gapi.client.fusiontables/gapi.client.fusiontables-tests.ts b/types/gapi.client.fusiontables/gapi.client.fusiontables-tests.ts new file mode 100644 index 0000000000..3ce93fc7f1 --- /dev/null +++ b/types/gapi.client.fusiontables/gapi.client.fusiontables-tests.ts @@ -0,0 +1,225 @@ +/* This is stub file for gapi.client.{{=it.name}} definition tests */ +/* IMPORTANT. +* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +**/ +gapi.load('client', () => { + /** now we can use gapi.client */ + gapi.client.load('fusiontables', 'v2', () => { + /** now we can use gapi.client.fusiontables */ + + /** don't forget to authenticate your client before sending any request to resources: */ + /** declare client_id registered in Google Developers Console */ + const client_id = '<>'; + const scope = [ + /** Manage your Fusion Tables */ + 'https://www.googleapis.com/auth/fusiontables', + /** View your Fusion Tables */ + 'https://www.googleapis.com/auth/fusiontables.readonly', + ]; + const immediate = true; + gapi.auth.authorize({ client_id, scope, immediate }, authResult => { + if (authResult && !authResult.error) { + /** handle succesfull authorization */ + run(); + } else { + /** handle authorization error */ + } + }); + run(); + }); + + async function run() { + /** Deletes the specified column. */ + await gapi.client.column.delete({ + columnId: "columnId", + tableId: "tableId", + }); + /** Retrieves a specific column by its ID. */ + await gapi.client.column.get({ + columnId: "columnId", + tableId: "tableId", + }); + /** Adds a new column to the table. */ + await gapi.client.column.insert({ + tableId: "tableId", + }); + /** Retrieves a list of columns. */ + await gapi.client.column.list({ + maxResults: 1, + pageToken: "pageToken", + tableId: "tableId", + }); + /** Updates the name or type of an existing column. This method supports patch semantics. */ + await gapi.client.column.patch({ + columnId: "columnId", + tableId: "tableId", + }); + /** Updates the name or type of an existing column. */ + await gapi.client.column.update({ + columnId: "columnId", + tableId: "tableId", + }); + /** + * Executes a Fusion Tables SQL statement, which can be any of + * - SELECT + * - INSERT + * - UPDATE + * - DELETE + * - SHOW + * - DESCRIBE + * - CREATE statement. + */ + await gapi.client.query.sql({ + hdrs: true, + sql: "sql", + typed: true, + }); + /** + * Executes a SQL statement which can be any of + * - SELECT + * - SHOW + * - DESCRIBE + */ + await gapi.client.query.sqlGet({ + hdrs: true, + sql: "sql", + typed: true, + }); + /** Deletes a style. */ + await gapi.client.style.delete({ + styleId: 1, + tableId: "tableId", + }); + /** Gets a specific style. */ + await gapi.client.style.get({ + styleId: 1, + tableId: "tableId", + }); + /** Adds a new style for the table. */ + await gapi.client.style.insert({ + tableId: "tableId", + }); + /** Retrieves a list of styles. */ + await gapi.client.style.list({ + maxResults: 1, + pageToken: "pageToken", + tableId: "tableId", + }); + /** Updates an existing style. This method supports patch semantics. */ + await gapi.client.style.patch({ + styleId: 1, + tableId: "tableId", + }); + /** Updates an existing style. */ + await gapi.client.style.update({ + styleId: 1, + tableId: "tableId", + }); + /** Copies a table. */ + await gapi.client.table.copy({ + copyPresentation: true, + tableId: "tableId", + }); + /** Deletes a table. */ + await gapi.client.table.delete({ + tableId: "tableId", + }); + /** Retrieves a specific table by its ID. */ + await gapi.client.table.get({ + tableId: "tableId", + }); + /** Imports more rows into a table. */ + await gapi.client.table.importRows({ + delimiter: "delimiter", + encoding: "encoding", + endLine: 3, + isStrict: true, + startLine: 5, + tableId: "tableId", + }); + /** Imports a new table. */ + await gapi.client.table.importTable({ + delimiter: "delimiter", + encoding: "encoding", + name: "name", + }); + /** Creates a new table. */ + await gapi.client.table.insert({ + }); + /** Retrieves a list of tables a user owns. */ + await gapi.client.table.list({ + maxResults: 1, + pageToken: "pageToken", + }); + /** + * Updates an existing table. Unless explicitly requested, only the name, description, and attribution will be updated. This method supports patch + * semantics. + */ + await gapi.client.table.patch({ + replaceViewDefinition: true, + tableId: "tableId", + }); + /** Replaces rows of an existing table. Current rows remain visible until all replacement rows are ready. */ + await gapi.client.table.replaceRows({ + delimiter: "delimiter", + encoding: "encoding", + endLine: 3, + isStrict: true, + startLine: 5, + tableId: "tableId", + }); + /** Updates an existing table. Unless explicitly requested, only the name, description, and attribution will be updated. */ + await gapi.client.table.update({ + replaceViewDefinition: true, + tableId: "tableId", + }); + /** Deletes a specific task by its ID, unless that task has already started running. */ + await gapi.client.task.delete({ + tableId: "tableId", + taskId: "taskId", + }); + /** Retrieves a specific task by its ID. */ + await gapi.client.task.get({ + tableId: "tableId", + taskId: "taskId", + }); + /** Retrieves a list of tasks. */ + await gapi.client.task.list({ + maxResults: 1, + pageToken: "pageToken", + startIndex: 3, + tableId: "tableId", + }); + /** Deletes a template */ + await gapi.client.template.delete({ + tableId: "tableId", + templateId: 2, + }); + /** Retrieves a specific template by its id */ + await gapi.client.template.get({ + tableId: "tableId", + templateId: 2, + }); + /** Creates a new template for the table. */ + await gapi.client.template.insert({ + tableId: "tableId", + }); + /** Retrieves a list of templates. */ + await gapi.client.template.list({ + maxResults: 1, + pageToken: "pageToken", + tableId: "tableId", + }); + /** Updates an existing template. This method supports patch semantics. */ + await gapi.client.template.patch({ + tableId: "tableId", + templateId: 2, + }); + /** Updates an existing template */ + await gapi.client.template.update({ + tableId: "tableId", + templateId: 2, + }); + } +}); diff --git a/types/gapi.client.fusiontables/index.d.ts b/types/gapi.client.fusiontables/index.d.ts new file mode 100644 index 0000000000..95750c8f38 --- /dev/null +++ b/types/gapi.client.fusiontables/index.d.ts @@ -0,0 +1,1188 @@ +// Type definitions for Google Fusion Tables API v2 2.0 +// Project: https://developers.google.com/fusiontables +// Definitions by: Bolisov Alexey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// IMPORTANT +// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. +// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator +// Generated from: https://www.googleapis.com/discovery/v1/apis/fusiontables/v2/rest + +/// + +declare namespace gapi.client { + /** Load Fusion Tables API v2 */ + function load(name: "fusiontables", version: "v2"): PromiseLike; + function load(name: "fusiontables", version: "v2", callback: () => any): void; + + const column: fusiontables.ColumnResource; + + const query: fusiontables.QueryResource; + + const style: fusiontables.StyleResource; + + const table: fusiontables.TableResource; + + const task: fusiontables.TaskResource; + + const template: fusiontables.TemplateResource; + + namespace fusiontables { + interface Bucket { + /** Color of line or the interior of a polygon in #RRGGBB format. */ + color?: string; + /** Icon name used for a point. */ + icon?: string; + /** Maximum value in the selected column for a row to be styled according to the bucket color, opacity, icon, or weight. */ + max?: number; + /** Minimum value in the selected column for a row to be styled according to the bucket color, opacity, icon, or weight. */ + min?: number; + /** Opacity of the color: 0.0 (transparent) to 1.0 (opaque). */ + opacity?: number; + /** Width of a line (in pixels). */ + weight?: number; + } + interface Column { + /** Identifier of the base column. If present, this column is derived from the specified base column. */ + baseColumn?: { + /** The id of the column in the base table from which this column is derived. */ + columnId?: number; + /** Offset to the entry in the list of base tables in the table definition. */ + tableIndex?: number; + }; + /** Identifier for the column. */ + columnId?: number; + /** JSON schema for interpreting JSON in this column. */ + columnJsonSchema?: string; + /** JSON object containing custom column properties. */ + columnPropertiesJson?: string; + /** Column description. */ + description?: string; + /** + * Format pattern. + * Acceptable values are DT_DATE_MEDIUMe.g Dec 24, 2008 DT_DATE_SHORTfor example 12/24/08 DT_DATE_TIME_MEDIUMfor example Dec 24, 2008 8:30:45 PM + * DT_DATE_TIME_SHORTfor example 12/24/08 8:30 PM DT_DAY_MONTH_2_DIGIT_YEARfor example 24/12/08 DT_DAY_MONTH_2_DIGIT_YEAR_TIMEfor example 24/12/08 20:30 + * DT_DAY_MONTH_2_DIGIT_YEAR_TIME_MERIDIANfor example 24/12/08 8:30 PM DT_DAY_MONTH_4_DIGIT_YEARfor example 24/12/2008 DT_DAY_MONTH_4_DIGIT_YEAR_TIMEfor + * example 24/12/2008 20:30 DT_DAY_MONTH_4_DIGIT_YEAR_TIME_MERIDIANfor example 24/12/2008 8:30 PM DT_ISO_YEAR_MONTH_DAYfor example 2008-12-24 + * DT_ISO_YEAR_MONTH_DAY_TIMEfor example 2008-12-24 20:30:45 DT_MONTH_DAY_4_DIGIT_YEARfor example 12/24/2008 DT_TIME_LONGfor example 8:30:45 PM UTC-6 + * DT_TIME_MEDIUMfor example 8:30:45 PM DT_TIME_SHORTfor example 8:30 PM DT_YEAR_ONLYfor example 2008 HIGHLIGHT_UNTYPED_CELLSHighlight cell data that does + * not match the data type NONENo formatting (default) NUMBER_CURRENCYfor example $1234.56 NUMBER_DEFAULTfor example 1,234.56 NUMBER_INTEGERfor example + * 1235 NUMBER_NO_SEPARATORfor example 1234.56 NUMBER_PERCENTfor example 123,456% NUMBER_SCIENTIFICfor example 1E3 STRING_EIGHT_LINE_IMAGEDisplays + * thumbnail images as tall as eight lines of text STRING_FOUR_LINE_IMAGEDisplays thumbnail images as tall as four lines of text STRING_JSON_TEXTAllows + * editing of text as JSON in UI STRING_JSON_LISTAllows editing of text as a JSON list in UI STRING_LINKTreats cell as a link (must start with http:// or + * https://) STRING_ONE_LINE_IMAGEDisplays thumbnail images as tall as one line of text STRING_VIDEO_OR_MAPDisplay a video or map thumbnail + */ + formatPattern?: string; + /** + * Column graph predicate. + * Used to map table to graph data model (subject,predicate,object) + * See W3C Graph-based Data Model. + */ + graphPredicate?: string; + /** The kind of item this is. For a column, this is always fusiontables#column. */ + kind?: string; + /** Name of the column. */ + name?: string; + /** Type of the column. */ + type?: string; + /** List of valid values used to validate data and supply a drop-down list of values in the web application. */ + validValues?: string[]; + /** If true, data entered via the web application is validated. */ + validateData?: boolean; + } + interface ColumnList { + /** List of all requested columns. */ + items?: Column[]; + /** The kind of item this is. For a column list, this is always fusiontables#columnList. */ + kind?: string; + /** Token used to access the next page of this result. No token is displayed if there are no more pages left. */ + nextPageToken?: string; + /** Total number of columns for the table. */ + totalItems?: number; + } + interface Geometry { + /** The list of geometries in this geometry collection. */ + geometries?: any[]; + geometry?: any; + /** Type: A collection of geometries. */ + type?: string; + } + interface Import { + /** The kind of item this is. For an import, this is always fusiontables#import. */ + kind?: string; + /** The number of rows received from the import request. */ + numRowsReceived?: string; + } + interface Line { + /** The coordinates that define the line. */ + coordinates?: number[][]; + /** Type: A line geometry. */ + type?: string; + } + interface LineStyle { + /** Color of the line in #RRGGBB format. */ + strokeColor?: string; + /** Column-value, gradient or buckets styler that is used to determine the line color and opacity. */ + strokeColorStyler?: StyleFunction; + /** Opacity of the line : 0.0 (transparent) to 1.0 (opaque). */ + strokeOpacity?: number; + /** Width of the line in pixels. */ + strokeWeight?: number; + /** Column-value or bucket styler that is used to determine the width of the line. */ + strokeWeightStyler?: StyleFunction; + } + interface Point { + /** The coordinates that define the point. */ + coordinates?: number[]; + /** Point: A point geometry. */ + type?: string; + } + interface PointStyle { + /** Name of the icon. Use values defined in http://www.google.com/fusiontables/DataSource?dsrcid=308519 */ + iconName?: string; + /** Column or a bucket value from which the icon name is to be determined. */ + iconStyler?: StyleFunction; + } + interface Polygon { + /** The coordinates that define the polygon. */ + coordinates?: number[][][]; + /** Type: A polygon geometry. */ + type?: string; + } + interface PolygonStyle { + /** Color of the interior of the polygon in #RRGGBB format. */ + fillColor?: string; + /** Column-value, gradient, or bucket styler that is used to determine the interior color and opacity of the polygon. */ + fillColorStyler?: StyleFunction; + /** Opacity of the interior of the polygon: 0.0 (transparent) to 1.0 (opaque). */ + fillOpacity?: number; + /** Color of the polygon border in #RRGGBB format. */ + strokeColor?: string; + /** Column-value, gradient or buckets styler that is used to determine the border color and opacity. */ + strokeColorStyler?: StyleFunction; + /** Opacity of the polygon border: 0.0 (transparent) to 1.0 (opaque). */ + strokeOpacity?: number; + /** Width of the polyon border in pixels. */ + strokeWeight?: number; + /** Column-value or bucket styler that is used to determine the width of the polygon border. */ + strokeWeightStyler?: StyleFunction; + } + interface Sqlresponse { + /** Columns in the table. */ + columns?: string[]; + /** The kind of item this is. For responses to SQL queries, this is always fusiontables#sqlresponse. */ + kind?: string; + /** + * The rows in the table. For each cell we print out whatever cell value (e.g., numeric, string) exists. Thus it is important that each cell contains only + * one value. + */ + rows?: any[][]; + } + interface StyleFunction { + /** Bucket function that assigns a style based on the range a column value falls into. */ + buckets?: Bucket[]; + /** Name of the column whose value is used in the style. */ + columnName?: string; + /** Gradient function that interpolates a range of colors based on column value. */ + gradient?: { + /** Array with two or more colors. */ + colors?: Array<{ + /** Color in #RRGGBB format. */ + color?: string; + /** Opacity of the color: 0.0 (transparent) to 1.0 (opaque). */ + opacity?: number; + }>; + /** Higher-end of the interpolation range: rows with this value will be assigned to colors[n-1]. */ + max?: number; + /** Lower-end of the interpolation range: rows with this value will be assigned to colors[0]. */ + min?: number; + }; + /** + * Stylers can be one of three kinds: "fusiontables#fromColumn if the column value is to be used as is, i.e., the column values can have colors in + * #RRGGBBAA format or integer line widths or icon names; fusiontables#gradient if the styling of the row is to be based on applying the gradient function + * on the column value; or fusiontables#buckets if the styling is to based on the bucket into which the the column value falls. + */ + kind?: string; + } + interface StyleSetting { + /** + * The kind of item this is. A StyleSetting contains the style definitions for points, lines, and polygons in a table. Since a table can have any one or + * all of them, a style definition can have point, line and polygon style definitions. + */ + kind?: string; + /** Style definition for points in the table. */ + markerOptions?: PointStyle; + /** Optional name for the style setting. */ + name?: string; + /** Style definition for polygons in the table. */ + polygonOptions?: PolygonStyle; + /** Style definition for lines in the table. */ + polylineOptions?: LineStyle; + /** Identifier for the style setting (unique only within tables). */ + styleId?: number; + /** Identifier for the table. */ + tableId?: string; + } + interface StyleSettingList { + /** All requested style settings. */ + items?: StyleSetting[]; + /** The kind of item this is. For a style list, this is always fusiontables#styleSettingList . */ + kind?: string; + /** Token used to access the next page of this result. No token is displayed if there are no more styles left. */ + nextPageToken?: string; + /** Total number of styles for the table. */ + totalItems?: number; + } + interface Table { + /** Attribution assigned to the table. */ + attribution?: string; + /** Optional link for attribution. */ + attributionLink?: string; + /** Base table identifier if this table is a view or merged table. */ + baseTableIds?: string[]; + /** Default JSON schema for validating all JSON column properties. */ + columnPropertiesJsonSchema?: string; + /** Columns in the table. */ + columns?: Column[]; + /** Description assigned to the table. */ + description?: string; + /** Variable for whether table is exportable. */ + isExportable?: boolean; + /** The kind of item this is. For a table, this is always fusiontables#table. */ + kind?: string; + /** Name assigned to a table. */ + name?: string; + /** SQL that encodes the table definition for derived tables. */ + sql?: string; + /** Encrypted unique alphanumeric identifier for the table. */ + tableId?: string; + /** JSON object containing custom table properties. */ + tablePropertiesJson?: string; + /** JSON schema for validating the JSON table properties. */ + tablePropertiesJsonSchema?: string; + } + interface TableList { + /** List of all requested tables. */ + items?: Table[]; + /** The kind of item this is. For table list, this is always fusiontables#tableList. */ + kind?: string; + /** Token used to access the next page of this result. No token is displayed if there are no more pages left. */ + nextPageToken?: string; + } + interface Task { + /** Type of the resource. This is always "fusiontables#task". */ + kind?: string; + /** Task percentage completion. */ + progress?: string; + /** false while the table is busy with some other task. true if this background task is currently running. */ + started?: boolean; + /** Identifier for the task. */ + taskId?: string; + /** Type of background task. */ + type?: string; + } + interface TaskList { + /** List of all requested tasks. */ + items?: Task[]; + /** Type of the resource. This is always "fusiontables#taskList". */ + kind?: string; + /** Token used to access the next page of this result. No token is displayed if there are no more pages left. */ + nextPageToken?: string; + /** Total number of tasks for the table. */ + totalItems?: number; + } + interface Template { + /** List of columns from which the template is to be automatically constructed. Only one of body or automaticColumns can be specified. */ + automaticColumnNames?: string[]; + /** + * Body of the template. It contains HTML with {column_name} to insert values from a particular column. The body is sanitized to remove certain tags, + * e.g., script. Only one of body or automaticColumns can be specified. + */ + body?: string; + /** The kind of item this is. For a template, this is always fusiontables#template. */ + kind?: string; + /** Optional name assigned to a template. */ + name?: string; + /** Identifier for the table for which the template is defined. */ + tableId?: string; + /** Identifier for the template, unique within the context of a particular table. */ + templateId?: number; + } + interface TemplateList { + /** List of all requested templates. */ + items?: Template[]; + /** The kind of item this is. For a template list, this is always fusiontables#templateList . */ + kind?: string; + /** Token used to access the next page of this result. No token is displayed if there are no more pages left. */ + nextPageToken?: string; + /** Total number of templates for the table. */ + totalItems?: number; + } + interface ColumnResource { + /** Deletes the specified column. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Name or identifier for the column being deleted. */ + columnId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table from which the column is being deleted. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a specific column by its ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Name or identifier for the column that is being requested. */ + columnId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table to which the column belongs. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Adds a new column to the table. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table for which a new column is being added. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of columns. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of columns to return. Default is 5. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Continuation token specifying which result page to return. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table whose columns are being listed. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the name or type of an existing column. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Name or identifier for the column that is being updated. */ + columnId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table for which the column is being updated. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates the name or type of an existing column. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Name or identifier for the column that is being updated. */ + columnId: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table for which the column is being updated. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface QueryResource { + /** + * Executes a Fusion Tables SQL statement, which can be any of + * - SELECT + * - INSERT + * - UPDATE + * - DELETE + * - SHOW + * - DESCRIBE + * - CREATE statement. + */ + sql(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Whether column names are included in the first row. Default is true. */ + hdrs?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * A Fusion Tables SQL statement, which can be any of + * - SELECT + * - INSERT + * - UPDATE + * - DELETE + * - SHOW + * - DESCRIBE + * - CREATE + */ + sql: string; + /** Whether typed values are returned in the (JSON) response: numbers for numeric values and parsed geometries for KML values. Default is true. */ + typed?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Executes a SQL statement which can be any of + * - SELECT + * - SHOW + * - DESCRIBE + */ + sqlGet(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** Whether column names are included (in the first row). Default is true. */ + hdrs?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** + * A SQL statement which can be any of + * - SELECT + * - SHOW + * - DESCRIBE + */ + sql: string; + /** Whether typed values are returned in the (JSON) response: numbers for numeric values and parsed geometries for KML values. Default is true. */ + typed?: boolean; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface StyleResource { + /** Deletes a style. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Identifier (within a table) for the style being deleted */ + styleId: number; + /** Table from which the style is being deleted */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Gets a specific style. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Identifier (integer) for a specific style in a table */ + styleId: number; + /** Table to which the requested style belongs */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Adds a new style for the table. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table for which a new style is being added */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of styles. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of styles to return. Optional. Default is 5. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Continuation token specifying which result page to return. Optional. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table whose styles are being listed */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing style. This method supports patch semantics. */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Identifier (within a table) for the style being updated. */ + styleId: number; + /** Table whose style is being updated. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing style. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Identifier (within a table) for the style being updated. */ + styleId: number; + /** Table whose style is being updated. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TableResource { + /** Copies a table. */ + copy(request: { + /** Data format for the response. */ + alt?: string; + /** Whether to also copy tabs, styles, and templates. Default is false. */ + copyPresentation?: boolean; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ID of the table that is being copied. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Deletes a table. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** ID of the table to be deleted. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a specific table by its ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Identifier for the table being requested. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request
    ; + /** Imports more rows into a table. */ + importRows(request: { + /** Data format for the response. */ + alt?: string; + /** The delimiter used to separate cell values. This can only consist of a single character. Default is ,. */ + delimiter?: string; + /** The encoding of the content. Default is UTF-8. Use auto-detect if you are unsure of the encoding. */ + encoding?: string; + /** + * The index of the line up to which data will be imported. Default is to import the entire file. If endLine is negative, it is an offset from the end of + * the file; the imported content will exclude the last endLine lines. + */ + endLine?: number; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Whether the imported CSV must have the same number of values for each row. If false, rows with fewer values will be padded with empty values. Default + * is true. + */ + isStrict?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The index of the first line from which to start importing, inclusive. Default is 0. */ + startLine?: number; + /** The table into which new rows are being imported. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Imports a new table. */ + importTable(request: { + /** Data format for the response. */ + alt?: string; + /** The delimiter used to separate cell values. This can only consist of a single character. Default is ,. */ + delimiter?: string; + /** The encoding of the content. Default is UTF-8. Use auto-detect if you are unsure of the encoding. */ + encoding?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** The name to be assigned to the new table. */ + name: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request
    ; + /** Creates a new table. */ + insert(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request
    ; + /** Retrieves a list of tables a user owns. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of tables to return. Default is 5. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Continuation token specifying which result page to return. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** + * Updates an existing table. Unless explicitly requested, only the name, description, and attribution will be updated. This method supports patch + * semantics. + */ + patch(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether the view definition is also updated. The specified view definition replaces the existing one. Only a view can be updated with a new definition. */ + replaceViewDefinition?: boolean; + /** ID of the table that is being updated. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request
    ; + /** Replaces rows of an existing table. Current rows remain visible until all replacement rows are ready. */ + replaceRows(request: { + /** Data format for the response. */ + alt?: string; + /** The delimiter used to separate cell values. This can only consist of a single character. Default is ,. */ + delimiter?: string; + /** The encoding of the content. Default is UTF-8. Use 'auto-detect' if you are unsure of the encoding. */ + encoding?: string; + /** + * The index of the line up to which data will be imported. Default is to import the entire file. If endLine is negative, it is an offset from the end of + * the file; the imported content will exclude the last endLine lines. + */ + endLine?: number; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** + * Whether the imported CSV must have the same number of column values for each row. If true, throws an exception if the CSV does not have the same number + * of columns. If false, rows with fewer column values will be padded with empty values. Default is true. + */ + isStrict?: boolean; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** The index of the first line from which to start importing, inclusive. Default is 0. */ + startLine?: number; + /** Table whose rows will be replaced. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Updates an existing table. Unless explicitly requested, only the name, description, and attribution will be updated. */ + update(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Whether the view definition is also updated. The specified view definition replaces the existing one. Only a view can be updated with a new definition. */ + replaceViewDefinition?: boolean; + /** ID of the table that is being updated. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request
    ; + } + interface TaskResource { + /** Deletes a specific task by its ID, unless that task has already started running. */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table from which the task is being deleted. */ + tableId: string; + /** The identifier of the task to delete. */ + taskId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a specific task by its ID. */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table to which the task belongs. */ + tableId: string; + /** The identifier of the task to get. */ + taskId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a list of tasks. */ + list(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** Maximum number of tasks to return. Default is 5. */ + maxResults?: number; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Continuation token specifying which result page to return. */ + pageToken?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Index of the first result returned in the current page. */ + startIndex?: number; + /** Table whose tasks are being listed. */ + tableId: string; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + } + interface TemplateResource { + /** Deletes a template */ + delete(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table from which the template is being deleted */ + tableId: string; + /** Identifier for the template which is being deleted */ + templateId: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request; + /** Retrieves a specific template by its id */ + get(request: { + /** Data format for the response. */ + alt?: string; + /** Selector specifying which fields to include in a partial response. */ + fields?: string; + /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ + key?: string; + /** OAuth 2.0 token for the current user. */ + oauth_token?: string; + /** Returns response with indentations and line breaks. */ + prettyPrint?: boolean; + /** + * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + * Overrides userIp if both are provided. + */ + quotaUser?: string; + /** Table to which the template belongs */ + tableId: string; + /** Identifier for the template that is being requested */ + templateId: number; + /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */ + userIp?: string; + }): Request